@abtnode/webapp 1.17.8-beta-20260108-021819-e099f0ca → 1.17.8-beta-20260108-120904-21cb5fb6
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-Chnfr9fe.js → AdapterDayjs-CtD5my-S.js} +1 -1
- package/dist/assets/{Add-b-MNk7UB.js → Add-CVe35B9U.js} +1 -1
- package/dist/assets/ArrowDropDown-59b471Ns.js +1 -0
- package/dist/assets/{Autocomplete-79tADtg2.js → Autocomplete-CZdtlRmS.js} +1 -1
- package/dist/assets/{Breadcrumbs-Cqjt-kp8.js → Breadcrumbs-DOWk4s-Q.js} +1 -1
- package/dist/assets/{ButtonGroup-C_JbniJW.js → ButtonGroup-83J5hh2q.js} +1 -1
- package/dist/assets/{CSSTransition-DinXVMZy.js → CSSTransition-Dmpq-B51.js} +1 -1
- package/dist/assets/{CallMerge-CF5jo3Pw.js → CallMerge-CZNqia3S.js} +1 -1
- package/dist/assets/{CardContent-CYNmFsYJ.js → CardContent-DXDn75TD.js} +1 -1
- package/dist/assets/{ChevronLeft-Byy2_Dj8.js → ChevronLeft-B8v-crqw.js} +1 -1
- package/dist/assets/{ChevronRight-BKFXnJ7g.js → ChevronRight-DIxNh4jH.js} +1 -1
- package/dist/assets/{Clear-Chg9fOPG.js → Clear-kzRbvP4u.js} +1 -1
- package/dist/assets/{Delete-B306vkSB.js → Delete-Cw_Z_UMc.js} +1 -1
- package/dist/assets/{DeleteOutline-BjSm7PCr.js → DeleteOutline-D2i9YJBS.js} +1 -1
- package/dist/assets/{Done-Bh0vP7e6.js → Done-CmV6TZSG.js} +1 -1
- package/dist/assets/{Edit-DFmlgA7E.js → Edit-DDUKSYdb.js} +1 -1
- package/dist/assets/{EditOutlined-Qskj3-tY.js → EditOutlined-MUSbzQj_.js} +1 -1
- package/dist/assets/{ErrorOutline-CjKNiJFO.js → ErrorOutline-jxA-S5AH.js} +1 -1
- package/dist/assets/{FilterList-Dphn1UXx.js → FilterList-B8T7rkYs.js} +1 -1
- package/dist/assets/{Google-C0G3l0jL.js → Google-Bg8SlDZS.js} +1 -1
- package/dist/assets/{HelpOutline--A0maMxb.js → HelpOutline-BOrIHXkQ.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-CD6n37Y9.js → KeyboardArrowDown-CE7zJDcv.js} +1 -1
- package/dist/assets/{Launch-Cor8d4pT.js → Launch-BHeCrhBj.js} +1 -1
- package/dist/assets/{Link-Mg5UlAaZ.js → Link-C39j8j-1.js} +1 -1
- package/dist/assets/{ListItemButton-C8XIzvy_.js → ListItemButton-DLzzgnWj.js} +1 -1
- package/dist/assets/{ListSubheader-CHT01bOG.js → ListSubheader-BgTycqrg.js} +1 -1
- package/dist/assets/{LoadingButton-DtnAWL1w.js → LoadingButton-OiBPqmL8.js} +1 -1
- package/dist/assets/{MoreVert-KNjOpSoE.js → MoreVert-DJQ3tC1s.js} +1 -1
- package/dist/assets/{OpenInNew-DGDd5qxt.js → OpenInNew-awII5Ys1.js} +1 -1
- package/dist/assets/{Refresh-B0_3c6OW.js → Refresh-BpllOjUS.js} +1 -1
- package/dist/assets/{Replay-BzP784vV.js → Replay-CMmg_T4k.js} +1 -1
- package/dist/assets/{Search-CUoYhy1v.js → Search-DobdZczv.js} +1 -1
- package/dist/assets/{Stepper-DfUO9buC.js → Stepper-DJ4LlLol.js} +1 -1
- package/dist/assets/{TableSearch-DxZYknBa.js → TableSearch-NL7mGzF6.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-BwLu2zCu.js → ToggleButtonGroup-1ZqP29sD.js} +1 -1
- package/dist/assets/{UnfoldMore-DvSw9pGy.js → UnfoldMore-BNE7Q7I9.js} +1 -1
- package/dist/assets/{Verified-CfonAx-G.js → Verified-pVnWh8ct.js} +1 -1
- package/dist/assets/{VerifiedUser-wCwGdsz1.js → VerifiedUser-Bq5EjyL0.js} +1 -1
- package/dist/assets/{ViewList-DhdvL6AT.js → ViewList-DikGBOob.js} +1 -1
- package/dist/assets/{_createAggregator-BLxu5C4t.js → _createAggregator-xAuoCETp.js} +1 -1
- package/dist/assets/{actions-Wo9kGXdj.js → actions-BHqqnvHK.js} +1 -1
- package/dist/assets/{actions-D1YtdqKL.js → actions-QNxlOGpH.js} +1 -1
- package/dist/assets/{agreement-07HiBYSX.js → agreement-D-rCiZRR.js} +1 -1
- package/dist/assets/api-ZR56mSDv.js +1 -0
- package/dist/assets/{appearance-CKF7Bo6h.js → appearance-CL4dIHJL.js} +1 -1
- package/dist/assets/{audit-logs-CLt2l7-q.js → audit-logs-BHIFDkts.js} +1 -1
- package/dist/assets/{base-chart-_0APPWGp.js → base-chart-CbniXo_r.js} +1 -1
- package/dist/assets/{blocklet-ClPWX-SV.js → blocklet-e4asDkfP.js} +1 -1
- package/dist/assets/{chain-Bg9mny_E.js → chain-CADjEEjt.js} +1 -1
- package/dist/assets/{click-to-copy-BbJJzGI1.js → click-to-copy-D5SbepAS.js} +1 -1
- package/dist/assets/cloneDeep-ChH4oif_.js +1 -0
- package/dist/assets/{config-navigation-B-CtKO70.js → config-navigation-ySXIDWww.js} +3 -3
- package/dist/assets/{connect-2JDWTFDP.js → connect-CdvuGCCf.js} +1 -1
- package/dist/assets/{connect-to-CBEHT895.js → connect-to-98MGJ7Yl.js} +1 -1
- package/dist/assets/{cssMode-U7KzpQEJ.js → cssMode-C_dsdlzf.js} +1 -1
- package/dist/assets/{delete-confirm-Cx4JPY2I.js → delete-confirm-Dk2gUSc_.js} +1 -1
- package/dist/assets/depsEqual-D1oKMHHx.js +1 -0
- package/dist/assets/{detail-Cgws9Fjd.js → detail-BSLJegmW.js} +3 -3
- package/dist/assets/{domains-BJzrDugH.js → domains-DgPIevHh.js} +1 -1
- package/dist/assets/{download-Df1TrhTI.js → download-DjUrRSaE.js} +1 -1
- package/dist/assets/{edit.svg-833vjqGH.js → edit.svg-BGFHNdYl.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-CO4m2LjK.js +1 -0
- package/dist/assets/engine-AOyfq5pg.js +1 -0
- package/dist/assets/{freemarker2-J5nZkQuM.js → freemarker2-Ynl3hbRt.js} +1 -1
- package/dist/assets/{get-safe-url-QppwE77w.js → get-safe-url-D0pcxgUJ.js} +1 -1
- package/dist/assets/getValidReactChildren-BrnINUbd.js +1 -0
- package/dist/assets/{graphqlMode-5yY_akok.js → graphqlMode-D3ZzOvwh.js} +2 -2
- package/dist/assets/{handlebars-DfBT6Rl2.js → handlebars-BXtXOFnU.js} +1 -1
- package/dist/assets/{html-BBpT31Z8.js → html-68WkZj1H.js} +1 -1
- package/dist/assets/{html-title-BpNgi7iw.js → html-title-CT8s_pnR.js} +1 -1
- package/dist/assets/{htmlMode-CDF4YwlA.js → htmlMode-D6dQwFeL.js} +1 -1
- package/dist/assets/{iframe-CH8rbppJ.js → iframe-BzTEh7qO.js} +1 -1
- package/dist/assets/{index-jHF3D4cy.js → index-AoP-pJu3.js} +1 -1
- package/dist/assets/{index-B8qqbKQt.js → index-B-25u8Uu.js} +1 -1
- package/dist/assets/index-B1_4iuGC.js +782 -0
- package/dist/assets/{index-tNmk7CjJ.js → index-BAYzgNzt.js} +1 -1
- package/dist/assets/{index-BdVOugOI.js → index-BFzkIx2h.js} +1 -1
- package/dist/assets/index-BQ9Dluv4.js +1 -0
- package/dist/assets/{index-B3tcK3_z.js → index-BTw_aopw.js} +14 -14
- package/dist/assets/{index-Dr7VuVvC.js → index-BV0mjh6r.js} +1 -1
- package/dist/assets/{index-DSjaZAu3.js → index-BaJk36L1.js} +1 -1
- package/dist/assets/{index-BJVvRV0h.js → index-BazbEWXv.js} +1 -1
- package/dist/assets/{index-CsTd8Q4H.js → index-Bd2vWvMu.js} +1 -1
- package/dist/assets/{index-CbnvHmOA.js → index-Bmj3JRL8.js} +1 -1
- package/dist/assets/{index-DCHzmqFc.js → index-BspQeR3D.js} +1 -1
- package/dist/assets/{index-CKWS_NIP.js → index-Bwnzqjf1.js} +1 -1
- package/dist/assets/{index-B4fcaU-r.js → index-CB1i_uf2.js} +1 -1
- package/dist/assets/{index-DqkfLKvE.js → index-CIjzdo65.js} +1 -1
- package/dist/assets/{index-CDd3s2GI.js → index-CVfXb0nN.js} +1 -1
- package/dist/assets/{index-CaxsY_au.js → index-CmbSgUyL.js} +3 -3
- package/dist/assets/{index-BikUP_wv.js → index-Cmvy-qPR.js} +1 -1
- package/dist/assets/{index-BVJB29cJ.js → index-Cp8XtCdH.js} +1 -1
- package/dist/assets/{index-BSBkhGl0.js → index-Cq78KErH.js} +1 -1
- package/dist/assets/{index-WHQs_PkC.js → index-Cy488fNr.js} +1 -1
- package/dist/assets/{index-B6x6Mq9n.js → index-D2bmvDtL.js} +1 -1
- package/dist/assets/{index-Crqqt-AN.js → index-D33KlJUT.js} +1 -1
- package/dist/assets/{index-3MwDYHdN.js → index-DA7EVQ4v.js} +9 -9
- package/dist/assets/{index-DXfP6ckA.js → index-DDI8UY6T.js} +2 -2
- package/dist/assets/{index-BBe9oV9e.js → index-DLJTQrAL.js} +1 -1
- package/dist/assets/{index-Bek3Nxot.js → index-DQhyMeoV.js} +3 -3
- package/dist/assets/{index-D_L4A5jU.js → index-DVXDeiLF.js} +1 -1
- package/dist/assets/{index-m8sITmne.js → index-DXHVn7yq.js} +1 -1
- package/dist/assets/{index-BbND9whL.js → index-Da8PZ-lu.js} +1 -1
- package/dist/assets/{index-iqFfmV_z.js → index-DfDHgwS-.js} +1 -1
- package/dist/assets/{index-BqrWLXQw.js → index-Dpw7fQUd.js} +3 -3
- package/dist/assets/{index-DrsAyGr6.js → index-DuNah4NO.js} +1 -1
- package/dist/assets/{index-BHQcEGDq.js → index-DvMdH51T.js} +1 -1
- package/dist/assets/{index-CBHMH4Z7.js → index-DxFY8dMO.js} +1 -1
- package/dist/assets/{index-cZdqepfp.js → index-Dz1ZwZ8x.js} +1 -1
- package/dist/assets/{index-0NOALS_P.js → index-Fir5RRo8.js} +1 -1
- package/dist/assets/{index-FdUIQyuT.js → index-Fr0im6-l.js} +1 -1
- package/dist/assets/{index-DJfXtT-f.js → index-Jt9YjCeK.js} +1 -1
- package/dist/assets/{index-CHgpIuFF.js → index-Ltxc7YUP.js} +1 -1
- package/dist/assets/{index-BfTQCMKf.js → index-LvA6paIR.js} +1 -1
- package/dist/assets/{index-CbK68mel.js → index-ZuJcpT1T.js} +1 -1
- package/dist/assets/{index-BfnrUUfH.js → index-bAcW8HYF.js} +1 -1
- package/dist/assets/{index-BRSm_uSW.js → index-teas2Eib.js} +3 -3
- package/dist/assets/{index-CZX-K9Eg.js → index-yR3ovHMI.js} +1 -1
- package/dist/assets/{index.esm-WZ7Avw4n.js → index.esm-CL88L2RD.js} +1 -1
- package/dist/assets/{install-from-url-PuHPLadE.js → install-from-url-C9wGB_q1.js} +1 -1
- package/dist/assets/{invitation-Bi2QgUpB.js → invitation-DBHFAKTZ.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-BAfeJQQq.js → is-path-prefix-equal-Df12gAPj.js} +1 -1
- package/dist/assets/{item-hbtsGcq0.js → item-D4OgvExU.js} +1 -1
- package/dist/assets/{javascript-CH6uPFyX.js → javascript-CY8tPfqG.js} +1 -1
- package/dist/assets/{jsonMode-B3mvgwT0.js → jsonMode-B1lllzUE.js} +1 -1
- package/dist/assets/{liquid-BoDus-ho.js → liquid-gpD4GU-k.js} +1 -1
- package/dist/assets/{list-header-C3SJDsfy.js → list-header-CjwjgfKp.js} +1 -1
- package/dist/assets/{lock.svg-CGmlgpmU.js → lock.svg-BmAm_LJl.js} +1 -1
- package/dist/assets/{log-D4BWVj7G.js → log-9z7r8Lwt.js} +1 -1
- package/dist/assets/{lottie-react.esm-ayFZjR4e.js → lottie-react.esm-C8kqAAU9.js} +1 -1
- package/dist/assets/{mdx-C33wkq6H.js → mdx-BwNO0Air.js} +1 -1
- package/dist/assets/{memory-lh5QZ4zg.js → memory-DO3ZqhrY.js} +1 -1
- package/dist/assets/{metric-chc-qmc8.js → metric-BcTiOrOk.js} +1 -1
- package/dist/assets/omit-jBEByUQC.js +1 -0
- package/dist/assets/{overview-DL-GP40o.js → overview-CikmJX9H.js} +1 -1
- package/dist/assets/{permission-D09K4EY6.js → permission-D1opDJhT.js} +1 -1
- package/dist/assets/{preference-iiwdIYk6.js → preference-Cs7lm-MF.js} +3 -3
- package/dist/assets/{provider-icon-Dm9XYo2I.js → provider-icon-CFKcu3V6.js} +1 -1
- package/dist/assets/{python-D_lYYAX1.js → python-CNXRlmYQ.js} +1 -1
- package/dist/assets/{raf-schd.esm-Bo9SYHL8.js → raf-schd.esm-D0EagQlv.js} +1 -1
- package/dist/assets/{razor-dpsmZHh4.js → razor-eMpDpC4X.js} +1 -1
- package/dist/assets/{rotate-session-key-Bfdv46s3.js → rotate-session-key-BiL0Bo_O.js} +1 -1
- package/dist/assets/{runtime-BUcScDcM.js → runtime-DUYT_SiT.js} +1 -1
- package/dist/assets/schema-iTOku2t8.js +1 -0
- package/dist/assets/sdk-B0lvz_Iz.js +1 -0
- package/dist/assets/{service-DCzLPjA3.js → service-BTdtH483.js} +1 -1
- package/dist/assets/{shorten-label-CN9pEyom.js → shorten-label-BNzeaF4J.js} +1 -1
- package/dist/assets/{simple-select-DxwJpURO.js → simple-select-BhAfKrhv.js} +1 -1
- package/dist/assets/{spaces-BrB8zqzV.js → spaces-OwZlXUZ4.js} +1 -1
- package/dist/assets/{status-BZx_J-ps.js → status-D6WlCP08.js} +1 -1
- package/dist/assets/{status-B-GGRrEB.js → status-cEVhL_8t.js} +1 -1
- package/dist/assets/{switch-control-X9WA2UjB.js → switch-control-DfH5Tjol.js} +1 -1
- package/dist/assets/{table-icons-Xs4hP9Pw.js → table-icons-CDTf0wL3.js} +1 -1
- package/dist/assets/{team-B9jB42uy.js → team-BGXKsY22.js} +1 -1
- package/dist/assets/{toLower-DwWNsNMJ.js → toLower-CSOmIMZJ.js} +1 -1
- package/dist/assets/toUpper-DnO1VFxi.js +1 -0
- package/dist/assets/{traffic-C_4zWOQM.js → traffic-DvCEQ5xd.js} +1 -1
- package/dist/assets/{tsMode-57DuREfP.js → tsMode-Let-Q8zu.js} +1 -1
- package/dist/assets/{typescript-BJp2b_J1.js → typescript-DyjM7FW9.js} +1 -1
- package/dist/assets/{url-evaluation-DetQFE_e.js → url-evaluation-Bukt7_Lj.js} +1 -1
- package/dist/assets/{url-join-rRKl4Ear.js → url-join-xsOaQKQ2.js} +1 -1
- package/dist/assets/{use-mobile-DOhPXmq7.js → use-mobile-BIQUR7Fz.js} +1 -1
- package/dist/assets/{use-mobile-BDRFDg8j.js → use-mobile-CFNU7YUg.js} +1 -1
- package/dist/assets/{useAsync-B59MJoKM.js → useAsync-tWL_hrVo.js} +1 -1
- package/dist/assets/{useAsyncRetry-CGp0YSlH.js → useAsyncRetry-CUFV5zTA.js} +1 -1
- package/dist/assets/{useLocalStorage-Dpl2DibN.js → useLocalStorage-MLO2O-Eu.js} +1 -1
- package/dist/assets/{useThemeProps-BS48y1B2.js → useThemeProps-C4X8Xuf-.js} +1 -1
- package/dist/assets/{util-DgOs7OwT.js → util-Byl4XHzq.js} +1 -1
- package/dist/assets/{wait-container-CxHAyAQN.js → wait-container-80uXorh3.js} +1 -1
- package/dist/assets/{without-wallet-qfmn1VhQ.js → without-wallet-U6nu7HMX.js} +1 -1
- package/dist/assets/wrap-locale-pkCcV7CX.js +1 -0
- package/dist/assets/{xml-BZRt8HAs.js → xml-CtKLgaY7.js} +1 -1
- package/dist/assets/{yaml-0X7rH3i7.js → yaml-CMyMNgnc.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-lsZjWbH5.js +0 -1
- package/dist/assets/api-eF9wxSJp.js +0 -1
- package/dist/assets/cloneDeep-DNOsGRuG.js +0 -1
- package/dist/assets/depsEqual-Cvglsxh5.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-Epiq9rij.js +0 -1
- package/dist/assets/engine-a9f8P0CB.js +0 -1
- package/dist/assets/getValidReactChildren-Cjo-LFyx.js +0 -1
- package/dist/assets/index-B31H3tAk.js +0 -1
- package/dist/assets/index-HqyXcG7M.js +0 -602
- package/dist/assets/omit-C11lcOpj.js +0 -1
- package/dist/assets/schema-DidDB4o0.js +0 -1
- package/dist/assets/sdk-l1r4MOQ_.js +0 -1
- package/dist/assets/toUpper-DXK6zXOf.js +0 -1
- package/dist/assets/wrap-locale-D8IL6u8L.js +0 -1
|
@@ -0,0 +1,782 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CmbSgUyL.js","./index-DQhyMeoV.js","./index-DUrTVFR9.css","./url-join-xsOaQKQ2.js","./index-BFzkIx2h.js","./_createAggregator-xAuoCETp.js","./depsEqual-D1oKMHHx.js","./index-Dz1ZwZ8x.js","./index-DRYJ0xIl.js","./toUpper-DnO1VFxi.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aF as Xe,j as t,eu as is,hq as ss,js as as,V as je,bn as Ie,J as Y,P as Oe,H as fe,o as _,f as Bt,r as U,p as Me,bF as vt,b as Ne,i as be,Y as nr,bE as Tt,Z as Pe,jt as ls,t as De,s as we,a4 as Re,aV as Ao,T as Se,$ as hn,dv as Pt,y as Ae,b8 as cs,bJ as us,aH as ue,b1 as ds,he as fs,hf as ps,C as Le,g4 as Mo,ix as dr,x as ms,ax as un,w as hs,ju as gs,jv as xs,v as He,jw as ys,I as vs,a0 as bs,jx as $o,bo as Fo,U as Ye,g6 as Cs,g1 as ws,aA as js,aB as Ss,bk as _s,aC as Es,aD as Ee,aO as ks,cS as Rs,S as Ts,fN as Br,bi as Ps,h as Is,jy as Bs,jz as qo,ey as Kt,jA as Ds,gW as zo,jB as Os,fz as ke,jC as Wo,eH as Ns,hv as Ls,i2 as Us,gK as As,jD as Ms,cI as Dr,d$ as Go,av as $s,bA as gn,ek as et,bu as Fs,bv as Or,z as dn,fG as Nr,jE as Ho,bD as Et,cv as qs,G as tt,aP as Lr,hb as Vo,F as at,h_ as zs,co as Ur,ir as Ws,gk as Ar,bg as Gs,L as Dt,E as Ko,bm as Hs,_ as Vs,N as zt,aZ as fr,jF as Ks,a_ as Ze,az as Mr,cQ as Ys,ad as bt,aM as Yo,bX as pr,cA as Zs,b9 as Xs,A as mr,aU as rr,g as Qs,aS as kt,O as Pn,W as Js,bG as Zo,aI as ea,bx as Xo,aR as ta,gb as $r,h0 as Fr,h1 as qr,X as zr,cP as na,h2 as ra,bW as oa,jG as ia}from"./index-DQhyMeoV.js";import{y as sa}from"./index-CVfXb0nN.js";import{a as aa,S as la,u as hr}from"./actions-BHqqnvHK.js";import{S as ca,a as ua}from"./switch-control-DfH5Tjol.js";import{u as We}from"./blocklet-e4asDkfP.js";import{P as or,w as xn}from"./permission-D1opDJhT.js";import{E as Qo}from"./Edit-DDUKSYdb.js";import{T as da,M as fa,t as pa}from"./table-icons-CDTf0wL3.js";import{s as ma,F as Jo,A as ha,b as ga,c as xa,d as ya,R as yt,L as va,I as ba,S as St,a as Wt,B as Ca}from"./preference-Cs7lm-MF.js";import{C as Wr}from"./click-to-copy-D5SbepAS.js";import{O as In}from"./index-CB1i_uf2.js";import{A as wa}from"./Add-CVe35B9U.js";import{A as yn}from"./Link-C39j8j-1.js";import{C as ja,c as Sa,b as _a,f as ei,A as Ea,_ as ka,a as Ra,e as Ta,d as ti,s as Pa,L as Ia,u as Ba,g as Da,S as Oa}from"./item-D4OgvExU.js";import{T as Na,L as La,a as ir,u as Gr,W as Ua,P as Aa}from"./index-Cq78KErH.js";import{e as ni}from"./engine-AOyfq5pg.js";import{u as Ma,C as $a,D as Fa,a as qa,b as za,S as ri}from"./connect-to-98MGJ7Yl.js";import{C as Wa,u as Ga,A as Ha}from"./agreement-D-rCiZRR.js";import{D as oi}from"./Done-CmV6TZSG.js";import{C as Va}from"./Google-Bg8SlDZS.js";import{I as ii,f as Ka,a as Ya,B as Za}from"./install-from-url-C9wGB_q1.js";import{a as Hr}from"./api-ZR56mSDv.js";import{v as si,e as Xa,a as fn}from"./util-Byl4XHzq.js";import{u as ai}from"./use-mobile-BIQUR7Fz.js";import{A as Qa}from"./ArrowDropDown-59b471Ns.js";import{u as Ja}from"./useLocalStorage-MLO2O-Eu.js";import{r as vn}from"./index-BFzkIx2h.js";import{b as bn}from"./without-wallet-U6nu7HMX.js";import{E as gr}from"./ErrorOutline-jxA-S5AH.js";import{H as el}from"./HelpOutline-BOrIHXkQ.js";import{c as tl}from"./lock.svg-BmAm_LJl.js";import{D as Cn}from"./Delete-Cw_Z_UMc.js";import{L as li}from"./Launch-BHeCrhBj.js";import{D as nl}from"./delete-confirm-Dk2gUSc_.js";import{W as It,B as sr,m as rl}from"./status-cEVhL_8t.js";import{R as ol}from"./Replay-CMmg_T4k.js";import{R as il,a as Vr}from"./url-evaluation-Bukt7_Lj.js";import{A as ci}from"./actions-QNxlOGpH.js";import{v as Bn}from"./index-B-25u8Uu.js";import{t as sl}from"./toUpper-DnO1VFxi.js";import{a as al}from"./team-BGXKsY22.js";import"./MoreVert-DJQ3tC1s.js";import"./DeleteOutline-D2i9YJBS.js";import"./get-safe-url-D0pcxgUJ.js";import"./ButtonGroup-83J5hh2q.js";import"./getValidReactChildren-BrnINUbd.js";import"./FilterList-B8T7rkYs.js";import"./CSSTransition-Dmpq-B51.js";import"./emotion-cache.browser.esm-CO4m2LjK.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-D0EagQlv.js";import"./redux-DfszZyTl.js";import"./useThemeProps-C4X8Xuf-.js";import"./html-title-CT8s_pnR.js";import"./Clear-kzRbvP4u.js";import"./ChevronRight-DIxNh4jH.js";import"./ChevronLeft-B8v-crqw.js";import"./Search-DobdZczv.js";import"./omit-jBEByUQC.js";import"./edit.svg-BGFHNdYl.js";import"./index-Dz1ZwZ8x.js";import"./iframe-BzTEh7qO.js";import"./index-Bmj3JRL8.js";import"./KeyboardArrowDown-CE7zJDcv.js";import"./Autocomplete-CZdtlRmS.js";import"./ListSubheader-BgTycqrg.js";import"./Verified-pVnWh8ct.js";import"./VerifiedUser-Bq5EjyL0.js";import"./url-join-xsOaQKQ2.js";import"./index-BojVbZw0.js";import"./spaces-OwZlXUZ4.js";import"./OpenInNew-awII5Ys1.js";import"./index-DRYJ0xIl.js";import"./index-Cy488fNr.js";import"./decode-DPztD6kB.js";import"./cloneDeep-ChH4oif_.js";import"./ListItemButton-DLzzgnWj.js";import"./Stepper-DJ4LlLol.js";import"./is-path-prefix-equal-Df12gAPj.js";const ll=Xe(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),cl=Xe(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"})),ul=Xe(t.jsx("path",{d:"M8 5v14l11-7z"})),ui=Xe(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"})),dl=Xe(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"})),di=Xe(t.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),fl=Xe(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"})),pl=Xe(t.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),ml=Xe(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"})),hl=Xe(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 Kr(e,n){var r={};return n=is(n),ss(e,function(s,a,o){as(r,a,n(s,a,o))}),r}function fi({children:e=null,...n}){const{t:r}=je(),{api:s}=Ie(),{blocklet:a}=We(),o=a?.settings?.autoCheckUpdate,d=async i=>{await s.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:i}})},c=async()=>{try{const i=!o?.enabled;await d({enabled:i}),fe.success(r(i?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(i){fe.error(i.message)}},l=!!o?.enabled;return t.jsxs(Y,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,t.jsx(Oe,{title:r("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(ca,{checked:l,onChange:c,name:"enableWelcomePage",style:{...n.style,zoom:.8}})})})]})}fi.propTypes={children:_.any};function Yr(e){function n({sx:r,...s}){return t.jsx(e,{...s,sx:{color:"text.primary",...r}})}return n}const gl={...Kr(pa,Yr),...Kr(aa,Yr)},xl=(e,n)=>{let{description:r}=e;return(Object.values(Ne.CHAIN_PROP_MAP).includes(e.key)||be.isEnvShareable(e))&&(r?r=`${r} (${n("blocklet.config.sharedToAllComponents")})`:r=n("blocklet.config.sharedToAllComponents")),r&&t.jsx("div",{style:{marginLeft:12},children:r})},Dn=(e,n,r=[])=>!r?.length&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!n.meta.environments.find(s=>s.name===e.key)&&n.children.every(s=>!s.meta.environments.find(a=>a.name===e.key))?!0:e.custom,Zr=e=>[Ne.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),On=e=>[Ne.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function pi({blocklet:e,ancestors:n=[]}){const r=Ie(),{palette:s}=Bt(),{inService:a}=r,{t:o}=U.useContext(Me),d=[...n.map(u=>u.meta.did),e.meta.did],c=()=>fe.success(o("blocklet.config.changedTip")),l=u=>Dn(u,e,n);if(vt(e.status)||e.status==="unknown"&&vt(e.status))return null;const i=u=>new Promise(async(b,E)=>{if(!u.key.trim()||!u.value.trim()){fe.error(o("blocklet.config.environment.keyValueRequired")),E();return}if(Zr(u.key)===!1){fe.error(o("blocklet.config.environment.invalidKey")),E();return}u.custom=On(u.key);try{const S=await r.api.configBlocklet({input:{did:d,configs:[u]}});c(S.blocklet),b()}catch(S){fe.error(Pe(S)),E()}}),h=(u,b)=>new Promise(async(E,S)=>{if(u.required&&(!u.key.trim()||!u.value.trim())){fe.error(o("blocklet.config.environment.keyValueRequired")),S();return}if(Zr(u.key)===!1){fe.error(o("blocklet.config.environment.invalidKey")),S();return}if(u.key===Ne.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const X=ls(u);if(X){fe.error(X),S();return}}const C=[{...u,value:u.secure&&u.value==="__encrypted__"?"":u.value}];if(u.key!==b.key){if(!Dn(u,e,n)){fe.error("Only key of custom env can be changed"),S();return}C.push({key:b.key,custom:On(u.key)})}try{const X=await r.api.configBlocklet({input:{did:d,configs:C}});c(X.blocklet),E()}catch(X){fe.error(Pe(X)),S()}}),p=u=>new Promise(async(b,E)=>{if(u.required){fe.error(o("blocklet.config.environment.deleteForbidden")),E();return}if(!Dn(u,e,n)){fe.error(o("environmentTips.deleteForbidden")),E();return}try{const S=await r.api.configBlocklet({input:{did:d,configs:[{key:u.key,custom:On(u.key)}]}});c(S.blocklet),b()}catch(S){fe.error(Pe(S)),E()}}),v=(e.configs||[]).filter(u=>!Ne.BLOCKLET_CONFIGURABLE_KEY[u.key]||[Ne.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(u.key)),g=be.getSharedConfigObj(n[0],e),R=be.getComponentMissingConfigs(e,n[0]),P=v.map(u=>({...u,value:Object.values(Ne.CHAIN_PROP_MAP).includes(u.key)&&Object.keys(g).includes(u.key)?g[u.key]:g[u.key]||u.value})),T=P.some(u=>u.key&&u.key.startsWith("BWA_")),D={onRowAdd:i,onRowUpdate:h,onRowDelete:p,isDeletable:l},m=()=>[{title:o("common.key"),field:"key",initialEditValue:"",width:"30%",render:u=>t.jsx(Wr,{value:u.value,style:{color:u.required&&!u.value?s.error.main:s.text.primary,fontWeight:u.required?"bold":"normal"},children:u.key}),editComponent:u=>{const{value:b,rowData:E,onChange:S}=u;return t.jsx(Xr,{children:t.jsx(De,{fullWidth:!0,size:"small",value:ma.escapeTag(b),onChange:C=>S(C.target.value),variant:"outlined",label:"Key",placeholder:o("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:l(E)===!1}}})})}},{title:o("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:u=>u.value?u.secure?"******":t.jsx(Wr,{unstyled:!0,value:u.value,style:{wordBreak:"break-all"},children:u.value}):null,editComponent:u=>{const{value:b,rowData:E,onChange:S}=u;return t.jsxs(Xr,{children:[t.jsx(De,{fullWidth:!0,size:"small",value:b==="__encrypted__"?"":b,onChange:C=>S(C.target.value),variant:"outlined",label:o("common.value"),placeholder:o("blocklet.config.environment.value"),margin:"dense"}),xl(E,o)]})}}];return t.jsxs(yl,{children:[!!R.length&&t.jsx(nr,{severity:"error",style:{marginTop:24},children:o("blocklet.config.missingRequired")}),T&&t.jsx(nr,{severity:"info",children:o("blocklet.config.environment.tip")}),t.jsx(or,{permission:a?"":"mutate_blocklets",role:a?Tt:[],children:u=>t.jsx(da,{className:"config-table",children:t.jsx(fa,{title:t.jsx(Y,{sx:{fontWeight:"bold"},children:o("common.environments")}),columns:m(),icons:gl,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:P,editable:u?D:{}})})})]})}pi.propTypes={blocklet:_.object.isRequired,ancestors:_.array};const yl=we.div`
|
|
3
|
+
.config-table {
|
|
4
|
+
margin-bottom: 24px;
|
|
5
|
+
position: relative;
|
|
6
|
+
.hide-control {
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 10px;
|
|
9
|
+
left: 200px;
|
|
10
|
+
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
11
|
+
left: 160px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.MuiToolbar-root {
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.MuiTableRow-head {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.hide-header {
|
|
24
|
+
.MuiToolbar-root {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.accordion {
|
|
31
|
+
margin-bottom: 16px;
|
|
32
|
+
&:last-of-type {
|
|
33
|
+
margin-bottom: 0;
|
|
34
|
+
}
|
|
35
|
+
padding: 8px 0 8px 0px;
|
|
36
|
+
&.MuiAccordion-root {
|
|
37
|
+
background: transparent;
|
|
38
|
+
box-shadow: none;
|
|
39
|
+
border: 1px solid #ddd;
|
|
40
|
+
border-radius: 4px;
|
|
41
|
+
&::before,
|
|
42
|
+
&::after {
|
|
43
|
+
height: 0;
|
|
44
|
+
}
|
|
45
|
+
.MuiAccordionSummary-root {
|
|
46
|
+
padding-left: 0;
|
|
47
|
+
}
|
|
48
|
+
.accordion-title {
|
|
49
|
+
font-weight: bold;
|
|
50
|
+
padding-left: 16px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`,Xr=we.div`
|
|
55
|
+
height: 60px;
|
|
56
|
+
`;function xr({open:e=!1,onClose:n=null,hiddenChildren:r=!1,blocklet:s,ancestors:a=[],children:o=null}){const[d,c]=U.useState(!1),{t:l}=je(),i=l("environmentFor",{name:be.getDisplayName(s,!0)});if(vt(s.status)||s.status==="unknown"&&vt(s.status))return null;const h=()=>{n?.(),c(!1)},p=g=>{g.stopPropagation(),c(!0)};let v=null;return r||(v=typeof o=="function"?o({open:p}):t.jsx(Re,{onClick:p,"data-cy":"action-config-component",children:t.jsx(Qo,{})})),t.jsxs(t.Fragment,{children:[v,(e||d)&&t.jsx(vl,{open:!0,fullWidth:!0,maxWidth:"md",title:i,onClose:h,PaperProps:{style:{minHeight:"auto",backgroundImage:"none"}},children:t.jsxs(Ao,{sx:{gap:0},children:[t.jsx(Se,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:l("description.environment",{name:be.getDisplayName(s,!0)})}),t.jsx(pi,{blocklet:s,ancestors:a})]})})]})}xr.propTypes={blocklet:_.object.isRequired,ancestors:_.array,children:_.any,open:_.bool,onClose:_.func,hiddenChildren:_.bool};const vl=we(hn)`
|
|
57
|
+
.MuiDialogContent-root {
|
|
58
|
+
padding-top: 0;
|
|
59
|
+
padding-bottom: 24px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.MuiToolbar-root {
|
|
63
|
+
padding-right: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ux-dialog_closeButton {
|
|
67
|
+
margin: 0;
|
|
68
|
+
}
|
|
69
|
+
`,bl=U.lazy(()=>us(()=>import("./index-CmbSgUyL.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}))),Cl="/blocklet/component/upload",Qr=[".html",".htm",".tgz",".zip"],wl=Number(window.env?.maxUploadFileSize)||ue.MAX_UPLOAD_FILE_SIZE,jl=wl*1024*1024;function mi({did:e,prefix:n,headers:r=()=>({}),onUploaded:s=Pt,open:a=!1,onClose:o=Pt}){const{t:d,locale:c}=je(),l=U.useRef(null),i=U.useCallback(h=>{const{status:p,data:v}=h;if(p===200){s(v);return}fe.error(d("blocklet.component.addComponentTip.uploadFailed"))},[s,d]);return U.useEffect(()=>{a?l.current?.open():l.current?.close()},[a]),t.jsx(Sl,{id:`component-uploader-${e}`,children:t.jsx(bl,{ref:l,locale:c,popup:!0,disableXssAttack:!0,onUploadFinish:i,plugins:[],onClose:o,installerProps:{disabled:!0},apiPathProps:{uploader:Ae(n,Cl,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:Qr,maxFileSize:jl,maxNumberOfFiles:1}},tusProps:{headers:r},dashboardProps:{note:d("blocklet.component.addComponentTip.allowedFileTypes",{types:Qr.map(h=>h.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}mi.propTypes={did:_.string.isRequired,prefix:_.string.isRequired,open:_.bool,headers:_.func,onUploaded:_.func,onClose:_.func};const Sl=cs(Y)`
|
|
70
|
+
.uploader-wrapper {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
position: relative;
|
|
73
|
+
font-size: 0px;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
&.enabled {
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
}
|
|
78
|
+
&::after {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
&.enabled::after {
|
|
82
|
+
display: block;
|
|
83
|
+
opacity: 1;
|
|
84
|
+
position: absolute;
|
|
85
|
+
bottom: 0;
|
|
86
|
+
background: rgba(0, 0, 0, 0.3);
|
|
87
|
+
left: 0;
|
|
88
|
+
right: 0;
|
|
89
|
+
height: 2.2em;
|
|
90
|
+
color: white;
|
|
91
|
+
text-align: center;
|
|
92
|
+
font-size: 12px;
|
|
93
|
+
line-height: 2em;
|
|
94
|
+
transition: opacity 0.3s ease;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`,yr={description:_.string,editing:_.bool,onChange:_.func,required:_.bool,value:_.any,componentProps:_.object,render:_.func,renderFormItem:_.func};function vr({editing:e,value:n,onChange:r}){const[s,a]=U.useState(!1),o=U.useRef(),d=U.useRef(n);U.useEffect(()=>{let p=null;return e&&(p=setTimeout(()=>{a(!0)},50)),()=>{clearTimeout(p)}},[e]);const c=p=>{d.current=p,r(p)},l=()=>{a(!1),r(d.current)},i=t.jsx(Y,{className:"form-item-input slot",sx:{px:1},children:t.jsxs(Y,{sx:{display:"flex",alignItems:"center"},children:[n,n!=="auto"&&t.jsx("div",{style:{marginLeft:4,backgroundColor:n,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),h=t.jsxs(Y,{onKeyDown:l,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[t.jsx(Y,{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(ds,{open:s,anchorEl:o.current,onClose:()=>a(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:t.jsx(Va,{color:n,onChange:p=>c(p.hex)})})]});return e?h:i}vr.propTypes=yr;function hi({editing:e,description:n,value:r,onChange:s,componentProps:a={},...o}){const{placeholder:d}=a,c=U.useRef(r),{t:l}=U.useContext(Me),i=p=>{p.key==="Enter"&&s(c.current,"confirm")},h=p=>{c.current=p,s(p)};return e?t.jsx(De,{style:{flex:1},fullWidth:!0,value:r,onChange:p=>{p.persist(),h(p.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:n||d,onKeyDown:i,...o}):t.jsx(Y,{className:"form-item-input slot",sx:{px:1},children:r||t.jsx("span",{className:"placeholder",children:l("common.requiredInputPlaceholder",{name:n||d})})})}hi.propTypes=yr;function gi({editing:e,value:n,onChange:r,componentProps:s,...a}){const{blocklet:o}=s,d=n==="auto"?fs(o.appDid):n;return t.jsxs(Y,{sx:{display:"flex",alignItems:"center"},children:[t.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:ps({title:"Owner",issuer:be.getDisplayName(o),issuerDid:o.appDid,ownerName:"Your Name",ownerDid:o.appDid,preferredColor:n||"auto"})}}),t.jsx(vr,{...a,editing:e,value:e?d:n,onChange:r,componentProps:s})]})}gi.propTypes={...yr,componentProps:_.shape({blocklet:_.object.isRequired}).isRequired};const _l=dr`
|
|
98
|
+
0%, 100% {
|
|
99
|
+
transform: scale(1) translateX(0);
|
|
100
|
+
}
|
|
101
|
+
50% {
|
|
102
|
+
transform: scale(1.05) translateX(-3px);
|
|
103
|
+
}
|
|
104
|
+
25%, 75% {
|
|
105
|
+
transform: scale(1.1) translateX(3px);
|
|
106
|
+
}
|
|
107
|
+
`,El={input:hi,color:vr,passport:gi,uploader:e=>t.jsx(va,{...e.componentProps})};function kl(e,{editing:n=!1}){const{componentType:r="input",render:s,renderFormItem:a}=e;return n&&a?a:!n&&s?s:El[r?.toLowerCase()]}br.propTypes={item:_.object.isRequired,findEditingItem:_.func.isRequired,getItemValue:_.func.isRequired,onFormItemChange:_.func.isRequired,onFocusOut:_.func.isRequired,disabled:_.bool,loading:_.bool,onCancel:_.func,formValues:_.object.isRequired};function br({item:e,findEditingItem:n,getItemValue:r,onFormItemChange:s,onFocusOut:a,disabled:o=!1,loading:d=!1,onCancel:c=()=>{},formValues:l}){const{key:i,description:h,required:p,solo:v=!1,hidden:g=!1,componentProps:R={},skipButtonDisabled:P=!1}=e;if(g)return null;const T=n(i),{editing:D,shaking:m}=T??{},u=r(e,{editing:D}),b=kl(e,{editing:D}),E={inputProps:{"data-cy":"schema-form-item-component"},key:i,description:h,editing:D,value:u,onChange:(S,C="change")=>s(e,S,C),componentProps:R,skipButtonDisabled:P,onBlur:()=>a(e)};return e.componentType==="collapse"&&e.children?.length>0?t.jsxs(ha,{children:[t.jsx(ga,{expandIcon:t.jsx(xa,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:e.description}),t.jsx(ya,{children:e.children.map(S=>t.jsx(br,{item:S,findEditingItem:n,getItemValue:r,onFormItemChange:s,onFocusOut:a,formValues:l,disabled:o,loading:d,onCancel:c},S.key))})]}):t.jsxs(Y,{className:"form-item",children:[!v&&t.jsxs(Y,{className:"form-item-label",sx:{color:p&&!u?"error.main":"text.secondary"},children:[h,p&&t.jsx(yt,{})]}),t.jsxs(Y,{className:"form-item-body",children:[t.jsx(Y,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:v?"center":"left"},style:{cursor:"text"},onClick:()=>{o||T?.edited||P||s(e,l[i],"edit")},children:t.jsx(b,{...E})}),!v&&t.jsx(Y,{className:"form-item-action",style:{marginLeft:0},children:D?t.jsxs(t.Fragment,{children:[T.edited?t.jsx(Re,{"data-cy":"schema-form-item-confirm",onClick:()=>{s(e,u,"confirm")},disabled:o||d,sx:{animation:m?`${_l} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:d?t.jsx(Le,{size:24}):t.jsx(oi,{})}):null,t.jsx(Re,{"data-cy":"schema-form-item-cancel",onClick:()=>c(e),style:{paddingLeft:T.edited?4:8},disabled:o||d,size:"large",children:t.jsx(Mo,{})})]}):null})]})]},i)}function xi({schema:e,loading:n=!1,value:r=void 0,defaultValue:s={},onChange:a,style:o={},disabled:d=!1}){const c=Object.prototype.toString.call(r)==="[object Object]",[l,i]=U.useState([]),[h,p]=U.useState(c?r:s),v=U.useMemo(()=>e.length===1,[e]),g=U.useCallback(b=>l.find(E=>E.key===b),[l]);U.useEffect(()=>{v&&e[0]?.required&&i([{key:e[0].key,editing:!0,initialValue:s[e[0].key]}])},[e,v,s]);const R=U.useCallback(b=>{i(E=>E.find(C=>C.key===b.key)?E.map(C=>C.key===b.key?b:{...C}):[b].concat(E))},[]),P=U.useCallback((b,E,S)=>{const{key:C,secure:X}=b,Q=g(C)??{...b};Q.editing=!0;const q=h[C]!==E;Q.edited=E&&Q.initialValue!==E,Q.initialValue=s[C];const $={...h,[C]:E};q&&p($),a({[C]:E},{allValues:$,action:S,currentItem:b}),S==="confirm"&&X&&p({...h,[C]:"__encrypted__"}),S==="confirm"&&(Q.initialValue=h[C]),["confirm","cancel"].includes(S)&&(Q.editing=!1,Q.edited=!1),R(Q)},[s,h,a,R,g]),T=U.useCallback((b,{editing:E=!1})=>{const{key:S}=b,C=c?r[S]:h[S];return C==="__encrypted__"?E?"":"******":C},[c,r,h]),D=U.useCallback(b=>{const E=g(b.key);E&&P(b,E.initialValue,"cancel")},[g,P]),m=U.useCallback(b=>{const E=g(b.key);!E||!E.edited||(E.shaking=!0,R(E),setTimeout(()=>{E.shaking=!1,R(E)},500))},[g,R]),u=U.useCallback(b=>{const E=g(b.key);!E||!E.edited?D(b):m(b)},[g,m,D]);return t.jsx(Rl,{className:"form",style:o,children:e?.map(b=>{const{hidden:E=!1}=b;return E?null:t.jsx(br,{item:b,findEditingItem:g,getItemValue:T,onFormItemChange:P,onFocusOut:u,formValues:h,disabled:d,loading:n,onCancel:D})})})}xi.propTypes={schema:_.array.isRequired,loading:_.bool,onChange:_.func.isRequired,value:_.object,defaultValue:_.object,style:_.object,disabled:_.bool};const Rl=we(Jo)``;function yi({meta:e,onCancel:n,mode:r,handlePaySuccess:s=()=>{}}){const{t:a,locale:o}=je(),{info:d}=Ie(),c=ms(d),[l,i]=U.useState(null),h=new URL(e?.registryUrl).origin,p=be.getDisplayName({meta:e}),v=async(R,P)=>{const T=({downloadTokenList:u})=>{s({downloadTokenList:u})},D=u=>{fe.error(u),n(u)};function m(u){return xs(()=>Hr.get(u).then(async({data:b})=>{const E=b?.downloadTokenList;if(b.status==="succeed"){if(E&&E.length)await T({downloadTokenList:E});else return await D(a("blocklet.component.missDownloadTokenTip")),!0;return!0}return b.status==="error"?(console.error("vc error: ",b),await D(b?.error),!0):!1}),{interval:1e3})}if(r==="purchase"&&l){const{statusUrl:u}=gs(l);await m(u)}else await T({downloadTokenList:R.downloadTokenList&&P(R.downloadTokenList)})};if(U.useEffect(()=>{if(r==="purchase"){const R=new URL(h);R.pathname="/api/did/verify-purchase-blocklet/token",R.searchParams.set("serverDid",d.did),R.searchParams.set("blockletDid",e?.did);try{Hr.get(R.href).then(({data:P})=>{const T=`${P.url}`;i(T)})}catch(P){console.error("get next workflow url error: ",P)}}return()=>{i(null)}},[r]),r==="purchase"&&!l)return"";const g={verify:{action:"verify-purchase-blocklet",checkFn:un.create({baseURL:h}).get,extraParams:{serverDid:d.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:un.create({baseURL:Ae(h,"/store")}).get,extraParams:{factory:e.nftFactory,nw:l},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(hs,{open:!0,locale:o,popup:!1,saveConnect:!1,className:"connect",baseUrl:h,onSuccess:v,cancelWhenScanned:n,onClose:n,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...g[r]})}yi.propTypes={...Sa,handlePaySuccess:_.func,mode:_.oneOf(["verify","purchase"]).isRequired};function vi({ref:e=null,mode:n,...r}){const[s,a]=U.useState(n!=="both"?n:"verify"),[o,d]=U.useState(n!=="both"?2:1),c=i=>{i!==s&&a(i)},l=()=>{s&&o!==2&&d(2)};return U.useImperativeHandle(e,()=>({onNext:l,getCurrentStep:()=>o})),o===1?t.jsx("div",{style:{maxWidth:520},children:t.jsx(ja,{action:s,onNext:null,onSelect:c})}):t.jsx(yi,{...r,mode:s})}vi.propTypes={mode:_.oneOf(["both","verify","purchase"]).isRequired,ref:_.any};function Tl({...e}){return t.jsx(He,{className:"bottom-button",variant:"contained",color:"primary",...e})}function bi({blocklet:e=null,onStartNow:n=()=>{},children:r=null,disabled:s=!1}){const{t:a}=je(),o=ai();return!e||ys(e.meta)?t.jsx(Pl,{children:r}):t.jsxs(Il,{isMobile:o,children:[t.jsx(Tl,{className:"start-now",variant:"contained",color:"primary",disabled:s,onClick:()=>n(),children:a("setup.startNow")}),t.jsx(Y,{sx:{display:"flex",alignItems:"center"},children:r})]})}bi.propTypes={blocklet:_.object,onStartNow:_.func,children:_.any,disabled:_.bool};const Pl=we(Y)`
|
|
108
|
+
width: 100%;
|
|
109
|
+
margin-top: auto;
|
|
110
|
+
padding-top: 24px;
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
.bottom-button {
|
|
115
|
+
min-width: 200px;
|
|
116
|
+
}
|
|
117
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
118
|
+
.bottom-button {
|
|
119
|
+
width: 100%;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
`,Il=we(Y)`
|
|
123
|
+
padding-top: 24px;
|
|
124
|
+
margin-top: auto;
|
|
125
|
+
width: 100%;
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: space-between;
|
|
129
|
+
.start-now {
|
|
130
|
+
min-width: 140px;
|
|
131
|
+
}
|
|
132
|
+
.bottom-button {
|
|
133
|
+
min-width: 120px;
|
|
134
|
+
}
|
|
135
|
+
${e=>e.theme.breakpoints.down("lg")} {
|
|
136
|
+
width: 100%;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
140
|
+
.start-now {
|
|
141
|
+
min-width: inherit;
|
|
142
|
+
}
|
|
143
|
+
.bottom-button {
|
|
144
|
+
min-width: 100px;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
${e=>e.isMobile} {
|
|
149
|
+
justify-content: space-between;
|
|
150
|
+
gap: '32px',
|
|
151
|
+
}}
|
|
152
|
+
`;function Ci({blockletMeta:e,onEndpointUpdate:n=()=>{}}){const r=ai(),{blocklet:s}=We(),{updateSpaceGateway:a,loading:o,hasStorageEndpoint:d}=Ma();return U.useEffect(()=>{n?.()},[s]),o?t.jsx(vs,{relative:"parent",children:t.jsx(Le,{})}):t.jsxs(Bl,{children:[t.jsx(Y,{sx:{width:r?"360px":"720px"},children:d?t.jsx($a,{}):t.jsx(Fa,{})}),e?.capabilities?.didSpace==="required"&&t.jsx(bi,{mt:8,children:t.jsx(qa,{onConnect:a})})]})}Ci.propTypes={blockletMeta:_.any.isRequired,onEndpointUpdate:bs.func};const Bl=we(Wa)`
|
|
153
|
+
height: 100%;
|
|
154
|
+
overflow-y: auto;
|
|
155
|
+
padding-bottom: 32px;
|
|
156
|
+
overflow-x: hidden;
|
|
157
|
+
`;function wi({onChange:e=()=>{},loading:n=!1,children:r,extra:s="",stores:a=[],storageKey:o=""}){const{t:d}=je(),{info:c,inService:l}=Ie(),{blocklet:i}=We(),[h,p]=U.useState(!1),v=U.useRef(null),[g,R]=U.useState(),[P,T]=Ja(o||"tmp"),[D,m]=o?[P,T]:[g,R],{storeList:u,teamDid:b}=$o({fromBlocklet:l,blocklet:i,nodeInfo:c}),E=Fo([...a.map(C=>({...C,protected:!0})),...u],"url"),S=D&&E.find(C=>D===C.url)||E[0];return t.jsxs(t.Fragment,{children:[t.jsxs(Dl,{children:[t.jsx(He,{ref:v,color:"primary","data-cy":"add-component-select-store",endIcon:t.jsx(Qa,{color:"primary"}),onClick:()=>{p(!0)},style:{padding:"0 2px"},children:t.jsx(Se,{color:"primary",children:S.name})}),t.jsx(Se,{color:"primary",children:s})]}),t.jsxs(De,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:d("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:S,autoFocus:!0,onChange:C=>{const X=C.target.value;m(X.url),e(X)},style:{display:"none"},margin:"normal",slotProps:{select:{open:h,MenuProps:{anchorEl:v.current},renderValue:C=>C?.name,onClose:()=>{p(!1)}}},children:[E?.map(C=>t.jsx(Ye,{sx:{width:"400px",maxWidth:"90vw"},value:C,"data-cy":C.url,children:t.jsx(_a,{teamDid:b,store:C,onDelete:()=>{D===C.url&&m(E[0]?.url)}})},C.url)),!ei.isInServerlessMode(c)&&t.jsx(Ea,{disabled:n,storeList:E,teamDid:b,onAdd:C=>{m(C)}})]}),r({currentRegistry:S})]})}wi.propTypes={onChange:_.func,loading:_.bool,children:_.any.isRequired,extra:_.node,storageKey:_.string,stores:_.arrayOf(_.shape({name:_.string.isRequired,url:_.string.isRequired}))};const Dl=we.div`
|
|
158
|
+
display: flex;
|
|
159
|
+
justify-content: space-between;
|
|
160
|
+
align-items: center;
|
|
161
|
+
margin-bottom: 16px;
|
|
162
|
+
|
|
163
|
+
span {
|
|
164
|
+
font-size: 16px;
|
|
165
|
+
color: ${e=>e.theme.palette.text.primary};
|
|
166
|
+
// font-weight: bold;
|
|
167
|
+
}
|
|
168
|
+
`,Ol={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"/>'},Nl={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>'},Ll={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"/>'},Ul=(e,n)=>Ae(n,`/blocklets/${e.did}`),Jr=({blocklet:e,attribute:n,value:r})=>e._formatted?e._formatted[n]:r,Al=e=>e.inStore&&be.isFreeBlocklet(e)===!1;function ji({blocklet:e,blocklets:n=[],handleButtonClick:r=null,endpoint:s="",serverVersion:a=""}){const{t:o}=je();let d=Ae(s,Es(e.did,e.logo||""));try{const T=new URL(d);T.searchParams.set("v",e.version||+new Date),d=T.href}catch{}const[c,l]=U.useState(!1),i=async()=>{try{l(!0),await r({meta:e,registryUrl:s,blocklets:n})}catch(T){fe.error(T.message)}finally{l(!1)}},{blocklet:h}=We(),p=()=>(h?.children||[]).find(m=>m.meta.bundleDid===e.did).meta.version,g=(()=>{const T=(h?.children||[]).find(D=>D.meta.bundleDid===e.did);if(T){try{const D=T.meta.version,m=e.version;if(ks.gt(m,D))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),R=e.requirements?.server,P=[];return g==="upgrade"?P.push({key:"upgrade",icon:t.jsx(Ee,{icon:Ll,color:"success.light",width:20,height:20},"version"),title:`${p()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:t.jsx(Y,{sx:{fontWeight:"bold"},children:o("blocklet.component.upgradeAvailable")})}):g==="disable"?P.push({key:"disable",icon:t.jsx(Ee,{icon:Ol,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:o("blocklet.component.installed")}):Al(e)&&P.push({key:"purchase",icon:t.jsx(Ee,{icon:Nl,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:o("blocklet.component.needBuy")}),t.jsx(Ml,{title:Jr({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Jr({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?d:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:g!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:g==="disable"?void 0:i,icons:e.docker?.image?[{key:"docker",icon:t.jsx(Y,{sx:{display:"flex",color:"primary.main"},children:t.jsx(Ee,{icon:ti})}),title:o("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:o("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:P,button:t.jsx(Ra,{serverVersion:a,requirementVersion:R,size:"small",children:t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(Ta,{children:t.jsx(He,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:T=>{T.preventDefault(),T.stopPropagation();const D=Ul(e,s);D&&window.open(D,"_blank","noopener,noreferrer")},children:o("common.detail")},e.did)})})})})}ji.propTypes={blocklet:_.object.isRequired,blocklets:_.array,handleButtonClick:_.func,endpoint:_.string,serverVersion:_.string};function Si({handleButtonClick:e=null,handleSearchSelect:n=null,storeUrl:r,handleBlockletRender:s=null,extraFilter:a=void 0,serverVersion:o="",resourceType:d="",resourceDid:c="",showResourcesSwitch:l=!0,showCategory:i=!0,compact:h=!1,...p}){const v=Bt(),{locale:g}=je(),[R,P]=U.useState(!1),[T,D]=U.useState({}),m=E=>{D(E)},u=r,b=U.useMemo(()=>Cs(v,{palette:{background:{default:v.palette.background.paper}}}),[v]);return U.useEffect(()=>{D({showResources:!0,resourceType:d,resourceDid:c})},[u,d,c]),U.useEffect(()=>{P(!0),D({showResources:!0,resourceType:d,resourceDid:c})},[]),t.jsx(ws,{theme:b,children:t.jsx(js,{FallbackComponent:Ss,resetKeys:[u],children:t.jsxs(Y,{...p,sx:_s({overflow:"auto",".title-bar + div":{height:"unset"}},p.sx),children:[R&&t.jsx(ka,{showCategory:i,showResourcesSwitch:l,blockletRender:E=>{const S={...E,handleButtonClick:e,endpoint:u};return s({...E,defaultRender:t.jsx(ji,{...S})})},compact:h,minItemWidth:300,baseSearch:!0,endpoint:u,locale:g,onFilterChange:m,onSearchSelect:n,filters:T,extraFilter:a,serverVersion:o,fetchCategoryDelay:500}),t.jsx(Y,{sx:{mt:2},children:" "})]})})})}Si.propTypes={storeUrl:_.string.isRequired,handleButtonClick:_.func,handleSearchSelect:_.func,handleBlockletRender:_.func,extraFilter:_.func,serverVersion:_.string,resourceType:_.string,resourceDid:_.string,showResourcesSwitch:_.bool,showCategory:_.bool,compact:_.bool};const Ml=we(Pa)`
|
|
169
|
+
.ms-highlight {
|
|
170
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
171
|
+
}
|
|
172
|
+
`;function _i({ref:e=null,meta:n=null,isMobile:r,onStepChange:s}){const a=Bt(),{steps:o,activeStep:d,setActiveStepByKey:c,setActiveStepByIndex:l}=Na(),{t:i,locale:h}=je(),p=o[d];return U.useEffect(()=>{s(d)},[s,d]),U.useImperativeHandle(e,()=>({setActiveStepByKey:c,setActiveStepByIndex:l})),t.jsx(Fl,{component:"div",className:r?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:t.jsx(La,{locale:h,blockletMeta:{title:" ",...n},pcWidth:"100%",pcHeight:"100%",logoUrl:n&&n.logo&&n.registryUrl?Rs({did:n.did,version:n.version,baseUrl:n.registryUrl,logoPath:n.logo}):null,theme:a,stepTip:i("blocklet.component.add"),children:t.jsx($l,{children:typeof p?.body=="function"?p.body():p?.body})})})}_i.propTypes={ref:_.any,meta:_.any,onStepChange:_.func.isRequired,isMobile:_.bool.isRequired};const eo=e=>e.isMobile?`
|
|
173
|
+
height: calc(100vh - 56px - 64px - 48px);
|
|
174
|
+
`:"",$l=we.div`
|
|
175
|
+
width: 100%;
|
|
176
|
+
height: 100%;
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
justify-content: flex-start;
|
|
180
|
+
align-items: flex-start;
|
|
181
|
+
|
|
182
|
+
.bottom-button {
|
|
183
|
+
min-width: 200px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// blocklet-select-side
|
|
187
|
+
aside {
|
|
188
|
+
width: 140px;
|
|
189
|
+
}
|
|
190
|
+
`,Fl=we(Y)`
|
|
191
|
+
${({className:e})=>e==="mobileStyle"?`
|
|
192
|
+
& > div{
|
|
193
|
+
height: 100%;
|
|
194
|
+
}
|
|
195
|
+
.root-header {
|
|
196
|
+
.app-name-content {
|
|
197
|
+
display: none;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// content-panel
|
|
202
|
+
.root-header + div{
|
|
203
|
+
padding-top: 0;
|
|
204
|
+
position: relative;
|
|
205
|
+
& > div {
|
|
206
|
+
padding-top: 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
header + div {
|
|
211
|
+
padding-top: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
header {
|
|
215
|
+
.header-title {
|
|
216
|
+
margin-left: 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.header-title-name {
|
|
220
|
+
max-width: 100% !important;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
.app-content {
|
|
224
|
+
padding: 0!important;
|
|
225
|
+
}
|
|
226
|
+
`:`
|
|
227
|
+
position: relative;
|
|
228
|
+
.ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
|
|
229
|
+
width: 100%;
|
|
230
|
+
height: 100%;
|
|
231
|
+
border-radius: 0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.root-header {
|
|
235
|
+
z-index: auto !important;
|
|
236
|
+
position: fixed !important;
|
|
237
|
+
}
|
|
238
|
+
& > div {
|
|
239
|
+
height: 100%;
|
|
240
|
+
width: 100%;
|
|
241
|
+
max-width: 100%;
|
|
242
|
+
& > div {
|
|
243
|
+
max-height: unset !important;
|
|
244
|
+
max-width: 100%;
|
|
245
|
+
& > div {
|
|
246
|
+
// left-panel
|
|
247
|
+
&:first-of-type {
|
|
248
|
+
padding: 0;
|
|
249
|
+
width: 20%;
|
|
250
|
+
min-width: 180px;
|
|
251
|
+
|
|
252
|
+
& > div:first-of-type {
|
|
253
|
+
display: none;
|
|
254
|
+
}
|
|
255
|
+
// step
|
|
256
|
+
& > div:last-child {
|
|
257
|
+
// margin-top: 32px;
|
|
258
|
+
margin-top: 0;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// right-panel
|
|
262
|
+
&:last-child {
|
|
263
|
+
padding-top: 0;
|
|
264
|
+
padding-right: 0px;
|
|
265
|
+
overflow-y: hidden;
|
|
266
|
+
.app-content {
|
|
267
|
+
padding: 0 0 24px 0;
|
|
268
|
+
}
|
|
269
|
+
.button-container {
|
|
270
|
+
padding-right: 0;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
`}
|
|
278
|
+
|
|
279
|
+
& .ll-container {
|
|
280
|
+
background: ${({theme:e})=>e.palette.background.paper};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
& .app-overview {
|
|
284
|
+
margin-left: 0 !important;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
& .flex-justify-center {
|
|
288
|
+
display: flex;
|
|
289
|
+
justify-content: center;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
& .flex-align-center {
|
|
293
|
+
display: flex;
|
|
294
|
+
height: 100%;
|
|
295
|
+
align-items: center;
|
|
296
|
+
${e=>eo(e)}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
& .agreement-wrapper {
|
|
300
|
+
${e=>eo(e)}
|
|
301
|
+
max-height: 60vh;
|
|
302
|
+
.eula-trigger {
|
|
303
|
+
padding-right: 0;
|
|
304
|
+
}
|
|
305
|
+
.next-button {
|
|
306
|
+
display: none;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
& .connect {
|
|
311
|
+
background: white;
|
|
312
|
+
}
|
|
313
|
+
`,ql=dr`
|
|
314
|
+
0%, 100% {
|
|
315
|
+
transform: scale(1) translateX(0);
|
|
316
|
+
}
|
|
317
|
+
50% {
|
|
318
|
+
transform: scale(1.05) translateX(-3px);
|
|
319
|
+
}
|
|
320
|
+
25%, 75% {
|
|
321
|
+
transform: scale(1.1) translateX(3px);
|
|
322
|
+
}
|
|
323
|
+
`;function Yt({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:s=>{s.target.style.display="none"}})}Yt.propTypes={src:_.string.isRequired,alt:_.string.isRequired,size:_.number};const zl=48,Wl=8,to={PaperProps:{style:{maxHeight:zl*4.5+Wl,width:250}}},Gl=(e,n,r)=>({fontWeight:n.indexOf(e)===-1?r.typography.fontWeightRegular:r.typography.fontWeightMedium});function Ei({label:e="",disabled:n=!1,required:r=!1,initialValue:s="",onChange:a=()=>{},sx:o={},onSubmit:d=()=>{},triggers:c=[],options:l=[],formatterBeforeSubmit:i=P=>P.join(","),helperText:h="",config:p={},directEditing:v=!1,searchable:g=!0,...R}){const P=Bt(),[T,D]=U.useState(v),[m,u]=U.useState(!1),[b,E]=U.useState(""),{multiple:S=!1,labelField:C="name",valueField:X="code"}=p,[Q,k]=U.useState(s),[q,$]=U.useState(Q),[G,J]=U.useState(!1),[ee,ae]=U.useState(!1),de=U.useCallback(()=>{ae(!0),setTimeout(()=>{ae(!1)},500)},[]),me=async()=>{u(!0);try{await d(typeof i=="function"&&S?i(q):q)===!1?$(Q):($(q),k(q),J(!1))}catch{$(Q)}finally{u(!1),D(!1)}},V=U.useCallback(()=>{v&&!n&&!m&&me(),G&&de(),!G&&!n&&!m&&(D(!1),J(!1))},[v,n,m,G,de]);U.useEffect(()=>{const w=s;w!==Q&&(k(w),$(w),J(!1))},[s,Q]);const xe=l.filter(w=>{if(!b)return!0;const y=b.toLowerCase();return w[C]?.toLowerCase().includes(y)||w[X]?.toLowerCase().includes(y)}),K=w=>{let{value:y}=w.target;S&&(y=typeof y=="string"?y.split(","):y),J(y!==q),$(y),a(y)},H=T||v?t.jsxs(Ts,{value:q,onChange:K,fullWidth:!0,multiple:S,variant:"outlined",margin:"dense",onBlur:V,disabled:n,renderValue:w=>{if(S)return t.jsx(Y,{sx:{display:"flex",flexWrap:"wrap"},children:w.filter(F=>l.some(re=>re[X]===F)).map(F=>t.jsx(Br,{label:l.find(re=>re[X]===F)[C],style:{marginRight:8},size:"small"},F))});if(!w)return null;const y=l.find(F=>F[X]===w);return t.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[y?.logo&&t.jsx(Yt,{src:y.logo,alt:y[C],size:20}),t.jsx("span",{children:y?y[C]:""})]})},MenuProps:{...to,PaperProps:{...to.PaperProps}},error:!!h,...R,children:[g?t.jsx(Y,{sx:{p:1,borderBottom:1,borderColor:"divider"},children:t.jsx(De,{size:"small",placeholder:"Search...",value:b,onChange:w=>E(w.target.value),onClick:w=>w.stopPropagation(),onKeyDown:w=>w.stopPropagation(),fullWidth:!0,variant:"outlined"})}):null,xe.map(w=>t.jsx(Ye,{value:w[X],style:Gl(w[X],q,P),children:t.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&t.jsx(Yt,{src:w.logo,alt:w[C],size:20}),t.jsx("span",{children:w[C]})]})},w[X]))]}):t.jsx(Y,{"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},sx:{px:1},onClick:()=>{n||D(!0)},children:S?q.filter(w=>l.some(y=>y[X]===w)).map(w=>t.jsx(Br,{label:l.find(y=>y[X]===w)[C],style:{marginRight:8},size:"small"},w)):q&&l.some(w=>w[X]===q)&&t.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[(()=>{const w=l.find(y=>y[X]===q);return w?.logo?t.jsx(Yt,{src:w.logo,alt:w[C],size:20}):null})(),t.jsx("span",{children:l.find(w=>w[X]===q)[C]})]})});return t.jsx(Jo,{className:"form",sx:o,children:t.jsxs(Y,{className:"form-item",children:[t.jsxs(Y,{className:"form-item-label",children:[e,r&&t.jsx(yt,{})]}),t.jsxs(Y,{className:"form-item-body",children:[t.jsx(Y,{className:"form-item-input",children:H}),t.jsx(Y,{className:"form-item-action",style:!T||v?{marginLeft:0}:{},children:T&&!v?t.jsxs(t.Fragment,{children:[G?t.jsx(Re,{"data-cy":"schema-form-item-confirm",onClick:me,disabled:n||m,sx:{animation:ee?`${ql} 0.5s linear`:"none"},size:"large",children:m?t.jsx(Le,{size:24}):t.jsx(oi,{})}):null,t.jsx(Re,{"data-cy":"schema-form-item-cancel",onClick:()=>{$(Q),D(!1)},disabled:n||m,size:"large",children:t.jsx(Mo,{})})]}):t.jsx(Y,{children:c.length?t.jsx(ba,{triggers:c,disabled:n}):null})})]}),T&&h&&t.jsx(Ps,{error:!0,children:h})]})})}Ei.propTypes={sx:_.object,onSubmit:_.func,onChange:_.func,label:_.string,initialValue:_.string,required:_.bool,disabled:_.bool,triggers:_.array,options:_.array,helperText:_.string,formatterBeforeSubmit:_.func,config:_.object,directEditing:_.bool,searchable:_.bool};const lt={};function Hl(e){lt[e]&&(clearTimeout(lt[e]),delete lt[e])}async function Vl(e,{interval:n=1e3,maxDuration:r=120*1e3,intervalFirst:s=4e3,timerKey:a=""}){lt[a]&&clearTimeout(lt[a]),await new Promise(c=>setTimeout(c,s));const o=Date.now(),d=async(c,l)=>{try{const i=await e();c(i)}catch(i){Date.now()-o>r?l(i):a?lt[a]=setTimeout(()=>d(c,l),n):setTimeout(()=>d(c,l),n)}};return new Promise(d)}function Kl(e,{did:n,refresh:r,t:s,providerName:a,values:o,timerKey:d}){return Vl(async()=>{const{blocklet:c}=await e.getBlocklet({input:{did:n}}),l=Is(c,"settings.aigne",{}),{url:i,key:h,provider:p}=l||{},{key:v}=o;if(p==="aigneHub"){if(!i||!h)throw new Error(s("setting.aigne.connectTimeOut",{provider:a}));if(v&&v===h)throw new Error(s("setting.aigne.connectTimeOut",{provider:a}));await r(),clearTimeout(lt[`connect-aigne-${n}`])}else{if(!v||v!==h)throw new Error(s("setting.aigne.connectTimeOut",{provider:a}));await r(),clearTimeout(lt[`connect-aigne-${n}`])}},{timerKey:d,maxDuration:3*60*1e3})}var _t={},Gt={},no;function Yl(){if(no)return Gt;no=1,Object.defineProperty(Gt,"__esModule",{value:!0});const e=qo();let n=Bs();n=e.__toESM(n);var r=n.default.create("encrypt","decrypt");return Gt.default=r,Gt}var Zt={exports:{}},Xt={exports:{}},Zl=Xt.exports,ro;function Ve(){return ro||(ro=1,function(e,n){(function(r,s){e.exports=s()})(Zl,function(){var r=r||function(s,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 Kt<"u"&&Kt.crypto&&(o=Kt.crypto),!o&&typeof Ds=="function")try{o=zo()}catch{}var d=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 m(){}return function(u){var b;return m.prototype=u,b=new m,m.prototype=null,b}}(),l={},i=l.lib={},h=i.Base=function(){return{extend:function(m){var u=c(this);return m&&u.mixIn(m),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},create:function(){var m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var u in m)m.hasOwnProperty(u)&&(this[u]=m[u]);m.hasOwnProperty("toString")&&(this.toString=m.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),p=i.WordArray=h.extend({init:function(m,u){m=this.words=m||[],u!=a?this.sigBytes=u:this.sigBytes=m.length*4},toString:function(m){return(m||g).stringify(this)},concat:function(m){var u=this.words,b=m.words,E=this.sigBytes,S=m.sigBytes;if(this.clamp(),E%4)for(var C=0;C<S;C++){var X=b[C>>>2]>>>24-C%4*8&255;u[E+C>>>2]|=X<<24-(E+C)%4*8}else for(var Q=0;Q<S;Q+=4)u[E+Q>>>2]=b[Q>>>2];return this.sigBytes+=S,this},clamp:function(){var m=this.words,u=this.sigBytes;m[u>>>2]&=4294967295<<32-u%4*8,m.length=s.ceil(u/4)},clone:function(){var m=h.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var u=[],b=0;b<m;b+=4)u.push(d());return new p.init(u,m)}}),v=l.enc={},g=v.Hex={stringify:function(m){for(var u=m.words,b=m.sigBytes,E=[],S=0;S<b;S++){var C=u[S>>>2]>>>24-S%4*8&255;E.push((C>>>4).toString(16)),E.push((C&15).toString(16))}return E.join("")},parse:function(m){for(var u=m.length,b=[],E=0;E<u;E+=2)b[E>>>3]|=parseInt(m.substr(E,2),16)<<24-E%8*4;return new p.init(b,u/2)}},R=v.Latin1={stringify:function(m){for(var u=m.words,b=m.sigBytes,E=[],S=0;S<b;S++){var C=u[S>>>2]>>>24-S%4*8&255;E.push(String.fromCharCode(C))}return E.join("")},parse:function(m){for(var u=m.length,b=[],E=0;E<u;E++)b[E>>>2]|=(m.charCodeAt(E)&255)<<24-E%4*8;return new p.init(b,u)}},P=v.Utf8={stringify:function(m){try{return decodeURIComponent(escape(R.stringify(m)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(m){return R.parse(unescape(encodeURIComponent(m)))}},T=i.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(m){typeof m=="string"&&(m=P.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes},_process:function(m){var u,b=this._data,E=b.words,S=b.sigBytes,C=this.blockSize,X=C*4,Q=S/X;m?Q=s.ceil(Q):Q=s.max((Q|0)-this._minBufferSize,0);var k=Q*C,q=s.min(k*4,S);if(k){for(var $=0;$<k;$+=C)this._doProcessBlock(E,$);u=E.splice(0,k),b.sigBytes-=q}return new p.init(u,q)},clone:function(){var m=h.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});i.Hasher=T.extend({cfg:h.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset()},reset:function(){T.reset.call(this),this._doReset()},update:function(m){return this._append(m),this._process(),this},finalize:function(m){m&&this._append(m);var u=this._doFinalize();return u},blockSize:16,_createHelper:function(m){return function(u,b){return new m.init(b).finalize(u)}},_createHmacHelper:function(m){return function(u,b){return new D.HMAC.init(m,b).finalize(u)}}});var D=l.algo={};return l}(Math);return r})}(Xt)),Xt.exports}var Qt={exports:{}},Xl=Qt.exports,oo;function ki(){return oo||(oo=1,function(e,n){(function(r,s){e.exports=s(Ve())})(Xl,function(r){return function(){var s=r,a=s.lib,o=a.WordArray,d=s.enc;d.Base64={stringify:function(l){var i=l.words,h=l.sigBytes,p=this._map;l.clamp();for(var v=[],g=0;g<h;g+=3)for(var R=i[g>>>2]>>>24-g%4*8&255,P=i[g+1>>>2]>>>24-(g+1)%4*8&255,T=i[g+2>>>2]>>>24-(g+2)%4*8&255,D=R<<16|P<<8|T,m=0;m<4&&g+m*.75<h;m++)v.push(p.charAt(D>>>6*(3-m)&63));var u=p.charAt(64);if(u)for(;v.length%4;)v.push(u);return v.join("")},parse:function(l){var i=l.length,h=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var v=0;v<h.length;v++)p[h.charCodeAt(v)]=v}var g=h.charAt(64);if(g){var R=l.indexOf(g);R!==-1&&(i=R)}return c(l,i,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(l,i,h){for(var p=[],v=0,g=0;g<i;g++)if(g%4){var R=h[l.charCodeAt(g-1)]<<g%4*2,P=h[l.charCodeAt(g)]>>>6-g%4*2,T=R|P;p[v>>>2]|=T<<24-v%4*8,v++}return o.create(p,v)}}(),r.enc.Base64})}(Qt)),Qt.exports}var Jt={exports:{}},Ql=Jt.exports,io;function Jl(){return io||(io=1,function(e,n){(function(r,s){e.exports=s(Ve())})(Ql,function(r){return function(s){var a=r,o=a.lib,d=o.WordArray,c=o.Hasher,l=a.algo,i=[];(function(){for(var P=0;P<64;P++)i[P]=s.abs(s.sin(P+1))*4294967296|0})();var h=l.MD5=c.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(P,T){for(var D=0;D<16;D++){var m=T+D,u=P[m];P[m]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}var b=this._hash.words,E=P[T+0],S=P[T+1],C=P[T+2],X=P[T+3],Q=P[T+4],k=P[T+5],q=P[T+6],$=P[T+7],G=P[T+8],J=P[T+9],ee=P[T+10],ae=P[T+11],de=P[T+12],me=P[T+13],V=P[T+14],xe=P[T+15],K=b[0],H=b[1],w=b[2],y=b[3];K=p(K,H,w,y,E,7,i[0]),y=p(y,K,H,w,S,12,i[1]),w=p(w,y,K,H,C,17,i[2]),H=p(H,w,y,K,X,22,i[3]),K=p(K,H,w,y,Q,7,i[4]),y=p(y,K,H,w,k,12,i[5]),w=p(w,y,K,H,q,17,i[6]),H=p(H,w,y,K,$,22,i[7]),K=p(K,H,w,y,G,7,i[8]),y=p(y,K,H,w,J,12,i[9]),w=p(w,y,K,H,ee,17,i[10]),H=p(H,w,y,K,ae,22,i[11]),K=p(K,H,w,y,de,7,i[12]),y=p(y,K,H,w,me,12,i[13]),w=p(w,y,K,H,V,17,i[14]),H=p(H,w,y,K,xe,22,i[15]),K=v(K,H,w,y,S,5,i[16]),y=v(y,K,H,w,q,9,i[17]),w=v(w,y,K,H,ae,14,i[18]),H=v(H,w,y,K,E,20,i[19]),K=v(K,H,w,y,k,5,i[20]),y=v(y,K,H,w,ee,9,i[21]),w=v(w,y,K,H,xe,14,i[22]),H=v(H,w,y,K,Q,20,i[23]),K=v(K,H,w,y,J,5,i[24]),y=v(y,K,H,w,V,9,i[25]),w=v(w,y,K,H,X,14,i[26]),H=v(H,w,y,K,G,20,i[27]),K=v(K,H,w,y,me,5,i[28]),y=v(y,K,H,w,C,9,i[29]),w=v(w,y,K,H,$,14,i[30]),H=v(H,w,y,K,de,20,i[31]),K=g(K,H,w,y,k,4,i[32]),y=g(y,K,H,w,G,11,i[33]),w=g(w,y,K,H,ae,16,i[34]),H=g(H,w,y,K,V,23,i[35]),K=g(K,H,w,y,S,4,i[36]),y=g(y,K,H,w,Q,11,i[37]),w=g(w,y,K,H,$,16,i[38]),H=g(H,w,y,K,ee,23,i[39]),K=g(K,H,w,y,me,4,i[40]),y=g(y,K,H,w,E,11,i[41]),w=g(w,y,K,H,X,16,i[42]),H=g(H,w,y,K,q,23,i[43]),K=g(K,H,w,y,J,4,i[44]),y=g(y,K,H,w,de,11,i[45]),w=g(w,y,K,H,xe,16,i[46]),H=g(H,w,y,K,C,23,i[47]),K=R(K,H,w,y,E,6,i[48]),y=R(y,K,H,w,$,10,i[49]),w=R(w,y,K,H,V,15,i[50]),H=R(H,w,y,K,k,21,i[51]),K=R(K,H,w,y,de,6,i[52]),y=R(y,K,H,w,X,10,i[53]),w=R(w,y,K,H,ee,15,i[54]),H=R(H,w,y,K,S,21,i[55]),K=R(K,H,w,y,G,6,i[56]),y=R(y,K,H,w,xe,10,i[57]),w=R(w,y,K,H,q,15,i[58]),H=R(H,w,y,K,me,21,i[59]),K=R(K,H,w,y,Q,6,i[60]),y=R(y,K,H,w,ae,10,i[61]),w=R(w,y,K,H,C,15,i[62]),H=R(H,w,y,K,J,21,i[63]),b[0]=b[0]+K|0,b[1]=b[1]+H|0,b[2]=b[2]+w|0,b[3]=b[3]+y|0},_doFinalize:function(){var P=this._data,T=P.words,D=this._nDataBytes*8,m=P.sigBytes*8;T[m>>>5]|=128<<24-m%32;var u=s.floor(D/4294967296),b=D;T[(m+64>>>9<<4)+15]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,T[(m+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,P.sigBytes=(T.length+1)*4,this._process();for(var E=this._hash,S=E.words,C=0;C<4;C++){var X=S[C];S[C]=(X<<8|X>>>24)&16711935|(X<<24|X>>>8)&4278255360}return E},clone:function(){var P=c.clone.call(this);return P._hash=this._hash.clone(),P}});function p(P,T,D,m,u,b,E){var S=P+(T&D|~T&m)+u+E;return(S<<b|S>>>32-b)+T}function v(P,T,D,m,u,b,E){var S=P+(T&m|D&~m)+u+E;return(S<<b|S>>>32-b)+T}function g(P,T,D,m,u,b,E){var S=P+(T^D^m)+u+E;return(S<<b|S>>>32-b)+T}function R(P,T,D,m,u,b,E){var S=P+(D^(T|~m))+u+E;return(S<<b|S>>>32-b)+T}a.MD5=c._createHelper(h),a.HmacMD5=c._createHmacHelper(h)}(Math),r.MD5})}(Jt)),Jt.exports}var en={exports:{}},tn={exports:{}},ec=tn.exports,so;function tc(){return so||(so=1,function(e,n){(function(r,s){e.exports=s(Ve())})(ec,function(r){return function(){var s=r,a=s.lib,o=a.WordArray,d=a.Hasher,c=s.algo,l=[],i=c.SHA1=d.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(h,p){for(var v=this._hash.words,g=v[0],R=v[1],P=v[2],T=v[3],D=v[4],m=0;m<80;m++){if(m<16)l[m]=h[p+m]|0;else{var u=l[m-3]^l[m-8]^l[m-14]^l[m-16];l[m]=u<<1|u>>>31}var b=(g<<5|g>>>27)+D+l[m];m<20?b+=(R&P|~R&T)+1518500249:m<40?b+=(R^P^T)+1859775393:m<60?b+=(R&P|R&T|P&T)-1894007588:b+=(R^P^T)-899497514,D=T,T=P,P=R<<30|R>>>2,R=g,g=b}v[0]=v[0]+g|0,v[1]=v[1]+R|0,v[2]=v[2]+P|0,v[3]=v[3]+T|0,v[4]=v[4]+D|0},_doFinalize:function(){var h=this._data,p=h.words,v=this._nDataBytes*8,g=h.sigBytes*8;return p[g>>>5]|=128<<24-g%32,p[(g+64>>>9<<4)+14]=Math.floor(v/4294967296),p[(g+64>>>9<<4)+15]=v,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=d.clone.call(this);return h._hash=this._hash.clone(),h}});s.SHA1=d._createHelper(i),s.HmacSHA1=d._createHmacHelper(i)}(),r.SHA1})}(tn)),tn.exports}var nn={exports:{}},nc=nn.exports,ao;function rc(){return ao||(ao=1,function(e,n){(function(r,s){e.exports=s(Ve())})(nc,function(r){(function(){var s=r,a=s.lib,o=a.Base,d=s.enc,c=d.Utf8,l=s.algo;l.HMAC=o.extend({init:function(i,h){i=this._hasher=new i.init,typeof h=="string"&&(h=c.parse(h));var p=i.blockSize,v=p*4;h.sigBytes>v&&(h=i.finalize(h)),h.clamp();for(var g=this._oKey=h.clone(),R=this._iKey=h.clone(),P=g.words,T=R.words,D=0;D<p;D++)P[D]^=1549556828,T[D]^=909522486;g.sigBytes=R.sigBytes=v,this.reset()},reset:function(){var i=this._hasher;i.reset(),i.update(this._iKey)},update:function(i){return this._hasher.update(i),this},finalize:function(i){var h=this._hasher,p=h.finalize(i);h.reset();var v=h.finalize(this._oKey.clone().concat(p));return v}})})()})}(nn)),nn.exports}var oc=en.exports,lo;function Ri(){return lo||(lo=1,function(e,n){(function(r,s,a){e.exports=s(Ve(),tc(),rc())})(oc,function(r){return function(){var s=r,a=s.lib,o=a.Base,d=a.WordArray,c=s.algo,l=c.MD5,i=c.EvpKDF=o.extend({cfg:o.extend({keySize:128/32,hasher:l,iterations:1}),init:function(h){this.cfg=this.cfg.extend(h)},compute:function(h,p){for(var v,g=this.cfg,R=g.hasher.create(),P=d.create(),T=P.words,D=g.keySize,m=g.iterations;T.length<D;){v&&R.update(v),v=R.update(h).finalize(p),R.reset();for(var u=1;u<m;u++)v=R.finalize(v),R.reset();P.concat(v)}return P.sigBytes=D*4,P}});s.EvpKDF=function(h,p,v){return i.create(v).compute(h,p)}}(),r.EvpKDF})}(en)),en.exports}var rn={exports:{}},ic=rn.exports,co;function sc(){return co||(co=1,function(e,n){(function(r,s,a){e.exports=s(Ve(),Ri())})(ic,function(r){r.lib.Cipher||function(s){var a=r,o=a.lib,d=o.Base,c=o.WordArray,l=o.BufferedBlockAlgorithm,i=a.enc;i.Utf8;var h=i.Base64,p=a.algo,v=p.EvpKDF,g=o.Cipher=l.extend({cfg:d.extend(),createEncryptor:function(k,q){return this.create(this._ENC_XFORM_MODE,k,q)},createDecryptor:function(k,q){return this.create(this._DEC_XFORM_MODE,k,q)},init:function(k,q,$){this.cfg=this.cfg.extend($),this._xformMode=k,this._key=q,this.reset()},reset:function(){l.reset.call(this),this._doReset()},process:function(k){return this._append(k),this._process()},finalize:function(k){k&&this._append(k);var q=this._doFinalize();return q},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function k(q){return typeof q=="string"?Q:S}return function(q){return{encrypt:function($,G,J){return k(G).encrypt(q,$,G,J)},decrypt:function($,G,J){return k(G).decrypt(q,$,G,J)}}}}()});o.StreamCipher=g.extend({_doFinalize:function(){var k=this._process(!0);return k},blockSize:1});var R=a.mode={},P=o.BlockCipherMode=d.extend({createEncryptor:function(k,q){return this.Encryptor.create(k,q)},createDecryptor:function(k,q){return this.Decryptor.create(k,q)},init:function(k,q){this._cipher=k,this._iv=q}}),T=R.CBC=function(){var k=P.extend();k.Encryptor=k.extend({processBlock:function($,G){var J=this._cipher,ee=J.blockSize;q.call(this,$,G,ee),J.encryptBlock($,G),this._prevBlock=$.slice(G,G+ee)}}),k.Decryptor=k.extend({processBlock:function($,G){var J=this._cipher,ee=J.blockSize,ae=$.slice(G,G+ee);J.decryptBlock($,G),q.call(this,$,G,ee),this._prevBlock=ae}});function q($,G,J){var ee,ae=this._iv;ae?(ee=ae,this._iv=s):ee=this._prevBlock;for(var de=0;de<J;de++)$[G+de]^=ee[de]}return k}(),D=a.pad={},m=D.Pkcs7={pad:function(k,q){for(var $=q*4,G=$-k.sigBytes%$,J=G<<24|G<<16|G<<8|G,ee=[],ae=0;ae<G;ae+=4)ee.push(J);var de=c.create(ee,G);k.concat(de)},unpad:function(k){var q=k.words[k.sigBytes-1>>>2]&255;k.sigBytes-=q}};o.BlockCipher=g.extend({cfg:g.cfg.extend({mode:T,padding:m}),reset:function(){var k;g.reset.call(this);var q=this.cfg,$=q.iv,G=q.mode;this._xformMode==this._ENC_XFORM_MODE?k=G.createEncryptor:(k=G.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==k?this._mode.init(this,$&&$.words):(this._mode=k.call(G,this,$&&$.words),this._mode.__creator=k)},_doProcessBlock:function(k,q){this._mode.processBlock(k,q)},_doFinalize:function(){var k,q=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(q.pad(this._data,this.blockSize),k=this._process(!0)):(k=this._process(!0),q.unpad(k)),k},blockSize:128/32});var u=o.CipherParams=d.extend({init:function(k){this.mixIn(k)},toString:function(k){return(k||this.formatter).stringify(this)}}),b=a.format={},E=b.OpenSSL={stringify:function(k){var q,$=k.ciphertext,G=k.salt;return G?q=c.create([1398893684,1701076831]).concat(G).concat($):q=$,q.toString(h)},parse:function(k){var q,$=h.parse(k),G=$.words;return G[0]==1398893684&&G[1]==1701076831&&(q=c.create(G.slice(2,4)),G.splice(0,4),$.sigBytes-=16),u.create({ciphertext:$,salt:q})}},S=o.SerializableCipher=d.extend({cfg:d.extend({format:E}),encrypt:function(k,q,$,G){G=this.cfg.extend(G);var J=k.createEncryptor($,G),ee=J.finalize(q),ae=J.cfg;return u.create({ciphertext:ee,key:$,iv:ae.iv,algorithm:k,mode:ae.mode,padding:ae.padding,blockSize:k.blockSize,formatter:G.format})},decrypt:function(k,q,$,G){G=this.cfg.extend(G),q=this._parse(q,G.format);var J=k.createDecryptor($,G).finalize(q.ciphertext);return J},_parse:function(k,q){return typeof k=="string"?q.parse(k,this):k}}),C=a.kdf={},X=C.OpenSSL={execute:function(k,q,$,G,J){if(G||(G=c.random(64/8)),J)var ee=v.create({keySize:q+$,hasher:J}).compute(k,G);else var ee=v.create({keySize:q+$}).compute(k,G);var ae=c.create(ee.words.slice(q),$*4);return ee.sigBytes=q*4,u.create({key:ee,iv:ae,salt:G})}},Q=o.PasswordBasedCipher=S.extend({cfg:S.cfg.extend({kdf:X}),encrypt:function(k,q,$,G){G=this.cfg.extend(G);var J=G.kdf.execute($,k.keySize,k.ivSize,G.salt,G.hasher);G.iv=J.iv;var ee=S.encrypt.call(this,k,q,J.key,G);return ee.mixIn(J),ee},decrypt:function(k,q,$,G){G=this.cfg.extend(G),q=this._parse(q,G.format);var J=G.kdf.execute($,k.keySize,k.ivSize,q.salt,G.hasher);G.iv=J.iv;var ee=S.decrypt.call(this,k,q,J.key,G);return ee}})}()})}(rn)),rn.exports}var ac=Zt.exports,uo;function lc(){return uo||(uo=1,function(e,n){(function(r,s,a){e.exports=s(Ve(),ki(),Jl(),Ri(),sc())})(ac,function(r){return function(){var s=r,a=s.lib,o=a.BlockCipher,d=s.algo,c=[],l=[],i=[],h=[],p=[],v=[],g=[],R=[],P=[],T=[];(function(){for(var u=[],b=0;b<256;b++)b<128?u[b]=b<<1:u[b]=b<<1^283;for(var E=0,S=0,b=0;b<256;b++){var C=S^S<<1^S<<2^S<<3^S<<4;C=C>>>8^C&255^99,c[E]=C,l[C]=E;var X=u[E],Q=u[X],k=u[Q],q=u[C]*257^C*16843008;i[E]=q<<24|q>>>8,h[E]=q<<16|q>>>16,p[E]=q<<8|q>>>24,v[E]=q;var q=k*16843009^Q*65537^X*257^E*16843008;g[C]=q<<24|q>>>8,R[C]=q<<16|q>>>16,P[C]=q<<8|q>>>24,T[C]=q,E?(E=X^u[u[u[k^X]]],S^=u[u[S]]):E=S=1}})();var D=[0,1,2,4,8,16,32,64,128,27,54],m=d.AES=o.extend({_doReset:function(){var u;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var b=this._keyPriorReset=this._key,E=b.words,S=b.sigBytes/4,C=this._nRounds=S+6,X=(C+1)*4,Q=this._keySchedule=[],k=0;k<X;k++)k<S?Q[k]=E[k]:(u=Q[k-1],k%S?S>6&&k%S==4&&(u=c[u>>>24]<<24|c[u>>>16&255]<<16|c[u>>>8&255]<<8|c[u&255]):(u=u<<8|u>>>24,u=c[u>>>24]<<24|c[u>>>16&255]<<16|c[u>>>8&255]<<8|c[u&255],u^=D[k/S|0]<<24),Q[k]=Q[k-S]^u);for(var q=this._invKeySchedule=[],$=0;$<X;$++){var k=X-$;if($%4)var u=Q[k];else var u=Q[k-4];$<4||k<=4?q[$]=u:q[$]=g[c[u>>>24]]^R[c[u>>>16&255]]^P[c[u>>>8&255]]^T[c[u&255]]}}},encryptBlock:function(u,b){this._doCryptBlock(u,b,this._keySchedule,i,h,p,v,c)},decryptBlock:function(u,b){var E=u[b+1];u[b+1]=u[b+3],u[b+3]=E,this._doCryptBlock(u,b,this._invKeySchedule,g,R,P,T,l);var E=u[b+1];u[b+1]=u[b+3],u[b+3]=E},_doCryptBlock:function(u,b,E,S,C,X,Q,k){for(var q=this._nRounds,$=u[b]^E[0],G=u[b+1]^E[1],J=u[b+2]^E[2],ee=u[b+3]^E[3],ae=4,de=1;de<q;de++){var me=S[$>>>24]^C[G>>>16&255]^X[J>>>8&255]^Q[ee&255]^E[ae++],V=S[G>>>24]^C[J>>>16&255]^X[ee>>>8&255]^Q[$&255]^E[ae++],xe=S[J>>>24]^C[ee>>>16&255]^X[$>>>8&255]^Q[G&255]^E[ae++],K=S[ee>>>24]^C[$>>>16&255]^X[G>>>8&255]^Q[J&255]^E[ae++];$=me,G=V,J=xe,ee=K}var me=(k[$>>>24]<<24|k[G>>>16&255]<<16|k[J>>>8&255]<<8|k[ee&255])^E[ae++],V=(k[G>>>24]<<24|k[J>>>16&255]<<16|k[ee>>>8&255]<<8|k[$&255])^E[ae++],xe=(k[J>>>24]<<24|k[ee>>>16&255]<<16|k[$>>>8&255]<<8|k[G&255])^E[ae++],K=(k[ee>>>24]<<24|k[$>>>16&255]<<16|k[G>>>8&255]<<8|k[J&255])^E[ae++];u[b]=me,u[b+1]=V,u[b+2]=xe,u[b+3]=K},keySize:256/32});s.AES=o._createHelper(m)}(),r.AES})}(Zt)),Zt.exports}var on={exports:{}},cc=on.exports,fo;function uc(){return fo||(fo=1,function(e,n){(function(r,s){e.exports=s(Ve())})(cc,function(r){return r.enc.Latin1})}(on)),on.exports}var sn={exports:{}},dc=sn.exports,po;function fc(){return po||(po=1,function(e,n){(function(r,s){e.exports=s(Ve())})(dc,function(r){return r.enc.Utf8})}(sn)),sn.exports}var an={exports:{}},pc=an.exports,mo;function mc(){return mo||(mo=1,function(e,n){(function(r,s){e.exports=s(Ve())})(pc,function(r){return function(){var s=r,a=s.lib,o=a.WordArray,d=s.enc;d.Utf16=d.Utf16BE={stringify:function(l){for(var i=l.words,h=l.sigBytes,p=[],v=0;v<h;v+=2){var g=i[v>>>2]>>>16-v%4*8&65535;p.push(String.fromCharCode(g))}return p.join("")},parse:function(l){for(var i=l.length,h=[],p=0;p<i;p++)h[p>>>1]|=l.charCodeAt(p)<<16-p%2*16;return o.create(h,i*2)}},d.Utf16LE={stringify:function(l){for(var i=l.words,h=l.sigBytes,p=[],v=0;v<h;v+=2){var g=c(i[v>>>2]>>>16-v%4*8&65535);p.push(String.fromCharCode(g))}return p.join("")},parse:function(l){for(var i=l.length,h=[],p=0;p<i;p++)h[p>>>1]|=c(l.charCodeAt(p)<<16-p%2*16);return o.create(h,i*2)}};function c(l){return l<<8&4278255360|l>>>8&16711935}}(),r.enc.Utf16})}(an)),an.exports}var ln={exports:{}},hc=ln.exports,ho;function gc(){return ho||(ho=1,function(e,n){(function(r,s){e.exports=s(Ve())})(hc,function(r){return r.enc.Hex})}(ln)),ln.exports}var go;function xc(){if(go)return _t;go=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=qo(),n=Yl();let r=lc();r=e.__toESM(r);let s=uc();s=e.__toESM(s);let a=fc();a=e.__toESM(a);let o=mc();o=e.__toESM(o);let d=ki();d=e.__toESM(d);let c=gc();c=e.__toESM(c);const l={latin1:s.default,utf8:a.default,hex:c.default,utf16:o.default,base64:d.default};var i=class extends n.default{encrypt(p,v){const g=typeof p=="string"?p:JSON.stringify(p);return r.encrypt(g,v).toString()}decrypt(p,v,g="utf8"){return r.decrypt(p,v).toString(l[g])}},h=new i;return _t.AesCrypter=i,_t.default=h,_t}const yc=!0,vc=">= 8",bc=">= 0.5 && < 0.9.7",Cc=!0,wc=!0,jc=">= 0.5",Sc=!0,_c=!0,Ec=!0,kc=">= 1 && < 8",Rc="< 8",Tc=!0,Pc=[">= 14.17 && < 15",">= 15.1"],Ic=!0,Bc=">= 0.7.12",Dc=!0,Oc="< 6",Nc=!0,Lc=">= 0.11.1",Uc=">= 0.11.1",Ac=">= 0.11.1",Mc=">= 0.11.1",$c=">= 0.11.1",Fc=">= 0.11.1",qc=!0,zc=">= 8.8",Wc=!0,Gc=">= 8",Hc="< 8",Vc=!0,Kc=!0,Yc=!0,Zc=!0,Xc=">= 8.5",Qc=">= 1",Jc=">= 0.5",eu=!0,tu=!0,nu=!0,ru=">= 0.11.5 && < 3",ou=">= 0.9.4",iu=">= 0.9.4",su=">= 1.4.1",au=">= 0.9.4",lu=">= 0.9.4",cu=">= 0.9.4",uu=!0,du=!0,fu=[">= 0.4 && < 0.7",">= 0.8"],pu=!0,mu=">= 0.11.13",hu=">= 0.11.3 && < 10",gu=">= 0.11.3",xu=!0,yu=">= 10",vu=!0,bu=!0,Cu=!0,wu=">= 1",ju=!0,Su=[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],_u=">= 11.7",Eu=">= 0.5",ku={assert:yc,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:vc,"node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:bc,buffer:Cc,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:wc,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:jc,"node:cluster":[">= 14.18 && < 15",">= 16"],console:Sc,"node:console":[">= 14.18 && < 15",">= 16"],constants:_c,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:Ec,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:kc,_debugger:Rc,dgram:Tc,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:Pc,"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:Ic,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:Bc,"node:domain":[">= 14.18 && < 15",">= 16"],events:Dc,"node:events":[">= 14.18 && < 15",">= 16"],freelist:Oc,fs:Nc,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:Lc,"node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:Uc,"node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:Ac,"node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:Mc,"node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:$c,"node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:Fc,"node:_http_server":[">= 14.18 && < 15",">= 16"],http:qc,"node:http":[">= 14.18 && < 15",">= 16"],http2:zc,"node:http2":[">= 14.18 && < 15",">= 16"],https:Wc,"node:https":[">= 14.18 && < 15",">= 16"],inspector:Gc,"node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:Hc,module:Vc,"node:module":[">= 14.18 && < 15",">= 16"],net:Kc,"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:Yc,"node:os":[">= 14.18 && < 15",">= 16"],path:Zc,"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:Qc,"node:process":[">= 14.18 && < 15",">= 16"],punycode:Jc,"node:punycode":[">= 14.18 && < 15",">= 16"],querystring:eu,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:tu,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:nu,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:ru,_stream_duplex:ou,"node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:iu,"node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:su,"node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:au,"node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:lu,"node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:cu,"node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:uu,"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:du,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:fu,"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:pu,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:mu,"node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:hu,_tls_wrap:gu,"node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:xu,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:yu,"node:trace_events":[">= 14.18 && < 15",">= 16"],tty:vu,"node:tty":[">= 14.18 && < 15",">= 16"],url:bu,"node:url":[">= 14.18 && < 15",">= 16"],util:Cu,"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:wu,"node:v8":[">= 14.18 && < 15",">= 16"],vm:ju,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:Su,"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:_u,"node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:Eu,"node:zlib":[">= 14.18 && < 15",">= 16"]};var Nn,xo;function Ru(){if(xo)return Nn;xo=1;var e=Os();function n(o,d){for(var c=o.split("."),l=d.split(" "),i=l.length>1?l[0]:"=",h=(l.length>1?l[1]:l[0]).split("."),p=0;p<3;++p){var v=parseInt(c[p]||0,10),g=parseInt(h[p]||0,10);if(v!==g)return i==="<"?v<g:i===">="?v>=g:!1}return i===">="}function r(o,d){var c=d.split(/ ?&& ?/);if(c.length===0)return!1;for(var l=0;l<c.length;++l)if(!n(o,c[l]))return!1;return!0}function s(o,d){if(typeof d=="boolean")return d;var c=typeof o>"u"?ke.versions&&ke.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(d&&typeof d=="object"){for(var l=0;l<d.length;++l)if(r(c,d[l]))return!0;return!1}return r(c,d)}var a=ku;return Nn=function(d,c){return e(a,d)&&s(c,a[d])},Nn}var Ln,yo;function Tu(){if(yo)return Ln;yo=1;var e={},n=Wo();return Ln=n.homedir||function(){var s=e.HOME,a=e.LOGNAME||e.USER||e.LNAME||e.USERNAME;return ke.platform==="win32"?e.USERPROFILE||e.HOMEDRIVE+e.HOMEPATH||s||null:ke.platform==="darwin"?s||(a?"/Users/"+a:null):ke.platform==="linux"?s||(ke.getuid()===0?"/root":a?"/home/"+a:null):s||null},Ln}var Un,vo;function Pu(){return vo||(vo=1,Un=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(r,s){return s};var n=new Error().stack;return Error.prepareStackTrace=e,n[2].getFileName()}),Un}var ht={exports:{}},bo;function Iu(){if(bo)return ht.exports;bo=1;var e=ke.platform==="win32",n=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,r={};function s(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 l=s(c);if(!l||l.length!==5)throw new TypeError("Invalid path '"+c+"'");return{root:l[1],dir:l[0]===l[1]?l[0]:l[0].slice(0,-1),base:l[2],ext:l[4],name:l[3]}};var a=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,o={};function d(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 l=d(c);if(!l||l.length!==5)throw new TypeError("Invalid path '"+c+"'");return{root:l[1],dir:l[0].slice(0,-1),base:l[2],ext:l[4],name:l[3]}},e?ht.exports=r.parse:ht.exports=o.parse,ht.exports.posix=o.parse,ht.exports.win32=r.parse,ht.exports}var An,Co;function Bu(){if(Co)return An;Co=1;var e=vn(),n=e.parse||Iu(),r=function(a,o){var d="/";/^([A-Za-z]:)/.test(a)?d="":/^\\\\/.test(a)&&(d="\\\\");for(var c=[a],l=n(a);l.dir!==c[c.length-1];)c.push(l.dir),l=n(l.dir);return c.reduce(function(i,h){return i.concat(o.map(function(p){return e.resolve(d,h,p)}))},[])};return An=function(a,o,d){var c=o&&o.moduleDirectory?[].concat(o.moduleDirectory):["node_modules"];if(o&&typeof o.paths=="function")return o.paths(d,a,function(){return r(a,c)},o);var l=r(a,c);return o&&o.paths?l.concat(o.paths):l},An}var Mn,wo;function Du(){return wo||(wo=1,Mn=function(e,n){return n||{}}),Mn}var $n,jo;function Ou(){if(jo)return $n;jo=1;var e=Ru(),n=bn,r=vn(),s=Tu(),a=Pu(),o=Bu(),d=Du(),c=ke.platform!=="win32"&&n.realpathSync&&typeof n.realpathSync.native=="function"?n.realpathSync.native:n.realpathSync,l=s(),i=function(){return[r.join(l,".node_modules"),r.join(l,".node_libraries")]},h=function(D){try{var m=n.statSync(D,{throwIfNoEntry:!1})}catch(u){if(u&&(u.code==="ENOENT"||u.code==="ENOTDIR"))return!1;throw u}return!!m&&(m.isFile()||m.isFIFO())},p=function(D){try{var m=n.statSync(D,{throwIfNoEntry:!1})}catch(u){if(u&&(u.code==="ENOENT"||u.code==="ENOTDIR"))return!1;throw u}return!!m&&m.isDirectory()},v=function(D){try{return c(D)}catch(m){if(m.code!=="ENOENT")throw m}return D},g=function(D,m,u){return u&&u.preserveSymlinks===!1?D(m):m},R=function(D,m){var u=D(m);try{var b=JSON.parse(u);return b}catch{}},P=function(D,m,u){for(var b=o(m,u,D),E=0;E<b.length;E++)b[E]=r.join(b[E],D);return b};return $n=function(D,m){if(typeof D!="string")throw new TypeError("Path must be a string.");var u=d(D,m),b=u.isFile||h,E=u.readFileSync||n.readFileSync,S=u.isDirectory||p,C=u.realpathSync||v,X=u.readPackageSync||R;if(u.readFileSync&&u.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var Q=u.packageIterator,k=u.extensions||[".js"],q=u.includeCoreModules!==!1,$=u.basedir||r.dirname(a()),G=u.filename||$;u.paths=u.paths||i();var J=g(C,r.resolve($),u);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(D)){var ee=r.resolve(J,D);(D==="."||D===".."||D.slice(-1)==="/")&&(ee+="/");var ae=V(ee)||K(ee);if(ae)return g(C,ae,u)}else{if(q&&e(D))return D;var de=H(D,J);if(de)return g(C,de,u)}var me=new Error("Cannot find module '"+D+"' from '"+G+"'");throw me.code="MODULE_NOT_FOUND",me;function V(w){var y=xe(r.dirname(w));if(y&&y.dir&&y.pkg&&u.pathFilter){var F=r.relative(y.dir,w),re=u.pathFilter(y.pkg,w,F);re&&(w=r.resolve(y.dir,re))}if(b(w))return w;for(var ce=0;ce<k.length;ce++){var oe=w+k[ce];if(b(oe))return oe}}function xe(w){if(!(w===""||w==="/")&&!(ke.platform==="win32"&&/^\w:[/\\]*$/.test(w))&&!/[/\\]node_modules[/\\]*$/.test(w)){var y=r.join(g(C,w,u),"package.json");if(!b(y))return xe(r.dirname(w));var F=X(E,y);return F&&u.packageFilter&&(F=u.packageFilter(F,w)),{pkg:F,dir:w}}}function K(w){var y=r.join(g(C,w,u),"/package.json");if(b(y)){try{var F=X(E,y)}catch{}if(F&&u.packageFilter&&(F=u.packageFilter(F,w)),F&&F.main){if(typeof F.main!="string"){var re=new TypeError("package “"+F.name+"” `main` must be a string");throw re.code="INVALID_PACKAGE_MAIN",re}(F.main==="."||F.main==="./")&&(F.main="index");try{var ce=V(r.resolve(w,F.main));if(ce)return ce;var oe=K(r.resolve(w,F.main));if(oe)return oe}catch{}}}return V(r.join(w,"/index"))}function H(w,y){for(var F=function(){return P(w,y,u)},re=Q?Q(w,y,F,u):F(),ce=0;ce<re.length;ce++){var oe=re[ce];if(S(r.dirname(oe))){var he=V(oe);if(he)return he;var f=K(oe);if(f)return f}}}},$n}var Fn,So;function Nu(){return So||(So=1,Fn=Ou()),Fn}var qn,_o;function Lu(){if(_o)return qn;_o=1;var e={};qn=a,a.sync=o;var n=bn;function r(d,c){var l=c.pathExt!==void 0?c.pathExt:e.PATHEXT;if(!l||(l=l.split(";"),l.indexOf("")!==-1))return!0;for(var i=0;i<l.length;i++){var h=l[i].toLowerCase();if(h&&d.substr(-h.length).toLowerCase()===h)return!0}return!1}function s(d,c,l){return!d.isSymbolicLink()&&!d.isFile()?!1:r(c,l)}function a(d,c,l){n.stat(d,function(i,h){l(i,i?!1:s(h,d,c))})}function o(d,c){return s(n.statSync(d),d,c)}return qn}var zn,Eo;function Uu(){if(Eo)return zn;Eo=1,zn=n,n.sync=r;var e=bn;function n(o,d,c){e.stat(o,function(l,i){c(l,l?!1:s(i,d))})}function r(o,d){return s(e.statSync(o),d)}function s(o,d){return o.isFile()&&a(o,d)}function a(o,d){var c=o.mode,l=o.uid,i=o.gid,h=d.uid!==void 0?d.uid:ke.getuid&&ke.getuid(),p=d.gid!==void 0?d.gid:ke.getgid&&ke.getgid(),v=parseInt("100",8),g=parseInt("010",8),R=parseInt("001",8),P=v|g,T=c&R||c&g&&i===p||c&v&&l===h||c&P&&h===0;return T}return zn}var Wn,ko;function Au(){if(ko)return Wn;ko=1;var e;ke.platform==="win32"||Kt.TESTING_WINDOWS?e=Lu():e=Uu(),Wn=n,n.sync=r;function n(s,a,o){if(typeof a=="function"&&(o=a,a={}),!o){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(d,c){n(s,a||{},function(l,i){l?c(l):d(i)})})}e(s,a||{},function(d,c){d&&(d.code==="EACCES"||a&&a.ignoreErrors)&&(d=null,c=!1),o(d,c)})}function r(s,a){try{return e.sync(s,a||{})}catch(o){if(a&&a.ignoreErrors||o.code==="EACCES")return!1;throw o}}return Wn}var Gn,Ro;function Mu(){if(Ro)return Gn;Ro=1;var e={};const n=ke.platform==="win32"||e.OSTYPE==="cygwin"||e.OSTYPE==="msys",r=vn(),s=n?";":":",a=Au(),o=i=>Object.assign(new Error(`not found: ${i}`),{code:"ENOENT"}),d=(i,h)=>{const p=h.colon||s,v=i.match(/\//)||n&&i.match(/\\/)?[""]:[...n?[ke.cwd()]:[],...(h.path||e.PATH||"").split(p)],g=n?h.pathExt||e.PATHEXT||".EXE;.CMD;.BAT;.COM":"",R=n?g.split(p):[""];return n&&i.indexOf(".")!==-1&&R[0]!==""&&R.unshift(""),{pathEnv:v,pathExt:R,pathExtExe:g}},c=(i,h,p)=>{typeof h=="function"&&(p=h,h={}),h||(h={});const{pathEnv:v,pathExt:g,pathExtExe:R}=d(i,h),P=[],T=m=>new Promise((u,b)=>{if(m===v.length)return h.all&&P.length?u(P):b(o(i));const E=v[m],S=/^".*"$/.test(E)?E.slice(1,-1):E,C=r.join(S,i),X=!S&&/^\.[\\\/]/.test(i)?i.slice(0,2)+C:C;u(D(X,m,0))}),D=(m,u,b)=>new Promise((E,S)=>{if(b===g.length)return E(T(u+1));const C=g[b];a(m+C,{pathExt:R},(X,Q)=>{if(!X&&Q)if(h.all)P.push(m+C);else return E(m+C);return E(D(m,u,b+1))})});return p?T(0).then(m=>p(null,m),p):T(0)},l=(i,h)=>{h=h||{};const{pathEnv:p,pathExt:v,pathExtExe:g}=d(i,h),R=[];for(let P=0;P<p.length;P++){const T=p[P],D=/^".*"$/.test(T)?T.slice(1,-1):T,m=r.join(D,i),u=!D&&/^\.[\\\/]/.test(i)?i.slice(0,2)+m:m;for(let b=0;b<v.length;b++){const E=u+v[b];try{if(a.sync(E,{pathExt:g}))if(h.all)R.push(E);else return E}catch{}}}if(h.all&&R.length)return R;if(h.nothrow)return null;throw o(i)};return Gn=c,c.sync=l,Gn}var Hn,To;function $u(){if(To)return Hn;To=1;function e(n){if(!(typeof n>"u"))try{return structuredClone(n)}catch{return JSON.parse(JSON.stringify(n))}}return Hn=e,Hn}var Vn,Po;function Fu(){if(Po)return Vn;Po=1;var e={};const{BLOCKLET_MODES:n}=Ns(),r=zo(),s=xc().default,a=Ls(),o=Ms,{dirname:d,join:c,sep:l}=vn(),i=Nu(),{tmpdir:h,homedir:p}=Wo(),v=Mu(),{withHttps:g}=Us(),{exec:R}=bn,{promisify:P}=As(),T=$u(),D="z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o",m="z8iZjMn7Hcyh93rKf8PqcSM94XnS8nRqSrPoP",u=(w,y,F)=>s.encrypt(w,r.pbkdf2Sync(F,y,256,32,"sha512").toString("hex")),b=(w,y,F)=>s.decrypt(w,r.pbkdf2Sync(F,y,256,32,"sha512").toString("hex")),E=(w,y=!0)=>{let F=w;return Array.isArray(F)&&F.every(re=>re.originFileObj&&re.url)&&(F=F.map(re=>re.url),F.length===1&&([F]=F)),y&&F&&typeof F=="object"&&(F=JSON.stringify(F)),F&&typeof F=="string"&&(F=F.replace(/(\r\n|\n|\r)/gm," ")),F},S=w=>w.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),C=w=>S(Dr.from(w).toString("base64")),X=w=>(w+"===".slice((w.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"),Q=w=>new Uint8Array(Dr.from(X(w),"base64")),k="v21.6.0",q=()=>a.gte(ke.version,k),$=()=>{try{return i("@arcblock/pm2",{basedir:__dirname})}catch{return null}};function G(w){try{return v.sync(w)}catch{return null}}const J=new Map;async function ee({optionsKey:w,optionsValues:y}){const F=P(R),re=ke.version,ce=`${re}.${w}`;if(J.has(ce))return J.get(ce);try{const{stdout:oe}=await F("node -h"),he=y.find(f=>oe.includes(f));if(!he)throw new Error(`Can not get permission option: ${w} for this Node.js version: ${re}`);return J.set(ce,he),he}catch(oe){throw console.error(oe),oe}}const ae=async(w,y=!0)=>{const F=e.NODE_OPTIONS??"";if(F.includes("--experimental-permission")||F.includes("--permission")||F.includes("--allow-fs-read")||F.includes("--allow-fs-write")||F.includes("--allow-addons")||F.includes("--allow-child-process")||F.includes("--allow-worker"))throw console.error("getSecurityNodeOptions",{nodeOptions:F}),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(!w)throw new Error("blocklet is not defined");if(F.includes("ms-vscode.js-debug/src/bootloader.js")&&(w.mode===n.DEVELOPMENT||w.environmentObj.BLOCKLET_MODE===n.DEVELOPMENT))return F;const re=[F].filter(O=>!!O&&O!=="undefined");if(!q()||!y)return re.join(" ").trim();const ce=$(),oe=G("meilisearch"),he="/data/bin/meilisearch",f=G("blocklet"),x=[e.XDG_DATA_HOME?c(e.XDG_DATA_HOME,"pnpm/global/"):"",e.PNPM_HOME?c(e.PNPM_HOME,"global/"):""],j=await ee({optionsKey:"--permission",optionsValues:["--permission","--experimental-permission"]});if(re.push(j,...[w.environmentObj.BLOCKLET_DATA_DIR,w.environmentObj.BLOCKLET_APP_DIR,w.environmentObj.BLOCKLET_LOG_DIR,w.environmentObj.BLOCKLET_CACHE_DIR,w.environmentObj.BLOCKLET_APP_DATA_DIR?c(w.environmentObj.BLOCKLET_APP_DATA_DIR,".projects"):"",h()].filter(Boolean).map(O=>`--allow-fs-write=${c(O,"/*")}`),"--allow-addons","--allow-child-process"),w.mode===n.DEVELOPMENT||w.environmentObj.BLOCKLET_MODE===n.DEVELOPMENT)re.push("--allow-worker","--allow-fs-read=*"),re.push(`--allow-fs-write=${c(p(),".npm","_logs","/*")}`);else if(re.push(...[w.environmentObj.BLOCKLET_LOG_DIR,w.environmentObj.BLOCKLET_CACHE_DIR,w.environmentObj.BLOCKLET_APP_DATA_DIR,d(d(w.environmentObj.BLOCKLET_APP_DIR)),ce&&d(d(d(d(ce)))),f,oe,he,d(d(ke.execPath)),ke.cwd(),h(),c(p(),".cursor-server"),"/Applications/Cursor.app",...x].filter(Boolean).filter(O=>O!==l).map(O=>`--allow-fs-read=${c(O,"/*")}`)),[D,m].includes(w?.environmentObj?.BLOCKLET_COMPONENT_DID)){const O=await ee({optionsKey:"--allow-worker",optionsValues:["--allow-worker","--experimental-worker"]});re.push(O)}return o(re).join(" ").trim()},de={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 me(w,y,F){const re=T(w[y]||[]);return re.push(...F),[...new Set(re)]}async function V(w,{node:y,blocklet:F,trustedDomains:re=[],info:ce}){if(!w?.contentSecurityPolicy?.directives)return w;const oe=T(w);oe.contentSecurityPolicy.directives["default-src"]=me(oe.contentSecurityPolicy.directives,"default-src",["'self'"]);const he=ce||await y.getNodeInfo({useCache:!0});let f=await y.getBlockletDomainAliases({blocklet:F,nodeInfo:he});return f=(f||[]).map(x=>x.value),oe.contentSecurityPolicy.directives["connect-src"]=me(oe.contentSecurityPolicy.directives,"connect-src",["'self'",...f.filter(x=>x).map(x=>`https://${x}/.well-known/ping`),"https://api.simplesvg.com","https://api.iconify.design","https://api.unisvg.com"]),oe.contentSecurityPolicy.directives["script-src"]=me(oe.contentSecurityPolicy.directives,"script-src",["'self'","https://js.stripe.com"]),oe.contentSecurityPolicy.directives["frame-src"]=me(oe.contentSecurityPolicy.directives,"frame-src",["'self'","https://js.stripe.com",...re.filter(Boolean).map(x=>`https://${x}`)]),oe.contentSecurityPolicy.directives["frame-ancestors"]=me(oe.contentSecurityPolicy.directives,"frame-ancestors",["'self'",...(F.settings.userSpaceHosts||[]).map(x=>`https://${x}`),...re.filter(Boolean).map(x=>`https://${x}`)]),oe}async function xe(w,{node:y,blocklet:F,info:re}){const ce=T(w);if(ce?.origin?.smart){const oe=[];oe.push(...ce.origin?.value||[]);const he=re||await y.getNodeInfo({useCache:!0});let f=await y.getBlockletDomainAliases({blocklet:F,nodeInfo:he});f=(f||[]).map(I=>I.value),oe.push(...f.map(I=>g(I)));const j=((F.settings.federated||{})?.sites||[]).filter(I=>I?.isMaster!==!1||I.status==="approved"),O=[];for(const I of j)O.push(new URL(I.appUrl).hostname),O.push(...I.aliasDomain||[]);oe.push(...O.map(I=>g(I))),ce.origin.value=[...new Set(oe)]}return ce}function K(w){const y=T(w);for(const F of Object.keys(y))y[F]=y[F]?.value??y[F];return y}function H(w){const y=T(w);for(const F of Object.keys(y))y[F]=y[F]?.override??!1;return y}return Vn={encrypt:u,decrypt:b,formatEnv:E,encodeEncryptionKey:C,decodeEncryptionKey:Q,canUseFileSystemIsolateApi:q,getSecurityNodeOptions:ae,patchResponseHeader:V,patchCors:xe,cleanConfigOverride:K,keepConfigOverride:H,DEFAULT_HELMET_CONFIG:de,SAFE_NODE_VERSION:k},Vn}var Ti=Fu();const Kn=(e,n)=>e&&Ti.encrypt(e,n||ue.AIGNE_CONFIG_ENCRYPT_SALT,""),Yn=(e,n)=>e&&Ti.decrypt(e,n||ue.AIGNE_CONFIG_ENCRYPT_SALT,""),Rt=e=>e==="aigneHub",cn=e=>e==="bedrock",qu=e=>{const n=["provider","model"];if(Go(e))return[...n,"key"];const{provider:r}=e;let s=n;return Rt(r)?s=[...n,"key","url"]:cn(r)?s=[...n,"accessKeyId","secretAccessKey"]:s=[...n,"key"],s.filter(a=>!e[a])},zu=e=>[{provider:"aigneHub",name:"AIGNE Hub",baseURL:"https://hub.aigne.io",logo:e?.imgPrefix?Ae(e.imgPrefix,"/aigne-hub.jpg"):"/aigne-hub.jpg",documentation:"https://hub.aigne.io/docs",models:[]}],pn="z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ",Wu=async e=>{const n=new URL(e);if(typeof window<"u"&&n.origin===window.location.origin)return Pi();const r=Ae(n.origin,"__blocklet__.js?type=json"),s=await un.get(r).then(d=>d.data);if((s?.componentId||"").split("/").pop()===pn)return Ae(n.origin,s.prefix||"/");const o=(s?.componentMountPoints||[]).find(d=>d?.did===pn);return o?Ae(n.origin,o.mountPoint):e},Pi=()=>{var e,n,r,s;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()===pn)return Ae(o,a);const c=(((s=window.blocklet)===null||s===void 0?void 0:s.componentMountPoints)||[]).find(l=>l?.did===pn);return c?Ae(o,c.mountPoint):Ae(o,a)};async function Gu({baseUrl:e="",accessKey:n=""}){let r=Pi();const s=typeof window<"u";try{if(e){const a=new URL(e);(!s||s&&a.origin!==window.location.origin)&&(r=await Wu(e))}}catch(a){throw console.warn("Failed to parse baseUrl:",a),new Error(`Failed to parse baseUrl: ${Pe(a)}`)}if(!r||!n)throw new Error("baseUrl or accessKey is not set");return un.get(Ae(r,"/api/user/info"),{headers:{Authorization:`Bearer ${n}`}}).then(a=>a.data)}const wn=we.div`
|
|
324
|
+
min-height: ${({minHeight:e})=>e==="none"?"auto":`${e||160}px`};
|
|
325
|
+
height: ${({height:e,minHeight:n})=>e==="none"?"auto":`${e||n||160}px`};
|
|
326
|
+
padding: ${({theme:e})=>e.spacing(2)};
|
|
327
|
+
border-radius: ${({theme:e})=>e.shape.borderRadius}px;
|
|
328
|
+
border: 1px solid;
|
|
329
|
+
border-color: ${({theme:e})=>e.palette.divider};
|
|
330
|
+
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
331
|
+
box-shadow: ${({theme:e})=>e.shadows[1]};
|
|
332
|
+
`,Hu={loading:_.bool,authLoading:_.bool,disconnectLoading:_.bool,connecting:_.bool},ar=we(gn)`
|
|
333
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
334
|
+
font-weight: 500;
|
|
335
|
+
border-color: ${({theme:e})=>e.palette.grey[300]};
|
|
336
|
+
line-height: 1.5;
|
|
337
|
+
&:hover {
|
|
338
|
+
background-color: ${({theme:e})=>$s(e.palette.primary.main,.1)};
|
|
339
|
+
}
|
|
340
|
+
`;function Ii({loading:e=!1,user:n=null,switchUser:r=Pt,connecting:s=!1,url:a=""}){const{t:o}=U.useContext(Me);return!n&&!e?null:t.jsx(wn,{children:e?t.jsxs(Y,{sx:{display:"flex",justifyContent:"center",alignItems:"flex-start",gap:2,height:"100%"},children:[t.jsx(et,{variant:"circular",width:48,height:48}),t.jsxs(Y,{sx:{display:"flex",flexDirection:"column",gap:1,width:"100%"},children:[t.jsx(et,{variant:"rounded",sx:{width:"80%",height:20}}),t.jsx(et,{variant:"rounded",sx:{width:"40%",height:20}}),t.jsx(et,{variant:"rounded",sx:{width:"30%",height:20}}),t.jsx(et,{variant:"rounded",sx:{width:"60%",height:20}})]})]}):t.jsxs(Y,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%"},children:[t.jsx(Fs,{size:"large",showDid:!0,showHoverCard:!0,user:n,avatarProps:{size:48},infoType:Or.Minimal,popupInfoType:Or.Basic,sx:{border:"none",p:0},onAvatarClick:()=>{a&&window.open(dn(Ae(a,ue.WELLKNOWN_BLOCKLET_USER_PATH),{did:n.did}),"_blank")}}),t.jsx(Y,{children:t.jsx(ar,{variant:"outlined",disabled:s,startIcon:s?t.jsx(Le,{size:16,sx:{mr:1}}):t.jsx(Ee,{style:{fontSize:16},icon:"tabler:switch-horizontal"}),onClick:r,children:o("setting.aigne.switchUser")})})]})})}Ii.propTypes={loading:_.bool,user:_.object,switchUser:_.func,url:_.string,...Hu};var Vu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Nr<"u"?Nr:typeof self<"u"?self:{};function Ku(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}/*!
|
|
341
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
342
|
+
*
|
|
343
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
344
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
345
|
+
* in the Software without restriction, including without limitation the rights
|
|
346
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
347
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
348
|
+
* furnished to do so, subject to the following conditions:
|
|
349
|
+
*
|
|
350
|
+
* The above copyright notice and this permission notice shall be included in
|
|
351
|
+
* all copies or substantial portions of the Software.
|
|
352
|
+
*
|
|
353
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
354
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
355
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
356
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
357
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
358
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
359
|
+
* SOFTWARE.
|
|
360
|
+
*/var Zn,Io;function Yu(){return Io||(Io=1,Zn={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){let n=e%10;return~~(e%100/10)===1?"th":n===1?"st":n===2?"nd":n===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),Zn}/*!
|
|
361
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
362
|
+
*
|
|
363
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
364
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
365
|
+
* in the Software without restriction, including without limitation the rights
|
|
366
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
367
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
368
|
+
* furnished to do so, subject to the following conditions:
|
|
369
|
+
*
|
|
370
|
+
* The above copyright notice and this permission notice shall be included in
|
|
371
|
+
* all copies or substantial portions of the Software.
|
|
372
|
+
*
|
|
373
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
374
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
375
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
376
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
377
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
378
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
379
|
+
* SOFTWARE.
|
|
380
|
+
*/var Xn,Bo;function Bi(){if(Bo)return Xn;Bo=1;const e=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function n(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function r(l,i,h,p,v,g,R){if(!isNaN(+l))return+l;let P="",T=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(T!==l)return-1*r(T,i,h,p,v,g);for(let S=0;S<e.length;S++){let C=e[S];if(P=l.replace(RegExp(`([0-9 ])(${C.key})$`),"$1"),P!==l)return r(P,i,h,p,v,g)*C.factor}if(P=l.replace("%",""),P!==l)return r(P,i,h,p,v,g)/100;let D=parseFloat(l);if(isNaN(D))return;let m=p(D);if(m&&m!=="."&&(P=l.replace(new RegExp(`${n(m)}$`),""),P!==l))return r(P,i,h,p,v,g);let u={};Object.keys(g).forEach(S=>{u[g[S]]=S});let b=Object.keys(u).sort().reverse(),E=b.length;for(let S=0;S<E;S++){let C=b[S],X=u[C];if(P=l.replace(C,""),P!==l){let Q;switch(X){case"thousand":Q=Math.pow(10,3);break;case"million":Q=Math.pow(10,6);break;case"billion":Q=Math.pow(10,9);break;case"trillion":Q=Math.pow(10,12);break}return r(P,i,h,p,v,g)*Q}}}function s(l,i,h){let p=l.replace(h,"");return p=p.replace(new RegExp(`([0-9])${n(i.thousands)}([0-9])`,"g"),"$1$2"),p=p.replace(i.decimal,"."),p}function a(l,i,h="",p,v,g,R){if(l==="")return;if(l===v)return 0;let P=s(l,i,h);return r(P,i,h,p,v,g)}function o(l,i){if(!(l.indexOf(":")&&i.thousands!==":"))return!1;let p=l.split(":");if(p.length!==3)return!1;let v=+p[0],g=+p[1],R=+p[2];return!isNaN(v)&&!isNaN(g)&&!isNaN(R)}function d(l){let i=l.split(":"),h=+i[0],p=+i[1];return+i[2]+60*p+3600*h}function c(l,i){const h=jr();let p=h.currentDelimiters(),v=h.currentCurrency().symbol,g=h.currentOrdinal(),R=h.getZeroFormat(),P=h.currentAbbreviations(),T;if(typeof l=="string")o(l,p)?T=d(l):T=a(l,p,v,g,R,P);else if(typeof l=="number")T=l;else return;if(T!==void 0)return T}return Xn={unformat:c},Xn}/*!
|
|
381
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
382
|
+
*
|
|
383
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
384
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
385
|
+
* in the Software without restriction, including without limitation the rights
|
|
386
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
387
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
388
|
+
* furnished to do so, subject to the following conditions:
|
|
389
|
+
*
|
|
390
|
+
* The above copyright notice and this permission notice shall be included in
|
|
391
|
+
* all copies or substantial portions of the Software.
|
|
392
|
+
*
|
|
393
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
394
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
395
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
396
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
397
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
398
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
399
|
+
* SOFTWARE.
|
|
400
|
+
*/var Qn,Do;function Cr(){if(Do)return Qn;Do=1;let e=Bi();const n=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,r=["currency","percent","byte","time","ordinal","number"],s=["trillion","billion","million","thousand"],a=["prefix","infix","postfix"],o=["sign","parenthesis"],d={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},i={output:{type:"string",validValues:r},base:{type:"string",validValues:["decimal","binary","general"],restriction:(T,D)=>D.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:T=>T.output==="byte"},characteristic:{type:"number",restriction:T=>T>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:s},average:"boolean",lowPrecision:{type:"boolean",restriction:(T,D)=>D.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:a},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:T=>T>=0,message:"value must be positive"},{restriction:(T,D)=>!D.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:T=>T>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:o},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(T,D)=>D.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},h={languageTag:{type:"string",mandatory:!0,restriction:T=>T.match(n),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:d,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function p(T,D){let m=v(T),u=R(D);return m&&u}function v(T){return e.unformat(T)!==void 0}function g(T,D,m,u=!1){let b=Object.keys(T).map(E=>{if(!D[E])return console.error(`${m} Invalid key: ${E}`),!1;let S=T[E],C=D[E];if(typeof C=="string"&&(C={type:C}),C.type==="format"){if(!g(S,i,`[Validate ${E}]`,!0))return!1}else if(typeof S!==C.type)return console.error(`${m} ${E} type mismatched: "${C.type}" expected, "${typeof S}" provided`),!1;if(C.restrictions&&C.restrictions.length){let X=C.restrictions.length;for(let Q=0;Q<X;Q++){let{restriction:k,message:q}=C.restrictions[Q];if(!k(S,T))return console.error(`${m} ${E} invalid value: ${q}`),!1}}return C.restriction&&!C.restriction(S,T)?(console.error(`${m} ${E} invalid value: ${C.message}`),!1):C.validValues&&C.validValues.indexOf(S)===-1?(console.error(`${m} ${E} invalid value: must be among ${JSON.stringify(C.validValues)}, "${S}" provided`),!1):!(C.children&&!g(S,C.children,`[Validate ${E}]`))});return u||b.push(...Object.keys(D).map(E=>{let S=D[E];if(typeof S=="string"&&(S={type:S}),S.mandatory){let C=S.mandatory;if(typeof C=="function"&&(C=C(T)),C&&T[E]===void 0)return console.error(`${m} Missing mandatory key "${E}"`),!1}return!0})),b.reduce((E,S)=>E&&S,!0)}function R(T){return g(T,i,"[Validate format]")}function P(T){return g(T,h,"[Validate language]")}return Qn={validate:p,validateFormat:R,validateInput:v,validateLanguage:P},Qn}/*!
|
|
401
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
402
|
+
*
|
|
403
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
404
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
405
|
+
* in the Software without restriction, including without limitation the rights
|
|
406
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
407
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
408
|
+
* furnished to do so, subject to the following conditions:
|
|
409
|
+
*
|
|
410
|
+
* The above copyright notice and this permission notice shall be included in
|
|
411
|
+
* all copies or substantial portions of the Software.
|
|
412
|
+
*
|
|
413
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
414
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
415
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
416
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
417
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
418
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
419
|
+
* SOFTWARE.
|
|
420
|
+
*/function Zu(e,n){let r=e.match(/^{([^}]*)}/);return r?(n.prefix=r[1],e.slice(r[0].length)):e}function Xu(e,n){let r=e.match(/{([^}]*)}$/);return r?(n.postfix=r[1],e.slice(0,-r[0].length)):e}function Qu(e,n){if(e.indexOf("$")!==-1){n.output="currency";return}if(e.indexOf("%")!==-1){n.output="percent";return}if(e.indexOf("bd")!==-1){n.output="byte",n.base="general";return}if(e.indexOf("b")!==-1){n.output="byte",n.base="binary";return}if(e.indexOf("d")!==-1){n.output="byte",n.base="decimal";return}if(e.indexOf(":")!==-1){n.output="time";return}e.indexOf("o")!==-1&&(n.output="ordinal")}function Ju(e,n){e.indexOf(",")!==-1&&(n.thousandSeparated=!0)}function ed(e,n){e.indexOf(" ")!==-1&&(n.spaceSeparated=!0,n.spaceSeparatedCurrency=!0,(n.average||n.forceAverage)&&(n.spaceSeparatedAbbreviation=!0))}function td(e,n){let r=e.match(/[1-9]+[0-9]*/);r&&(n.totalLength=+r[0])}function nd(e,n){let s=e.split(".")[0].match(/0+/);s&&(n.characteristic=s[0].length)}function rd(e,n){let r=e.split(".")[1];if(r){let s=r.match(/0+/);s&&(n.mantissa=s[0].length)}}function od(e,n){const r=e.split(".")[1];r&&(n.trimMantissa=r.indexOf("[")!==-1)}function id(e,n){e.indexOf("a")!==-1&&(n.average=!0)}function sd(e,n){e.indexOf("K")!==-1?n.forceAverage="thousand":e.indexOf("M")!==-1?n.forceAverage="million":e.indexOf("B")!==-1?n.forceAverage="billion":e.indexOf("T")!==-1&&(n.forceAverage="trillion")}function ad(e,n){e.match(/\[\.]/)?n.optionalMantissa=!0:e.match(/\./)&&(n.optionalMantissa=!1)}function ld(e,n){if(e.indexOf(".")!==-1){let r=e.split(".")[0];n.optionalCharacteristic=r.indexOf("0")===-1}}function cd(e,n){e.match(/^\+?\([^)]*\)$/)&&(n.negative="parenthesis"),e.match(/^\+?-/)&&(n.negative="sign")}function ud(e,n){e.match(/^\+/)&&(n.forceSign=!0)}function dd(e,n={}){return typeof e!="string"?e:(e=Zu(e,n),e=Xu(e,n),Qu(e,n),td(e,n),nd(e,n),ld(e,n),id(e,n),sd(e,n),rd(e,n),ad(e,n),od(e,n),Ju(e,n),ed(e,n),cd(e,n),ud(e,n),n)}var wr={parseFormat:dd};/*!
|
|
421
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
422
|
+
*
|
|
423
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
424
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
425
|
+
* in the Software without restriction, including without limitation the rights
|
|
426
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
427
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
428
|
+
* furnished to do so, subject to the following conditions:
|
|
429
|
+
*
|
|
430
|
+
* The above copyright notice and this permission notice shall be included in
|
|
431
|
+
* all copies or substantial portions of the Software.
|
|
432
|
+
*
|
|
433
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
434
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
435
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
436
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
437
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
438
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
439
|
+
* SOFTWARE.
|
|
440
|
+
*/var Jn,Oo;function jr(){if(Oo)return Jn;Oo=1;const e=Yu(),n=Cr(),r=wr;let s={},a,o={},d=null,c={};function l(h){a=h}function i(){return o[a]}return s.languages=()=>Object.assign({},o),s.currentLanguage=()=>a,s.currentBytes=()=>i().bytes||{},s.currentCurrency=()=>i().currency,s.currentAbbreviations=()=>i().abbreviations,s.currentDelimiters=()=>i().delimiters,s.currentOrdinal=()=>i().ordinal,s.currentDefaults=()=>Object.assign({},i().defaults,c),s.currentOrdinalDefaultFormat=()=>Object.assign({},s.currentDefaults(),i().ordinalFormat),s.currentByteDefaultFormat=()=>Object.assign({},s.currentDefaults(),i().byteFormat),s.currentPercentageDefaultFormat=()=>Object.assign({},s.currentDefaults(),i().percentageFormat),s.currentCurrencyDefaultFormat=()=>Object.assign({},s.currentDefaults(),i().currencyFormat),s.currentTimeDefaultFormat=()=>Object.assign({},s.currentDefaults(),i().timeFormat),s.setDefaults=h=>{h=r.parseFormat(h),n.validateFormat(h)&&(c=h)},s.getZeroFormat=()=>d,s.setZeroFormat=h=>d=typeof h=="string"?h:null,s.hasZeroFormat=()=>d!==null,s.languageData=h=>{if(h){if(o[h])return o[h];throw new Error(`Unknown tag "${h}"`)}return i()},s.registerLanguage=(h,p=!1)=>{if(!n.validateLanguage(h))throw new Error("Invalid language data");o[h.languageTag]=h,p&&l(h.languageTag)},s.setLanguage=(h,p=e.languageTag)=>{if(!o[h]){let v=h.split("-")[0],g=Object.keys(o).find(R=>R.split("-")[0]===v);if(!o[g]){l(p);return}l(g);return}l(h)},s.registerLanguage(e),a=e.languageTag,Jn=s,Jn}function fd(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}/*!
|
|
441
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
442
|
+
*
|
|
443
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
444
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
445
|
+
* in the Software without restriction, including without limitation the rights
|
|
446
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
447
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
448
|
+
* furnished to do so, subject to the following conditions:
|
|
449
|
+
*
|
|
450
|
+
* The above copyright notice and this permission notice shall be included in
|
|
451
|
+
* all copies or substantial portions of the Software.
|
|
452
|
+
*
|
|
453
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
454
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
455
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
456
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
457
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
458
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
459
|
+
* SOFTWARE.
|
|
460
|
+
*/function pd(e,n){e.forEach(r=>{let s;try{s=fd(`../languages/${r}`)}catch{console.error(`Unable to load "${r}". No matching language file found.`)}s&&n.registerLanguage(s)})}var md=e=>({loadLanguagesInNode:n=>pd(n,e)}),Di={exports:{}};(function(e){(function(n){var r,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,o=Math.floor,d="[BigNumber Error] ",c=d+"Number primitive has more than 15 significant digits: ",l=1e14,i=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],v=1e7,g=1e9;function R(S){var C,X,Q,k=y.prototype={constructor:y,toString:null,valueOf:null},q=new y(1),$=20,G=4,J=-7,ee=21,ae=-1e7,de=1e7,me=!1,V=1,xe=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function y(f,x){var j,O,I,L,W,B,N,M,A=this;if(!(A instanceof y))return new y(f,x);if(x==null){if(f&&f._isBigNumber===!0){A.s=f.s,!f.c||f.e>de?A.c=A.e=null:f.e<ae?A.c=[A.e=0]:(A.e=f.e,A.c=f.c.slice());return}if((B=typeof f=="number")&&f*0==0){if(A.s=1/f<0?(f=-f,-1):1,f===~~f){for(L=0,W=f;W>=10;W/=10,L++);L>de?A.c=A.e=null:(A.e=L,A.c=[f]);return}M=String(f)}else{if(!s.test(M=String(f)))return Q(A,M,B);A.s=M.charCodeAt(0)==45?(M=M.slice(1),-1):1}(L=M.indexOf("."))>-1&&(M=M.replace(".","")),(W=M.search(/e/i))>0?(L<0&&(L=W),L+=+M.slice(W+1),M=M.substring(0,W)):L<0&&(L=M.length)}else{if(m(x,2,H.length,"Base"),x==10&&w)return A=new y(f),oe(A,$+A.e+1,G);if(M=String(f),B=typeof f=="number"){if(f*0!=0)return Q(A,M,B,x);if(A.s=1/f<0?(M=M.slice(1),-1):1,y.DEBUG&&M.replace(/^0\.0*|\./,"").length>15)throw Error(c+f)}else A.s=M.charCodeAt(0)===45?(M=M.slice(1),-1):1;for(j=H.slice(0,x),L=W=0,N=M.length;W<N;W++)if(j.indexOf(O=M.charAt(W))<0){if(O=="."){if(W>L){L=N;continue}}else if(!I&&(M==M.toUpperCase()&&(M=M.toLowerCase())||M==M.toLowerCase()&&(M=M.toUpperCase()))){I=!0,W=-1,L=0;continue}return Q(A,String(f),B,x)}B=!1,M=X(M,x,10,A.s),(L=M.indexOf("."))>-1?M=M.replace(".",""):L=M.length}for(W=0;M.charCodeAt(W)===48;W++);for(N=M.length;M.charCodeAt(--N)===48;);if(M=M.slice(W,++N)){if(N-=W,B&&y.DEBUG&&N>15&&(f>h||f!==o(f)))throw Error(c+A.s*f);if((L=L-W-1)>de)A.c=A.e=null;else if(L<ae)A.c=[A.e=0];else{if(A.e=L,A.c=[],W=(L+1)%i,L<0&&(W+=i),W<N){for(W&&A.c.push(+M.slice(0,W)),N-=i;W<N;)A.c.push(+M.slice(W,W+=i));W=i-(M=M.slice(W)).length}else W-=N;for(;W--;M+="0");A.c.push(+M)}}else A.c=[A.e=0]}y.clone=R,y.ROUND_UP=0,y.ROUND_DOWN=1,y.ROUND_CEIL=2,y.ROUND_FLOOR=3,y.ROUND_HALF_UP=4,y.ROUND_HALF_DOWN=5,y.ROUND_HALF_EVEN=6,y.ROUND_HALF_CEIL=7,y.ROUND_HALF_FLOOR=8,y.EUCLID=9,y.config=y.set=function(f){var x,j;if(f!=null)if(typeof f=="object"){if(f.hasOwnProperty(x="DECIMAL_PLACES")&&(j=f[x],m(j,0,g,x),$=j),f.hasOwnProperty(x="ROUNDING_MODE")&&(j=f[x],m(j,0,8,x),G=j),f.hasOwnProperty(x="EXPONENTIAL_AT")&&(j=f[x],j&&j.pop?(m(j[0],-g,0,x),m(j[1],0,g,x),J=j[0],ee=j[1]):(m(j,-g,g,x),J=-(ee=j<0?-j:j))),f.hasOwnProperty(x="RANGE"))if(j=f[x],j&&j.pop)m(j[0],-g,-1,x),m(j[1],1,g,x),ae=j[0],de=j[1];else if(m(j,-g,g,x),j)ae=-(de=j<0?-j:j);else throw Error(d+x+" cannot be zero: "+j);if(f.hasOwnProperty(x="CRYPTO"))if(j=f[x],j===!!j)if(j)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))me=j;else throw me=!j,Error(d+"crypto unavailable");else me=j;else throw Error(d+x+" not true or false: "+j);if(f.hasOwnProperty(x="MODULO_MODE")&&(j=f[x],m(j,0,9,x),V=j),f.hasOwnProperty(x="POW_PRECISION")&&(j=f[x],m(j,0,g,x),xe=j),f.hasOwnProperty(x="FORMAT"))if(j=f[x],typeof j=="object")K=j;else throw Error(d+x+" not an object: "+j);if(f.hasOwnProperty(x="ALPHABET"))if(j=f[x],typeof j=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(j))w=j.slice(0,10)=="0123456789",H=j;else throw Error(d+x+" invalid: "+j)}else throw Error(d+"Object expected: "+f);return{DECIMAL_PLACES:$,ROUNDING_MODE:G,EXPONENTIAL_AT:[J,ee],RANGE:[ae,de],CRYPTO:me,MODULO_MODE:V,POW_PRECISION:xe,FORMAT:K,ALPHABET:H}},y.isBigNumber=function(f){if(!f||f._isBigNumber!==!0)return!1;if(!y.DEBUG)return!0;var x,j,O=f.c,I=f.e,L=f.s;e:if({}.toString.call(O)=="[object Array]"){if((L===1||L===-1)&&I>=-g&&I<=g&&I===o(I)){if(O[0]===0){if(I===0&&O.length===1)return!0;break e}if(x=(I+1)%i,x<1&&(x+=i),String(O[0]).length==x){for(x=0;x<O.length;x++)if(j=O[x],j<0||j>=l||j!==o(j))break e;if(j!==0)return!0}}}else if(O===null&&I===null&&(L===null||L===1||L===-1))return!0;throw Error(d+"Invalid BigNumber: "+f)},y.maximum=y.max=function(){return re(arguments,-1)},y.minimum=y.min=function(){return re(arguments,1)},y.random=function(){var f=9007199254740992,x=Math.random()*f&2097151?function(){return o(Math.random()*f)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(j){var O,I,L,W,B,N=0,M=[],A=new y(q);if(j==null?j=$:m(j,0,g),W=a(j/i),me)if(crypto.getRandomValues){for(O=crypto.getRandomValues(new Uint32Array(W*=2));N<W;)B=O[N]*131072+(O[N+1]>>>11),B>=9e15?(I=crypto.getRandomValues(new Uint32Array(2)),O[N]=I[0],O[N+1]=I[1]):(M.push(B%1e14),N+=2);N=W/2}else if(crypto.randomBytes){for(O=crypto.randomBytes(W*=7);N<W;)B=(O[N]&31)*281474976710656+O[N+1]*1099511627776+O[N+2]*4294967296+O[N+3]*16777216+(O[N+4]<<16)+(O[N+5]<<8)+O[N+6],B>=9e15?crypto.randomBytes(7).copy(O,N):(M.push(B%1e14),N+=7);N=W/7}else throw me=!1,Error(d+"crypto unavailable");if(!me)for(;N<W;)B=x(),B<9e15&&(M[N++]=B%1e14);for(W=M[--N],j%=i,W&&j&&(B=p[i-j],M[N]=o(W/B)*B);M[N]===0;M.pop(),N--);if(N<0)M=[L=0];else{for(L=-1;M[0]===0;M.splice(0,1),L-=i);for(N=1,B=M[0];B>=10;B/=10,N++);N<i&&(L-=i-N)}return A.e=L,A.c=M,A}}(),y.sum=function(){for(var f=1,x=arguments,j=new y(x[0]);f<x.length;)j=j.plus(x[f++]);return j},X=function(){var f="0123456789";function x(j,O,I,L){for(var W,B=[0],N,M=0,A=j.length;M<A;){for(N=B.length;N--;B[N]*=O);for(B[0]+=L.indexOf(j.charAt(M++)),W=0;W<B.length;W++)B[W]>I-1&&(B[W+1]==null&&(B[W+1]=0),B[W+1]+=B[W]/I|0,B[W]%=I)}return B.reverse()}return function(j,O,I,L,W){var B,N,M,A,Z,ie,z,te,se=j.indexOf("."),ye=$,ve=G;for(se>=0&&(A=xe,xe=0,j=j.replace(".",""),te=new y(O),ie=te.pow(j.length-se),xe=A,te.c=x(E(T(ie.c),ie.e,"0"),10,I,f),te.e=te.c.length),z=x(j,O,I,W?(B=H,f):(B=f,H)),M=A=z.length;z[--A]==0;z.pop());if(!z[0])return B.charAt(0);if(se<0?--M:(ie.c=z,ie.e=M,ie.s=L,ie=C(ie,te,ye,ve,I),z=ie.c,Z=ie.r,M=ie.e),N=M+ye+1,se=z[N],A=I/2,Z=Z||N<0||z[N+1]!=null,Z=ve<4?(se!=null||Z)&&(ve==0||ve==(ie.s<0?3:2)):se>A||se==A&&(ve==4||Z||ve==6&&z[N-1]&1||ve==(ie.s<0?8:7)),N<1||!z[0])j=Z?E(B.charAt(1),-ye,B.charAt(0)):B.charAt(0);else{if(z.length=N,Z)for(--I;++z[--N]>I;)z[N]=0,N||(++M,z=[1].concat(z));for(A=z.length;!z[--A];);for(se=0,j="";se<=A;j+=B.charAt(z[se++]));j=E(j,M,B.charAt(0))}return j}}(),C=function(){function f(O,I,L){var W,B,N,M,A=0,Z=O.length,ie=I%v,z=I/v|0;for(O=O.slice();Z--;)N=O[Z]%v,M=O[Z]/v|0,W=z*N+M*ie,B=ie*N+W%v*v+A,A=(B/L|0)+(W/v|0)+z*M,O[Z]=B%L;return A&&(O=[A].concat(O)),O}function x(O,I,L,W){var B,N;if(L!=W)N=L>W?1:-1;else for(B=N=0;B<L;B++)if(O[B]!=I[B]){N=O[B]>I[B]?1:-1;break}return N}function j(O,I,L,W){for(var B=0;L--;)O[L]-=B,B=O[L]<I[L]?1:0,O[L]=B*W+O[L]-I[L];for(;!O[0]&&O.length>1;O.splice(0,1));}return function(O,I,L,W,B){var N,M,A,Z,ie,z,te,se,ye,ve,Ce,Te,rt,Ct,Ue,Fe,ne,le=O.s==I.s?1:-1,ge=O.c,pe=I.c;if(!ge||!ge[0]||!pe||!pe[0])return new y(!O.s||!I.s||(ge?pe&&ge[0]==pe[0]:!pe)?NaN:ge&&ge[0]==0||!pe?le*0:le/0);for(se=new y(le),ye=se.c=[],M=O.e-I.e,le=L+M+1,B||(B=l,M=P(O.e/i)-P(I.e/i),le=le/i|0),A=0;pe[A]==(ge[A]||0);A++);if(pe[A]>(ge[A]||0)&&M--,le<0)ye.push(1),Z=!0;else{for(Ct=ge.length,Fe=pe.length,A=0,le+=2,ie=o(B/(pe[0]+1)),ie>1&&(pe=f(pe,ie,B),ge=f(ge,ie,B),Fe=pe.length,Ct=ge.length),rt=Fe,ve=ge.slice(0,Fe),Ce=ve.length;Ce<Fe;ve[Ce++]=0);ne=pe.slice(),ne=[0].concat(ne),Ue=pe[0],pe[1]>=B/2&&Ue++;do{if(ie=0,N=x(pe,ve,Fe,Ce),N<0){if(Te=ve[0],Fe!=Ce&&(Te=Te*B+(ve[1]||0)),ie=o(Te/Ue),ie>1)for(ie>=B&&(ie=B-1),z=f(pe,ie,B),te=z.length,Ce=ve.length;x(z,ve,te,Ce)==1;)ie--,j(z,Fe<te?ne:pe,te,B),te=z.length,N=1;else ie==0&&(N=ie=1),z=pe.slice(),te=z.length;if(te<Ce&&(z=[0].concat(z)),j(ve,z,Ce,B),Ce=ve.length,N==-1)for(;x(pe,ve,Fe,Ce)<1;)ie++,j(ve,Fe<Ce?ne:pe,Ce,B),Ce=ve.length}else N===0&&(ie++,ve=[0]);ye[A++]=ie,ve[0]?ve[Ce++]=ge[rt]||0:(ve=[ge[rt]],Ce=1)}while((rt++<Ct||ve[0]!=null)&&le--);Z=ve[0]!=null,ye[0]||ye.splice(0,1)}if(B==l){for(A=1,le=ye[0];le>=10;le/=10,A++);oe(se,L+(se.e=A+M*i-1)+1,W,Z)}else se.e=M,se.r=+Z;return se}}();function F(f,x,j,O){var I,L,W,B,N;if(j==null?j=G:m(j,0,8),!f.c)return f.toString();if(I=f.c[0],W=f.e,x==null)N=T(f.c),N=O==1||O==2&&(W<=J||W>=ee)?b(N,W):E(N,W,"0");else if(f=oe(new y(f),x,j),L=f.e,N=T(f.c),B=N.length,O==1||O==2&&(x<=L||L<=J)){for(;B<x;N+="0",B++);N=b(N,L)}else if(x-=W,N=E(N,L,"0"),L+1>B){if(--x>0)for(N+=".";x--;N+="0");}else if(x+=L-B,x>0)for(L+1==B&&(N+=".");x--;N+="0");return f.s<0&&I?"-"+N:N}function re(f,x){for(var j,O,I=1,L=new y(f[0]);I<f.length;I++)O=new y(f[I]),(!O.s||(j=D(L,O))===x||j===0&&L.s===x)&&(L=O);return L}function ce(f,x,j){for(var O=1,I=x.length;!x[--I];x.pop());for(I=x[0];I>=10;I/=10,O++);return(j=O+j*i-1)>de?f.c=f.e=null:j<ae?f.c=[f.e=0]:(f.e=j,f.c=x),f}Q=function(){var f=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,j=/^\.([^.]+)$/,O=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(L,W,B,N){var M,A=B?W:W.replace(I,"");if(O.test(A))L.s=isNaN(A)?null:A<0?-1:1;else{if(!B&&(A=A.replace(f,function(Z,ie,z){return M=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!N||N==M?ie:Z}),N&&(M=N,A=A.replace(x,"$1").replace(j,"0.$1")),W!=A))return new y(A,M);if(y.DEBUG)throw Error(d+"Not a"+(N?" base "+N:"")+" number: "+W);L.s=null}L.c=L.e=null}}();function oe(f,x,j,O){var I,L,W,B,N,M,A,Z=f.c,ie=p;if(Z){e:{for(I=1,B=Z[0];B>=10;B/=10,I++);if(L=x-I,L<0)L+=i,W=x,N=Z[M=0],A=o(N/ie[I-W-1]%10);else if(M=a((L+1)/i),M>=Z.length)if(O){for(;Z.length<=M;Z.push(0));N=A=0,I=1,L%=i,W=L-i+1}else break e;else{for(N=B=Z[M],I=1;B>=10;B/=10,I++);L%=i,W=L-i+I,A=W<0?0:o(N/ie[I-W-1]%10)}if(O=O||x<0||Z[M+1]!=null||(W<0?N:N%ie[I-W-1]),O=j<4?(A||O)&&(j==0||j==(f.s<0?3:2)):A>5||A==5&&(j==4||O||j==6&&(L>0?W>0?N/ie[I-W]:0:Z[M-1])%10&1||j==(f.s<0?8:7)),x<1||!Z[0])return Z.length=0,O?(x-=f.e+1,Z[0]=ie[(i-x%i)%i],f.e=-x||0):Z[0]=f.e=0,f;if(L==0?(Z.length=M,B=1,M--):(Z.length=M+1,B=ie[i-L],Z[M]=W>0?o(N/ie[I-W]%ie[W])*B:0),O)for(;;)if(M==0){for(L=1,W=Z[0];W>=10;W/=10,L++);for(W=Z[0]+=B,B=1;W>=10;W/=10,B++);L!=B&&(f.e++,Z[0]==l&&(Z[0]=1));break}else{if(Z[M]+=B,Z[M]!=l)break;Z[M--]=0,B=1}for(L=Z.length;Z[--L]===0;Z.pop());}f.e>de?f.c=f.e=null:f.e<ae&&(f.c=[f.e=0])}return f}function he(f){var x,j=f.e;return j===null?f.toString():(x=T(f.c),x=j<=J||j>=ee?b(x,j):E(x,j,"0"),f.s<0?"-"+x:x)}return k.absoluteValue=k.abs=function(){var f=new y(this);return f.s<0&&(f.s=1),f},k.comparedTo=function(f,x){return D(this,new y(f,x))},k.decimalPlaces=k.dp=function(f,x){var j,O,I,L=this;if(f!=null)return m(f,0,g),x==null?x=G:m(x,0,8),oe(new y(L),f+L.e+1,x);if(!(j=L.c))return null;if(O=((I=j.length-1)-P(this.e/i))*i,I=j[I])for(;I%10==0;I/=10,O--);return O<0&&(O=0),O},k.dividedBy=k.div=function(f,x){return C(this,new y(f,x),$,G)},k.dividedToIntegerBy=k.idiv=function(f,x){return C(this,new y(f,x),0,1)},k.exponentiatedBy=k.pow=function(f,x){var j,O,I,L,W,B,N,M,A,Z=this;if(f=new y(f),f.c&&!f.isInteger())throw Error(d+"Exponent not an integer: "+he(f));if(x!=null&&(x=new y(x)),B=f.e>14,!Z.c||!Z.c[0]||Z.c[0]==1&&!Z.e&&Z.c.length==1||!f.c||!f.c[0])return A=new y(Math.pow(+he(Z),B?f.s*(2-u(f)):+he(f))),x?A.mod(x):A;if(N=f.s<0,x){if(x.c?!x.c[0]:!x.s)return new y(NaN);O=!N&&Z.isInteger()&&x.isInteger(),O&&(Z=Z.mod(x))}else{if(f.e>9&&(Z.e>0||Z.e<-1||(Z.e==0?Z.c[0]>1||B&&Z.c[1]>=24e7:Z.c[0]<8e13||B&&Z.c[0]<=9999975e7)))return L=Z.s<0&&u(f)?-0:0,Z.e>-1&&(L=1/L),new y(N?1/L:L);xe&&(L=a(xe/i+2))}for(B?(j=new y(.5),N&&(f.s=1),M=u(f)):(I=Math.abs(+he(f)),M=I%2),A=new y(q);;){if(M){if(A=A.times(Z),!A.c)break;L?A.c.length>L&&(A.c.length=L):O&&(A=A.mod(x))}if(I){if(I=o(I/2),I===0)break;M=I%2}else if(f=f.times(j),oe(f,f.e+1,1),f.e>14)M=u(f);else{if(I=+he(f),I===0)break;M=I%2}Z=Z.times(Z),L?Z.c&&Z.c.length>L&&(Z.c.length=L):O&&(Z=Z.mod(x))}return O?A:(N&&(A=q.div(A)),x?A.mod(x):L?oe(A,xe,G,W):A)},k.integerValue=function(f){var x=new y(this);return f==null?f=G:m(f,0,8),oe(x,x.e+1,f)},k.isEqualTo=k.eq=function(f,x){return D(this,new y(f,x))===0},k.isFinite=function(){return!!this.c},k.isGreaterThan=k.gt=function(f,x){return D(this,new y(f,x))>0},k.isGreaterThanOrEqualTo=k.gte=function(f,x){return(x=D(this,new y(f,x)))===1||x===0},k.isInteger=function(){return!!this.c&&P(this.e/i)>this.c.length-2},k.isLessThan=k.lt=function(f,x){return D(this,new y(f,x))<0},k.isLessThanOrEqualTo=k.lte=function(f,x){return(x=D(this,new y(f,x)))===-1||x===0},k.isNaN=function(){return!this.s},k.isNegative=function(){return this.s<0},k.isPositive=function(){return this.s>0},k.isZero=function(){return!!this.c&&this.c[0]==0},k.minus=function(f,x){var j,O,I,L,W=this,B=W.s;if(f=new y(f,x),x=f.s,!B||!x)return new y(NaN);if(B!=x)return f.s=-x,W.plus(f);var N=W.e/i,M=f.e/i,A=W.c,Z=f.c;if(!N||!M){if(!A||!Z)return A?(f.s=-x,f):new y(Z?W:NaN);if(!A[0]||!Z[0])return Z[0]?(f.s=-x,f):new y(A[0]?W:G==3?-0:0)}if(N=P(N),M=P(M),A=A.slice(),B=N-M){for((L=B<0)?(B=-B,I=A):(M=N,I=Z),I.reverse(),x=B;x--;I.push(0));I.reverse()}else for(O=(L=(B=A.length)<(x=Z.length))?B:x,B=x=0;x<O;x++)if(A[x]!=Z[x]){L=A[x]<Z[x];break}if(L&&(I=A,A=Z,Z=I,f.s=-f.s),x=(O=Z.length)-(j=A.length),x>0)for(;x--;A[j++]=0);for(x=l-1;O>B;){if(A[--O]<Z[O]){for(j=O;j&&!A[--j];A[j]=x);--A[j],A[O]+=l}A[O]-=Z[O]}for(;A[0]==0;A.splice(0,1),--M);return A[0]?ce(f,A,M):(f.s=G==3?-1:1,f.c=[f.e=0],f)},k.modulo=k.mod=function(f,x){var j,O,I=this;return f=new y(f,x),!I.c||!f.s||f.c&&!f.c[0]?new y(NaN):!f.c||I.c&&!I.c[0]?new y(I):(V==9?(O=f.s,f.s=1,j=C(I,f,0,3),f.s=O,j.s*=O):j=C(I,f,0,V),f=I.minus(j.times(f)),!f.c[0]&&V==1&&(f.s=I.s),f)},k.multipliedBy=k.times=function(f,x){var j,O,I,L,W,B,N,M,A,Z,ie,z,te,se,ye,ve=this,Ce=ve.c,Te=(f=new y(f,x)).c;if(!Ce||!Te||!Ce[0]||!Te[0])return!ve.s||!f.s||Ce&&!Ce[0]&&!Te||Te&&!Te[0]&&!Ce?f.c=f.e=f.s=null:(f.s*=ve.s,!Ce||!Te?f.c=f.e=null:(f.c=[0],f.e=0)),f;for(O=P(ve.e/i)+P(f.e/i),f.s*=ve.s,N=Ce.length,Z=Te.length,N<Z&&(te=Ce,Ce=Te,Te=te,I=N,N=Z,Z=I),I=N+Z,te=[];I--;te.push(0));for(se=l,ye=v,I=Z;--I>=0;){for(j=0,ie=Te[I]%ye,z=Te[I]/ye|0,W=N,L=I+W;L>I;)M=Ce[--W]%ye,A=Ce[W]/ye|0,B=z*M+A*ie,M=ie*M+B%ye*ye+te[L]+j,j=(M/se|0)+(B/ye|0)+z*A,te[L--]=M%se;te[L]=j}return j?++O:te.splice(0,1),ce(f,te,O)},k.negated=function(){var f=new y(this);return f.s=-f.s||null,f},k.plus=function(f,x){var j,O=this,I=O.s;if(f=new y(f,x),x=f.s,!I||!x)return new y(NaN);if(I!=x)return f.s=-x,O.minus(f);var L=O.e/i,W=f.e/i,B=O.c,N=f.c;if(!L||!W){if(!B||!N)return new y(I/0);if(!B[0]||!N[0])return N[0]?f:new y(B[0]?O:I*0)}if(L=P(L),W=P(W),B=B.slice(),I=L-W){for(I>0?(W=L,j=N):(I=-I,j=B),j.reverse();I--;j.push(0));j.reverse()}for(I=B.length,x=N.length,I-x<0&&(j=N,N=B,B=j,x=I),I=0;x;)I=(B[--x]=B[x]+N[x]+I)/l|0,B[x]=l===B[x]?0:B[x]%l;return I&&(B=[I].concat(B),++W),ce(f,B,W)},k.precision=k.sd=function(f,x){var j,O,I,L=this;if(f!=null&&f!==!!f)return m(f,1,g),x==null?x=G:m(x,0,8),oe(new y(L),f,x);if(!(j=L.c))return null;if(I=j.length-1,O=I*i+1,I=j[I]){for(;I%10==0;I/=10,O--);for(I=j[0];I>=10;I/=10,O++);}return f&&L.e+1>O&&(O=L.e+1),O},k.shiftedBy=function(f){return m(f,-h,h),this.times("1e"+f)},k.squareRoot=k.sqrt=function(){var f,x,j,O,I,L=this,W=L.c,B=L.s,N=L.e,M=$+4,A=new y("0.5");if(B!==1||!W||!W[0])return new y(!B||B<0&&(!W||W[0])?NaN:W?L:1/0);if(B=Math.sqrt(+he(L)),B==0||B==1/0?(x=T(W),(x.length+N)%2==0&&(x+="0"),B=Math.sqrt(+x),N=P((N+1)/2)-(N<0||N%2),B==1/0?x="5e"+N:(x=B.toExponential(),x=x.slice(0,x.indexOf("e")+1)+N),j=new y(x)):j=new y(B+""),j.c[0]){for(N=j.e,B=N+M,B<3&&(B=0);;)if(I=j,j=A.times(I.plus(C(L,I,M,1))),T(I.c).slice(0,B)===(x=T(j.c)).slice(0,B))if(j.e<N&&--B,x=x.slice(B-3,B+1),x=="9999"||!O&&x=="4999"){if(!O&&(oe(I,I.e+$+2,0),I.times(I).eq(L))){j=I;break}M+=4,B+=4,O=1}else{(!+x||!+x.slice(1)&&x.charAt(0)=="5")&&(oe(j,j.e+$+2,1),f=!j.times(j).eq(L));break}}return oe(j,j.e+$+1,G,f)},k.toExponential=function(f,x){return f!=null&&(m(f,0,g),f++),F(this,f,x,1)},k.toFixed=function(f,x){return f!=null&&(m(f,0,g),f=f+this.e+1),F(this,f,x)},k.toFormat=function(f,x,j){var O,I=this;if(j==null)f!=null&&x&&typeof x=="object"?(j=x,x=null):f&&typeof f=="object"?(j=f,f=x=null):j=K;else if(typeof j!="object")throw Error(d+"Argument not an object: "+j);if(O=I.toFixed(f,x),I.c){var L,W=O.split("."),B=+j.groupSize,N=+j.secondaryGroupSize,M=j.groupSeparator||"",A=W[0],Z=W[1],ie=I.s<0,z=ie?A.slice(1):A,te=z.length;if(N&&(L=B,B=N,N=L,te-=L),B>0&&te>0){for(L=te%B||B,A=z.substr(0,L);L<te;L+=B)A+=M+z.substr(L,B);N>0&&(A+=M+z.slice(L)),ie&&(A="-"+A)}O=Z?A+(j.decimalSeparator||"")+((N=+j.fractionGroupSize)?Z.replace(new RegExp("\\d{"+N+"}\\B","g"),"$&"+(j.fractionGroupSeparator||"")):Z):A}return(j.prefix||"")+O+(j.suffix||"")},k.toFraction=function(f){var x,j,O,I,L,W,B,N,M,A,Z,ie,z=this,te=z.c;if(f!=null&&(B=new y(f),!B.isInteger()&&(B.c||B.s!==1)||B.lt(q)))throw Error(d+"Argument "+(B.isInteger()?"out of range: ":"not an integer: ")+he(B));if(!te)return new y(z);for(x=new y(q),M=j=new y(q),O=N=new y(q),ie=T(te),L=x.e=ie.length-z.e-1,x.c[0]=p[(W=L%i)<0?i+W:W],f=!f||B.comparedTo(x)>0?L>0?x:M:B,W=de,de=1/0,B=new y(ie),N.c[0]=0;A=C(B,x,0,1),I=j.plus(A.times(O)),I.comparedTo(f)!=1;)j=O,O=I,M=N.plus(A.times(I=M)),N=I,x=B.minus(A.times(I=x)),B=I;return I=C(f.minus(j),O,0,1),N=N.plus(I.times(M)),j=j.plus(I.times(O)),N.s=M.s=z.s,L=L*2,Z=C(M,O,L,G).minus(z).abs().comparedTo(C(N,j,L,G).minus(z).abs())<1?[M,O]:[N,j],de=W,Z},k.toNumber=function(){return+he(this)},k.toPrecision=function(f,x){return f!=null&&m(f,1,g),F(this,f,x,2)},k.toString=function(f){var x,j=this,O=j.s,I=j.e;return I===null?O?(x="Infinity",O<0&&(x="-"+x)):x="NaN":(f==null?x=I<=J||I>=ee?b(T(j.c),I):E(T(j.c),I,"0"):f===10&&w?(j=oe(new y(j),$+I+1,G),x=E(T(j.c),j.e,"0")):(m(f,2,H.length,"Base"),x=X(E(T(j.c),I,"0"),10,f,O,!0)),O<0&&j.c[0]&&(x="-"+x)),x},k.valueOf=k.toJSON=function(){return he(this)},k._isBigNumber=!0,S!=null&&y.set(S),y}function P(S){var C=S|0;return S>0||S===C?C:C-1}function T(S){for(var C,X,Q=1,k=S.length,q=S[0]+"";Q<k;){for(C=S[Q++]+"",X=i-C.length;X--;C="0"+C);q+=C}for(k=q.length;q.charCodeAt(--k)===48;);return q.slice(0,k+1||1)}function D(S,C){var X,Q,k=S.c,q=C.c,$=S.s,G=C.s,J=S.e,ee=C.e;if(!$||!G)return null;if(X=k&&!k[0],Q=q&&!q[0],X||Q)return X?Q?0:-G:$;if($!=G)return $;if(X=$<0,Q=J==ee,!k||!q)return Q?0:!k^X?1:-1;if(!Q)return J>ee^X?1:-1;for(G=(J=k.length)<(ee=q.length)?J:ee,$=0;$<G;$++)if(k[$]!=q[$])return k[$]>q[$]^X?1:-1;return J==ee?0:J>ee^X?1:-1}function m(S,C,X,Q){if(S<C||S>X||S!==o(S))throw Error(d+(Q||"Argument")+(typeof S=="number"?S<C||S>X?" out of range: ":" not an integer: ":" not a primitive number: ")+String(S))}function u(S){var C=S.c.length-1;return P(S.e/i)==C&&S.c[C]%2!=0}function b(S,C){return(S.length>1?S.charAt(0)+"."+S.slice(1):S)+(C<0?"e":"e+")+C}function E(S,C,X){var Q,k;if(C<0){for(k=X+".";++C;k+=X);S=k+S}else if(Q=S.length,++C>Q){for(k=X,C-=Q;--C;k+=X);S+=k}else C<Q&&(S=S.slice(0,C)+"."+S.slice(C));return S}r=R(),r.default=r.BigNumber=r,e.exports?e.exports=r:(n||(n=typeof self<"u"&&self?self:window),n.BigNumber=r)})(Vu)})(Di);var Oi=Di.exports;/*!
|
|
461
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
462
|
+
*
|
|
463
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
464
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
465
|
+
* in the Software without restriction, including without limitation the rights
|
|
466
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
467
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
468
|
+
* furnished to do so, subject to the following conditions:
|
|
469
|
+
*
|
|
470
|
+
* The above copyright notice and this permission notice shall be included in
|
|
471
|
+
* all copies or substantial portions of the Software.
|
|
472
|
+
*
|
|
473
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
474
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
475
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
476
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
477
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
478
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
479
|
+
* SOFTWARE.
|
|
480
|
+
*/const Ge=jr(),hd=Cr(),gd=wr,xd=Oi,Be={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},Ot={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:Ni,decimalSuffixes:mn}=Ge.currentBytes(),Sr={general:{scale:1024,suffixes:mn},binary:{scale:1024,suffixes:Ni},decimal:{scale:1e3,suffixes:mn}};function yd(e,n={},r){if(typeof n=="string"&&(n=gd.parseFormat(n)),!hd.validateFormat(n))return"ERROR: invalid format";let a=n.prefix||"",o=n.postfix||"",d=vd(e,n,r);return d=Ad(d,a),d=Md(d,o),d}function vd(e,n,r){switch(n.output){case"currency":return n=gt(n,Ge.currentCurrencyDefaultFormat()),kd(e,n,Ge);case"percent":return n=gt(n,Ge.currentPercentageDefaultFormat()),Ed(e,n,Ge,r);case"byte":return n=gt(n,Ge.currentByteDefaultFormat()),jd(e,n,Ge,r);case"time":return n=gt(n,Ge.currentTimeDefaultFormat()),_d(e);case"ordinal":return n=gt(n,Ge.currentOrdinalDefaultFormat()),Sd(e,n,Ge);case"number":default:return Nt({instance:e,providedFormat:n})}}function bd(e){let n=Sr.decimal;return jn(e._value,n.suffixes,n.scale).suffix}function Cd(e){let n=Sr.binary;return jn(e._value,n.suffixes,n.scale).suffix}function wd(e){let n=Sr.general;return jn(e._value,n.suffixes,n.scale).suffix}function jn(e,n,r){let s=n[0],a=Math.abs(e);if(a>=r){for(let o=1;o<n.length;++o){let d=Math.pow(r,o),c=Math.pow(r,o+1);if(a>=d&&a<c){s=n[o],e=e/d;break}}s===n[0]&&(e=e/Math.pow(r,n.length-1),s=n[n.length-1])}return{value:e,suffix:s}}function jd(e,n,r,s){let a=n.base||"binary",o=Object.assign({},Ot,n);const{binarySuffixes:d,decimalSuffixes:c}=r.currentBytes();let i={general:{scale:1024,suffixes:c||mn,marker:"bd"},binary:{scale:1024,suffixes:d||Ni,marker:"b"},decimal:{scale:1e3,suffixes:c||mn,marker:"d"}}[a],{value:h,suffix:p}=jn(e._value,i.suffixes,i.scale);return`${Nt({instance:s(h),providedFormat:n,state:r,defaults:r.currentByteDefaultFormat()})}${o.spaceSeparated?" ":""}${p}`}function Sd(e,n,r){let s=r.currentOrdinal(),a=Object.assign({},Ot,n),o=Nt({instance:e,providedFormat:n,state:r}),d=s(e._value);return`${o}${a.spaceSeparated?" ":""}${d}`}function _d(e){let n=Math.floor(e._value/60/60),r=Math.floor((e._value-n*60*60)/60),s=Math.round(e._value-n*60*60-r*60);return`${n}:${r<10?"0":""}${r}:${s<10?"0":""}${s}`}function Ed(e,n,r,s){let a=n.prefixSymbol,o=Nt({instance:s(e._value*100),providedFormat:n,state:r}),d=Object.assign({},Ot,n);return a?`%${d.spaceSeparated?" ":""}${o}`:`${o}${d.spaceSeparated?" ":""}%`}function kd(e,n,r){const s=r.currentCurrency();let a=Object.assign({},n),o=Object.assign({},Ot,a),d,c="",l=!!o.totalLength||!!o.forceAverage||o.average,i=a.currencyPosition||s.position,h=a.currencySymbol||s.symbol;const p=o.spaceSeparatedCurrency!==void 0?o.spaceSeparatedCurrency:o.spaceSeparated;a.lowPrecision===void 0&&(a.lowPrecision=!1),p&&(c=" "),i==="infix"&&(d=c+h+c);let v=Nt({instance:e,providedFormat:a,state:r,decimalSeparator:d});return i==="prefix"&&(e._value<0&&o.negative==="sign"?v=`-${c}${h}${v.slice(1)}`:e._value>0&&o.forceSign?v=`+${c}${h}${v.slice(1)}`:v=h+c+v),(!i||i==="postfix")&&(c=!o.spaceSeparatedAbbreviation&&l?"":c,v=v+c+h),v}function Rd({value:e,forceAverage:n,lowPrecision:r=!0,abbreviations:s,spaceSeparated:a=!1,totalLength:o=0,roundingFunction:d=Math.round}){let c="",l=Math.abs(e),i=-1;if(n&&s[n]&&Be[n]?(c=s[n],e=e/Be[n]):l>=Be.trillion||r&&d(l/Be.trillion)===1?(c=s.trillion,e=e/Be.trillion):l<Be.trillion&&l>=Be.billion||r&&d(l/Be.billion)===1?(c=s.billion,e=e/Be.billion):l<Be.billion&&l>=Be.million||r&&d(l/Be.million)===1?(c=s.million,e=e/Be.million):(l<Be.million&&l>=Be.thousand||r&&d(l/Be.thousand)===1)&&(c=s.thousand,e=e/Be.thousand),c&&(c=(a?" ":"")+c),o){let p=e<0,v=e.toString().split(".")[0],g=p?v.length-1:v.length;i=Math.max(o-g,0)}return{value:e,abbreviation:c,mantissaPrecision:i}}function Td({value:e,characteristicPrecision:n}){let[r,s]=e.toExponential().split("e"),a=+r;if(!n)return{value:a,abbreviation:`e${s}`};let o=1;return o<n&&(a=a*Math.pow(10,n-o),s=+s-(n-o),s=s>=0?`+${s}`:s),{value:a,abbreviation:`e${s}`}}function Ht(e){let n="";for(let r=0;r<e;r++)n+="0";return n}function Pd(e,n){let r=e.toString(),[s,a]=r.split("e"),[o,d=""]=s.split(".");if(+a>0)r=o+d+Ht(a-d.length);else{let c=".";+o<0?c=`-0${c}`:c=`0${c}`;let l=(Ht(-a-1)+Math.abs(o)+d).substr(0,n);l.length<n&&(l+=Ht(n-l.length)),r=c+l}return+a>0&&n>0&&(r+=`.${Ht(n)}`),r}function Id(e,n,r=Math.round){return e.toString().indexOf("e")!==-1?Pd(e,n):new xd(r(+`${e}e+${n}`)/Math.pow(10,n)).toFixed(n)}function Bd(e,n,r,s,a,o){if(s===-1)return e;let d=Id(n,s,o),[c,l=""]=d.toString().split(".");if(l.match(/^0+$/)&&(r||a))return c;let i=l.match(/0+$/);return a&&i?`${c}.${l.toString().slice(0,i.index)}`:d.toString()}function Dd(e,n,r,s){let a=e,[o,d]=a.toString().split(".");if(o.match(/^-?0$/)&&r)return d?`${o.replace("0","")}.${d}`:o.replace("0","");const c=n<0&&o.indexOf("-")===0;if(c&&(o=o.slice(1),a=a.slice(1)),o.length<s){let l=s-o.length;for(let i=0;i<l;i++)a=`0${a}`}return c&&(a=`-${a}`),a.toString()}function Od(e,n){let r=[],s=0;for(let a=e;a>0;a--)s===n&&(r.unshift(a),s=0),s++;return r}function Nd(e,n,r,s,a){let o=s.currentDelimiters(),d=o.thousands;a=a||o.decimal;let c=o.thousandsSize||3,l=e.toString(),i=l.split(".")[0],h=l.split(".")[1];const p=n<0&&i.indexOf("-")===0;return r&&(p&&(i=i.slice(1)),Od(i.length,c).forEach((g,R)=>{i=i.slice(0,g+R)+d+i.slice(g+R)}),p&&(i=`-${i}`)),h?l=i+a+h:l=i,l}function Ld(e,n){return e+n}function Ud(e,n,r){return n===0?e:+e==0?e.replace("-",""):n>0?`+${e}`:r==="sign"?e:`(${e.replace("-","")})`}function Ad(e,n){return n+e}function Md(e,n){return e+n}function Nt({instance:e,providedFormat:n,state:r=Ge,decimalSeparator:s,defaults:a=r.currentDefaults()}){let o=e._value;if(o===0&&r.hasZeroFormat())return r.getZeroFormat();if(!isFinite(o))return o.toString();let d=Object.assign({},Ot,a,n),c=d.totalLength,l=c?0:d.characteristic,i=d.optionalCharacteristic,h=d.forceAverage,p=d.lowPrecision,v=!!c||!!h||d.average,g=c?-1:v&&n.mantissa===void 0?0:d.mantissa,R=c?!1:n.optionalMantissa===void 0?g===-1:d.optionalMantissa,P=d.trimMantissa,T=d.thousandSeparated,D=d.spaceSeparated,m=d.negative,u=d.forceSign,b=d.exponential,E=d.roundingFunction,S="";if(v){let X=Rd({value:o,forceAverage:h,lowPrecision:p,abbreviations:r.currentAbbreviations(),spaceSeparated:D,roundingFunction:E,totalLength:c});o=X.value,S+=X.abbreviation,c&&(g=X.mantissaPrecision)}if(b){let X=Td({value:o,characteristicPrecision:l});o=X.value,S=X.abbreviation+S}let C=Bd(o.toString(),o,R,g,P,E);return C=Dd(C,o,i,l),C=Nd(C,o,T,r,s),(v||b)&&(C=Ld(C,S)),(u||o<0)&&(C=Ud(C,o,m)),C}function gt(e,n){if(!e)return n;let r=Object.keys(e);return r.length===1&&r[0]==="output"?n:e}var $d=e=>({format:(...n)=>yd(...n,e),getByteUnit:(...n)=>wd(...n,e),getBinaryByteUnit:(...n)=>Cd(...n,e),getDecimalByteUnit:(...n)=>bd(...n,e),formatOrDefault:gt});/*!
|
|
481
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
482
|
+
*
|
|
483
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
484
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
485
|
+
* in the Software without restriction, including without limitation the rights
|
|
486
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
487
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
488
|
+
* furnished to do so, subject to the following conditions:
|
|
489
|
+
*
|
|
490
|
+
* The above copyright notice and this permission notice shall be included in
|
|
491
|
+
* all copies or substantial portions of the Software.
|
|
492
|
+
*
|
|
493
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
494
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
495
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
496
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
497
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
498
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
499
|
+
* SOFTWARE.
|
|
500
|
+
*/const nt=Oi;function Fd(e,n,r){let s=new nt(e._value),a=n;return r.isNumbro(n)&&(a=n._value),a=new nt(a),e._value=s.plus(a).toNumber(),e}function Li(e,n,r){let s=new nt(e._value),a=n;return r.isNumbro(n)&&(a=n._value),a=new nt(a),e._value=s.minus(a).toNumber(),e}function qd(e,n,r){let s=new nt(e._value),a=n;return r.isNumbro(n)&&(a=n._value),a=new nt(a),e._value=s.times(a).toNumber(),e}function zd(e,n,r){let s=new nt(e._value),a=n;return r.isNumbro(n)&&(a=n._value),a=new nt(a),e._value=s.dividedBy(a).toNumber(),e}function Wd(e,n,r){let s=n;return r.isNumbro(n)&&(s=n._value),e._value=s,e}function Gd(e,n,r){let s=r(e._value);return Li(s,n,r),Math.abs(s._value)}var Hd=e=>({add:(n,r)=>Fd(n,r,e),subtract:(n,r)=>Li(n,r,e),multiply:(n,r)=>qd(n,r,e),divide:(n,r)=>zd(n,r,e),set:(n,r)=>Wd(n,r,e),difference:(n,r)=>Gd(n,r,e),BigNumber:nt});/*!
|
|
501
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
502
|
+
*
|
|
503
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
504
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
505
|
+
* in the Software without restriction, including without limitation the rights
|
|
506
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
507
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
508
|
+
* furnished to do so, subject to the following conditions:
|
|
509
|
+
*
|
|
510
|
+
* The above copyright notice and this permission notice shall be included in
|
|
511
|
+
* all copies or substantial portions of the Software.
|
|
512
|
+
*
|
|
513
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
514
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
515
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
516
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
517
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
518
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
519
|
+
* SOFTWARE.
|
|
520
|
+
*/const Vd="2.5.0",Qe=jr(),Kd=Cr(),Yd=md(_e),Zd=Bi();let ut=$d(_e),dt=Hd(_e);const Xd=wr;class Ui{constructor(n){this._value=n}clone(){return _e(this._value)}format(n={}){return ut.format(this,n)}formatCurrency(n){return typeof n=="string"&&(n=Xd.parseFormat(n)),n=ut.formatOrDefault(n,Qe.currentCurrencyDefaultFormat()),n.output="currency",ut.format(this,n)}formatTime(n={}){return n.output="time",ut.format(this,n)}binaryByteUnits(){return ut.getBinaryByteUnit(this)}decimalByteUnits(){return ut.getDecimalByteUnit(this)}byteUnits(){return ut.getByteUnit(this)}difference(n){return dt.difference(this,n)}add(n){return dt.add(this,n)}subtract(n){return dt.subtract(this,n)}multiply(n){return dt.multiply(this,n)}divide(n){return dt.divide(this,n)}set(n){return dt.set(this,Ai(n))}value(){return this._value}valueOf(){return this._value}}function Ai(e){let n=e;return _e.isNumbro(e)?n=e._value:typeof e=="string"?n=_e.unformat(e):isNaN(e)&&(n=NaN),n}function _e(e){return new Ui(Ai(e))}_e.version=Vd;_e.isNumbro=function(e){return e instanceof Ui};_e.language=Qe.currentLanguage;_e.registerLanguage=Qe.registerLanguage;_e.setLanguage=Qe.setLanguage;_e.languages=Qe.languages;_e.languageData=Qe.languageData;_e.zeroFormat=Qe.setZeroFormat;_e.defaultFormat=Qe.currentDefaults;_e.setDefaults=Qe.setDefaults;_e.defaultCurrencyFormat=Qe.currentCurrencyDefaultFormat;_e.validate=Kd.validate;_e.loadLanguagesInNode=Yd.loadLanguagesInNode;_e.unformat=Zd.unformat;_e.BigNumber=dt.BigNumber;var Qd=_e,Jd=Ku(Qd);function ef(e,n=2,r=!1,s=!0,a=6){const o=Jd(e||0),d=o.value();if(!d)return"0";const c=h=>{const[p,v]=h.split(".");return v?[p,Ho(v,"0")].filter(Boolean).join("."):p},l=h=>{const p=c(h);return p==="0"||p==="-0"};let i=d.toString();for(let h=n;h<=Math.max(n,a)&&(i=o.format({thousandSeparated:s,mantissa:h,roundingFunction:p=>p<0?Math.ceil(p):Math.floor(p)}),!!l(i));h+=1);return r?c(i):i}function Mi({loading:e=!1,credit:n=null,connecting:r=!1,onRefresh:s=()=>{},refreshing:a=!1}){const{t:o}=U.useContext(Me),d=dr`
|
|
521
|
+
from {
|
|
522
|
+
transform: rotate(0deg);
|
|
523
|
+
}
|
|
524
|
+
to {
|
|
525
|
+
transform: rotate(360deg);
|
|
526
|
+
}
|
|
527
|
+
`,c=U.useMemo(()=>!n?.enableCredit,[n]),l=U.useMemo(()=>Number(n?.creditBalance?.balance)<=0&&Number(n?.creditBalance?.pendingCredit)>0,[n]),{creditBalance:i,profileLink:h="",paymentLink:p="",creditPrefix:v=""}=n||{},g=Et(()=>{const R=ef(i?.balance??0),P=v?`${v} ${R}`:R;return l?`- ${P}`:P},[l,v,i?.balance]);return!n&&!e?null:t.jsx(wn,{children:e?t.jsxs(Y,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",gap:2,height:"100%"},children:[t.jsxs(Y,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:1},children:[t.jsx(et,{variant:"rounded",sx:{width:"80%",height:20}}),t.jsx(et,{variant:"rounded",sx:{width:"50%",height:20}})]}),t.jsxs(Y,{sx:{width:"100%",display:"flex",justifyContent:"space-between",gap:1},children:[t.jsx(et,{variant:"rounded",sx:{width:"100%",height:20}}),t.jsx(et,{variant:"rounded",sx:{width:"100%",height:20}})]})]}):t.jsxs(Y,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%",width:"100%"},children:[t.jsxs(Y,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[t.jsx(Se,{variant:"body1",children:"AIGNE Hub Credits"}),t.jsxs(Se,{variant:"h2",sx:{color:!c&&l?"error.main":"text.primary"},children:[c?o("setting.aigne.infinite"):g,c?null:t.jsx(Oe,{title:o("common.refresh"),children:t.jsx(cl,{sx:{fontSize:14,ml:1,cursor:"pointer",animation:a?`${d} 1s linear infinite`:"none"},onClick:s})})]})]}),c?null:t.jsxs(Y,{sx:{width:"100%",display:"flex",gap:1},children:[t.jsx(ar,{fullWidth:!0,variant:"outlined",disabled:r,onClick:()=>{p&&window.open(p,"_blank")},startIcon:t.jsx(Ee,{style:{fontSize:16},icon:"tabler:credit-card"}),children:o("setting.aigne.addCredits")}),t.jsx(ar,{fullWidth:!0,disabled:r,onClick:()=>{h&&window.open(dn(h,{appDid:window.blocklet.appPid}),"_blank")},variant:"outlined",startIcon:t.jsx(Ee,{style:{fontSize:16},icon:"hugeicons:transaction"}),children:o("setting.aigne.transaction")})]})]})})}Mi.propTypes={loading:_.bool,credit:_.object,connecting:_.bool,onRefresh:_.func,refreshing:_.bool};function $i({url:e,apiKey:n,switchUser:r=Pt,connecting:s=!1}){const{t:a}=U.useContext(Me),[o,d]=U.useState(!1),{data:c,loading:l,error:i,refresh:h}=qs(()=>Gu({baseUrl:e,accessKey:n}),{ready:!!(e&&n),refreshDeps:[e,n],onSuccess:()=>{d(!1)},onError:()=>{d(!1)}}),p=U.useCallback(()=>{l||o||(d(!0),h())},[h,l,o]);return i?null:t.jsxs(Y,{children:[t.jsx(Se,{variant:"h5",sx:{fontSize:18,mb:2},children:a("setting.aigne.account")}),t.jsxs(tt,{container:!0,className:"config-container",spacing:2,sx:{width:"100%"},children:[t.jsx(tt,{size:{xs:12,md:6},children:t.jsx(Ii,{loading:l&&!o,user:c?.user,switchUser:r,connecting:s,url:e})}),t.jsx(tt,{size:{xs:12,md:6},children:t.jsx(Mi,{refreshing:o,loading:l&&!o,credit:c,connecting:s,onRefresh:p})})]})]})}$i.propTypes={url:_.string.isRequired,apiKey:_.string.isRequired,connecting:_.bool,switchUser:_.func};function Fi({url:e,providerName:n,disconnect:r=Pt,disabled:s=!1,loading:a=!1,validationResult:o=""}){const{t:d}=U.useContext(Me),c=U.useMemo(()=>o&&o!=="success",[o]);return t.jsx(wn,{minHeight:80,height:"none",children:t.jsxs(Y,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2},children:[c?t.jsx(Oe,{title:o,children:t.jsx(gr,{sx:{fontSize:24,color:"error.main",cursor:"pointer",flexShrink:0}})}):t.jsx(ui,{sx:{fontSize:24,color:"success.main",cursor:"pointer",flexShrink:0}}),t.jsxs(Y,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flex:1,flexWrap:"wrap"},children:[t.jsxs(Y,{children:[t.jsx(Se,{variant:"h5",sx:{fontSize:18},children:c?d("setting.aigne.testFailed"):d("setting.aigne.connected",{provider:n})}),t.jsxs(Se,{variant:"body1",sx:{color:"text.secondary",fontSize:14},children:[d("setting.aigne.baseUrl",{provider:n}),": ",e]})]}),t.jsx(gn,{variant:"outlined",color:"error",startIcon:a?t.jsx(Le,{size:16,sx:{mr:1}}):t.jsx(Ia,{}),onClick:r,disabled:s||a,sx:{lineHeight:1.5},children:d("setting.aigne.disconnect")})]})]})})}Fi.propTypes={url:_.string.isRequired,providerName:_.string.isRequired,disabled:_.bool,disconnect:_.func,loading:_.bool,validationResult:_.string};function xt({desc:e,docLink:n=null,provider:r="",orientation:s="vertical"}){const{t:a}=U.useContext(Me);return t.jsxs(Se,{variant:"body2",sx:{lineHeight:1.6,color:"text.secondary",fontSize:12,...s==="vertical"&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},title:e,children:[e,n&&t.jsx(Oe,{title:t.jsxs(t.Fragment,{children:[a("setting.aigne.desc.docLink"),n&&t.jsxs(t.Fragment,{children:[":"," ",t.jsx(Dt,{href:n,target:"_blank",rel:"noopener noreferrer",sx:{ml:.5},children:r||"documentation"})]})]}),arrow:!0,children:t.jsx(el,{fontSize:"small",sx:{ml:.25,fontSize:14,cursor:"pointer",verticalAlign:"middle"}})})]})}const er={provider:"",model:"",url:"",key:"",accessKeyId:"",testConnection:""};xt.propTypes={desc:_.string.isRequired,docLink:_.string,provider:_.string,orientation:_.oneOf(["vertical","horizontal"])};function qi({orientation:e="vertical",hideDivider:n=!1,source:r="dashboard",forceValidate:s=!1},a){const[o,d]=U.useState(!1),[c,l]=U.useState(!1),[i,h]=U.useState(!1),[p,v]=U.useState(!1),{t:g}=U.useContext(Me),R=Ie(),{api:P}=R,{did:T,blocklet:D,actions:m}=We(),[u,b]=U.useState(!1),E=Lr({...er}),S=Lr({loading:!1,success:!1}),{confirmApi:C,confirmHolder:X}=Vo(),Q=U.useMemo(()=>`connect-aigne-${T}`,[T]),k=zu(R),q=Ba({messageType:"connect-aigne-message",onOpen:()=>d(!0),onClose:()=>d(!1)}),$=U.useMemo(()=>o||c||i||S.loading,[o,c,i,S.loading]),G=at(z=>k.find(te=>te.provider===z)),J=at(z=>G(z)?.models||[]);zs(()=>{Q&&Hl(Q)});const ee=at(z=>{if(z)return z;const te=k[0]?.provider;return J(te)[0]?.name||"auto"}),ae=at(()=>{Object.keys(er).forEach(z=>{E[z]=er[z]})}),de=Et(()=>{const{aigne:z={}}=D?.settings||{};return z},[D]),me=Et(()=>{const z={...de},te=z?.provider||k[0]?.provider,se=G(te),ye=Rt(te),ve=cn(te);return{...z,url:Ur.getOriginUrl(z?.url||ye&&se?.baseURL||""),provider:te,model:ee(z?.model),key:Yn(z?.key,T),accessKeyId:ve?Yn(z?.accessKeyId,T):z?.accessKeyId,secretAccessKey:ve?Yn(z?.secretAccessKey,T):z?.secretAccessKey}},[D,G,ee]),[V,xe]=U.useState(me);U.useEffect(()=>{xe(me)},[me]);const K=U.useMemo(()=>V?.url&&V?.key&&V?.provider==="aigneHub",[V]),H=Et(()=>G(V.provider)?.name||V.provider,[V,G]),w=U.useMemo(()=>qu(V),[V]),y=Et(()=>G(V.provider)?.documentation||"",[V,G]),F=async()=>{try{d(!0);const z=new Set(["running","error"]),te=D.children.filter(se=>z.has(se.status)||z.has(se.greenStatus)).map(se=>se.meta.did);await P.restartBlocklet({input:{did:T,componentDids:te}}),m.refreshBlocklet()}catch(z){console.error("error",z),fe.error(Pe(z))}finally{d(!1)}},re=(z=!0)=>{if(r!=="setup")return new Promise(te=>{C.open({title:g("setting.aigne.restart.title"),content:z?g("setting.aigne.restart.connectedContent",{provider:H}):g("setting.aigne.restart.notConnectedContent",{provider:H}),confirmButtonText:g("setting.aigne.restart.confirm"),cancelButtonText:g("setting.aigne.restart.cancel"),onConfirm(se){se(),F(),te(!0)},onCancel(){te(!1)}})})},ce=at(()=>new Promise(z=>{C.open({title:g("setting.aigne.revokeUrlAuthTitle",{url:g("setting.aigne.baseUrl",{provider:H})}),content:g("setting.aigne.revokeUrlAuth",{url:g("setting.aigne.baseUrl",{provider:H})}),confirmButtonText:g("common.confirm"),cancelButtonText:g("common.cancel"),onConfirm(te){te(),z(!0)},onCancel(){z(!1)}})})),oe=async(z,te)=>{const se={};if(xe({...V,[z]:te}),z==="provider"){const ye=J(te);ye.length>0&&(se.model=ye[0].name),se.key=""}return K&&z==="url"&&te!==V.url&&(await ce()?(se.key="",se.validationResult=""):se.url=V.url),setTimeout(()=>{xe({...V,[z]:te,...se})},100),b(!0),!0},he=U.useMemo(()=>V.provider,[V.provider]),f=at(z=>Ws(z)?"":g("setting.aigne.invalidUrl",{provider:H})),x=(z=[])=>{const te=w.filter(ye=>!z.includes(ye));if(te.length)return te.forEach(ye=>{E[ye]="required"}),!te.includes("url")&&Rt(V.provider)&&(E.url=f(V.url)),!1;const se=Rt(V.provider)&&f(V.url);return se?(E.url=se,!1):!0},j=async()=>{try{h(!0),await P.disconnectToAigne({input:{did:T,url:V.url,key:V.key}}),b(!1),fe.success(g("setting.aigne.disconnectSuccess")),setTimeout(()=>{re(!1)},300)}catch(z){console.error("disconnect error:",z),fe.error(Pe(z)||g("setting.aigne.disconnectFailed"))}finally{h(!1)}},O=()=>{C.open({title:g("setting.aigne.disconnect"),content:g("setting.aigne.disconnectConfirm"),confirmButtonText:g("setting.aigne.disconnect"),cancelButtonText:g("common.cancel"),onConfirm(z){z(),j()}})},I=async()=>{if(!x())return;ae();const z={...V,model:"auto",key:Kn(V.key,T)};cn(z.provider)?(z.key="",V.accessKeyId&&(z.accessKeyId=Kn(V.accessKeyId,T)),V.secretAccessKey&&(z.secretAccessKey=Kn(V.secretAccessKey,T))):(z.accessKeyId="",z.secretAccessKey="");const te=await P.updateBlockletSettings({input:{did:T,aigne:z}});return m.refreshBlocklet(),te},L=async()=>{try{if(!u&&!s)return;d(!0);const z=await I();return z?(b(!1),fe.success(g("common.saveSuccess")),z):void 0}catch(z){throw console.error("error",z),fe.error(Pe(z)||g("setting.aigne.failed")),z}finally{d(!1)}},W=async(z=!1)=>{E.testConnection="";try{if(S.loading=!0,!z&&(await I())?.code!=="ok")return;await P.verifyAigneConnection({input:{did:T}}),fe.success(g("setting.aigne.testSuccess",{provider:H})),S.success=!0}catch(te){throw console.error("error",te),E.testConnection=te.message,fe.error(g("setting.aigne.testFailed")),te}finally{S.loading=!1,m.refreshBlocklet()}},B=async()=>{try{await Kl(P,{did:T,refresh:m.refreshBlocklet,t:g,providerName:H,timerKey:Q,values:{...de}}).catch(z=>{throw console.error("waitGetConnectedAigne error",z),fe.error(Pe(z)),z}).then(()=>W(!0).catch(z=>{throw console.error("onVerifyConnection error",z),z})),re(!0)}catch(z){console.error("error",z)}finally{b(!1)}},N=()=>{x(["key"])&&(ae(),q(async(z,te)=>{try{l(!0);const se=await P.connectToAigne({input:{did:T,baseUrl:Ur.getOriginUrl(V.url||new URL(window.location.origin).origin),provider:V.provider,model:"auto"}});if(!se?.url){fe.error("failed to connect to endpoint"),l(!1),d(!1);return}te(se.url),await B(),l(!1)}catch(se){const ye=Pe(se);fe.error(ye),l(!1)}}))};U.useImperativeHandle(a,()=>({onSubmit:L,loading:o||c||i})),J(he);const M=he==="aigneHub",A=()=>{v(!p)},Z=z=>{z.preventDefault()},ie=U.useMemo(()=>E.url==="required"?g("common.requiredErrorText",{name:g("setting.aigne.baseUrl",{provider:H})}):E.url?E.url:E.key==="required"?g("setting.aigne.apiKeyNotAuthorized",{provider:H}):"",[E.url,E.key,g,H]);return t.jsxs(tf,{source:r,children:[t.jsx(Se,{variant:"h5",sx:{fontSize:18},children:g("setting.aigne.authorizeAigneHub",{name:H})}),K&&V.validationResult?t.jsx(Fi,{url:V.url,providerName:H,disconnect:O,validationResult:V.validationResult,disabled:$,loading:i}):t.jsx(wn,{height:"none",minHeight:"none",children:t.jsxs(Y,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[t.jsx(St,{orientation:e,title:g("setting.aigne.baseUrl",{provider:H}),required:Rt(V.provider),desc:t.jsx(xt,{desc:g("setting.aigne.desc.baseUrl",{example:"https://hub.aigne.io"})}),children:t.jsx(Wt,{disabled:$,initialValue:V.url||"",directEditing:!0,onSubmit:z=>{oe("url",z)},autoFocus:!1,errorTips:ie,InputProps:K?{endAdornment:t.jsx(Ar,{position:"end",children:S.loading||c?t.jsx(Le,{size:16}):t.jsxs(t.Fragment,{children:[V.validationResult==="success"?t.jsx(Oe,{title:g("setting.aigne.testSuccess",{provider:H}),children:t.jsx(ui,{sx:{fontSize:16,color:"success.main",cursor:"pointer"}})}):null,V.validationResult&&V.validationResult!=="success"?t.jsx(Oe,{title:V.validationResult,children:t.jsx(gr,{sx:{fontSize:16,color:"error.main",cursor:"pointer"}})}):null,V.validationResult?null:t.jsx(Re,{"aria-label":"test connection",onClick:W,edge:"end",children:S.loading?t.jsx(Le,{size:16}):t.jsx(Oe,{title:g("setting.aigne.testConnection",{provider:H}),children:t.jsx(Ee,{style:{fontSize:16},icon:"tabler:location-check"})})})]})})}:{}})}),t.jsx(gn,{variant:"contained",onClick:N,startIcon:c?t.jsx(Le,{size:16,sx:{mr:1}}):t.jsx(yn,{}),disabled:$||!V.url,sx:{flexShrink:0},children:g("setting.aigne.authorizeAigneHub",{name:"AIGNE Hub"})})]})}),t.jsxs(tt,{container:!0,className:"config-container",spacing:2,sx:{display:"none"},children:[t.jsx(tt,{size:{xs:12,md:4},children:t.jsx(St,{orientation:e,title:g("setting.aigne.modelAdapter"),required:!0,desc:t.jsx(xt,{desc:g("setting.aigne.desc.modelAdapter")}),children:t.jsx(Ei,{disabled:$,options:k,config:{multiple:!1,labelField:"name",valueField:"provider"},initialValue:V.provider,directEditing:!0,searchable:!1,helperText:E.provider==="required"?g("common.requiredErrorText",{name:g("setting.aigne.modelAdapter")}):E.provider,onChange:z=>oe("provider",z)})})}),null,M?null:t.jsx(t.Fragment,{children:cn(V.provider)?t.jsxs(t.Fragment,{children:[t.jsx(St,{orientation:e,title:"Access Key ID",required:!0,desc:t.jsx(xt,{desc:g("setting.aigne.desc.accessKeyId"),docLink:y,provider:H}),children:t.jsx(Wt,{disabled:$,initialValue:V.accessKeyId||"",type:p?"text":"password",onChange:z=>oe("accessKeyId",z),directEditing:!0,autoFocus:!1})}),!n&&t.jsx(Y,{className:"config-form",component:Gs,sx:{my:3}}),t.jsx(St,{orientation:e,title:"Secret Access Key",required:!0,desc:t.jsx(xt,{desc:g("setting.aigne.desc.secretAccessKey"),docLink:y,provider:H}),children:t.jsx(Wt,{disabled:$,initialValue:V.secretAccessKey||"",type:p?"text":"password",onChange:z=>oe("secretAccessKey",z),directEditing:!0,autoFocus:!1})})]}):t.jsx(St,{orientation:e,title:"API Key",required:!0,desc:t.jsx(xt,{desc:g("setting.aigne.desc.key",{provider:H}),docLink:y,provider:H}),children:t.jsx(Wt,{disabled:$,initialValue:V.key||"",type:p?"text":"password",onChange:z=>oe("key",z),directEditing:!0,autoFocus:!1,InputProps:{endAdornment:t.jsx(Ar,{position:"end",children:t.jsx(Re,{"aria-label":"toggle password visibility",onClick:A,onMouseDown:Z,edge:"end",children:p?t.jsx(ml,{}):t.jsx(hl,{})})})}})})})]}),K&&V.validationResult==="success"?t.jsx($i,{switchUser:N,url:V.url||"",apiKey:V.key||"",connecting:c||i}):null,r!=="setup"&&t.jsxs(Se,{sx:{fontSize:12,color:"text.secondary",mt:3,fontStyle:"italic"},children:["* ",g("setting.aigne.description",{name:be.getDisplayName(D,!0)})]}),X]})}qi.propTypes={orientation:_.oneOf(["vertical","horizontal"]),hideDivider:_.bool,source:_.oneOf(["dashboard","setup"]),forceValidate:_.bool};const tf=we.div`
|
|
528
|
+
max-width: 920px;
|
|
529
|
+
display: flex;
|
|
530
|
+
flex-direction: column;
|
|
531
|
+
gap: 16px;
|
|
532
|
+
.section-title {
|
|
533
|
+
line-height: 1.2 !important;
|
|
534
|
+
font-weight: ${({source:e})=>e==="setup"?"400":"500"};
|
|
535
|
+
color: ${({theme:e,source:n})=>n==="setup"?e.palette.text.secondary:e.palette.text.primary};
|
|
536
|
+
font-size: ${({source:e})=>e==="setup"?"14px":"16px"};
|
|
537
|
+
}
|
|
538
|
+
.section-left {
|
|
539
|
+
width: 100%;
|
|
540
|
+
}
|
|
541
|
+
.form-item {
|
|
542
|
+
margin-bottom: 0 !important;
|
|
543
|
+
margin-top: 0 !important;
|
|
544
|
+
}
|
|
545
|
+
`,nf=U.forwardRef(qi),rf=(e,n)=>(e?.children||[]).find(r=>r.mountPoint===n)?.meta,of=e=>e.inStore&&be.isFreeBlocklet(e)===!1,sf=e=>[Ne.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Ne.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),tr=e=>e?.configs?.find(n=>n.key===Ne.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,af=e=>(e.environments||[]).some(n=>n.required),No=(e,n)=>e?.some(r=>r.required&&!n[r.key]),lf=({params:e,blocklet:n,t:r})=>{const s=e.title||e.name;return s?(n?.children||[]).find(o=>o.meta.bundleDid===e.bundleDid)?r("blocklet.component.upgradeNext",{name:s}):r("blocklet.component.addNext",{name:s}):r("common.next")},Lo=({componentDid:e,timeout:n=1e3,manual:r=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:r},"*")},n)},cf=e=>e?.store?e.store:e?.url||"";function zi({onClose:e=()=>{},mode:n="normal",stores:r=[],resourceType:s="",resourceDid:a="",storageKey:o="",inDialog:d=!0,selectedMeta:c=null,storeUrl:l="",showResourcesSwitch:i=!0,showFromUrl:h=!0,enableRunBackground:p=!0,showCategory:v=!0,installFromUrlParams:g=null}){const{t:R,locale:P}=je(),[T,D]=U.useState(!1),[m,u]=U.useState(null),[b,E]=U.useState(""),[S,C]=U.useState(""),{api:X,ws:{useSubscription:Q},inService:k,info:q}=Ie(),{blocklet:$,actions:{refreshBlocklet:G}}=We(),[J,ee]=U.useState(null),[ae,de]=U.useState(!1),me={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:""},[V,xe]=U.useState(me),[K,H]=U.useState(0),w=U.useRef({}),y=U.useRef({}),F=U.useRef({}),re=Ko(ne=>ne.breakpoints.down("md")),ce=Hs(),[oe,he]=U.useState(!0),{meta:f}=w.current,x=Ga(f),j=U.useRef(!1),O=U.useRef(null),I=ne=>xe(le=>({...le,...ne}));U.useEffect(()=>{if(V.pathPrefix){const{errMsg:ne}=te({...V,pathPrefix:V.pathPrefix,locale:P});E(ne)}},[V.pathPrefix]),U.useEffect(()=>{K===0&&xe(me)},[K]);const L=()=>{const ne=tr($)??"";I({didSpaceEndpoint:ne})},W=()=>w?.current?.meta?be.getDisplayName(w.current):"",B=()=>{D(!1),xe({}),j.current=!1,w.current={},e()},N=ne=>{const le=ge=>{I({installResultProps:{variant:"error",title:W(),subTitle:ne,footer:t.jsx(He,{className:"bottom-button",disabled:ge,"data-cy":"retry-install-component",onClick:async()=>{le(!0),await z(w.current.installInput)},children:t.jsxs(Y,{sx:{display:"flex",alignItems:"center"},children:[ge&&t.jsx(Le,{size:16,style:{marginRight:8}}),R("common.retry")]})})}})};le()},M=ne=>le=>{(le?.meta?.did||le?.meta)===$?.meta?.did&&ne(le)},A=()=>{Lo({timeout:0,componentDid:ce.componentDid,manual:!0}),B(),setTimeout(()=>{const ne=document.getElementsByClassName("dashboard-main")[0];ne&&(ne.scrollTop=ne.scrollHeight)},200)};Q(Ne.BlockletEvents.componentInstalled,M(()=>{I({installResultProps:{variant:"success",title:W(),subTitle:R("blocklet.component.installSuccessTip")}}),Lo({componentDid:ce.componentDid})}),[$?.meta?.did]),Q(Ne.BlockletEvents.statusChange,M(()=>{const ne=tr($);I(le=>({...le,didSpaceEndpoint:ne}))}),[$?.meta?.did]),Q(Ne.BlockletEvents.downloadFailed,M(()=>{j.current=!1,N(R("blocklet.component.installComponentError"))}),[$?.meta?.did]),Q(Ne.BlockletEvents.installFailed,M(()=>{j.current=!1,N(R("blocklet.component.installComponentError"))}),[$?.meta?.did]);const Z=[],ie=ne=>($?.children||[]).find(le=>le.meta.did===ne),z=async ne=>{j.current=!0;const{pathPrefix:le,bundleDid:ge,title:pe,componentName:qe="",componentDid:ot=""}=V,ct=w.current?.meta||{},{configs:ft=[],registryUrl:Ke,inStore:pt,inputUrl:wt,dist:_n}=ct,Lt=w.current?.downloadTokenList,Ut=wt||(pt?Mr(Ke,ge,_n):"");D(!0);const $e={rootDid:$.meta.did,url:Ut,mountPoint:le?Ze.urlPathFriendly(le):`/${Ze.urlPathFriendly(ct.title||ct.name)}`,title:pe,name:qe,did:V.isUpload&&V.upgradeDid?V.upgradeDid:ot,dist:{tarball:"",integrity:""},onlyRequired:!oe,...V.hasEnvironmentsStep&&ft.length>0?{configs:ft.map(Je=>({...Je,value:V.configsValue[Je.key]||""}))}:{},...Lt?{downloadTokenList:Lt}:{},...ne};try{if(await X.installComponent({input:$e}),Ke){const{teamDid:Je,storeList:it}=$o({fromBlocklet:k,nodeInfo:q,blocklet:$}),{isNew:jt,decoded:At}=Ys(Ke,it);jt&&X.addBlockletStore({input:{teamDid:Je,url:At}}).catch(En=>{console.error("addBlockletStore error: ",En)})}I({installResultProps:{}}),G({showError:!1,attachRuntimeInfo:!1})}catch(Je){const it=Pe(Je);fe.error(it),console.error("installComponent error: ",Je),N(it)}finally{D(!1),w.current.installInput=$e}},te=ne=>{const le=si({params:{...ne,did:ne.bundleDid},blocklets:[$],blocklet:$,locale:P,isUpload:V.isUpload});let ge=le;const pe=rf($,V.pathPrefix);if(le==="overwrite"&&pe&&pe.did!==ne.bundleDid?(I({upgradeDid:pe.did}),ge=""):(I({upgradeDid:""}),ge=le),ge){const qe=ie(ne.bundleDid),ot=Xa({params:{...ne,did:ne.bundleDid},blocklet:$});if(qe&&qe.mountPoint===ot)return{errMsg:""}}return{errMsg:ge}},se=async ne=>{const{errMsg:le}=te({...V,locale:P});E(le),K===Z.length-2&&!j.current&&await z(ne),y.current?.setActiveStepByIndex?.(ge=>ge+1)},ye=()=>{y.current?.setActiveStepByIndex?.(ne=>ne-1)},ve=()=>{const{pathPrefix:ne,bundleDid:le,title:ge,componentName:pe="",componentDid:qe=""}=V,{meta:ot={}}=w.current||{},{registryUrl:ct,inStore:ft,inputUrl:Ke,dist:pt}=ot,wt=ft?Mr(ct,le,pt):Ke;ee({meta:ot,installOpts:{type:"component",rootDid:$.meta.did,mountPoint:ne,url:wt,title:ge,name:pe,did:qe}})},Ce=ne=>{de(!1),I({purchaseResultProps:{variant:"error",title:W(),subTitle:ne,style:{paddingTop:120},footer:t.jsx(He,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{I({purchaseResultProps:{}})},children:R("common.retry")})}})},Te=({downloadTokenList:ne})=>{w.current.downloadTokenList=ne,de(!1),se()},rt=({chooseParams:ne=w.current,componentDid:le,isInit:ge=!1,isUpload:pe=!1})=>{const{meta:qe,registryUrl:ot,inStore:ct,inputUrl:ft}=ne,{did:Ke,title:pt,name:wt}=qe,_n=($.settings?.children||[]).filter(ze=>ze.status==="deleted"&&ze.meta.bundleDid===Ke),Lt=le||"",Ut=qe.environments?.map(ze=>{const{name:kn,validation:Mt,...$t}=ze,Rn={validation:Go(Mt)?"":Mt};return{...$t,key:kn,...Rn}});w.current={...ne,meta:{...qe,configs:Ut,registryUrl:ot,inStore:ct,inputUrl:ft}};let $e={};if(ge){const ze=[$],kn=Ut||[],Mt=[],$t=Fo(Ks([...kn,...Mt]),"key").filter(mt=>!!mt.key).sort((mt,Ft)=>mt.required&&!Ft.required?-1:Ft.required&&!mt.required?1:0),Rn=be.getSharedConfigObj(ze[0],{configs:$t}),Tn={},Ir=$t.map(mt=>{const{default:Ft,key:qt,...os}=mt;return Tn[qt]=Rn[qt]||Ft,{...os,key:qt,hidden:!!Ne.BLOCKLET_CONFIGURABLE_KEY[qt]}});$e={...$e,configsList:Ir,configsValue:Tn,hasMissRequiredConfigs:No(Ir,Tn)}}const Je=$.children.some(ze=>ze.mountPoint==="/"),it=_n.find(ze=>ze.meta.bundleDid===Ke),jt=$.children.find(ze=>ze.meta.bundleDid===Ke);$e.title=pt||"",it?$e={...$e,pathPrefix:it.mountPoint||"",componentName:it.meta.name,hasEnvironmentsStep:!1}:jt?$e={...$e,pathPrefix:jt.mountPoint||"",componentName:jt.meta.name,hasEnvironmentsStep:!1}:$e={...$e,pathPrefix:Je?`/${Ze.urlPathFriendly(pt)||Ze.urlPathFriendly(wt)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:w.current.meta?.environments?.length>0};const At=of(w.current.meta),En=sf(w.current.meta),rs=tr($);I({bundleDid:Ke,componentDid:Lt,...$e,hasRequiredEnvironments:af(w.current.meta),requirePurchase:At,didSpaceIsRequiredSetup:En,didSpaceEndpoint:rs,isUpload:pe}),ge&&At&&ve()},Ct=async()=>{if(!O.current.loading)try{D(!0),await O.current.onSubmit()&&se()}catch(ne){console.error("error",ne)}finally{D(!1)}};U.useEffect(()=>{if(!c&&!g?.meta||K!==0||!$)return;const{meta:ne,inputUrl:le="",inStore:ge=!0,registryUrl:pe="",isUpload:qe=!1}=g||{};rt({chooseParams:{blocklets:[c||ne],meta:c||ne,registryUrl:pe||l||cf(c?.bundleSource),inStore:ge,inputUrl:le},isInit:!0,isUpload:qe}),I({showFromUrlDialog:!1}),se()},[c,K,$,g]),Z.push({key:"selectComponent",name:R("blocklet.component.selectComponent"),body:t.jsxs(st,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[h&&V.showFromUrlDialog&&t.jsx(ii,{mode:"component",onCancel:()=>{I({showFromUrlDialog:!1})},onSuccess:({meta:ne,inputUrl:le,inStore:ge,registryUrl:pe})=>{rt({chooseParams:{meta:ne,inputUrl:le,inStore:ge,registryUrl:pe},isInit:!0}),I({showFromUrlDialog:!1}),se()},handleText:{title:R("blocklet.component.addComponentTip.fromUrl"),confirm:R("blocklet.component.choose")}}),t.jsx(wi,{stores:r,extra:ei.isInServerlessMode(q)?null:h?t.jsxs(He,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{I({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[t.jsx(yn,{style:{fontSize:20,marginRight:4}}),R("blocklet.component.addComponentTip.fromUrl")]}):null,loading:T,onChange:()=>{xe({}),w.current={}},storageKey:o,children:({currentRegistry:ne})=>t.jsx(Si,{showResourcesSwitch:i,showCategory:v,serverVersion:q?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:ne.url,resourceType:s,resourceDid:a,handleButtonClick:le=>{rt({chooseParams:{...le,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:le,defaultRender:ge})=>{const pe=V?.bundleDid&&V?.bundleDid===le?.did;return t.jsxs(df,{children:[t.jsx(Y,{className:pe?"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",...pe?{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:ge}),pe&&t.jsx(Y,{className:"check-container",children:t.jsx(Vs,{className:"check-icon"})})]})}})})]}),cancel:n==="embed"?void 0:R("common.cancel"),confirm:lf({params:V,blocklet:$,t:R}),onCancel:B,onConfirm:()=>{se()}}),Z.push({key:"agreement",name:R("launchBlocklet.introduction"),body:t.jsxs(st,{component:"div",className:"agreement-wrapper",children:[t.jsx(ir,{title:R("launchBlocklet.introduction"),subTitle:R("blocklet.component.addComponentTip.introduction")}),f?t.jsx(Ha,{meta:f,onClickNext:se,installRelated:oe,onChangeInstallRelated:he,handleDescEle:t.jsx("p",{children:R("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:c?void 0:R("common.pre"),disabled:!x,confirm:R(x?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?B:ye,onConfirm:()=>{de(!1),se()}}),f&&V.requirePurchase&&Z.push({key:"purchase",name:t.jsxs(t.Fragment,{children:[R("common.verifyNFT"),t.jsx(yt,{})]}),body:t.jsxs(st,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(F.current?.getCurrentStep?.()===2||ae)&&t.jsx(Vt,{title:R("common.verifyNFT"),subTitle:R("blocklet.component.addComponentTip.verifyNFT")}),zt(V.purchaseResultProps)?J&&t.jsx(vi,{ref:F,meta:J.meta,mode:V.componentDid?"verify":"both",onCancel:Ce,installOpts:J.installOpts,handlePaySuccess:Te}):t.jsx("div",{className:"flex-align-center flex-justify-center",children:t.jsx(Gr,{...V.purchaseResultProps})})]}),disabled:F.current?.getCurrentStep?.()===2||ae,cancel:R("common.pre"),confirm:R("common.next"),onConfirm:()=>{typeof F.current.onNext=="function"&&(F.current.onNext(),de(!0))},onCancel:()=>{ye()}}),be.hasStartEngine(f)&&ni.hasMountPoint(f)?Z.push({key:"config",name:R("common.config"),error:b,body:t.jsxs(st,{component:"div",children:[t.jsx(Vt,{title:R("common.config"),subTitle:R("blocklet.component.addComponentTip.config")}),t.jsx(De,{label:R("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:S||R("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:V.pathPrefix,onChange:ne=>{const le=ne.target.value;I({pathPrefix:le}),C(R("common.slugifyHint",{value:fr(le)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!b&&t.jsx(nr,{severity:"error",style:{width:"100%",marginTop:8},children:b})]}),cancel:R("common.pre"),confirm:R("common.next"),onCancel:ye,onConfirm:()=>{se()}}):f&&(V.pathPrefix=f.interfaces?.[0]?.path||`/${f.did}`),f&&f?.requirements?.aigne&&Z.push({key:"aigne",name:t.jsxs(Se,{component:"div",title:R("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[R("setting.aigne.config")," ",t.jsx(yt,{})]}),body:()=>t.jsxs(st,{component:"div",className:"aigne-config-wrapper",children:[t.jsx(ir,{title:R("setting.aigne.config")}),t.jsx(Y,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:t.jsx(nf,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:O})})]}),cancel:R("common.pre"),confirm:R("common.next"),onCancel:()=>{O.current.loading||ye()},onConfirm:Ct,loading:T||O.current?.loading,disabled:T||O.current?.loading}),f&&V?.hasEnvironmentsStep&&Z.push({key:"environment",name:t.jsxs(t.Fragment,{children:[R("common.environment")," ",V.hasRequiredEnvironments&&t.jsx(yt,{})]}),disabled:!!m||V?.hasMissRequiredConfigs,body:()=>t.jsxs(st,{component:"div",style:{overflowY:"auto"},children:[t.jsx(Vt,{title:R("common.environment"),subTitle:R("blocklet.component.addComponentTip.environment")}),t.jsx(xi,{style:{marginTop:-12,width:"100%"},schema:V.configsList,defaultValue:V.configsValue,onChange:(ne,{action:le,currentItem:ge,allValues:pe})=>{le==="confirm"&&I({hasMissRequiredConfigs:No(V.configsList,pe),configsValue:pe}),le==="edit"?u(ge):["cancel","confirm"].includes(le)&&u(null)}})]}),cancel:R("common.pre"),confirm:R("common.next"),onCancel:ye,onConfirm:se}),f&&V?.didSpaceIsRequiredSetup&&Z.push({key:"didSpace",name:t.jsxs(t.Fragment,{children:[R("blocklet.component.didSpaceConfig")," ",V.didSpaceIsRequiredSetup==="required"&&t.jsx(yt,{})]}),disabled:V?.didSpaceIsRequiredSetup&&!V.didSpaceEndpoint,body:()=>t.jsx(za,{children:t.jsxs(st,{component:"div",children:[t.jsx(Vt,{title:R("blocklet.component.didSpaceConfig"),subTitle:R("blocklet.component.didSpaceConfigTip")}),t.jsx(Y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:t.jsx(Ci,{blockletMeta:w.current.meta,onNext:()=>{se()},onEndpointUpdate:L})})]})}),cancel:R("common.pre"),confirm:R("common.next"),onCancel:ye,onConfirm:se}),Z.push({key:"install",name:ie(f?.did)?R("common.upgrade"):R("common.install"),disabled:p?!1:zt(V.installResultProps),loading:p?!1:zt(V.installResultProps),body:t.jsx(st,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:zt(V.installResultProps)?t.jsx(Ua,{message:t.jsx(ff,{children:R(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):t.jsx("div",{style:{marginTop:120},children:t.jsx(Gr,{...V.installResultProps})})}),confirm:R("common.complete"),onConfirm:A});const Ue=Z[K]||{},Fe=()=>T||Ue.error||!V.bundleDid?!0:K>1?!V.pathPrefix:!1;return $?t.jsxs(uf,{sx:d?{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(Aa,{steps:Z,mode:"memory",children:t.jsx(_i,{ref:y,meta:f,isMobile:re,onStepChange:ne=>{H(ne)}})}),t.jsxs(Y,{className:"action-bar",children:[Ue.cancel&&t.jsx(He,{onClick:ne=>{ne.stopPropagation(),Ue.onCancel()},disabled:K===Z.length-2&&T,color:"inherit",children:Ue.cancel||R("common.cancel")}),Ue.confirm&&t.jsx(He,{onClick:ne=>{ne.stopPropagation(),Ue.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:T||(typeof Ue.disabled=="boolean"?Ue.disabled:Fe()),variant:"contained",autoFocus:!0,title:Ue.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:t.jsxs(Y,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Ue.loading=="boolean"?Ue.loading:T)&&t.jsx(Le,{style:{marginRight:8},size:16}),t.jsx(Y,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ue.confirm})]})})]})]}):null}zi.propTypes={onClose:_.func,mode:_.oneOf(["normal","embed"]),inDialog:_.bool,stores:_.arrayOf(_.string),storeUrl:_.string,resourceType:_.string,resourceDid:_.string,storageKey:_.string,selectedMeta:_.object,showResourcesSwitch:_.bool,showFromUrl:_.bool,enableRunBackground:_.bool,showCategory:_.bool,installFromUrlParams:_.object};const uf=we(Y)`
|
|
546
|
+
.action-bar {
|
|
547
|
+
display: flex;
|
|
548
|
+
justify-content: flex-end;
|
|
549
|
+
position: sticky;
|
|
550
|
+
bottom: 0;
|
|
551
|
+
padding-top: 16px;
|
|
552
|
+
z-index: 100;
|
|
553
|
+
width: 100%;
|
|
554
|
+
background: ${({theme:e})=>e.palette.background.paper};
|
|
555
|
+
border-top: '1px solid';
|
|
556
|
+
border-color: ${({theme:e})=>e.palette.divider};
|
|
557
|
+
}
|
|
558
|
+
`,st=we(Se)`
|
|
559
|
+
width: 100%;
|
|
560
|
+
height: 100%;
|
|
561
|
+
`,Vt=we(ir)`
|
|
562
|
+
margin-bottom: 24px;
|
|
563
|
+
`,df=we.div`
|
|
564
|
+
position: relative;
|
|
565
|
+
|
|
566
|
+
.choose-blocklet {
|
|
567
|
+
background-color: rgb(236, 251, 253);
|
|
568
|
+
border-color: rgb(236, 251, 253);
|
|
569
|
+
border-radius: 8px;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.check-container {
|
|
573
|
+
position: absolute;
|
|
574
|
+
right: 0;
|
|
575
|
+
bottom: 0;
|
|
576
|
+
display: flex;
|
|
577
|
+
justify-content: flex-end;
|
|
578
|
+
align-items: flex-end;
|
|
579
|
+
width: 30px;
|
|
580
|
+
height: 30px;
|
|
581
|
+
border-radius: 0 0 8px 0;
|
|
582
|
+
color: ${e=>e.theme.palette.common.white};
|
|
583
|
+
overflow: hidden;
|
|
584
|
+
transition: all ease 0.3s;
|
|
585
|
+
&:after {
|
|
586
|
+
position: absolute;
|
|
587
|
+
z-index: 0;
|
|
588
|
+
display: block;
|
|
589
|
+
width: 0;
|
|
590
|
+
height: 0;
|
|
591
|
+
border-top: transparent solid 15px;
|
|
592
|
+
border-left: transparent solid 15px;
|
|
593
|
+
border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
594
|
+
border-right: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
595
|
+
transition: all ease 0.1s;
|
|
596
|
+
content: '';
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.check-icon {
|
|
600
|
+
position: relative;
|
|
601
|
+
z-index: 2;
|
|
602
|
+
margin: 0 1px 1px 0;
|
|
603
|
+
font-size: 16px;
|
|
604
|
+
transition: all ease 0.2s;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
`,ff=we.div`
|
|
608
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
609
|
+
.msg-before {
|
|
610
|
+
display: inline-block;
|
|
611
|
+
color: #aaa;
|
|
612
|
+
font-size: 14px;
|
|
613
|
+
margin-right: 6px;
|
|
614
|
+
}
|
|
615
|
+
`;function _r({blocklet:e,showDialog:n,setShowDialog:r,selectedMeta:s=null,showFromUrl:a=!0,installFromUrlParams:o=null}){const{t:d}=je(),c=Ko(h=>h.breakpoints.down("md")),{inService:l}=Ie(),i=()=>{r(!1)};return n?t.jsx(pf,{title:d("blocklet.component.addWithName",{name:be.getDisplayName(e)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(h,p)=>{p!=="backdropClick"&&i()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:t.jsx(zi,{selectedMeta:s,onClose:i,storageKey:l?Da:Oa,showFromUrl:a,installFromUrlParams:o})}):null}_r.propTypes={selectedMeta:_.object,showDialog:_.bool.isRequired,setShowDialog:_.func.isRequired,blocklet:_.object.isRequired,showFromUrl:_.bool,installFromUrlParams:_.object};const pf=we(hn)`
|
|
616
|
+
.ux-dialog_header {
|
|
617
|
+
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
618
|
+
}
|
|
619
|
+
.MuiDialogContent-root {
|
|
620
|
+
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
621
|
+
}
|
|
622
|
+
`;function Wi({blocklet:e,children:n=null,disabled:r=!1}){const{t:s}=je(),[a,o]=U.useState(!1),[d,c]=U.useState({show:!1,params:null}),[l,i]=U.useState({show:!1,params:null}),{getSessionInHeader:h,prefix:p}=Ie(),v=b=>{b.stopPropagation(),o(!0)},g=U.useCallback(()=>{c(b=>({...b,show:!0}))},[]),R=U.useCallback((b=!1)=>{c(b?{params:null,show:!1}:E=>({...E,show:!1}))},[]),P=U.useCallback(()=>{i({params:null,show:!0})},[]),T=U.useCallback(b=>{i({params:{...b,inStore:!1,isUpload:!0},show:!1}),b.meta&&o(!0)},[]),D=U.useCallback((b=!1)=>{i(b?{params:null,show:!1}:E=>({...E,show:!1}))},[]),m=U.useCallback(b=>{o(b),b||(R(!0),D(!0))},[R,D]),u=U.useMemo(()=>[t.jsxs(In.Item,{"data-cy":"add-component-from-url",onClick:g,style:{fontSize:14,color:"primary.main"},children:[t.jsx(yn,{style:{fontSize:16,marginRight:4}}),s("blocklet.component.addComponentTip.fromUrl")]},"add-component-from-url"),t.jsxs(In.Item,{"data-cy":"add-component-from-upload",onClick:P,style:{fontSize:14,color:"primary.main"},children:[t.jsx(pl,{style:{fontSize:16,marginRight:4}}),s("blocklet.component.addComponentTip.fromUpload")]},"add-component-from-upload")],[P,g,s]);return t.jsxs(t.Fragment,{children:[typeof n=="function"?n({open:v}):t.jsxs(In,{onClick:v,disabled:r,size:"small",menuButtonProps:{"data-cy":"add-component-more"},menu:u,children:[t.jsx(wa,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.component.add")]}),t.jsx(_r,{showDialog:a,setShowDialog:m,blocklet:e,selectedMeta:d.params?.meta||l.params?.meta||null,installFromUrlParams:d.params||l.params,showFromUrl:!1}),d.show?t.jsx(ii,{mode:"component",onCancel:R,onSuccess:({meta:b,inputUrl:E,inStore:S,registryUrl:C})=>{c({show:!1,params:{meta:b,inputUrl:E,inStore:S,registryUrl:C}}),o(!0)},handleText:{title:s("blocklet.component.addComponentTip.fromUrl"),confirm:s("blocklet.component.choose")}}):null,t.jsx(mi,{open:l.show,did:e.meta.did,prefix:p,headers:h,onUploaded:T,onClose:D})]})}Wi.propTypes={children:_.any,blocklet:_.object.isRequired,disabled:_.bool};const mf=e=>e.children.filter(n=>n.meta.interfaces.find(r=>r.type===Ne.BLOCKLET_INTERFACE_TYPE_WEB));function Er({params:e={},setParams:n=()=>{},setError:r=()=>{},serviceTypes:s=[{name:"Redirect",value:ue.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:ue.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:ue.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:ue.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:ue.ROUTING_RULE_TYPES.COMPONENT}]}){const{t:a}=je(),{blocklet:o}=We(),d=o.meta.did,c=mf(o),[l,i]=U.useState([]),h={301:a("common.redirectPermanently"),302:a("common.redirectTemporary"),307:a("common.redirectTemporary"),308:a("common.redirectPermanently")};return U.useEffect(()=>{if(e.type===ue.ROUTING_RULE_TYPES.COMPONENT&&e.componentId){const p=c.find(R=>R.meta.did===e.componentId),v=be.findWebInterface(p.meta),g=(Array.isArray(v?.pageGroups)?v.pageGroups:[]).map(R=>({value:R,label:`${R} pages`}));g.length&&g.unshift({value:"",label:"All pages"}),i(g),e.pageGroup&&g.find(R=>R.value===e.pageGroup)===!1&&n({...e,pageGroups:""})}},[e.componentId,e.type]),t.jsxs(t.Fragment,{children:[t.jsx(De,{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===ue.ROUTING_RULE_TYPES.BLOCKLET?d:"",__disableConfirm:!1})},style:{marginBottom:32},slotProps:{select:{}},children:s.map(({name:p,value:v})=>t.jsx(Ye,{value:v,children:p},v))}),e.type===ue.ROUTING_RULE_TYPES.REDIRECT&&[t.jsx(De,{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(h).map(p=>t.jsx(Ye,{value:p,children:`${h[p]} - ${p}`},p))},"redirectCode"),t.jsx(De,{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===ue.ROUTING_RULE_TYPES.COMPONENT&&[t.jsx(De,{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(Ye,{value:p.meta.did,selected:p.meta.did===e.componentId,children:be.getDisplayName(p,!0)},p.meta.did))},"componentId"),l.length?t.jsx(De,{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:l.map(p=>t.jsx(Ye,{value:p.value,selected:p.value===e.pageGroup,children:p.label},p.label))},"pageGroup"):null].filter(Boolean),e.type===ue.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(De,{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 v=p.target.value.trim();n({...e,url:p.target.value,__disableConfirm:!v}),r(v?"":a("router.validation.rewriteUrlRequired"))}},"url"),e.type===ue.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[t.jsx(De,{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:ue.ROUTING_RESPONSE_TYPES.map(p=>t.jsx(Ye,{value:p.value,children:p.text},p.value))},"responseType"),t.jsx(De,{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 v=p.target.value.trim();n({...e,responseBody:p.target.value,__disableConfirm:!v}),r(v?"":a("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Er.propTypes={params:_.object,serviceTypes:_.array,setParams:_.func,setError:_.func};function Gi({children:e=null,hiddenChildren:n=!1,open:r=!1,onClose:s=null}){const{t:a}=je(),{api:o}=Ie(),{blocklet:d}=We(),[c,l]=U.useState(!1),[i,h]=U.useState(!1),p=d.meta.did,v=d.site.id,g=()=>{s?.(),l(!1),h(!1)},R=async m=>{try{const u=await fn(m,a);if(u)throw u;l(!0);const b={from:{pathPrefix:Ze.urlPathFriendly(m.pathPrefix)},to:{type:m.type}};m.type===ue.ROUTING_RULE_TYPES.REDIRECT&&(b.to.url=m.url.trim(),b.to.redirectCode=m.redirectCode),m.type===ue.ROUTING_RULE_TYPES.COMPONENT&&(b.to.did=p,b.to.componentId=m.componentId,b.to.pageGroup=m.pageGroup),m.type===ue.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(b.to.url=Ze.urlPathFriendly(m.url)),m.type===ue.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(b.to.response={status:200,contentType:m.responseType,body:m.responseBody}),await o.addRoutingRule({input:{id:v,rule:b,teamDid:p}}),s?.()}catch(u){fe.error(u.message)}finally{l(!1),h(!1)}},P={title:a("router.rule.add.title"),description:(m,u,b)=>{const E=S=>{if(b(null),fn(S,a)){u({...S,__disableConfirm:!0});return}u({...S})};return t.jsxs(Se,{component:"div",children:[t.jsx(De,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,autoFocus:!0,helperText:m.pathPrefixHint||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:m.pathPrefix,onChange:S=>{let C=!1;const X=si({params:{...m,pathPrefix:S.target.value},blocklets:[d]});b(X),m.type===ue.ROUTING_RULE_TYPES.BLOCKLET&&X&&(C=!0),m.type===ue.ROUTING_RULE_TYPES.REDIRECT&&!m.url&&(C=!0),m.type===ue.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!m.url&&(C=!0),m.type===ue.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!m.responseType||!m.responseBody)&&(C=!0),S.target.value.trim()||(C=!0,b(a("router.validation.pathPrefixRequired"))),C||b("");const Q=a("common.slugifyHint",{value:fr(S.target.value)});u({...m,pathPrefix:S.target.value,pathPrefixHint:Q,__disableConfirm:C})},slotProps:{htmlInput:{"data-cy":"path-prefix-input"}}}),t.jsx(Er,{params:m,setParams:E,setError:b})]})},confirm:a("router.rule.add.confirm"),cancel:a("common.cancel"),params:{did:"",pathPrefix:"",type:ue.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:R,onCancel:g},T=m=>{m.stopPropagation(),h(!0)};let D=null;return n||(D=typeof e=="function"?e({open:T}):t.jsxs(Ye,{onClick:T,className:"rule-action","data-cy":"action-add-rule",children:[c?t.jsx(Le,{size:16}):t.jsx(yn,{style:{fontSize:18,marginRight:5}}),a("router.rule.add.title")]})),t.jsxs(t.Fragment,{children:[D,(r||i)&&t.jsx(bt,{title:P.title,description:P.description,confirm:P.confirm,cancel:P.cancel,params:P.params,onConfirm:P.onConfirm,onCancel:P.onCancel,color:"primary"})]})}Gi.propTypes={children:_.any,onClose:_.func,hiddenChildren:_.bool,open:_.bool};function Sn({depth:e=1,className:n=""}){return t.jsx(Y,{className:n,sx:{ml:Math.max((e-1)*2,0),borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}Sn.propTypes={depth:_.number,className:_.string};function Hi({id:e,from:n,children:r=null}){const{t:s}=je(),{api:a}=Ie(),{blocklet:o}=We(),[d,c]=U.useState(!1),[l,i]=U.useState(null),h=o.meta.did,p=o.site.id,v=n.pathPrefix,g=()=>{c(!1),i(null)},R=async()=>{c(!0);try{await a.deleteRoutingRule({input:{id:p,ruleId:e,teamDid:h}})}catch(D){fe.error(D.message)}finally{i(null),c(!1)}},P={keyName:v,title:s("router.rule.delete.title"),description:s("router.rule.delete.description",{name:`<b>${v}</b>`}),confirmPlaceholder:s("router.rule.delete.confirm_desc",{name:v}),confirm:s("common.delConfirm"),cancel:s("router.rule.delete.cancel"),onConfirm:R,onCancel:g},T=D=>{D.stopPropagation(),i(P)};return t.jsxs(t.Fragment,{children:[typeof r=="function"?r({loading:d,open:T}):t.jsxs(Ye,{onClick:T,className:"rule-action","data-cy":"action-delete-rule",children:[d?t.jsx(Le,{size:16}):t.jsx(Cn,{style:{fontSize:18,marginRight:5}}),s("router.rule.delete.title")]}),l&&t.jsx(nl,{keyName:l.keyName,title:l.title,description:l.description,confirmPlaceholder:l.confirmPlaceholder,confirm:l.confirm,cancel:l.cancel,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}Hi.propTypes={id:_.string.isRequired,from:_.object.isRequired,children:_.any};function Vi({id:e,from:n,to:r,children:s=null}){const{t:a}=je(),{api:o}=Ie(),{blocklet:d}=We(),[c,l]=U.useState(!1),[i,h]=U.useState(null),p=d.meta.did,v=d.site.id,g=n.pathPrefix,R=()=>{l(!1),h(null)},P=async m=>{try{const u=await fn(m,a);if(u)throw u;l(!0);const b={id:e,from:{pathPrefix:Ze.urlPathFriendly(m.pathPrefix)},to:{type:m.type}};m.type===ue.ROUTING_RULE_TYPES.REDIRECT&&(b.to.url=m.url,b.to.redirectCode=m.redirectCode),m.type===ue.ROUTING_RULE_TYPES.COMPONENT&&(b.to.did=p,b.to.componentId=m.componentId,b.to.pageGroup=m.pageGroup),m.type===ue.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(b.to.url=Ze.urlPathFriendly(m.url)),m.type===ue.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(b.to.response={status:200,contentType:m.responseType,body:m.responseBody}),await o.updateRoutingRule({input:{id:v,rule:b,teamDid:p}})}catch(u){fe.error(u.message)}finally{l(!1),h(null)}},T={title:a("router.rule.update.title"),description:(m,u,b)=>{const E=S=>{if(fn(S,a)){u({...S,__disableConfirm:!0});return}u({...S})};return t.jsxs(Se,{component:"div",children:[t.jsx(De,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,autoFocus:!0,helperText:m.helperText||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:m.pathPrefix,onChange:S=>{let C=!1;m.type===ue.ROUTING_RULE_TYPES.REDIRECT&&!m.url&&(C=!0),m.type===ue.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!m.url&&(C=!0),m.type===ue.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!m.responseType||!m.responseBody)&&(C=!0),S.target.value.trim()||(C=!0,b(a("router.validation.pathPrefixRequired"))),C||b("");const X=a("common.slugifyHint",{value:fr(S.target.value)});u({...m,pathPrefix:S.target.value,helperText:X,__disableConfirm:C})},slotProps:{htmlInput:{"data-cy":"path-prefix-input"}}}),t.jsx(Er,{params:m,setParams:E,setError:b})]})},confirm:a("router.rule.update.confirm"),cancel:a("router.rule.update.cancel"),color:"primary",params:{did:r.did||"",pathPrefix:g==="/"?g:g.replace(/^\/+/,"").replace(/\/+$/,""),type:r.type||ue.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:P,onCancel:R},D=m=>{m.stopPropagation(),h(T)};return t.jsxs(t.Fragment,{children:[typeof s=="function"?s({loading:c,open:D}):t.jsxs(Ye,{onClick:D,className:"rule-action","data-cy":"action-update-rule",children:[c?t.jsx(Le,{size:16}):t.jsx(Qo,{style:{fontSize:18,marginRight:5}}),a("router.rule.update.title")]}),i&&t.jsx(bt,{title:i.title,description:i.description,confirm:i.confirm,color:i.color,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}Vi.propTypes={id:_.string.isRequired,from:_.object.isRequired,to:_.object.isRequired,children:_.any};function Ki({from:e,isProtected:n=!1,...r}){const{locale:s}=je(),{blocklet:a,recommendedDomain:o}=We(),d=Yo(o,e.pathPrefix,pr(a,s));return t.jsxs(Y,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(Y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:d,rel:"noopener noreferrer",title:d,children:t.jsx(Re,{size:"small",children:t.jsx(li,{})})}),t.jsx(Vi,{...r,isProtected:n,from:e,children:({open:c})=>t.jsx(Re,{size:"small",onClick:c,disabled:n,"data-cy":"action-update-rule",children:t.jsx(la,{})})}),t.jsx(Hi,{...r,isProtected:n,from:e,children:({open:c})=>t.jsx(Re,{size:"small",onClick:c,disabled:n,"data-cy":"action-delete-rule",children:t.jsx(Cn,{})})})]})}Ki.propTypes={isProtected:_.bool};function Yi({group:e,...n}){return e?t.jsx(It,{type:"reverse",...n,children:e}):null}Yi.propTypes={group:_.string.isRequired};function lr({domain:e,isHttps:n=!1,toUrl:r}){const s=n?"https":"http";let a=r;return Xs(a)||(a=`${s}://${e}${r}`),t.jsx(Dt,{href:a,target:"_blank",style:{fontSize:14},underline:"hover",children:r},a)}lr.propTypes={domain:_.string.isRequired,toUrl:_.string.isRequired,isHttps:_.bool};function kr({hasPermission:e=!1}){const{t:n,locale:r}=je(),s=Bt(),{blocklet:a,recommendedDomain:o}=We();return a.site.rules.filter(c=>c.to.type!==ue.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{let l=null,i=null;c.to.type===ue.ROUTING_RULE_TYPES.NONE?l="404":c.to.type===ue.ROUTING_RULE_TYPES.REDIRECT?l=c.to.redirectCode:c.to.type===ue.ROUTING_RULE_TYPES.GENERAL_REWRITE?l="R":c.to.type===ue.ROUTING_RULE_TYPES.DIRECT_RESPONSE?l=t.jsx(dl,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===ue.ROUTING_RULE_TYPES.COMPONENT&&(i=a.children.find(p=>p.meta.did===c.to.componentId),l="C");const h=c.isProtected?t.jsx(Oe,{title:n("blocklet.router.urlLockTooltip"),placement:"top",children:t.jsx("span",{children:t.jsx(Re,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:t.jsx(tl,{style:{fill:s.palette.text.disabled}})})})}):t.jsx(Ki,{...c});return[t.jsxs(Y,{className:"component-item",sx:{display:"flex",py:2,justifyContent:"space-between",alignItems:"center"},children:[t.jsxs(Y,{sx:{width:{xs:300,md:400},display:"flex",alignItems:"center"},children:[t.jsx(Y,{className:"component-item__indent",sx:{width:28}}),typeof l=="object"?l:t.jsx(Zs,{children:l}),t.jsxs(Y,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[t.jsxs(Y,{style:{color:"text.primary",fontSize:16},children:[c.to.type===ue.ROUTING_RULE_TYPES.NONE&&n("common.page404"),c.to.type===ue.ROUTING_RULE_TYPES.REDIRECT&&n("common.redirect"),c.to.type===ue.ROUTING_RULE_TYPES.GENERAL_REWRITE&&n("common.rewrite"),c.to.type===ue.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&ue.ROUTING_RESPONSE_TYPES.find(p=>p.value===c.to.response.contentType)?.text,c.to.type===ue.ROUTING_RULE_TYPES.COMPONENT&&be.getDisplayName(i,!0)]}),t.jsxs(Y,{sx:{display:"flex",alignItems:"center"},children:[c.to.type===ue.ROUTING_RULE_TYPES.REDIRECT&&t.jsx(lr,{domain:o,toUrl:c.to.url}),c.to.type===ue.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(lr,{domain:o,toUrl:c.to.url}),c.to.type===ue.ROUTING_RULE_TYPES.COMPONENT&&t.jsx(Yi,{group:c.to.pageGroup})]})]})]}),t.jsx(Y,{sx:{px:2,alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:t.jsx(Dt,{href:Yo(o,c.from.pathPrefix,pr(a,r)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:Ho(c.from.pathPrefix,"/")||"/"})},c.from.pathPrefix),t.jsx(Y,{children:e&&t.jsx("div",{style:{textAlign:"right"},children:h})},"actions")]},"rule"),t.jsx(Sn,{},"divider")]})}kr.propTypes={hasPermission:_.bool};const hf=xn(kr,"mutate_blocklets"),gf=xn(kr,"",Tt);function xf(e){const{inService:n}=Ie();return n?t.jsx(gf,{...e}):t.jsx(hf,{...e})}function yf(e,n){const r=U.useRef(n);U.useEffect(()=>{const s=a=>r.current(a.detail);return window.addEventListener(e,s),()=>window.removeEventListener(e,s)},[e])}function vf(e){const n=mr(),{t:r}=je(),s=()=>{const a=new URLSearchParams(window.location.search);a.get("checkUpdate")&&(a.delete("checkUpdate"),n(a.toString()),e(),fe.success(r("notification.checkingForUpdates")))};U.useEffect(s,[]),yf("checkUpdate",s)}function bf({blocklet:e,scrollToComponent:n}={blocklet:null,scrollToComponent:!1}){const r=mr(),{t:s}=je(),a=U.useRef(null),o=U.useMemo(()=>{if(!e||!e.optionalComponents)return null;const d=new URLSearchParams(window.location.search),c=d.get("install-component");if(c){a.current=c,d.delete("install-component"),r(d.toString());const l=e.optionalComponents.find(h=>h.meta.did===c);if(!l)return fe.success(s("notification.installComponentError",{did:c})),null;const{meta:i}=l;if(n){const h=document.getElementById(`optional-component-${c}`),p=document.querySelector(".dashboard-main");if(h){const v=h.getBoundingClientRect(),g=p.getBoundingClientRect();p.scrollTo({top:v.top-g.top+p.scrollTop,behavior:"smooth"})}}return i}return null},[e,r,s,n]);return U.useEffect(()=>{a.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},window.blocklet?.appUrl)},[e]),o}function Rr({open:e=!1,onClose:n=null,blocklet:r,ancestors:s=[]}){const{t:a}=je(),o=[...(s||[]).map(i=>i?.meta?.did||""),r?.meta?.did||""].filter(Boolean).join("/"),d=a("preferencesFor",{name:be.getDisplayName(r,!0)}),c=U.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(vt(r.status)||r.status==="unknown"&&vt(r.status))return null;const l=()=>{n?.()};return t.jsx(Cf,{open:e,fullWidth:!0,maxWidth:"md",title:d,onClose:l,PaperProps:{style:{minHeight:"500px"}},children:t.jsxs(Ao,{sx:{gap:1},children:[t.jsx(Se,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:a("description.preferences",{name:be.getDisplayName(r,!0)})}),t.jsx(Ca,{id:o,styles:c})]})})}Rr.propTypes={blocklet:_.object.isRequired,ancestors:_.array,open:_.bool,onClose:_.func};const Cf=we(hn)`
|
|
623
|
+
.MuiDialogContent-root {
|
|
624
|
+
padding-top: 0;
|
|
625
|
+
padding-bottom: 24px;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.MuiToolbar-root {
|
|
629
|
+
padding-right: 0;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.ux-dialog_closeButton {
|
|
633
|
+
margin: 0;
|
|
634
|
+
}
|
|
635
|
+
`;function Zi({component:e,remove:n=async()=>{},disabled:r=!1,tip:s="",showConfirm:a=!1,hideBtn:o=!1,onCancel:d=()=>{}}){const{t:c}=U.useContext(Me),[l,i]=U.useState(!1),[h,p]=U.useState(null),v=async D=>{i(!0),await n(D.component,D.removeType),i(!1),p(null)},g=r||l,R=()=>{p({title:`${c("common.delete")} ${e.meta.title||e.meta.name}`,description:(D,m)=>t.jsxs(Se,{component:"div",children:[t.jsx(Se,{gutterBottom:!0,children:c("blocklet.action.removeComponentDescription")}),t.jsxs(il,{name:"removeType",value:D.removeType,onChange:u=>m({...D,removeType:u.target.value}),children:[t.jsx(rr,{value:"keepData",control:t.jsx(Vr,{}),label:c("blocklet.action.removeComponentKeepData")}),t.jsx(rr,{value:"complete",control:t.jsx(Vr,{}),label:c("blocklet.action.removeComponentComplete")})]})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),params:{component:e,removeType:"keepData"},onConfirm:v,onCancel:()=>{p(null),d()}})};U.useEffect(()=>{a?R():(i(!1),p(null))},[a]);const P=t.jsx(wf,{size:"small",disabled:g,onClick:()=>R,"data-cy":"delete-component-btn",children:t.jsx(Cn,{disabled:g})}),T=t.jsx(Oe,{title:s||c("common.delete"),children:t.jsx("span",{children:P})});return t.jsxs(t.Fragment,{children:[!o&&T,h&&t.jsx(bt,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}Zi.propTypes={component:_.object.isRequired,remove:_.func,onCancel:_.func,disabled:_.bool,showConfirm:_.bool,hideBtn:_.bool,tip:_.string};const wf=we(Re)`
|
|
636
|
+
&.Mui-disabled {
|
|
637
|
+
opacity: 0.5;
|
|
638
|
+
}
|
|
639
|
+
`;function Xi({component:e,onStart:n=async()=>{},onStop:r=async()=>{},disabled:s=!1,tip:a=""}){const{t:o}=U.useContext(Me),[d,c]=U.useState(!1),[l,i]=U.useState(),h=async()=>{c(!0);try{await n(e)}catch(D){fe.error(D.message)}c(!1)},p=async()=>{c(!0);try{await r(e)}catch(D){fe.error(D.message)}c(!1)},v=s||d,g=["starting","running","stopping"],R=g.includes(e.status)||g.includes(e.greenStatus),P=R?ri:ul,T=t.jsx(jf,{disabled:v,size:"small",onClick:()=>{R?i({title:`${o("common.stop")} ${e?.meta?.title}`,description:o("blocklet.action.stopComponentDescription"),confirm:o("blocklet.action.confirmStop"),cancel:o("common.cancel"),onConfirm:()=>(i(null),p()),onCancel:()=>i(null)}):h()},"data-cy":`${R?"stop":"start"}-component-btn`,children:t.jsx(P,{disabled:v,fontSize:"small"})});return[t.jsx(Oe,{title:a||o(`common.${R?"stop":"start"}`),children:t.jsx("span",{children:T})},"btn"),l&&t.jsx(bt,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel},"connect")]}Xi.propTypes={component:_.object.isRequired,onStart:_.func,onStop:_.func,disabled:_.bool,tip:_.string};const jf=we(Re)`
|
|
640
|
+
&.Mui-disabled {
|
|
641
|
+
opacity: 0.5;
|
|
642
|
+
}
|
|
643
|
+
`;function Qi({sourceInfo:e={},blocklet:n={}}){const{t:r}=U.useContext(Me);let{source:s}=e;return s==="registry"&&(s="Blocklet Store"),t.jsxs(Y,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(Qs,{type:"success",children:sl(s)},"source"),e.source==="registry"&&t.jsx(Dt,{href:Ae(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")})]})}Qi.propTypes={sourceInfo:_.shape({source:_.string,deployedFrom:_.string}),blocklet:_.object};function Tr({blocklet:e,checkUpgrade:n=!1,hasPermission:r=!1,...s}){const{api:a}=Ie(),{t:o}=U.useContext(Me),[d,c]=U.useState(!1),[l,i]=U.useState(""),[h,p]=U.useState(null),[v,g]=U.useState(null);U.useEffect(()=>{p(null),n&&(e.mode,Ne.BLOCKLET_MODES.DEVELOPMENT)},[e,n]);const R=()=>{c(!1),g(null)},P=async()=>{c(!0);try{const D={did:e.meta.did,version:h.version,storeUrl:h.registryUrl||""};await kt(2e3),await a.upgradeBlocklet({input:D})}catch(D){fe.error(`Blocklet upgrade failed: ${Pe(D)}`)}finally{c(!1),g(null)}},T={title:`${o("common.upgrade")} ${o("common.blocklet")} ${be.getDisplayName(e)}`,description:o("blocklet.action.upgradeDescription"),confirm:o("blocklet.action.confirmUpgrade"),cancel:o("common.cancel"),onConfirm:P,onCancel:R};return r&&h&&!be.isInProgress(e.status)?t.jsxs(t.Fragment,{children:[t.jsx(It,{...s,children:e.meta.version}),t.jsx(Oe,{title:o("common.updateAvailable",{version:h.version}),children:t.jsx(Re,{size:"small",style:{marginLeft:8},disabled:d,onClick:()=>g(T),children:d?t.jsx(Le,{size:16}):t.jsx(ll,{style:{fontSize:16,color:"red"}})})}),!!l&&t.jsx(fe,{variant:"error",message:l,onClose:()=>i("")}),v&&t.jsx(bt,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]}):t.jsx(It,{...s,children:e.meta.version})}Tr.propTypes={blocklet:_.object.isRequired,checkUpgrade:_.bool,hasPermission:_.bool};const Sf=xn(Tr,"mutate_blocklets"),_f=xn(Tr,"",Tt);function Ef(e){const{inService:n}=Ie();return n?t.jsx(_f,{...e}):t.jsx(Sf,{...e})}const kf=e=>!e?.meta?.group,Rf=(e,n)=>e?[{name:n("common.name"),value:e.displayName},{name:n("common.description"),value:e.description},{name:n("common.version"),value:t.jsx(It,{children:e.version})}]:[],Tf=e=>{const{source:n,deployedFrom:r,bundleSource:s}=e;if(n)return{source:n,deployedFrom:r};if(!s)return{source:"upload",deployedFrom:r};if(s.url){const a=r||Array.isArray(s.url)?s.url[0]:s.url;return{source:"url",deployedFrom:a,link:a}}if(s.store){const a=r||Array.isArray(s.store)?s.store[0]:s.store;return{source:"registry",deployedFrom:a,link:a}}return{}},Pf=(e,n)=>{const r=e.split("/").slice(1);let s=n,a=0;const o=[];for(;s&&a<r.length;){const d=s.children.find(c=>c.meta.did===r[a]);s=d,a++,d&&o.push(d.meta.title)}return o.join(" / ")};function Ji({blocklet:e,depth:n=0,componentInfo:r=null,app:s=null,onClose:a}){const{t:o,locale:d}=U.useContext(Me),{deletingBlocklets:c}=hr();let{status:l,greenStatus:i}=e;(l==="running"||i==="running")&&(l="running"),n===1&&c.includes(e.meta.did)&&(l="deleting");const h=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),p=R=>R.map(P=>P.name===o("common.did")||P.name===o("blocklet.appId")?t.jsx(Bn,{valueComponent:"div",nameWidth:120,name:P.name,nameFormatter:()=>P.name,children:P.value},P.name):t.jsx(Bn,{valueComponent:"div",nameWidth:120,name:P.name,children:P.link?t.jsx(Dt,{href:P.link,target:"_blank",className:"page-link",underline:"hover",children:P.value}):P.value},P.name)),v=r?Tf(r):{},g=r?[{name:o("common.name"),value:be.getDisplayName(r,!0)},{name:o("common.version"),value:t.jsx(Ef,{blocklet:r,checkUpgrade:!1})},{name:o("common.status"),value:t.jsx(sr,{isResource:kf(e),status:l,source:r.source,progress:e.progress})},be.isBlockletRunning(e)?{name:o("blocklet.startedAt"),value:e.startedAt?t.jsx(Pn,{value:e.startedAt,type:"all",locale:d}):"-"}:null,be.isBlockletRunning(e)?null:{name:o("blocklet.stoppedAt"),value:e.stoppedAt?t.jsx(Pn,{value:e.stoppedAt,type:"all",locale:d}):"-"},e.installedAt?{name:o("blocklet.installedAt"),value:e.installedAt?t.jsx(Pn,{value:e.installedAt,type:"all",locale:d}):"-"}:null,be.hasStartEngine(e.meta)?{name:o("common.mountPoint"),value:h}:null,r.meta.group?{name:o("common.group"),value:t.jsx(It,{type:"success",children:r.meta.group})}:null,{name:o("blocklet.overview.source"),value:t.jsx(Qi,{sourceInfo:v,blocklet:e})},{name:o("blocklet.overview.deployedFrom"),value:v.deployedFrom||"-",link:v.link??""},{name:o("common.did"),value:t.jsx(Js,{did:r.meta.did,showQrcode:!0})},{name:o("common.author"),value:r.meta.owner?t.jsx(Ya,{owner:r.meta.owner,locale:d}):Ka.formatPerson(r.meta.author)},{name:o("common.engine"),value:Rf(r.engine,o).map(({name:R,value:P})=>t.jsx(Bn,{style:{marginBottom:4},nameWidth:120,name:R,children:P},R))},e.dependents?.length?{name:o("common.dependents"),value:t.jsx(Y,{children:e.dependents.map(R=>t.jsx(Y,{children:`${Pf(R.id,s)} ${R.required?`(${o("common.required")})`:""}`},R.id))})}:null,e.meta.resources?.length?{name:o("common.resource"),value:e.meta.resources.join(", ")}:null].filter(Boolean):[];return r?t.jsx(hn,{open:!0,title:o("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{a(null)},children:t.jsx(Y,{sx:{paddingBottom:1.5},children:p(g)},"dialog-wrapper")},"base-info-dialog"):null}Ji.propTypes={blocklet:_.object.isRequired,depth:_.number,app:_.object,componentInfo:_.object,onClose:_.func.isRequired};we(Zo)`
|
|
644
|
+
.BaseBadge-badge {
|
|
645
|
+
top: ${e=>e.top*8||6}px;
|
|
646
|
+
right: ${e=>e.right*8||6}px;
|
|
647
|
+
}
|
|
648
|
+
`;we(Y)`
|
|
649
|
+
.component-header {
|
|
650
|
+
display: flex;
|
|
651
|
+
align-items: center;
|
|
652
|
+
align-items: flex-end;
|
|
653
|
+
cursor: pointer;
|
|
654
|
+
}
|
|
655
|
+
.component-name {
|
|
656
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
657
|
+
font-size: 16px;
|
|
658
|
+
}
|
|
659
|
+
.component-version {
|
|
660
|
+
color: ${({theme:e})=>e.palette.grey[400]};
|
|
661
|
+
font-size: 12px;
|
|
662
|
+
margin-left: 4px;
|
|
663
|
+
transform: translateY(-1px);
|
|
664
|
+
}
|
|
665
|
+
`;function es({blocklet:e,ancestors:n,mountPoint:r,href:s}){const[a,o]=U.useState(!1),[d,c]=U.useState(!1),[l,i]=U.useState(!1),[h,p]=U.useState(r),{api:v}=Ie(),g=!n.length,R=g?e.meta.did:n.map(C=>C.meta.did)[0],{t:P}=je(),{confirmApi:T,confirmHolder:D}=Vo();U.useEffect(()=>{c(!1),o(!1),i(!1)},[r]);const m=()=>{o(!1),c(!1),p(r)},u=async()=>{i(!0),o(!1);try{const C={rootDid:R,mountPoint:Ze.urlPathFriendly(h)};g||(C.did=e.meta.did),await v.updateComponentMountPoint({input:C})}catch(C){throw C.message=Pe(C),fe.error(C.message),C}finally{m()}},b=at(()=>{T.open({title:P("common.noticeTitle"),content:t.jsxs(Y,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[t.jsx(Se,{sx:{mb:1.5},children:P("blocklet.mountPoint.description1")}),t.jsx(Se,{component:"li",children:P("blocklet.mountPoint.case1")}),t.jsx(Se,{component:"li",children:P("blocklet.mountPoint.case2")}),t.jsx(Se,{sx:{mt:1.5},children:P("blocklet.mountPoint.description2")})]}),confirmButtonText:P("common.confirm"),cancelButtonText:P("common.cancel"),async onConfirm(C){await u(),C()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),E=C=>{C?.preventDefault(),Ze.urlPathFriendly(h)!==r?b():c(!1)},S=d?t.jsxs(Y,{sx:{ml:1},children:[t.jsx(Re,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"data-cy":"edit-mount-point-submit",onClick:E,children:t.jsx(Y,{component:Ee,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),t.jsx(Re,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:m,children:t.jsx(Y,{component:Ee,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):t.jsx(Re,{size:"medium",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:()=>c(!0),children:t.jsx(Y,{component:Ee,"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(Y,{sx:{alignItems:"center",flexGrow:"1",display:{xs:"none",md:"flex"}},children:[D,d?t.jsx("form",{onSubmit:E,children:t.jsx(De,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:h,onChange:C=>p(C.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:r})}):t.jsx(Y,{component:"a",target:"_blank",href:s,rel:"noopener noreferrer",title:s,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:t.jsx(Y,{sx:{maxWidth:400,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",color:"primary.main",fontSize:16,px:2},children:ea(r)})}),l?t.jsx(Le,{size:20,sx:{ml:1}}):S]},r)}es.propTypes={mountPoint:_.string.isRequired,href:_.string.isRequired,blocklet:_.object.isRequired,ancestors:_.array.isRequired};const If=e=>!e?.meta?.group,Uo=(e,n)=>{const r=e.split("/").slice(1);let s=n,a=0;const o=[];for(;s&&a<r.length;){const d=s.children.find(c=>c.meta.did===r[a]);s=d,a++,d&&o.push(d.meta.title)}return o.join(" / ")},Bf=(e,n)=>{window.IS_DEBUG&&console.log("blocklet status","blueStatus:",e,"greenStatus:",n);const r=e==="running"||n==="running",s=e==="stopping"||n==="stopping",a=e==="downloading"&&n==="downloading";let o="",d="";return s?(o="stopping",d=""):r?o="running":o=e||n||"",r&&e!==n&&(d=e==="running"?n:e),a&&(o="running",d="downloading"),o==="running"&&d==="stopped"&&(d=""),e===n&&(o=e,d=""),{primaryStatus:o,secondaryStatus:d}};function cr({blocklet:e,ancestors:n=[],depth:r=0,onRemove:s=()=>{},onStart:a=()=>{},onStop:o=()=>{},onRestart:d=()=>{},getComponentUrl:c=()=>window.location.origin,app:l=null}){const{t:i,locale:h}=U.useContext(Me),p=mr(),[v,g]=U.useState(),[R,P]=U.useState(!1),[T,D]=U.useState(!1),[m,u]=U.useState(null),{info:b,inService:E}=Ie(),[S,C]=U.useState(!1),[X,Q]=U.useState(!1),{deletingBlocklets:k}=hr();let{status:q}=e;r===1&&k.includes(e.meta.did)&&(q="deleting");const $=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),G=c($),J=be.isInProgress(l.status),ee=be.isInProgress(e.status);let ae="";if(J||ee||r===1&&k.includes(e.meta.did))ae=i("blocklet.component.tip.stopBlocklet");else if(e.dependents?.length){const w=e.dependents.filter(y=>y.required);if(w.length){const y=w.map(F=>Uo(F.id,l));ae=i("blocklet.component.tip.requiredBy",{name:y.join(", ")})}}const de=at(()=>{const w=e.meta.did;if(E){const y=dn(Ae(ue.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/developers/logs"),{locale:h,component:w});window.location.href=y}else{const y=dn(Ae("/blocklets",l.appPid,"/logs"),{locale:h,component:w});p(y)}}),me=async(...w)=>{D(!0);try{await s(...w)}catch{}D(!1),P(!1)},{usingDocker:V,usingIsolation:xe}=U.useMemo(()=>{if(!e.meta.group||e.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const w=!!b?.enableDocker||window.blocklet?.enableDocker,y=[...l.configs,...e.configs].find(ce=>ce.key==="SKIP_DOCKER"&&ce.value),F=[...l.configs,...e.configs].find(ce=>ce.key==="USE_DOCKER"&&ce.value),re=[...l.configs,...e.configs].find(ce=>ce.key==="SKIP_DOCKER_NETWORK"&&ce.value);return{usingDocker:w?!y:!!F,usingIsolation:w&&!re&&(b?.enableDockerNetwork||window.blocklet?.enableDockerNetwork)}},[e.configs,b?.enableDocker,b?.enableDockerNetwork,l.configs,e.meta.group]),{primaryStatus:K,secondaryStatus:H}=Bf(q,e.greenStatus);return t.jsxs(t.Fragment,{children:[t.jsxs(Pr,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[t.jsxs(Y,{sx:{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[t.jsx(Xo,{blocklet:e,ancestors:n}),t.jsxs(Y,{sx:{ml:"16px",minWidth:0},children:[t.jsxs(Y,{className:"component-header",onClick:()=>g(e),children:[t.jsx(Y,{className:"component-name",children:be.getDisplayName(e,!0)}),t.jsx(Y,{className:"component-version",children:e?.meta?.version})]}),t.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:.5},children:[K&&t.jsx(sr,{style:{whiteSpace:"nowrap"},status:K,source:e.source,progress:e.progress}),H&&(K==="running"&&rl[H]==="error"?t.jsx(Oe,{title:i("blocklet.status.failWithOldVersion"),children:t.jsx(Y,{sx:{display:"flex",color:"warning.main",ml:1},children:t.jsx(gr,{})})}):t.jsx(sr,{style:{whiteSpace:"nowrap"},status:H,source:e.source,progress:e.progress})),t.jsx(Za,{style:{whiteSpace:"nowrap"},mode:e.mode||""}),e.mode!=="development"&&V&&t.jsx(Oe,{title:i("blocklet.usingDocker"),children:t.jsx(Y,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(Ee,{icon:ti})})}),e.mode!=="development"&&xe&&t.jsx(Oe,{title:i("blocklet.usingIsolation"),children:t.jsx(Y,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(Ee,{icon:"streamline:network"})})}),!!e.dependents?.length&&t.jsx(Oe,{title:[`${i("common.dependents")}: `,e.dependents.map(w=>t.jsx(Y,{sx:{pl:1},children:`${Uo(w.id,l)} ${w.required?`(${i("common.required")})`:""}`},w.id))],children:t.jsx(Y,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(Ee,{icon:"octicon:package-dependents-16"})})})]})]})]},e),ni.hasMountPoint(e.meta)&&t.jsx(es,{blocklet:e,ancestors:n,mountPoint:$,href:G},$),t.jsx("div",{style:{flex:1}}),t.jsxs(Y,{sx:{display:"flex",alignItems:"center"},children:[be.hasStartEngine(e.meta)&&t.jsx(Oe,{title:i("common.visit"),children:t.jsx(Y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:G,rel:"noopener noreferrer",children:t.jsx(Re,{size:"small",children:t.jsx(li,{fontSize:"small"})})})}),t.jsx(Xi,{blocklet:l,component:e,onStart:a,onStop:o,disabled:!["starting","stopping"].includes(l.status)&&be.isInProgress(l.status)}),t.jsx(Re,{size:"small",onClick:()=>Q(!0),disabled:J||ee,children:t.jsx(di,{fontSize:"small"})}),t.jsx(ur,{color:"error",badgeContent:"",variant:"dot",invisible:!be.getComponentMissingConfigs(e,n[0]).length,children:t.jsx(ci,{"data-cy":"component-actions",actions:[be.hasStartEngine(e.meta)||If(e)?{icon:t.jsx(ta,{}),text:i("common.detail"),onClick:()=>{g(e)}}:null,{icon:t.jsx(ol,{}),text:i("common.restart"),onClick:()=>{u({title:`${i("common.restart")} ${e.meta.title}`,description:i("blocklet.action.restartDescription"),confirm:i("blocklet.action.confirmRestart"),cancel:i("common.cancel"),onConfirm:async()=>{D(!0),await d(e),D(!1),u(null)},onCancel:()=>u(null)})},disabled:T||J||ee||!be.isBlockletRunning(e)},K==="error"?{icon:t.jsx(ri,{}),text:i("common.stop"),onClick:()=>{u({title:`${i("common.stop")} ${e.meta.title}`,description:i("blocklet.action.stopDescription"),confirm:i("blocklet.action.confirmStop"),cancel:i("common.cancel"),onConfirm:async()=>{D(!0),await o(e),D(!1),u(null)},onCancel:()=>u(null)})},disabled:T||J||ee}:null,{icon:t.jsx(Cn,{}),text:i("common.delete"),onClick:()=>{P(!0)},disabled:J||ee||!!ae,tip:ae},{separator:!0},{icon:t.jsx(Ee,{icon:"mdi:variable"}),onClick:()=>{C(!0)},text:t.jsx(ur,{color:"error",badgeContent:"",variant:"dot",invisible:!be.getComponentMissingConfigs(e,n[0]).length,children:t.jsx(Y,{sx:{width:"100%"},children:i("common.environments")})}),disabled:J||ee},{icon:t.jsx(Ee,{icon:"heroicons:command-line"}),text:i("common.logs"),onClick:de,disabled:J||ee||!!ae,tip:ae}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),t.jsx(Sn,{},"line"),t.jsx(Ji,{componentInfo:v,onClose:g,blocklet:e,app:l,depth:r}),t.jsx(Zi,{blocklet:l,component:e,remove:me,onCancel:()=>P(!1),hideBtn:!0,showConfirm:R},"delete-component"),m&&t.jsx(bt,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel},"confirm-setting"),S&&t.jsx(xr,{open:!0,hiddenChildren:!0,onClose:()=>C(!1),blocklet:e,ancestors:n}),X&&t.jsx(Rr,{open:!0,onClose:()=>Q(!1),blocklet:e,ancestors:n})]})}cr.propTypes={blocklet:_.object.isRequired,ancestors:_.array,depth:_.number,onRemove:_.func,onStart:_.func,onStop:_.func,onRestart:_.func,getComponentUrl:_.func,app:_.object};const ur=we(Zo)`
|
|
666
|
+
.BaseBadge-badge {
|
|
667
|
+
top: ${e=>e.top*8||6}px;
|
|
668
|
+
right: ${e=>e.right*8||6}px;
|
|
669
|
+
}
|
|
670
|
+
`,Pr=we(Y)`
|
|
671
|
+
&:hover {
|
|
672
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
673
|
+
}
|
|
674
|
+
.component-header {
|
|
675
|
+
display: flex;
|
|
676
|
+
align-items: center;
|
|
677
|
+
align-items: flex-end;
|
|
678
|
+
cursor: pointer;
|
|
679
|
+
}
|
|
680
|
+
.component-name {
|
|
681
|
+
min-width: 0;
|
|
682
|
+
overflow: hidden;
|
|
683
|
+
text-overflow: ellipsis;
|
|
684
|
+
white-space: nowrap;
|
|
685
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
686
|
+
font-size: 16px;
|
|
687
|
+
}
|
|
688
|
+
.component-version {
|
|
689
|
+
color: ${({theme:e})=>e.palette.text.secondary};
|
|
690
|
+
font-size: 12px;
|
|
691
|
+
margin-left: 4px;
|
|
692
|
+
transform: translateY(-1px);
|
|
693
|
+
}
|
|
694
|
+
`;function ts({blocklet:e,ancestors:n=[],meta:r,dependencies:s=[],setInstallComponentMeta:a,logoUrl:o=""}){const d=Ie(),{t:c}=je(),l=()=>{r.bundleSource=e.bundleSource||{},a(r)},i=40;return t.jsxs(Df,{id:`optional-component-${r.did}`,children:[t.jsxs("div",{className:"cell",children:[t.jsxs("div",{className:"component-left",children:[t.jsx("div",{className:"component-logo",children:o?t.jsx("img",{src:o,onError:()=>`${d.imgPrefix}/blocklet.png`,alt:r.title,style:{width:i,height:i}}):t.jsx(Xo,{blocklet:e,ancestors:n})}),t.jsxs("div",{className:"component-header",children:[t.jsx("div",{className:"component-name",children:r.title}),t.jsx("div",{className:"component-version",children:r.version})]}),t.jsx(Oe,{title:[`${c("common.dependents")}: `,s.map(h=>t.jsx(Y,{sx:{pl:1},children:`${h.parentTitle} ${h.required?`(${c("common.required")})`:""}`},h.parentName+h.mount_point))],children:t.jsx(Y,{sx:{display:"flex",color:"primary.main",ml:1},children:t.jsx(Ee,{icon:"octicon:package-dependents-16"})})})]}),t.jsx("div",{style:{flex:1}}),t.jsx(Y,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:t.jsx(gn,{onClick:l,startIcon:t.jsx(Ee,{icon:"ph:download-simple-bold"}),children:c("common.install")})})]}),t.jsx(Sn,{class:"line"},"line")]})}ts.propTypes={meta:_.object.isRequired,blocklet:_.object.isRequired,ancestors:_.array,setInstallComponentMeta:_.func.isRequired,logoUrl:_.string,dependencies:_.arrayOf(_.shape({parentDid:_.string,parentName:_.string,parentPoint:_.string,required:_.bool}))};const Df=we(Pr)`
|
|
695
|
+
.line {
|
|
696
|
+
opacity: 0.5;
|
|
697
|
+
}
|
|
698
|
+
.cell {
|
|
699
|
+
display: flex;
|
|
700
|
+
width: 100%;
|
|
701
|
+
flex-direction: row;
|
|
702
|
+
align-items: center;
|
|
703
|
+
justify-content: flex-start;
|
|
704
|
+
padding-top: 16px;
|
|
705
|
+
padding-bottom: 16px;
|
|
706
|
+
}
|
|
707
|
+
.component-left {
|
|
708
|
+
display: flex;
|
|
709
|
+
flex-direction: row;
|
|
710
|
+
justify-content: flex-start;
|
|
711
|
+
align-items: center;
|
|
712
|
+
min-width: 0;
|
|
713
|
+
}
|
|
714
|
+
.component-logo {
|
|
715
|
+
width: 40px;
|
|
716
|
+
margin-left: 16px;
|
|
717
|
+
opacity: 0.5;
|
|
718
|
+
border-radius: 10px;
|
|
719
|
+
overflow: hidden;
|
|
720
|
+
}
|
|
721
|
+
.component-header {
|
|
722
|
+
flex: 1;
|
|
723
|
+
min-width: 0;
|
|
724
|
+
opacity: 0.5;
|
|
725
|
+
margin-left: 12px;
|
|
726
|
+
display: flex;
|
|
727
|
+
align-items: center;
|
|
728
|
+
align-items: flex-end;
|
|
729
|
+
cursor: pointer;
|
|
730
|
+
}
|
|
731
|
+
.component-name {
|
|
732
|
+
flex: 1;
|
|
733
|
+
opacity: 0.5;
|
|
734
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
735
|
+
font-size: 16px;
|
|
736
|
+
}
|
|
737
|
+
.component-version {
|
|
738
|
+
opacity: 0.8;
|
|
739
|
+
color: ${({theme:e})=>e.palette.grey[400]};
|
|
740
|
+
font-size: 12px;
|
|
741
|
+
margin-left: 4px;
|
|
742
|
+
transform: translateY(-1px);
|
|
743
|
+
}
|
|
744
|
+
`;function ns({blocklet:e,onUpdate:n=()=>{},getComponentUrl:r=()=>window.location.origin,...s}){const{t:a}=U.useContext(Me),{api:o,inService:d,info:c}=Ie(),{addDeletingDid:l,removeDeletingDid:i,matchDeletingDid:h}=hr(),[p,v]=U.useState(!1),[g,R]=U.useState(null),[P,T]=U.useState(null),[D,m]=U.useState(!1),[u,b]=U.useState(!1),[E,S]=U.useState(!1),[C,X]=U.useState(!1),[Q,k]=U.useState(null),q=e&&e.structVersion!==ue.APP_STRUCT_VERSION,[$,G]=U.useState(!1),J=[...e.children];e.meta.group!=="gateway"&&J.unshift(e),h(J.map(F=>F.meta.did));const ee=async()=>{if(!p){v(!0);try{const{updateId:F,updateList:re}=(await o.checkComponentsForUpdates({input:{did:e.meta.did}})).preUpdateInfo||{};if(v(!1),!F){fe.info(a("blocklet.component.noUpdate"));return}const ce=[];be.forEachChildSync(e,(he,{id:f,ancestors:x})=>{const j=re.find(O=>O.id===f);if(j){const O=x.slice(1).concat(he).map(L=>L.meta.title||L.meta.name).join(" / "),I=(x[1]||he).meta.did;ce.push({groupId:I,name:O,version:he.meta.version,newVersion:j.meta.version})}});const oe={};ce.forEach(he=>{oe[he.groupId]?he.disabled=!0:oe[he.groupId]=!0}),R({params:{updateId:F},list:ce,checks:oe,hasChecks:!0})}catch(F){v(!1),fe.error(Pe(F))}}},ae=async()=>{if(!p)try{v(!0);const F=Object.keys(g.checks).filter(ce=>g.checks[ce]),re={updateId:g.params.updateId,rootDid:e.meta.did,selectedComponents:F};await o.upgradeComponents({input:re}),v(!1),R(null),G(null)}catch(F){v(!1),fe.error(Pe(F))}},de=async(F,re)=>{l(F.meta.did);try{await o.deleteComponent({input:{did:F.meta.did,keepData:re==="keepData",rootDid:e.meta.did}}),await kt(800)}catch(ce){fe.error(Pe(ce)),i(F.meta.did)}},me=async F=>{try{await o.startBlocklet({input:{did:e.meta.did,componentDids:[F.meta.did]}}),await kt(800)}catch(re){fe.error(Pe(re))}},V=async F=>{try{await o.stopBlocklet({input:{did:e.meta.did,componentDids:[F.meta.did]}}),await kt(800)}catch(re){fe.error(Pe(re))}},xe=async F=>{try{await o.restartBlocklet({input:{did:e.meta.did,componentDids:[F.meta.did]}}),await kt(800)}catch(re){fe.error(Pe(re))}},K=(F,re)=>{const{checked:ce}=F.target;R(oe=>{const he=Object.entries(oe.checks).reduce((x,[j,O])=>(x[j]=re===j||re==="all"?ce:O,x),{}),f=Object.values(he).includes(!0);return{...oe,checks:he,hasChecks:f}})},H=U.useMemo(()=>g?.list.filter(F=>!F.disabled).every(F=>g.checks[F.groupId]),[g]);vf(ee);const w=bf({blocklet:e,scrollToComponent:!0}),y=Q||w;return t.jsxs(Of,{component:"div",...s,onUpdate:n,children:[t.jsxs(Nf,{display:"flex",children:[t.jsxs(Lf,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[J?.length?`${a("common.components")} (${J.length})`:`${a("common.components")}`,!q&&t.jsx(or,{permission:d?"":"mutate_blocklets",role:d?Tt:[],children:t.jsx(fi,{children:t.jsx(ur,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!$,children:t.jsxs(He,{disabled:p||be.isInProgress(e.status),onClick:()=>{ee()},"data-cy":"check-for-updates",children:[t.jsx(Y,{sx:{ml:.5,mr:.5,display:"flex"},children:p?t.jsx(Le,{size:16}):t.jsx(fl,{style:{fontSize:"1em"}})}),a("blocklet.component.checkUpdateTitle")]})})})})]}),t.jsx(or,{permission:d?"":"mutate_blocklets",role:d?Tt:[],children:t.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:.5},children:[!q&&t.jsx(Wi,{blocklet:e,serverVersion:c.version,disabled:p||be.isInProgress(e.status)}),t.jsx(ci,{"data-cy":"component-actions",actions:[{icon:t.jsx(Ee,{icon:"fluent:link-20-filled"}),onClick:()=>b(!0),text:a("router.rule.add.title"),disabled:p||be.isInProgress(e.status)},...q?[]:[{icon:t.jsx(Ee,{icon:"mdi:variable"}),onClick:()=>{S(!0)},text:a("common.environments")},{icon:t.jsx(di,{}),onClick:()=>{X(!0)},text:a("common.preferences")}]].filter(Boolean)})]})})]}),J?.length?t.jsxs(t.Fragment,{children:[t.jsxs(Y,{sx:{mt:2},children:[e.meta.group!=="gateway"&&t.jsx(cr,{blocklet:e,app:e,onRemove:de,onStart:me,onStop:V,onRestart:xe,getComponentUrl:r},`0-${e.meta.did}`),e.children.map(F=>t.jsx(cr,{depth:1,blocklet:F,ancestors:[e],app:e,onRemove:de,onStart:me,onStop:V,onRestart:xe,getComponentUrl:r},`1-${F.meta.did}`))]},`top-blocklet-${e.meta.did}`),e.optionalComponents?.map(F=>t.jsx(Pr,{children:t.jsx(ts,{blocklet:F,ancestors:[e],setInstallComponentMeta:k,...F})},F.meta.did))]}):t.jsx(Y,{sx:{mt:8},children:t.jsx(sa,{children:a("blocklet.component.noComponent")})}),!!e.site.rules.length&&t.jsx(Y,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:t.jsx(xf,{})}),!!g&&t.jsx($r,{open:!0,fullWidth:!0,children:t.jsxs(Y,{sx:{paddingY:1.5},children:[t.jsx(Fr,{children:a("blocklet.component.updateTitle")}),t.jsxs(Y,{component:qr,sx:{py:4},children:[g.list.filter(F=>!F.disabled).length>1&&t.jsxs(Y,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(zr,{checked:H,onChange:F=>K(F,"all")}),t.jsx(Y,{children:a(H?"common.unselectAll":"common.selectAll")})]}),g.list.map(F=>t.jsxs(Y,{sx:{display:"flex",alignItems:"center",mb:1},children:[t.jsx(zr,{checked:g.checks[F.groupId],onChange:re=>K(re,F.groupId),style:{marginLeft:F.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:F.disabled}),t.jsxs(Y,{sx:{flexGrow:1},children:[t.jsx(Y,{xs:8,sx:{pt:1},children:F.name}),F.version&&t.jsxs(tt,{container:!0,spacing:2,sx:{fontSize:"h6.fontSize",alignItems:"center"},children:[t.jsx(tt,{size:3,children:F.version}),t.jsx(tt,{size:1,children:t.jsx(na,{style:{fontSize:"0.9em"}})}),t.jsx(tt,{size:3,children:t.jsx(Y,{sx:{color:"secondary.main"},children:F.newVersion})})]})]},`${F.name}-${F.newVersion}`)]},F.name))]}),t.jsxs(ra,{style:{padding:"8px 24px 24px"},children:[t.jsx(He,{onClick:()=>{R(null)},children:a("common.cancel")}),t.jsxs(He,{onClick:F=>{F.stopPropagation(),ae()},color:"primary",disabled:p||!g.hasChecks,variant:"contained",autoFocus:!0,children:[p&&t.jsx(Le,{size:16}),a("common.update")]})]})]})}),!!P&&t.jsx($r,{open:!0,fullWidth:!0,onClose:()=>T(!1),children:t.jsxs(Y,{sx:{paddingY:1.5},children:[t.jsx(Fr,{children:a("common.configuration")}),t.jsx(qr,{children:t.jsx(Y,{sx:{py:2},children:t.jsx(rr,{control:t.jsx(ua,{checked:D,onChange:F=>m(!!F.target.checked)}),label:a("blocklet.component.showContainer")})})})]})}),t.jsx(_r,{selectedMeta:y,blocklet:e,showDialog:!!y,setShowDialog:()=>k(null)}),u&&t.jsx(Gi,{hiddenChildren:!0,open:!0,onClose:()=>b(!1)}),E&&t.jsx(xr,{open:!0,onClose:()=>S(!1),hiddenChildren:!0,blocklet:e,ancestors:[]}),C&&t.jsx(Rr,{open:!0,onClose:()=>X(!1),blocklet:e,ancestors:[]})]})}ns.propTypes={blocklet:_.object.isRequired,onUpdate:_.func,getComponentUrl:_.func};const Of=we.div`
|
|
745
|
+
.title {
|
|
746
|
+
font-size: 1.2rem;
|
|
747
|
+
font-weight: bold;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
@keyframes showDelay {
|
|
751
|
+
0% {
|
|
752
|
+
opacity: 0;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
100% {
|
|
756
|
+
opacity: 1;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.component-item {
|
|
761
|
+
animation: showDelay 0.75s ease 1;
|
|
762
|
+
}
|
|
763
|
+
`,Nf=we(Y)`
|
|
764
|
+
${e=>e.theme.breakpoints.up("sm")} {
|
|
765
|
+
flex-direction: row;
|
|
766
|
+
justify-content: space-between;
|
|
767
|
+
align-items: center;
|
|
768
|
+
}
|
|
769
|
+
${e=>e.theme.breakpoints.down("sm")} {
|
|
770
|
+
flex-direction: column;
|
|
771
|
+
justify-content: flex-end;
|
|
772
|
+
align-items: flex-end;
|
|
773
|
+
.sm-hide-icon > svg {
|
|
774
|
+
display: none;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
`,Lf=we(Y)`
|
|
778
|
+
${e=>e.theme.breakpoints.down("sm")} {
|
|
779
|
+
width: 100%;
|
|
780
|
+
justify-content: space-between;
|
|
781
|
+
}
|
|
782
|
+
`;function cm(e){const{locale:n}=U.useContext(Me),{blocklet:r,recommendedDomain:s}=al(),a=o=>oa({blocklet:r,domain:{value:s||`${ia.encode(r.appPid)}.${ue.DEFAULT_DID_DOMAIN}`},mountPoint:o,params:pr(r,n)});return t.jsx(ns,{blocklet:r,getComponentUrl:a,...e})}export{cm as default};
|