@abtnode/webapp 1.16.28 → 1.16.29-beta-0070353c
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/{Add-B8Ae2MjM.js → Add-BtLBv8RH.js} +1 -1
- package/dist/assets/{ArrowDropDown-BNt-WuI3.js → ArrowDropDown-BNLFLaKM.js} +1 -1
- package/dist/assets/{Autocomplete-Bo6UH2XL.js → Autocomplete-CVMLhogk.js} +1 -1
- package/dist/assets/{Breadcrumbs-CkmMkQDW.js → Breadcrumbs-CbySC_59.js} +1 -1
- package/dist/assets/{ButtonGroup-OcQcEz6r.js → ButtonGroup-DOhNpzpa.js} +1 -1
- package/dist/assets/{CheckCircle-BnRenrK4.js → CheckCircle-DV3NdWd1.js} +1 -1
- package/dist/assets/{ChevronLeft-Dp9aa91c.js → ChevronLeft-Bs6yI2R9.js} +1 -1
- package/dist/assets/{ChevronRight-C3NPaw6o.js → ChevronRight-D3SoQeN4.js} +1 -1
- package/dist/assets/{Close-Cbaq-RRq.js → Close-D3TvnCuM.js} +1 -1
- package/dist/assets/Delete-BEWLPqF6.js +1 -0
- package/dist/assets/DeleteOutline-CLuHNgk7.js +1 -0
- package/dist/assets/DeleteOutline-y9OF7zr1.js +1 -0
- package/dist/assets/{Done-BCLH1e-Y.js → Done-BV1sh6t2.js} +1 -1
- package/dist/assets/{Edit-i_Bman7K.js → Edit-Dxu2GeqU.js} +1 -1
- package/dist/assets/{EditIcon-DmNEjmIQ.js → EditIcon-Wn4LUZPl.js} +1 -1
- package/dist/assets/{FilterList-fpG1-3KQ.js → FilterList-Ct9UcCML.js} +1 -1
- package/dist/assets/{Google-DLkd6TAZ.js → Google-C07e65fF.js} +3 -3
- package/dist/assets/{Https-amCzjB1a.js → Https-BY-90ira.js} +1 -1
- package/dist/assets/{InputAdornment-C6LFxcti.js → InputAdornment-C6wsqdZK.js} +1 -1
- package/dist/assets/{InputLabel-avYwCvJM.js → InputLabel-BKDMs5hY.js} +1 -1
- package/dist/assets/{LastPage-DnBOlrut.js → LastPage-BxVeiJ-c.js} +1 -1
- package/dist/assets/{Launch-DPclIZbd.js → Launch-C-oETX-0.js} +1 -1
- package/dist/assets/{Link-DfSEdivF.js → Link-xROjqNZs.js} +1 -1
- package/dist/assets/{LoadingButton-xveWP_M5.js → LoadingButton-BIQfIg6d.js} +1 -1
- package/dist/assets/{LockIcon-9c7sG23a.js → LockIcon-CU1S2bME.js} +1 -1
- package/dist/assets/{Loop-DwAWKPvc.js → Loop-DAUngqMg.js} +1 -1
- package/dist/assets/{MoreVert-Nc1QBj2D.js → MoreVert-7yr_Whs5.js} +1 -1
- package/dist/assets/{Pagination-D5t0OCBH.js → Pagination-56H6v6JO.js} +1 -1
- package/dist/assets/{Public-BLh26Bb9.js → Public-iuGOu6O-.js} +1 -1
- package/dist/assets/{SchemaReference.es--oFfd0mm.js → SchemaReference.es-BYW_VZrE.js} +1 -1
- package/dist/assets/{Search-DnnCUnjB.js → Search-H33KEmee.js} +1 -1
- package/dist/assets/{Select-CBA-xyOJ.js → Select-qp0JQJcs.js} +2 -2
- package/dist/assets/{Skeleton-CQPjJHp3.js → Skeleton-qLcD_DNR.js} +5 -5
- package/dist/assets/{Slider-Bdpm9oO4.js → Slider-DNycUSdY.js} +1 -1
- package/dist/assets/{Stepper-UEQaZPW7.js → Stepper-sVD4C8Z2.js} +1 -1
- package/dist/assets/TextField-DUu48qpa.js +1 -0
- package/dist/assets/{ToggleButtonGroup-Drarswgi.js → ToggleButtonGroup-BYxfmC-0.js} +1 -1
- package/dist/assets/{ViewList-CoYI2XgO.js → ViewList-tc3iCWk6.js} +1 -1
- package/dist/assets/actions-5cGwZUC4.js +11 -0
- package/dist/assets/{actions-BAUfPsQv.js → actions-liZ1BI_O.js} +1 -1
- package/dist/assets/{agreement-_qYynElX.js → agreement-Cv6KX9ge.js} +3 -3
- package/dist/assets/api-BtaHDJED.js +1 -0
- package/dist/assets/app-avatar-B8i6B60Z.js +1 -0
- package/dist/assets/ar-Xzqk5Iho.js +1 -0
- package/dist/assets/{audit-logs-BqT_1MLt.js → audit-logs-Dijkdsja.js} +1 -1
- package/dist/assets/{brace-fold.es-CkrKXotH.js → brace-fold.es-DEA3m3Yb.js} +1 -1
- package/dist/assets/{bundle-avatar-RiFaz1Hb.js → bundle-avatar-BJ0k12JQ.js} +1 -1
- package/dist/assets/{chart-Cinf5zq_.js → chart-CMNEIxt8.js} +1 -1
- package/dist/assets/click-to-copy-DCp7mwue.js +1 -0
- package/dist/assets/{closebrackets.es-C32XuxI5.js → closebrackets.es-DADylHhw.js} +1 -1
- package/dist/assets/{codemirror.es-oms3GpFv.js → codemirror.es-D20kOkw6.js} +1 -1
- package/dist/assets/{comment.es-AVZXTIDr.js → comment.es-MMF0T-w1.js} +1 -1
- package/dist/assets/config-navigation-BEQQEhRp.js +25 -0
- package/dist/assets/de-B5fZJ8dI.js +1 -0
- package/dist/assets/delete-confirm-BHi-kfB3.js +1 -0
- package/dist/assets/{detail-CHKmnQLc.js → detail-Dvux3-xO.js} +3 -3
- package/dist/assets/{dialog.es-DHZdXjGS.js → dialog.es-Ck61atwe.js} +1 -1
- package/dist/assets/{download-DFPnF7mz.js → download-CGFnXDN3.js} +1 -1
- package/dist/assets/es-NWsIjqyt.js +1 -0
- package/dist/assets/{foldgutter.es-CSicbQSJ.js → foldgutter.es-tx788t2M.js} +1 -1
- package/dist/assets/fr-3m-rGPek.js +1 -0
- package/dist/assets/getValidReactChildren-CwN_gBVm.js +1 -0
- package/dist/assets/hi-BFzaaE9h.js +1 -0
- package/dist/assets/{hint.es-DAEQ9N76.js → hint.es--88Ij-Z1.js} +1 -1
- package/dist/assets/{hint.es2-DYXluLKu.js → hint.es2-CHJZyRjO.js} +1 -1
- package/dist/assets/id-CqIvQHOy.js +1 -0
- package/dist/assets/{iframe-DwuYX0Xq.js → iframe-Ba9in6Qd.js} +1 -1
- package/dist/assets/index--1f0rUbj.js +1 -0
- package/dist/assets/{index-CiZAReVP.js → index-7F2o6Jsk.js} +1 -1
- package/dist/assets/{index-DfNh08gP.js → index-95VdVy22.js} +3 -3
- package/dist/assets/{index-CqcpZ8C3.js → index-B3xG4j_m.js} +138 -174
- package/dist/assets/index-B5tU_YHI.js +1 -0
- package/dist/assets/{index-rPqHtLu4.js → index-B6ReVzVm.js} +1 -1
- package/dist/assets/index-B8n5bnN_.js +21 -0
- package/dist/assets/index-BHJdK_O3.js +58 -0
- package/dist/assets/{index-BnFWpIPQ.js → index-BNWW9QCy.js} +1 -1
- package/dist/assets/{index-BbS1Wq4p.js → index-BVXZUuf0.js} +1 -1
- package/dist/assets/{index-B60jROHj.js → index-BXZatxx9.js} +26 -26
- package/dist/assets/{index-zFXZLqso.js → index-BXm4LNPa.js} +2 -2
- package/dist/assets/{index-CKOyruf_.js → index-BwcvZbXh.js} +2 -2
- package/dist/assets/{index-DSByvARI.js → index-C0LCtUas.js} +1 -1
- package/dist/assets/{index-BKck0oIO.js → index-C7NLvxl6.js} +10 -10
- package/dist/assets/{index-CucnV9EX.js → index-CCdVS7OU.js} +25 -25
- package/dist/assets/{index-CHjwpGia.js → index-CEUa2l6u.js} +7 -7
- package/dist/assets/{index-ECk6dODK.js → index-CKheAcLC.js} +8 -8
- package/dist/assets/{index-0RUAEm49.js → index-CT6zfoli.js} +2 -2
- package/dist/assets/{index-D5MDxbqt.js → index-CbJHqm-m.js} +1 -1
- package/dist/assets/{index-7J6TijHC.js → index-CbqTMT0M.js} +1 -1
- package/dist/assets/{index-ByF3apMm.js → index-CcMLziaQ.js} +10 -10
- package/dist/assets/{index-v2cqn0eS.js → index-D1O_uQCI.js} +1 -1
- package/dist/assets/index-D1a5kAoh.js +177 -0
- package/dist/assets/{index-DrWhB0MJ.js → index-DCIg29rr.js} +1 -1
- package/dist/assets/{index-CZKHzmkC.js → index-DDz0k3Ws.js} +1 -1
- package/dist/assets/{index-9R6mPPbN.js → index-DGlwKQhV.js} +1 -1
- package/dist/assets/{index-Cl2QG8J6.js → index-DLHAB9Og.js} +2 -2
- package/dist/assets/{index-DHYJxTcV.js → index-D_QwsmGj.js} +57 -57
- package/dist/assets/{index-DKkTRBZn.js → index-DtVh1vWj.js} +4 -4
- package/dist/assets/{index-CyYUysSv.js → index-DzUYpFr5.js} +1 -1
- package/dist/assets/{index-CtzAe2AR.js → index-F8-V5r_A.js} +1 -1
- package/dist/assets/{index-BBnT5XB9.js → index-G_UgMU_Q.js} +1 -1
- package/dist/assets/{index-BKi0XLcv.js → index-K_ohrRtr.js} +1 -1
- package/dist/assets/{index-baq8DMtQ.js → index-X6nP96CH.js} +9 -9
- package/dist/assets/{index-DPx9NPlp.js → index-_JUCPX9w.js} +1 -1
- package/dist/assets/index-_Rmvlr0x.js +54 -0
- package/dist/assets/{index-cmiUur_8.js → index-aeZEXpF8.js} +1 -1
- package/dist/assets/{index-BVznp3M0.js → index-cAvy7d1t.js} +1 -1
- package/dist/assets/{index-DOsg2sHH.js → index-hBHLssQH.js} +1 -1
- package/dist/assets/{index-CIbzY-F7.js → index-oIMmMbXf.js} +1 -1
- package/dist/assets/{index-BbW2IRRR.js → index-vBDPHvLZ.js} +3 -3
- package/dist/assets/index-yTbErKca.js +1 -0
- package/dist/assets/{index-DV2quTIn.js → index-yd48Xv1r.js} +1 -1
- package/dist/assets/{index.es-Dkh9ejMp.js → index.es-bQWoWWGc.js} +1 -1
- package/dist/assets/{index.esm-Hqw0Nfnx.js → index.esm-B46G3n1W.js} +1 -1
- package/dist/assets/{info-addon.es-5NmROke-.js → info-addon.es-C7hj7g_M.js} +1 -1
- package/dist/assets/{info.es-CsELEfUv.js → info.es-6OPdC5N7.js} +1 -1
- package/dist/assets/{install-from-url-DXGlT7R8.js → install-from-url-8E3AOsnG.js} +1 -1
- package/dist/assets/{invitation-CSNEw5oM.js → invitation-DNaeN_XA.js} +7 -7
- package/dist/assets/{is-path-prefix-equal-CoJozASB.js → is-path-prefix-equal-Cr1mF6oQ.js} +1 -1
- package/dist/assets/{isEqual-BLnnfE4T.js → isEqual-CKWAVZDl.js} +1 -1
- package/dist/assets/{item-tD3jAfba.js → item-DclPrDJI.js} +22 -22
- package/dist/assets/ja-BIN09j9q.js +1 -0
- package/dist/assets/{javascript.es-BIUhEWTj.js → javascript.es-CsAX6BU6.js} +1 -1
- package/dist/assets/{jump-to-line.es-BQjWkUgo.js → jump-to-line.es-CLiQWQ0t.js} +1 -1
- package/dist/assets/{jump.es-D8ZxFsmc.js → jump.es-CJpdaiK6.js} +1 -1
- package/dist/assets/ko-Bielz7e2.js +1 -0
- package/dist/assets/{line-DW0juCGB.js → line-Cl2Sh_RP.js} +4 -4
- package/dist/assets/{lint.es-Dv2pWRyz.js → lint.es-DIolFfiW.js} +1 -1
- package/dist/assets/{lint.es2-CqGQ_rnk.js → lint.es2-Cvgl75-5.js} +1 -1
- package/dist/assets/{lint.es3-g58ofVJA.js → lint.es3-CXryUW3Q.js} +1 -1
- package/dist/assets/{list-header-tjKXNgOR.js → list-header-Bkg090yH.js} +1 -1
- package/dist/assets/{log-BFiA_Tyh.js → log-HXa-ya9d.js} +1 -1
- package/dist/assets/{lottie-yeTV0Y2m.js → lottie-CcK7qdKQ.js} +1 -1
- package/dist/assets/{matchbrackets.es-B-Xj5H9Q.js → matchbrackets.es-CLCMqvrU.js} +1 -1
- package/dist/assets/{memory-C7a59RsU.js → memory-L0qciQ6s.js} +1 -1
- package/dist/assets/{mode.es-BSNxo6gK.js → mode.es-DcbjvRDB.js} +1 -1
- package/dist/assets/{mode.es2-C1LDwVOl.js → mode.es2-B7tplvBs.js} +1 -1
- package/dist/assets/{mode.es3-C6-ZTyOk.js → mode.es3--q2Yuwu4.js} +1 -1
- package/dist/assets/{onlineParser.es-BzK7GlZv.js → onlineParser.es-BhtKrfa4.js} +1 -1
- package/dist/assets/overview-BFTJeNdA.js +23 -0
- package/dist/assets/pt-CSM7xevJ.js +1 -0
- package/dist/assets/{react-1fE0Sobf.js → react-C6-l77Z4.js} +7 -7
- package/dist/assets/{redux-hfExDDyr.js → redux-CLRT_Hpo.js} +1 -1
- package/dist/assets/{resource-dialog-DinbvH2C.js → resource-dialog-LvH-UYoC.js} +1 -1
- package/dist/assets/ru-C7jyAqCz.js +1 -0
- package/dist/assets/{runtime-tAjj0dmb.js → runtime-C1VzJAPy.js} +1 -1
- package/dist/assets/{search.es-DxfjuUNu.js → search.es-D_OTPxgw.js} +1 -1
- package/dist/assets/{searchcursor.es-C0Z2DY1c.js → searchcursor.es-BoGLQY-b.js} +1 -1
- package/dist/assets/service-DlopFa_B.js +1 -0
- package/dist/assets/{show-hint.es-q24U0q_A.js → show-hint.es-DidyZtAn.js} +1 -1
- package/dist/assets/{slicedToArray-CYGiqzmA.js → slicedToArray-g3KCCF__.js} +1 -1
- package/dist/assets/{spaces-C58gy1rM.js → spaces-BXx_g7nZ.js} +1 -1
- package/dist/assets/{sublime.es-BffqyCoy.js → sublime.es-f8BbokxV.js} +1 -1
- package/dist/assets/{switch-control-CuPWIx6T.js → switch-control-DnqITY5F.js} +1 -1
- package/dist/assets/{table-icons-DOOoyljy.js → table-icons-DoTJ5_gb.js} +10 -10
- package/dist/assets/{tag-Cxx1sXPF.js → tag-BblwJaFN.js} +1 -1
- package/dist/assets/{team-BynFP1rM.js → team-8IvUk6FA.js} +1 -1
- package/dist/assets/th-CWUx-4Dk.js +1 -0
- package/dist/assets/toUpper-2i2_fO5k.js +1 -0
- package/dist/assets/{traffic-D03HdfGL.js → traffic-B58GrB_8.js} +5 -5
- package/dist/assets/{url-evaluation-dheoi_Nj.js → url-evaluation-COaPCQQI.js} +4 -4
- package/dist/assets/{url-join-DMIMYkEk.js → url-join-BxAyYKSd.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-DWywlTbc.js → use-blocklet-info-for-connect-did-spaces-BKdy9KQ6.js} +1 -1
- package/dist/assets/{useLocalStorage-C3GQNaV2.js → useLocalStorage-oY64NyFX.js} +1 -1
- package/dist/assets/{util-cf4pvQDW.js → util-CSu6YJU0.js} +1 -1
- package/dist/assets/vi-CngGsWGn.js +1 -0
- package/dist/assets/{wait-container-BwlRhWl0.js → wait-container-BSfEt36J.js} +4 -4
- package/dist/assets/withStyles-L-lfwOe4.js +1 -0
- package/dist/assets/wrap-locale-8tSZ7ptg.js +1 -0
- package/dist/assets/{zh-OQY8LvIH.js → zh-BLQ-Lx7C.js} +2 -2
- package/dist/assets/zh-tw-ODzXBbzv.js +1 -0
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/Delete-CnrKsAGC.js +0 -1
- package/dist/assets/DeleteOutline-B4LqoCK2.js +0 -1
- package/dist/assets/TextField-DjRhIjo4.js +0 -1
- package/dist/assets/actions-C1t0ka-G.js +0 -11
- package/dist/assets/api-xvCGCwMn.js +0 -1
- package/dist/assets/app-avatar-DcgC0kB0.js +0 -1
- package/dist/assets/ar-B5gcsN0k.js +0 -1
- package/dist/assets/click-to-copy-Bj13kdln.js +0 -1
- package/dist/assets/config-navigation-LFUjTzgk.js +0 -25
- package/dist/assets/de-WUCASh9G.js +0 -1
- package/dist/assets/delete-confirm-BoeDYrYX.js +0 -1
- package/dist/assets/es-DsRorAcf.js +0 -1
- package/dist/assets/fr-CUMFVKph.js +0 -1
- package/dist/assets/getValidReactChildren-GMOIXwRG.js +0 -1
- package/dist/assets/hi-BinC6-tx.js +0 -1
- package/dist/assets/id-BVFhYsL8.js +0 -1
- package/dist/assets/index-DU7hJgoO.js +0 -1
- package/dist/assets/index-DcU_Cijj.js +0 -1
- package/dist/assets/index-DmPgcoiv.js +0 -150
- package/dist/assets/index-DsUZ7uiP.js +0 -58
- package/dist/assets/index-HOVCi07-.js +0 -54
- package/dist/assets/index-ZQu91rXz.js +0 -21
- package/dist/assets/ja-B1xj2XMp.js +0 -1
- package/dist/assets/ko-Buo9FEc0.js +0 -1
- package/dist/assets/overview-BlWFlRx2.js +0 -23
- package/dist/assets/pt-fvVMjgC8.js +0 -1
- package/dist/assets/ru-OQD02sOm.js +0 -1
- package/dist/assets/service-1GhnQw9a.js +0 -1
- package/dist/assets/th-DaDxf6qI.js +0 -1
- package/dist/assets/toUpper-mYvRPeiI.js +0 -1
- package/dist/assets/vi-D2hO2mdU.js +0 -1
- package/dist/assets/withStyles-BkcRLEgx.js +0 -1
- package/dist/assets/wrap-locale-BqGpRCMA.js +0 -1
- package/dist/assets/zh-tw-Dd8o0udA.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var
|
|
1
|
+
var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var V=(e,t,n)=>(Ht(e,typeof t!="symbol"?t+"":t,n),n);import{P as l,j as d,ce,fN as ot,fO as Ut,r as T,cn as Dt,ci as Bt,a2 as Qt,fP as _e,dQ as Vt,dO as Wt,fQ as Zt,dN as Gt,d6 as A,a7 as Jt,a8 as Yt,fR as Xt,O as P,fS as Kt,m as en,fT as tn,fU as nn,B as on,fV as rn,fz as rt,q as te,fW as sn,fX as cn,co as an,fY as ln,s as M,fZ as st,f_ as un,c8 as it,f$ as fn,aA as ct,bU as de,b3 as dn,ba as pn,cp as at,g0 as hn}from"./index-B3xG4j_m.js";/**
|
|
2
2
|
* (c) Iconify
|
|
3
3
|
*
|
|
4
4
|
* For the full copyright and license information, please view the license.txt
|
|
@@ -8,7 +8,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
* @version 1.0.8
|
|
11
|
-
*/const lt=Object.freeze({left:0,top:0,width:16,height:16}),J=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),U=Object.freeze({...lt,...J}),pe=Object.freeze({...U,body:"",hidden:!1}),gn=Object.freeze({width:null,height:null}),ut=Object.freeze({...gn,...J});function mn(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const yn=/[\s,]+/;function bn(e,t){t.split(yn).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const ft={...ut,preserveAspectRatio:""};function _e(e){const t={...ft},n=(r,o)=>e.getAttribute(r)||o;return t.width=n("width",null),t.height=n("height",null),t.rotate=mn(n("rotate","")),bn(t,n("flip","")),t.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),t}function xn(e,t){for(const n in ft)if(e[n]!==t[n])return!0;return!1}const _=/^[a-z0-9]+(-[a-z0-9]+)*$/,B=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),u={provider:o.length>0?o[0]:r,prefix:c,name:a};return t&&!Z(u)?null:u}const s=o[0],i=s.split("-");if(i.length>1){const a={provider:r,prefix:i.shift(),name:i.join("-")};return t&&!Z(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return t&&!Z(a,n)?null:a}return null},Z=(e,t)=>e?!!((e.provider===""||e.provider.match(_))&&(t&&e.prefix===""||e.prefix.match(_))&&e.name.match(_)):!1;function wn(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Fe(e,t){const n=wn(e,t);for(const r in pe)r in J?r in e&&!(r in n)&&(n[r]=J[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function vn(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(i){if(n[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=r[i]&&r[i].parent,c=a&&s(a);c&&(o[i]=[a].concat(c))}return o[i]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(s),o}function kn(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function i(a){s=Fe(r[a]||o[a],s)}return i(t),n.forEach(i),Fe(e,s)}function dt(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=vn(e);for(const o in r){const s=r[o];s&&(t(o,kn(e,o,s)),n.push(o))}return n}const jn={provider:"",aliases:{},not_found:{},...lt};function ae(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function pt(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ae(e,jn))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(_)||typeof s.body!="string"||!ae(s,pe))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(_)||typeof i!="string"||!n[i]&&!r[i]||!ae(s,pe))return null}return t}const Y=Object.create(null);function In(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function L(e,t){const n=Y[e]||(Y[e]=Object.create(null));return n[t]||(n[t]=In(e,t))}function ve(e,t){return pt(t)?dt(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Sn(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function Tn(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Y)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(Y[o]||{})).forEach(i=>{const a=L(o,i);n=n.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),n}let z=!1;function ht(e){return typeof e=="boolean"&&(z=e),z}function H(e){const t=typeof e=="string"?B(e,!0,z):e;if(t){const n=L(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function gt(e,t){const n=B(e,!0,z);if(!n)return!1;const r=L(n.provider,n.prefix);return Sn(r,n.name,t)}function ze(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),z&&!t&&!e.prefix){let o=!1;return pt(e)&&(e.prefix="",dt(e,(s,i)=>{i&>(s,i)&&(o=!0)})),o}const n=e.prefix;if(!Z({provider:t,prefix:n,name:"a"}))return!1;const r=L(t,n);return!!ve(r,e)}function Cn(e){return!!H(e)}function An(e){const t=H(e);return t?{...U,...t}:null}function Pn(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,i=o.prefix,a=o.name,c=n[s]||(n[s]=Object.create(null)),u=c[i]||(c[i]=L(s,i));let f;a in u.icons?f=t.loaded:i===""||u.missing.has(a)?f=t.missing:f=t.pending;const p={provider:s,prefix:i,name:a};f.push(p)}),t}function mt(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function Mn(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const i=s.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const u=c.name;if(e.icons[u])i.loaded.push({provider:r,prefix:o,name:u});else if(e.missing.has(u))i.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),i.pending.length!==a&&(n||mt([e],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let Nn=0;function Ln(e,t,n){const r=Nn++,o=mt.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const he=Object.create(null);function He(e,t){he[e]=t}function ge(e){return he[e]||he[""]}function Rn(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?B(o,t,n):o;s&&r.push(s)}),r}var On={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function En(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let i;if(e.random){let y=e.resources.slice(0);for(i=[];y.length>1;){const I=Math.floor(Math.random()*y.length);i.push(y[I]),y=y.slice(0,I).concat(y.slice(I+1))}i=i.concat(y)}else i=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",u=0,f,p=null,h=[],g=[];typeof r=="function"&&g.push(r);function m(){p&&(clearTimeout(p),p=null)}function x(){c==="pending"&&(c="aborted"),m(),h.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),h=[]}function v(y,I){I&&(g=[]),typeof y=="function"&&g.push(y)}function k(){return{startTime:a,payload:t,status:c,queriesSent:u,queriesPending:h.length,subscribe:v,abort:x}}function b(){c="failed",g.forEach(y=>{y(void 0,f)})}function w(){h.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),h=[]}function C(y,I,N){const S=I!=="success";switch(h=h.filter(R=>R!==y),c){case"pending":break;case"failed":if(S||!e.dataAfterTimeout)return;break;default:return}if(I==="abort"){f=N,b();return}if(S){f=N,h.length||(i.length?j():b());return}if(m(),w(),!e.random){const R=e.resources.indexOf(y.resource);R!==-1&&R!==e.index&&(e.index=R)}c="completed",g.forEach(R=>{R(N)})}function j(){if(c!=="pending")return;m();const y=i.shift();if(y===void 0){if(h.length){p=setTimeout(()=>{m(),c==="pending"&&(w(),b())},e.timeout);return}b();return}const I={status:"pending",resource:y,callback:(N,S)=>{C(I,N,S)}};h.push(I),u++,p=setTimeout(j,e.rotate),n(y,t,I.callback)}return setTimeout(j),k}function yt(e){const t={...On,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function o(a,c,u){const f=En(t,a,c,(p,h)=>{r(),u&&u(p,h)});return n.push(f),f}function s(a){return n.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function ke(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ne=Object.create(null),q=["https://api.simplesvg.com","https://api.unisvg.com"],G=[];for(;q.length>0;)q.length===1||Math.random()>.5?G.push(q.shift()):G.push(q.pop());ne[""]=ke({resources:["https://api.iconify.design"].concat(G)});function De(e,t){const n=ke(t);return n===null?!1:(ne[e]=n,!0)}function oe(e){return ne[e]}function $n(){return Object.keys(ne)}function Ue(){}const le=Object.create(null);function qn(e){if(!le[e]){const t=oe(e);if(!t)return;const n=yt(t),r={config:t,redundancy:n};le[e]=r}return le[e]}function bt(e,t,n){let r,o;if(typeof e=="string"){const s=ge(e);if(!s)return n(void 0,424),Ue;o=s.send;const i=qn(e);i&&(r=i.redundancy)}else{const s=ke(e);if(s){r=yt(s);const i=e.resources?e.resources[0]:"",a=ge(i);a&&(o=a.send)}}return!r||!o?(n(void 0,424),Ue):r.query(t,o,n)().abort}const Be="iconify2",D="iconify",xt=D+"-count",Ve=D+"-version",wt=36e5,_n=168;function me(e,t){try{return e.getItem(t)}catch{}}function je(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Qe(e,t){try{e.removeItem(t)}catch{}}function ye(e,t){return je(e,xt,t.toString())}function be(e){return parseInt(me(e,xt))||0}const O={local:!0,session:!0},vt={local:new Set,session:new Set};let Ie=!1;function Fn(e){Ie=e}let W=typeof window>"u"?{}:window;function kt(e){const t=e+"Storage";try{if(W&&W[t]&&typeof W[t].length=="number")return W[t]}catch{}O[e]=!1}function jt(e,t){const n=kt(e);if(!n)return;const r=me(n,Ve);if(r!==Be){if(r){const a=be(n);for(let c=0;c<a;c++)Qe(n,D+c.toString())}je(n,Ve,Be),ye(n,0);return}const o=Math.floor(Date.now()/wt)-_n,s=a=>{const c=D+a.toString(),u=me(n,c);if(typeof u=="string"){try{const f=JSON.parse(u);if(typeof f=="object"&&typeof f.cached=="number"&&f.cached>o&&typeof f.provider=="string"&&typeof f.data=="object"&&typeof f.data.prefix=="string"&&t(f,a))return!0}catch{}Qe(n,c)}};let i=be(n);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,ye(n,i)):vt[e].add(a))}function It(){if(!Ie){Fn(!0);for(const e in O)jt(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=L(r,o);if(!ve(s,n).length)return!1;const i=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function zn(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in O)jt(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Hn(e,t){Ie||It();function n(r){let o;if(!O[r]||!(o=kt(r)))return;const s=vt[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=be(o),!ye(o,i+1))return;const a={cached:Math.floor(Date.now()/wt),provider:e.provider,data:t};return je(o,D+i.toString(),JSON.stringify(a))}t.lastModified&&!zn(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function We(){}function Dn(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Mn(e)}))}function Un(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=ge(n)))return;s.prepare(n,r,o).forEach(a=>{bt(n,a,c=>{if(typeof c!="object")a.icons.forEach(u=>{e.missing.add(u)});else try{const u=ve(e,c);if(!u.length)return;const f=e.pendingIcons;f&&u.forEach(p=>{f.delete(p)}),Hn(e,c)}catch(u){console.error(u)}Dn(e)})})}))}const Se=(e,t)=>{const n=Rn(e,!0,ht()),r=Pn(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,We)}),()=>{c=!1}}const o=Object.create(null),s=[];let i,a;return r.pending.forEach(c=>{const{provider:u,prefix:f}=c;if(f===a&&u===i)return;i=u,a=f,s.push(L(u,f));const p=o[u]||(o[u]=Object.create(null));p[f]||(p[f]=[])}),r.pending.forEach(c=>{const{provider:u,prefix:f,name:p}=c,h=L(u,f),g=h.pendingIcons||(h.pendingIcons=new Set);g.has(p)||(g.add(p),o[u][f].push(p))}),s.forEach(c=>{const{provider:u,prefix:f}=c;o[u][f].length&&Un(c,o[u][f])}),t?Ln(t,r,s):We},Bn=e=>new Promise((t,n)=>{const r=typeof e=="string"?B(e,!0):e;if(!r){n(e);return}Se([r||e],o=>{if(o.length&&r){const s=H(r);if(s){t({...U,...s});return}}n(e)})});function Vn(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function Qn(e,t){const n=typeof e=="string"?B(e,!0,!0):null;if(!n){const s=Vn(e);return{value:e,data:s}}const r=H(n);if(r!==void 0||!n.prefix)return{value:e,name:n,data:r};const o=Se([n],()=>t(e,n,H(n)));return{value:e,name:n,loading:o}}function ue(e){return e.hasAttribute("inline")}let St=!1;try{St=navigator.vendor.indexOf("Apple")===0}catch{}function Wn(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(St||e.indexOf("<a")===-1)?"svg":e.indexOf("currentColor")===-1?"bg":"mask"}const Zn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Gn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function xe(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Zn);if(r===null||!r.length)return e;const o=[];let s=r.shift(),i=Gn.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const Jn=e=>e==="unset"||e==="undefined"||e==="none";function Tt(e,t){const n={...U,...e},r={...ut,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(m=>{const x=[],v=m.hFlip,k=m.vFlip;let b=m.rotate;v?k?b+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):k&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=o.height/2+o.top,x.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:w=o.width/2+o.left,x.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(o.left!==o.top&&(w=o.left,o.left=o.top,o.top=w),o.width!==o.height&&(w=o.width,o.width=o.height,o.height=w)),x.length&&(s='<g transform="'+x.join(" ")+'">'+s+"</g>")});const i=r.width,a=r.height,c=o.width,u=o.height;let f,p;i===null?(p=a===null?"1em":a==="auto"?u:a,f=xe(p,c/u)):(f=i==="auto"?c:i,p=a===null?xe(f,u/c):a==="auto"?u:a);const h={},g=(m,x)=>{Jn(x)||(h[m]=x.toString())};return g("width",f),g("height",p),h.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+u.toString(),{attributes:h,body:s}}const Yn=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let X=Yn();function Xn(e){X=e}function Kn(){return X}function eo(e,t){const n=oe(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(i=>{o=Math.max(o,i.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function to(e){return e===404}const no=(e,t,n)=>{const r=[],o=eo(e,t),s="icons";let i={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,u)=>{a+=c.length+1,a>=o&&u>0&&(r.push(i),i={type:s,provider:e,prefix:t,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function oo(e){if(typeof e=="string"){const t=oe(e);if(t)return t.path}return"/"}const ro=(e,t,n)=>{if(!X){n("abort",424);return}let r=oo(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;X(e+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{n(to(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},so={prepare:no,send:ro};function Ze(e,t){switch(e){case"local":case"session":O[e]=t;break;case"all":for(const n in O)O[n]=t;break}}const fe="data-style";let Ct="";function io(e){Ct=e}function Ge(e,t){let n=Array.from(e.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(fe));n||(n=document.createElement("style"),n.setAttribute(fe,fe),e.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+Ct}function At(){He("",so),ht(!0);let e;try{e=window}catch{}if(e){if(It(),e.IconifyPreload!==void 0){const n=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!ze(o))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const n=e.IconifyProviders;if(typeof n=="object"&&n!==null)for(const r in n){const o="IconifyProviders["+r+"] is invalid.";try{const s=n[r];if(typeof s!="object"||!s||s.resources===void 0)continue;De(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:n=>Ze(n,!0),disableCache:n=>Ze(n,!1),iconExists:Cn,getIcon:An,listIcons:Tn,addIcon:gt,addCollection:ze,calculateSize:xe,buildIcon:Tt,loadIcons:Se,loadIcon:Bn,addAPIProvider:De,appendCustomStyle:io,_api:{getAPIConfig:oe,setAPIModule:He,sendAPIQuery:bt,setFetch:Xn,getFetch:Kn,listAPIProviders:$n}}}function Pt(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function co(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ao(e){return"data:image/svg+xml,"+co(e)}function lo(e){return'url("'+ao(e)+'")'}const we={"background-color":"currentColor"},Mt={"background-color":"transparent"},Je={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Ye={"-webkit-mask":we,mask:we,background:Mt};for(const e in Ye){const t=Ye[e];for(const n in Je)t[e+"-"+n]=Je[n]}function Xe(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function uo(e,t,n){const r=document.createElement("span");let o=e.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=e.attributes,i=Pt(o,{...s,width:t.width+"",height:t.height+""}),a=lo(i),c=r.style,u={"--svg":a,width:Xe(s.width),height:Xe(s.height),...n?we:Mt};for(const f in u)c.setProperty(f,u[f]);return r}let F;function fo(){try{F=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{F=null}}function po(e){return F===void 0&&fo(),F?F.createHTML(e):e}function ho(e){const t=document.createElement("span"),n=e.attributes;let r="";n.width||(r="width: inherit;"),n.height||(r+="height: inherit;"),r&&(n.style=r);const o=Pt(e.body,n);return t.innerHTML=po(o),t.firstChild}function Ke(e,t){const n=t.icon.data,r=t.customisations,o=Tt(n,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=t.renderedMode;let i;switch(s){case"svg":i=ho(o);break;default:i=uo(o,{...U,...n},s==="mask")}const a=Array.from(e.childNodes).find(c=>{const u=c.tagName&&c.tagName.toUpperCase();return u==="SPAN"||u==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):e.replaceChild(i,a):e.appendChild(i)}function et(e,t,n){const r=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:r}}function go(e="iconify-icon"){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;const r=t.get(e);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends n{constructor(){super();Q(this,"_shadowRoot");Q(this,"_state");Q(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),u=ue(this);Ge(c,u),this._state=et({value:""},u),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const u=ue(this),f=this._state;u!==f.inline&&(f.inline=u,Ge(this._shadowRoot,u))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return ue(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const u=this._shadowRoot;if(c.renderedMode==="svg")try{u.lastChild.setCurrentTime(0);return}catch{}Ke(u,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,u=this.getAttribute("icon");if(u!==c.icon.value){this._iconChanged(u);return}if(!c.rendered)return;const f=this.getAttribute("mode"),p=_e(this);(c.attrMode!==f||xn(c.customisations,p))&&this._renderIcon(c.icon,p,f)}_iconChanged(c){const u=Qn(c,(f,p,h)=>{const g=this._state;if(g.rendered||this.getAttribute("icon")!==f)return;const m={value:f,name:p,data:h};m.data?this._gotIconData(m):g.icon=m});u.data?this._gotIconData(u):this._state=et(u,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,_e(this),this.getAttribute("mode"))}_renderIcon(c,u,f){const p=Wn(c.data.body,f),h=this._state.inline;Ke(this._shadowRoot,this._state={rendered:!0,icon:c,inline:h,customisations:u,attrMode:f,renderedMode:p})}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=At();for(const a in i)s[a]=s.prototype[a]=i[a];return t.define(e,s),s}go()||At();const E=(e,t,n="children")=>e.map(r=>Array.isArray(r[n])?t({...r,[n]:E(r[n],t,n)}):t(r)),Nt=(e,t="children")=>{const n=[];return E(e,r=>n.push(r),t),n},Te=(e,t,n="children")=>e.map(r=>({...r})).filter(r=>{const o=r[n];if(Array.isArray(o)){const i=Te(o,t,n);r[n]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[n],isLeaf:!(o!=null&&o.length)};return t(r,s)}),Lt=e=>/^https?:\/\//.test(e),mo=e=>/^[\w-]+:[\w-]+$/.test(e),yo=e=>{if(!e||!(e!=null&&e.startsWith("/")))return!1;const t=o=>o.endsWith("/")?o:`${o}/`,n=t(window.location.pathname),r=t(new URL(e,window.location.origin).pathname);return n.startsWith(r)},Rt=(e=[])=>{const t=e.map((r,o)=>({path:r,index:o})).filter(r=>yo(r.path));return t!=null&&t.length?t.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,t[0]).index:-1};function V({icon:e,size:t,sx:n,...r}){const o=[...Array.isArray(n)?n:[n]];if(t&&o.push({width:t,height:t}),r.variant||o.push({"&.MuiAvatar-root":{color:"inherit",fontWeight:"bold",backgroundColor:"transparent",borderRadius:0},"&.MuiAvatar-root svg":{width:"100%",height:"100%"}}),Lt(e))return d.jsx(ce,{as:"span",...r,src:e,sx:o});if(mo(e)){const s=t?.6*t+4:0;return d.jsx(ce,{as:"span",...r,sx:o,children:d.jsx("iconify-icon",{icon:e,height:s||void 0})})}return e&&typeof e=="string"?(o.push({"&.MuiAvatar-root":{display:"inline-flex",...t&&{fontSize:t-2}}}),d.jsx(ce,{as:"span",...r,sx:o,children:Array.from(e)[0]})):null}V.propTypes={icon:l.string.isRequired,size:l.number,sx:l.oneOfType([l.array,l.func,l.object])};V.defaultProps={size:null,sx:null};const bo=ot();function re({theme:e,children:t}){const n=e?ot(e):bo;return d.jsx(Dt,{theme:n,children:t})}re.propTypes={children:l.any.isRequired,theme:l.object};re.defaultProps={theme:null};const Ce=l.shape({appLogo:l.node,appName:l.string,theme:l.shape({background:l.string}),enableConnect:l.bool,enableLocale:l.bool,navigation:l.arrayOf(l.shape({title:l.oneOfType([l.string,l.object]),link:l.oneOfType([l.string,l.object]),icon:l.string,items:l.arrayOf(l.shape({title:l.oneOfType([l.string,l.object]),link:l.oneOfType([l.string,l.object])}))}))}),Ae=l.shape({showText:l.bool,showRole:l.bool,switchDid:l.bool,switchProfile:l.bool,switchPassport:l.bool,disableLogout:l.bool,onLogin:l.func,onLogout:l.func,onSwitchDid:l.func,onSwitchProfile:l.func,onSwitchPassport:l.func,menu:l.array,menuRender:l.func,dark:l.bool,size:l.number});var tt,nt;const K=((tt=window==null?void 0:window.blocklet)==null?void 0:tt.groupPrefix)||((nt=window==null?void 0:window.blocklet)==null?void 0:nt.prefix)||"/",xo=e=>{const t={...e},n=e==null?void 0:e.background;return typeof n=="string"?t.background={header:n,footer:n,default:n}:n&&typeof n=="object"&&(t.background={header:n.header||n.default,footer:n.footer||n.default,default:n.default}),t},$=(e,t="en")=>{if(!(e!=null&&e.length))return e;const n=(o,s)=>typeof o=="string"?o:typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,r=(o,s)=>{if(typeof o=="string"){if(Lt(o)){const a=new URL(o);return a.searchParams.set("locale",s),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",s),i.pathname+i.search}return typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return E(e,o=>{var s;return{...o,title:n(o.title,t),link:(s=o.items)!=null&&s.length?o.link:r(o.link,t),_rawLink:o.link}},"items")},wo=e=>E(e,t=>t.role?{...t,role:Array.isArray(t.role)?t.role:[t.role]}:t,"items"),vo=e=>{if(!(e!=null&&e.length))return null;const t=wo(e),n={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return t.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=n[s])==null||i.push(r)}):typeof r.section=="string"&&((o=n[r.section])==null||o.push(r)):n.header.push(r)}),n},Pe=e=>{if(!e)return null;const t={...e};return t.theme=xo(t.theme),t.navigation=vo(ko(t.navigation)),t},ko=(e=[])=>Te(e,(t,n)=>{var r;return!!t.link||((r=n.filteredChildren)==null?void 0:r.length)},"items"),Ot=(e,t)=>Te(e,(n,r)=>{var s;const o=!n.role||t&&n.role.includes(t);return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items"),jo={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},Io={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function Me({session:e,locale:t,size:n}){const r=(window==null?void 0:window.blocklet)||{},o=(r.navigation||[]).filter(c=>c.section==="sessionManager"&&!["/sessionManager"].includes(c.id)).filter(c=>{var u;return!!((c==null?void 0:c.role)||[]).includes(((u=e==null?void 0:e.user)==null?void 0:u.role)||"guest")}).map(c=>{const u=((r==null?void 0:r.componentMountPoints)||[]).find(f=>c.component===f.name);return{...c,component:u}}),s=T.useRef(null),i=Ut({open:!1}),a=Bt((c=!i.open)=>{i.open=c});return o.length===0||!(e!=null&&e.user)?null:d.jsxs(d.Fragment,{children:[d.jsx(Vt,{size:"medium",ref:s,onClick:()=>a(),children:d.jsx(qe,{icon:jo,fontSize:n,style:{transform:"scale(1.08)"}})}),d.jsx(Qt,{open:i.open,onClose:()=>a(!1),anchorEl:s.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>d.jsx(Wt,{onClickAway:u=>{u.preventDefault(),u.stopPropagation(),a(!1)},children:d.jsx(Zt,{...c,timeout:350,children:d.jsxs(Gt,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:A.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${A.gray6}, 0px 0px 0px 1px ${A.gray6}`},children:[d.jsx(Jt,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(u=>{var f;return d.jsx(Yt,{disablePadding:!0,children:d.jsxs(Xt,{href:u.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:A.surfacePrimarySubtitle}},children:[(f=u==null?void 0:u.component)!=null&&f.did?d.jsx(P,{component:"img",src:`${Kt}/blocklet/logo-bundle/${u.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):d.jsx(qe,{fontSize:50,icon:u.icon||Io,color:A.textSubtitle}),d.jsx(en,{sx:{fontSize:"12px",color:A.textBase,textAlign:"center",lineHeight:"normal"},children:tn(u.title,t)})]})},u.id)})}),d.jsx(nn,{session:e,children:d.jsx(on,{variant:"outlined",fullWidth:!0,href:rn,sx:{mt:1,borderRadius:2,color:A.textBase,borderColor:A.lineBorderStrong,"&:hover":{color:A.primaryBase,borderColor:A.primaryBase}},children:t==="zh"?"管理":"Manage"})})]})})})})]})}Me.propTypes={session:l.object.isRequired,locale:l.string,size:l.number};Me.defaultProps={locale:"en",size:24};function se({formattedBlocklet:e,addons:t,sessionManagerProps:n}){var h,g,m,x;const r=T.useContext(rt),{locale:o}=te()||{},{enableConnect:s=!0,enableLocale:i=!0}=e,a=!!((h=r==null?void 0:r.session)!=null&&h.user);let c=$((g=e==null?void 0:e.navigation)==null?void 0:g.sessionManager,o)||[];c=Ot(c,(x=(m=r==null?void 0:r.session)==null?void 0:m.user)==null?void 0:x.role);const f=(()=>{if(t&&typeof t!="function")return Array.isArray(t)?t:[t];let v=[];if(i&&o&&v.push(d.jsx(sn,{showText:!1},"locale-selector")),s&&r){const k=[];a&&(c?c.slice(0,5):[]).forEach(w=>{k.push({label:w.title,icon:w.icon?d.jsx("iconify-icon",{icon:w.icon,height:24,style:{marginRight:8}}):null,component:"a",href:w.link,key:w.link})}),v.push(d.jsx(Me,{session:r.session,locale:o},"session-blocklet")),v.push(d.jsx(cn,{session:r.session,locale:o,menu:k,showRole:!0,...n},"session-user"))}return typeof t=="function"&&(v=t(v)||[]),v})();return T.createElement(d.Fragment,null,...Array.isArray(f)?f:[f])}se.propTypes={formattedBlocklet:l.object.isRequired,addons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae};se.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const Et=()=>{const e=an();T.useEffect(()=>{e.wallet&&ln.call("arcHideTopBar","{}")},[e])},So=e=>{if(!(e!=null&&e.length))return{navItems:[],activeId:null};let t=1;const r=E(e,i=>{var u,f;const a=i.icon?d.jsx(V,{icon:i.icon}):null;if(i.items)return{id:`${t++}`,label:i.title,icon:a,children:i.items};let c={};return((u=i.link)!=null&&u.startsWith("http://")||(f=i.link)!=null&&f.startsWith("https://"))&&(c={target:"_blank",rel:"noreferrer"}),{id:`${t++}`,label:d.jsx("a",{href:i.link,...c,children:i.title}),icon:a,link:i.link}},"items"),o=Nt(r),s=Rt(o.map(i=>i.link));return{navItems:r,activeId:s>=0?o[s].id:null}};function Ne({meta:e,addons:t,sessionManagerProps:n,homeLink:r,theme:o,hideNavMenu:s,...i}){var b,w;Et();const{locale:a}=te()||{},c=T.useMemo(()=>{const C=Object.assign({},window.blocklet,e);try{return Pe(C)}catch(j){return console.error("Failed to format blocklet info",j,C),C}},[e]);if(!c.appName)return null;const{appLogo:u,appLogoRect:f,theme:p}=c,h=$((b=c==null?void 0:c.navigation)==null?void 0:b.header,a),g=So(h),{navItems:m,activeId:x}=g,v=typeof t=="function"?C=>t(C,{navigation:g}):t,k=d.jsx(se,{formattedBlocklet:c,addons:v,sessionManagerProps:n});return d.jsx(re,{theme:o,children:d.jsx(To,{homeLink:r,logo:d.jsx("img",{src:f||u,alt:"logo"}),addons:k,...it(i,["bordered"]),$bordered:i==null?void 0:i.bordered,$bgcolor:(w=p==null?void 0:p.background)==null?void 0:w.header,children:s||!(m!=null&&m.length)?null:({isMobile:C})=>d.jsx(fn,{mode:C?"inline":"horizontal",activeId:x,items:m,className:"header-nav",bgColor:"transparent",textColor:"#777"})})})}Ne.propTypes={meta:Ce,addons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae,homeLink:l.string,theme:l.object,hideNavMenu:l.bool};Ne.defaultProps={meta:{},addons:null,sessionManagerProps:{showRole:!0},homeLink:K,theme:null,hideNavMenu:!1};const To=M(un)`
|
|
11
|
+
*/const lt=Object.freeze({left:0,top:0,width:16,height:16}),J=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),D=Object.freeze({...lt,...J}),pe=Object.freeze({...D,body:"",hidden:!1}),gn=Object.freeze({width:null,height:null}),ut=Object.freeze({...gn,...J});function mn(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const yn=/[\s,]+/;function bn(e,t){t.split(yn).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const ft={...ut,preserveAspectRatio:""};function qe(e){const t={...ft},n=(r,o)=>e.getAttribute(r)||o;return t.width=n("width",null),t.height=n("height",null),t.rotate=mn(n("rotate","")),bn(t,n("flip","")),t.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),t}function xn(e,t){for(const n in ft)if(e[n]!==t[n])return!0;return!1}const q=/^[a-z0-9]+(-[a-z0-9]+)*$/,B=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),u={provider:o.length>0?o[0]:r,prefix:c,name:a};return t&&!Z(u)?null:u}const s=o[0],i=s.split("-");if(i.length>1){const a={provider:r,prefix:i.shift(),name:i.join("-")};return t&&!Z(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return t&&!Z(a,n)?null:a}return null},Z=(e,t)=>e?!!((e.provider===""||e.provider.match(q))&&(t&&e.prefix===""||e.prefix.match(q))&&e.name.match(q)):!1;function wn(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Fe(e,t){const n=wn(e,t);for(const r in pe)r in J?r in e&&!(r in n)&&(n[r]=J[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function vn(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(i){if(n[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=r[i]&&r[i].parent,c=a&&s(a);c&&(o[i]=[a].concat(c))}return o[i]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(s),o}function kn(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function i(a){s=Fe(r[a]||o[a],s)}return i(t),n.forEach(i),Fe(e,s)}function dt(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=vn(e);for(const o in r){const s=r[o];s&&(t(o,kn(e,o,s)),n.push(o))}return n}const jn={provider:"",aliases:{},not_found:{},...lt};function ae(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function pt(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ae(e,jn))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(q)||typeof s.body!="string"||!ae(s,pe))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(q)||typeof i!="string"||!n[i]&&!r[i]||!ae(s,pe))return null}return t}const Y=Object.create(null);function In(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function L(e,t){const n=Y[e]||(Y[e]=Object.create(null));return n[t]||(n[t]=In(e,t))}function ve(e,t){return pt(t)?dt(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Sn(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function Tn(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Y)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(Y[o]||{})).forEach(i=>{const a=L(o,i);n=n.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),n}let z=!1;function ht(e){return typeof e=="boolean"&&(z=e),z}function H(e){const t=typeof e=="string"?B(e,!0,z):e;if(t){const n=L(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function gt(e,t){const n=B(e,!0,z);if(!n)return!1;const r=L(n.provider,n.prefix);return Sn(r,n.name,t)}function ze(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),z&&!t&&!e.prefix){let o=!1;return pt(e)&&(e.prefix="",dt(e,(s,i)=>{i&>(s,i)&&(o=!0)})),o}const n=e.prefix;if(!Z({provider:t,prefix:n,name:"a"}))return!1;const r=L(t,n);return!!ve(r,e)}function Cn(e){return!!H(e)}function An(e){const t=H(e);return t?{...D,...t}:null}function Pn(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,i=o.prefix,a=o.name,c=n[s]||(n[s]=Object.create(null)),u=c[i]||(c[i]=L(s,i));let f;a in u.icons?f=t.loaded:i===""||u.missing.has(a)?f=t.missing:f=t.pending;const p={provider:s,prefix:i,name:a};f.push(p)}),t}function mt(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function Mn(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const i=s.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const u=c.name;if(e.icons[u])i.loaded.push({provider:r,prefix:o,name:u});else if(e.missing.has(u))i.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),i.pending.length!==a&&(n||mt([e],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let Nn=0;function Ln(e,t,n){const r=Nn++,o=mt.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const he=Object.create(null);function He(e,t){he[e]=t}function ge(e){return he[e]||he[""]}function Rn(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?B(o,t,n):o;s&&r.push(s)}),r}var On={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function En(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let i;if(e.random){let y=e.resources.slice(0);for(i=[];y.length>1;){const I=Math.floor(Math.random()*y.length);i.push(y[I]),y=y.slice(0,I).concat(y.slice(I+1))}i=i.concat(y)}else i=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",u=0,f,p=null,h=[],g=[];typeof r=="function"&&g.push(r);function m(){p&&(clearTimeout(p),p=null)}function x(){c==="pending"&&(c="aborted"),m(),h.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),h=[]}function v(y,I){I&&(g=[]),typeof y=="function"&&g.push(y)}function k(){return{startTime:a,payload:t,status:c,queriesSent:u,queriesPending:h.length,subscribe:v,abort:x}}function b(){c="failed",g.forEach(y=>{y(void 0,f)})}function w(){h.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),h=[]}function C(y,I,N){const S=I!=="success";switch(h=h.filter(R=>R!==y),c){case"pending":break;case"failed":if(S||!e.dataAfterTimeout)return;break;default:return}if(I==="abort"){f=N,b();return}if(S){f=N,h.length||(i.length?j():b());return}if(m(),w(),!e.random){const R=e.resources.indexOf(y.resource);R!==-1&&R!==e.index&&(e.index=R)}c="completed",g.forEach(R=>{R(N)})}function j(){if(c!=="pending")return;m();const y=i.shift();if(y===void 0){if(h.length){p=setTimeout(()=>{m(),c==="pending"&&(w(),b())},e.timeout);return}b();return}const I={status:"pending",resource:y,callback:(N,S)=>{C(I,N,S)}};h.push(I),u++,p=setTimeout(j,e.rotate),n(y,t,I.callback)}return setTimeout(j),k}function yt(e){const t={...On,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function o(a,c,u){const f=En(t,a,c,(p,h)=>{r(),u&&u(p,h)});return n.push(f),f}function s(a){return n.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function ke(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ne=Object.create(null),_=["https://api.simplesvg.com","https://api.unisvg.com"],G=[];for(;_.length>0;)_.length===1||Math.random()>.5?G.push(_.shift()):G.push(_.pop());ne[""]=ke({resources:["https://api.iconify.design"].concat(G)});function Ue(e,t){const n=ke(t);return n===null?!1:(ne[e]=n,!0)}function oe(e){return ne[e]}function $n(){return Object.keys(ne)}function De(){}const le=Object.create(null);function _n(e){if(!le[e]){const t=oe(e);if(!t)return;const n=yt(t),r={config:t,redundancy:n};le[e]=r}return le[e]}function bt(e,t,n){let r,o;if(typeof e=="string"){const s=ge(e);if(!s)return n(void 0,424),De;o=s.send;const i=_n(e);i&&(r=i.redundancy)}else{const s=ke(e);if(s){r=yt(s);const i=e.resources?e.resources[0]:"",a=ge(i);a&&(o=a.send)}}return!r||!o?(n(void 0,424),De):r.query(t,o,n)().abort}const Be="iconify2",U="iconify",xt=U+"-count",Qe=U+"-version",wt=36e5,qn=168;function me(e,t){try{return e.getItem(t)}catch{}}function je(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Ve(e,t){try{e.removeItem(t)}catch{}}function ye(e,t){return je(e,xt,t.toString())}function be(e){return parseInt(me(e,xt))||0}const O={local:!0,session:!0},vt={local:new Set,session:new Set};let Ie=!1;function Fn(e){Ie=e}let W=typeof window>"u"?{}:window;function kt(e){const t=e+"Storage";try{if(W&&W[t]&&typeof W[t].length=="number")return W[t]}catch{}O[e]=!1}function jt(e,t){const n=kt(e);if(!n)return;const r=me(n,Qe);if(r!==Be){if(r){const a=be(n);for(let c=0;c<a;c++)Ve(n,U+c.toString())}je(n,Qe,Be),ye(n,0);return}const o=Math.floor(Date.now()/wt)-qn,s=a=>{const c=U+a.toString(),u=me(n,c);if(typeof u=="string"){try{const f=JSON.parse(u);if(typeof f=="object"&&typeof f.cached=="number"&&f.cached>o&&typeof f.provider=="string"&&typeof f.data=="object"&&typeof f.data.prefix=="string"&&t(f,a))return!0}catch{}Ve(n,c)}};let i=be(n);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,ye(n,i)):vt[e].add(a))}function It(){if(!Ie){Fn(!0);for(const e in O)jt(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=L(r,o);if(!ve(s,n).length)return!1;const i=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function zn(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in O)jt(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Hn(e,t){Ie||It();function n(r){let o;if(!O[r]||!(o=kt(r)))return;const s=vt[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=be(o),!ye(o,i+1))return;const a={cached:Math.floor(Date.now()/wt),provider:e.provider,data:t};return je(o,U+i.toString(),JSON.stringify(a))}t.lastModified&&!zn(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function We(){}function Un(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Mn(e)}))}function Dn(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=ge(n)))return;s.prepare(n,r,o).forEach(a=>{bt(n,a,c=>{if(typeof c!="object")a.icons.forEach(u=>{e.missing.add(u)});else try{const u=ve(e,c);if(!u.length)return;const f=e.pendingIcons;f&&u.forEach(p=>{f.delete(p)}),Hn(e,c)}catch(u){console.error(u)}Un(e)})})}))}const Se=(e,t)=>{const n=Rn(e,!0,ht()),r=Pn(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,We)}),()=>{c=!1}}const o=Object.create(null),s=[];let i,a;return r.pending.forEach(c=>{const{provider:u,prefix:f}=c;if(f===a&&u===i)return;i=u,a=f,s.push(L(u,f));const p=o[u]||(o[u]=Object.create(null));p[f]||(p[f]=[])}),r.pending.forEach(c=>{const{provider:u,prefix:f,name:p}=c,h=L(u,f),g=h.pendingIcons||(h.pendingIcons=new Set);g.has(p)||(g.add(p),o[u][f].push(p))}),s.forEach(c=>{const{provider:u,prefix:f}=c;o[u][f].length&&Dn(c,o[u][f])}),t?Ln(t,r,s):We},Bn=e=>new Promise((t,n)=>{const r=typeof e=="string"?B(e,!0):e;if(!r){n(e);return}Se([r||e],o=>{if(o.length&&r){const s=H(r);if(s){t({...D,...s});return}}n(e)})});function Qn(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function Vn(e,t){const n=typeof e=="string"?B(e,!0,!0):null;if(!n){const s=Qn(e);return{value:e,data:s}}const r=H(n);if(r!==void 0||!n.prefix)return{value:e,name:n,data:r};const o=Se([n],()=>t(e,n,H(n)));return{value:e,name:n,loading:o}}function ue(e){return e.hasAttribute("inline")}let St=!1;try{St=navigator.vendor.indexOf("Apple")===0}catch{}function Wn(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(St||e.indexOf("<a")===-1)?"svg":e.indexOf("currentColor")===-1?"bg":"mask"}const Zn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Gn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function xe(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Zn);if(r===null||!r.length)return e;const o=[];let s=r.shift(),i=Gn.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const Jn=e=>e==="unset"||e==="undefined"||e==="none";function Tt(e,t){const n={...D,...e},r={...ut,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(m=>{const x=[],v=m.hFlip,k=m.vFlip;let b=m.rotate;v?k?b+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):k&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=o.height/2+o.top,x.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:w=o.width/2+o.left,x.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(o.left!==o.top&&(w=o.left,o.left=o.top,o.top=w),o.width!==o.height&&(w=o.width,o.width=o.height,o.height=w)),x.length&&(s='<g transform="'+x.join(" ")+'">'+s+"</g>")});const i=r.width,a=r.height,c=o.width,u=o.height;let f,p;i===null?(p=a===null?"1em":a==="auto"?u:a,f=xe(p,c/u)):(f=i==="auto"?c:i,p=a===null?xe(f,u/c):a==="auto"?u:a);const h={},g=(m,x)=>{Jn(x)||(h[m]=x.toString())};return g("width",f),g("height",p),h.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+u.toString(),{attributes:h,body:s}}const Yn=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let X=Yn();function Xn(e){X=e}function Kn(){return X}function eo(e,t){const n=oe(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(i=>{o=Math.max(o,i.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function to(e){return e===404}const no=(e,t,n)=>{const r=[],o=eo(e,t),s="icons";let i={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,u)=>{a+=c.length+1,a>=o&&u>0&&(r.push(i),i={type:s,provider:e,prefix:t,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function oo(e){if(typeof e=="string"){const t=oe(e);if(t)return t.path}return"/"}const ro=(e,t,n)=>{if(!X){n("abort",424);return}let r=oo(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;X(e+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{n(to(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},so={prepare:no,send:ro};function Ze(e,t){switch(e){case"local":case"session":O[e]=t;break;case"all":for(const n in O)O[n]=t;break}}const fe="data-style";let Ct="";function io(e){Ct=e}function Ge(e,t){let n=Array.from(e.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(fe));n||(n=document.createElement("style"),n.setAttribute(fe,fe),e.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+Ct}function At(){He("",so),ht(!0);let e;try{e=window}catch{}if(e){if(It(),e.IconifyPreload!==void 0){const n=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!ze(o))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const n=e.IconifyProviders;if(typeof n=="object"&&n!==null)for(const r in n){const o="IconifyProviders["+r+"] is invalid.";try{const s=n[r];if(typeof s!="object"||!s||s.resources===void 0)continue;Ue(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:n=>Ze(n,!0),disableCache:n=>Ze(n,!1),iconExists:Cn,getIcon:An,listIcons:Tn,addIcon:gt,addCollection:ze,calculateSize:xe,buildIcon:Tt,loadIcons:Se,loadIcon:Bn,addAPIProvider:Ue,appendCustomStyle:io,_api:{getAPIConfig:oe,setAPIModule:He,sendAPIQuery:bt,setFetch:Xn,getFetch:Kn,listAPIProviders:$n}}}function Pt(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function co(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ao(e){return"data:image/svg+xml,"+co(e)}function lo(e){return'url("'+ao(e)+'")'}const we={"background-color":"currentColor"},Mt={"background-color":"transparent"},Je={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Ye={"-webkit-mask":we,mask:we,background:Mt};for(const e in Ye){const t=Ye[e];for(const n in Je)t[e+"-"+n]=Je[n]}function Xe(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function uo(e,t,n){const r=document.createElement("span");let o=e.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=e.attributes,i=Pt(o,{...s,width:t.width+"",height:t.height+""}),a=lo(i),c=r.style,u={"--svg":a,width:Xe(s.width),height:Xe(s.height),...n?we:Mt};for(const f in u)c.setProperty(f,u[f]);return r}let F;function fo(){try{F=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{F=null}}function po(e){return F===void 0&&fo(),F?F.createHTML(e):e}function ho(e){const t=document.createElement("span"),n=e.attributes;let r="";n.width||(r="width: inherit;"),n.height||(r+="height: inherit;"),r&&(n.style=r);const o=Pt(e.body,n);return t.innerHTML=po(o),t.firstChild}function Ke(e,t){const n=t.icon.data,r=t.customisations,o=Tt(n,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=t.renderedMode;let i;switch(s){case"svg":i=ho(o);break;default:i=uo(o,{...D,...n},s==="mask")}const a=Array.from(e.childNodes).find(c=>{const u=c.tagName&&c.tagName.toUpperCase();return u==="SPAN"||u==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):e.replaceChild(i,a):e.appendChild(i)}function et(e,t,n){const r=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:r}}function go(e="iconify-icon"){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;const r=t.get(e);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends n{constructor(){super();V(this,"_shadowRoot");V(this,"_state");V(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),u=ue(this);Ge(c,u),this._state=et({value:""},u),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const u=ue(this),f=this._state;u!==f.inline&&(f.inline=u,Ge(this._shadowRoot,u))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return ue(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const u=this._shadowRoot;if(c.renderedMode==="svg")try{u.lastChild.setCurrentTime(0);return}catch{}Ke(u,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,u=this.getAttribute("icon");if(u!==c.icon.value){this._iconChanged(u);return}if(!c.rendered)return;const f=this.getAttribute("mode"),p=qe(this);(c.attrMode!==f||xn(c.customisations,p))&&this._renderIcon(c.icon,p,f)}_iconChanged(c){const u=Vn(c,(f,p,h)=>{const g=this._state;if(g.rendered||this.getAttribute("icon")!==f)return;const m={value:f,name:p,data:h};m.data?this._gotIconData(m):g.icon=m});u.data?this._gotIconData(u):this._state=et(u,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,qe(this),this.getAttribute("mode"))}_renderIcon(c,u,f){const p=Wn(c.data.body,f),h=this._state.inline;Ke(this._shadowRoot,this._state={rendered:!0,icon:c,inline:h,customisations:u,attrMode:f,renderedMode:p})}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=At();for(const a in i)s[a]=s.prototype[a]=i[a];return t.define(e,s),s}go()||At();const E=(e,t,n="children")=>e.map(r=>Array.isArray(r[n])?t({...r,[n]:E(r[n],t,n)}):t(r)),Nt=(e,t="children")=>{const n=[];return E(e,r=>n.push(r),t),n},Te=(e,t,n="children")=>e.map(r=>({...r})).filter(r=>{const o=r[n];if(Array.isArray(o)){const i=Te(o,t,n);r[n]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[n],isLeaf:!(o!=null&&o.length)};return t(r,s)}),Lt=e=>/^https?:\/\//.test(e),mo=e=>/^[\w-]+:[\w-]+$/.test(e),yo=e=>{if(!e||!(e!=null&&e.startsWith("/")))return!1;const t=o=>o.endsWith("/")?o:`${o}/`,n=t(window.location.pathname),r=t(new URL(e,window.location.origin).pathname);return n.startsWith(r)},Rt=(e=[])=>{const t=e.map((r,o)=>({path:r,index:o})).filter(r=>yo(r.path));return t!=null&&t.length?t.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,t[0]).index:-1};function Q({icon:e,size:t,sx:n,...r}){const o=[...Array.isArray(n)?n:[n]];if(t&&o.push({width:t,height:t}),r.variant||o.push({"&.MuiAvatar-root":{color:"inherit",fontWeight:"bold",backgroundColor:"transparent",borderRadius:0},"&.MuiAvatar-root svg":{width:"100%",height:"100%"}}),Lt(e))return d.jsx(ce,{as:"span",...r,src:e,sx:o});if(mo(e)){const s=t?.6*t+4:0;return d.jsx(ce,{as:"span",...r,sx:o,children:d.jsx("iconify-icon",{icon:e,height:s||void 0})})}return e&&typeof e=="string"?(o.push({"&.MuiAvatar-root":{display:"inline-flex",...t&&{fontSize:t-2}}}),d.jsx(ce,{as:"span",...r,sx:o,children:Array.from(e)[0]})):null}Q.propTypes={icon:l.string.isRequired,size:l.number,sx:l.oneOfType([l.array,l.func,l.object])};Q.defaultProps={size:null,sx:null};const bo=ot();function re({theme:e,children:t}){const n=e?ot(e):bo;return d.jsx(Ut,{theme:n,children:t})}re.propTypes={children:l.any.isRequired,theme:l.object};re.defaultProps={theme:null};const Ce=l.shape({appLogo:l.node,appName:l.string,theme:l.shape({background:l.string}),enableConnect:l.bool,enableLocale:l.bool,navigation:l.arrayOf(l.shape({title:l.oneOfType([l.string,l.object]),link:l.oneOfType([l.string,l.object]),icon:l.string,items:l.arrayOf(l.shape({title:l.oneOfType([l.string,l.object]),link:l.oneOfType([l.string,l.object])}))}))}),Ae=l.shape({showText:l.bool,showRole:l.bool,switchDid:l.bool,switchProfile:l.bool,switchPassport:l.bool,disableLogout:l.bool,onLogin:l.func,onLogout:l.func,onSwitchDid:l.func,onSwitchProfile:l.func,onSwitchPassport:l.func,menu:l.array,menuRender:l.func,dark:l.bool,size:l.number});var tt,nt;const K=((tt=window==null?void 0:window.blocklet)==null?void 0:tt.groupPrefix)||((nt=window==null?void 0:window.blocklet)==null?void 0:nt.prefix)||"/",xo=e=>{const t={...e},n=e==null?void 0:e.background;return typeof n=="string"?t.background={header:n,footer:n,default:n}:n&&typeof n=="object"&&(t.background={header:n.header||n.default,footer:n.footer||n.default,default:n.default}),t},$=(e,t="en")=>{if(!(e!=null&&e.length))return e;const n=(o,s)=>typeof o=="string"?o:typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,r=(o,s)=>{if(typeof o=="string"){if(Lt(o)){const a=new URL(o);return a.searchParams.set("locale",s),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",s),i.pathname+i.search}return typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return E(e,o=>{var s;return{...o,title:n(o.title,t),link:(s=o.items)!=null&&s.length?o.link:r(o.link,t),_rawLink:o.link}},"items")},wo=e=>E(e,t=>t.role?{...t,role:Array.isArray(t.role)?t.role:[t.role]}:t,"items"),vo=e=>{if(!(e!=null&&e.length))return null;const t=wo(e),n={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return t.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=n[s])==null||i.push(r)}):typeof r.section=="string"&&((o=n[r.section])==null||o.push(r)):n.header.push(r)}),n},Pe=e=>{if(!e)return null;const t={...e};return t.theme=xo(t.theme),t.navigation=vo(ko(t.navigation)),t},ko=(e=[])=>Te(e,(t,n)=>{var r;return!!t.link||((r=n.filteredChildren)==null?void 0:r.length)},"items"),Ot=(e,t)=>Te(e,(n,r)=>{var s;const o=!n.role||t&&n.role.includes(t);return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items"),jo={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},Io={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function Me({session:e,locale:t,size:n}){const r=(window==null?void 0:window.blocklet)||{},o=(r.navigation||[]).filter(c=>c.section==="sessionManager"&&!["/sessionManager"].includes(c.id)).filter(c=>{var u;return!!((c==null?void 0:c.role)||[]).includes(((u=e==null?void 0:e.user)==null?void 0:u.role)||"guest")}).map(c=>{const u=((r==null?void 0:r.componentMountPoints)||[]).find(f=>c.component===f.name);return{...c,component:u}}),s=T.useRef(null),i=Dt({open:!1}),a=Bt((c=!i.open)=>{i.open=c});return o.length===0||!(e!=null&&e.user)?null:d.jsxs(d.Fragment,{children:[d.jsx(Qt,{size:"medium",ref:s,onClick:()=>a(),children:d.jsx(_e,{icon:jo,fontSize:n,style:{transform:"scale(1.08)"}})}),d.jsx(Vt,{open:i.open,onClose:()=>a(!1),anchorEl:s.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>d.jsx(Wt,{onClickAway:u=>{u.preventDefault(),u.stopPropagation(),a(!1)},children:d.jsx(Zt,{...c,timeout:350,children:d.jsxs(Gt,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:A.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${A.gray6}, 0px 0px 0px 1px ${A.gray6}`},children:[d.jsx(Jt,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(u=>{var f;return d.jsx(Yt,{disablePadding:!0,children:d.jsxs(Xt,{href:u.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:A.surfacePrimarySubtitle}},children:[(f=u==null?void 0:u.component)!=null&&f.did?d.jsx(P,{component:"img",src:`${Kt}/blocklet/logo-bundle/${u.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):d.jsx(_e,{fontSize:50,icon:u.icon||Io,color:A.textSubtitle}),d.jsx(en,{sx:{fontSize:"12px",color:A.textBase,textAlign:"center",lineHeight:"normal"},children:tn(u.title,t)})]})},u.id)})}),d.jsx(nn,{session:e,children:d.jsx(on,{variant:"outlined",fullWidth:!0,href:rn,sx:{mt:1,borderRadius:2,color:A.textBase,borderColor:A.lineBorderStrong,"&:hover":{color:A.primaryBase,borderColor:A.primaryBase}},children:t==="zh"?"管理":"Manage"})})]})})})})]})}Me.propTypes={session:l.object.isRequired,locale:l.string,size:l.number};Me.defaultProps={locale:"en",size:24};function se({formattedBlocklet:e,addons:t,sessionManagerProps:n}){var h,g,m,x;const r=T.useContext(rt),{locale:o}=te()||{},{enableConnect:s=!0,enableLocale:i=!0}=e,a=!!((h=r==null?void 0:r.session)!=null&&h.user);let c=$((g=e==null?void 0:e.navigation)==null?void 0:g.sessionManager,o)||[];c=Ot(c,(x=(m=r==null?void 0:r.session)==null?void 0:m.user)==null?void 0:x.role);const f=(()=>{if(t&&typeof t!="function")return Array.isArray(t)?t:[t];let v=[];if(i&&o&&v.push(d.jsx(sn,{showText:!1},"locale-selector")),s&&r){const k=[];a&&(c?c.slice(0,5):[]).forEach(w=>{k.push({label:w.title,icon:w.icon?d.jsx("iconify-icon",{icon:w.icon,height:24,style:{marginRight:8}}):null,component:"a",href:w.link,key:w.link})}),v.push(d.jsx(Me,{session:r.session,locale:o},"session-blocklet")),v.push(d.jsx(cn,{session:r.session,locale:o,menu:k,showRole:!0,...n},"session-user"))}return typeof t=="function"&&(v=t(v)||[]),v})();return T.createElement(d.Fragment,null,...Array.isArray(f)?f:[f])}se.propTypes={formattedBlocklet:l.object.isRequired,addons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae};se.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const Et=()=>{const e=an();T.useEffect(()=>{e.wallet&&ln.call("arcHideTopBar","{}")},[e])},So=e=>{if(!(e!=null&&e.length))return{navItems:[],activeId:null};let t=1;const r=E(e,i=>{var u,f;const a=i.icon?d.jsx(Q,{icon:i.icon}):null;if(i.items)return{id:`${t++}`,label:i.title,icon:a,children:i.items};let c={};return((u=i.link)!=null&&u.startsWith("http://")||(f=i.link)!=null&&f.startsWith("https://"))&&(c={target:"_blank",rel:"noreferrer"}),{id:`${t++}`,label:d.jsx("a",{href:i.link,...c,children:i.title}),icon:a,link:i.link}},"items"),o=Nt(r),s=Rt(o.map(i=>i.link));return{navItems:r,activeId:s>=0?o[s].id:null}};function Ne({meta:e,addons:t,sessionManagerProps:n,homeLink:r,theme:o,hideNavMenu:s,...i}){var b,w;Et();const{locale:a}=te()||{},c=T.useMemo(()=>{const C=Object.assign({},window.blocklet,e);try{return Pe(C)}catch(j){return console.error("Failed to format blocklet info",j,C),C}},[e]);if(!c.appName)return null;const{appLogo:u,appLogoRect:f,theme:p}=c,h=$((b=c==null?void 0:c.navigation)==null?void 0:b.header,a),g=So(h),{navItems:m,activeId:x}=g,v=typeof t=="function"?C=>t(C,{navigation:g}):t,k=d.jsx(se,{formattedBlocklet:c,addons:v,sessionManagerProps:n});return d.jsx(re,{theme:o,children:d.jsx(To,{homeLink:r,logo:d.jsx("img",{src:f||u,alt:"logo"}),addons:k,...it(i,["bordered"]),$bordered:i==null?void 0:i.bordered,$bgcolor:(w=p==null?void 0:p.background)==null?void 0:w.header,children:s||!(m!=null&&m.length)?null:({isMobile:C})=>d.jsx(fn,{mode:C?"inline":"horizontal",activeId:x,items:m,className:"header-nav",bgColor:"transparent",textColor:"#777"})})})}Ne.propTypes={meta:Ce,addons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae,homeLink:l.string,theme:l.object,hideNavMenu:l.bool};Ne.defaultProps={meta:{},addons:null,sessionManagerProps:{showRole:!0},homeLink:K,theme:null,hideNavMenu:!1};const To=M(un)`
|
|
12
12
|
${({$bgcolor:e})=>`background-color: ${e||"#fff"};`}
|
|
13
13
|
font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
|
|
14
14
|
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
@@ -41,7 +41,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
41
41
|
height: 20px;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`,
|
|
44
|
+
`,qo=st(Ne,{FallbackComponent:ct});function Le({name:e,logo:t,description:n,...r}){if(!e&&!t&&!n)return null;const o=T.isValidElement(t)?t:d.jsx("img",{src:t,alt:e});return d.jsxs(Co,{...r,children:[d.jsxs("div",{children:[t&&d.jsx(P,{component:"a",href:"/",className:"footer-brand-logo",children:o}),e&&d.jsx("div",{className:"footer-brand-name",children:e})]}),n&&d.jsx("div",{className:"footer-brand-desc",children:n})]})}Le.propTypes={name:l.node,logo:l.node,description:l.string};Le.defaultProps={name:"",logo:"",description:""};const Co=M("div")`
|
|
45
45
|
display: flex;
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
font-size: 14px;
|
|
@@ -86,7 +86,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
`;function ee({links:e,flowLayout:t,...n}){const[r,o]=T.useState(-1);if(!(e!=null&&e.length))return null;const s=e.some(a=>{var c;return(c=a.items)==null?void 0:c.length}),i=({label:a,link:c,icon:u,render:f,props:p})=>{let h=a;return f?h=f({label:a,link:c,props:p}):c&&(h=d.jsx("a",{href:c,"aria-label":`Footer link for ${a}`,...p,children:a})),d.jsxs(d.Fragment,{children:[u&&d.jsx(
|
|
89
|
+
`;function ee({links:e,flowLayout:t,...n}){const[r,o]=T.useState(-1);if(!(e!=null&&e.length))return null;const s=e.some(a=>{var c;return(c=a.items)==null?void 0:c.length}),i=({label:a,link:c,icon:u,render:f,props:p})=>{let h=a;return f?h=f({label:a,link:c,props:p}):c&&(h=d.jsx("a",{href:c,"aria-label":`Footer link for ${a}`,...p,children:a})),d.jsxs(d.Fragment,{children:[u&&d.jsx(Q,{icon:u,size:20,sx:{mr:.5}}),h]})};return d.jsx(Ao,{...n,className:de(n.className,{"footer-links--grouped":s,"footer-links--flow":t}),children:d.jsxs("div",{className:"footer-links-inner",children:[t&&e.map((a,c)=>d.jsx("span",{className:"footer-links-item",children:i(a)},c)),!t&&e.map((a,c)=>{const{items:u}=a,f=c===r;return d.jsxs("div",{className:de("footer-links-group",{"footer-links-group--active":f}),onClick:()=>o(r===c?-1:c),children:[d.jsxs("span",{className:"footer-links-item",children:[i(a),!!(u!=null&&u.length)&&d.jsx("span",{className:"footer-links-group-expand-icon",children:d.jsx(dn,{style:{transform:`rotate(${f?180:0}deg)`}})})]}),!!(u!=null&&u.length)&&d.jsx("div",{className:"footer-links-sub",children:u.map((p,h)=>d.jsx("span",{className:"footer-links-item",children:i(p)},h))})]},c)})]})})}ee.propTypes={links:l.arrayOf(l.shape({label:l.string,link:l.string,render:l.func,props:l.object})),flowLayout:l.bool};ee.defaultProps={links:[],flowLayout:!1};const Ao=M("div")`
|
|
90
90
|
overflow: hidden;
|
|
91
91
|
color: ${e=>e.theme.palette.grey[600]};
|
|
92
92
|
.footer-links-inner {
|
|
@@ -209,7 +209,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
`;function Re({items:e,...t}){const n=pn();return e!=null&&e.length?d.jsx(Po,{...t,children:e.map((r,o)=>d.jsx("a",{href:r.link,target:"_blank","aria-label":`Social media icon${r.title?` for ${r.title}`:""}`,rel:"noreferrer",children:d.jsx(
|
|
212
|
+
`;function Re({items:e,...t}){const n=pn();return e!=null&&e.length?d.jsx(Po,{...t,children:e.map((r,o)=>d.jsx("a",{href:r.link,target:"_blank","aria-label":`Social media icon${r.title?` for ${r.title}`:""}`,rel:"noreferrer",children:d.jsx(Q,{icon:r.icon||r.title,sx:{bgcolor:n.palette.grey[600],color:"#fff"},size:24,component:"span"})},o))}):null}Re.propTypes={items:l.arrayOf(l.shape({icon:l.string,link:l.string}))};Re.defaultProps={items:null};const Po=M("div")`
|
|
213
213
|
display: inline-flex;
|
|
214
214
|
flex-wrap: wrap;
|
|
215
215
|
align-items: center;
|
|
@@ -260,7 +260,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
260
260
|
&& .footer-brand-logo {
|
|
261
261
|
margin-right: 0;
|
|
262
262
|
}
|
|
263
|
-
`;function
|
|
263
|
+
`;function _t({elements:e,data:t,...n}){return d.jsx(Ro,{...n,children:d.jsxs(at,{className:"plain-layout-container",children:[!!t.links&&d.jsxs(ie,{sx:{width:1},autoCenter:!0,children:[e.copyright,e.links]}),!t.links&&d.jsxs(d.Fragment,{children:[T.cloneElement(e.brand,{name:null,description:null}),e.copyright]})]})})}_t.propTypes={elements:l.shape({brand:l.element,navigation:l.element,socialMedia:l.element,copyright:l.element,links:l.element}).isRequired,data:l.object.isRequired};const Ro=M("div")`
|
|
264
264
|
padding: 24px 0;
|
|
265
265
|
.plain-layout-container {
|
|
266
266
|
display: flex;
|
|
@@ -269,10 +269,10 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
269
269
|
flex-wrap: wrap;
|
|
270
270
|
gap: 8px;
|
|
271
271
|
}
|
|
272
|
-
`,
|
|
272
|
+
`,qt=[{name:"plain",support:(e,t)=>{var n,r;return!((n=t.navigation)!=null&&n.length)&&!((r=t.socialMedia)!=null&&r.length)},component:_t},{name:"standard",support:()=>!0,component:$t}],Oo=qt.reduce((e,t)=>({...e,[t.name]:t}),{});function Ee(e){var x,v;const{brand:t,navigation:n,socialMedia:r,copyright:o,links:s,layout:i,...a}=e,c=()=>t?d.jsx(Le,{...t}):null,u=()=>n!=null&&n.length?d.jsx(ee,{links:n}):null,f=()=>r!=null&&r.length?d.jsx(Re,{items:r}):null,p=()=>{const k=(o==null?void 0:o.owner)||(t==null?void 0:t.name);return k?d.jsx(Oe,{owner:k,year:(o==null?void 0:o.year)||void 0}):null},h=()=>s!=null&&s.length?d.jsx(ee,{flowLayout:!0,links:s}):null,g={brand:c(),navigation:u(),socialMedia:f(),copyright:p(),links:h()};let m=null;if(i==="auto"?m=qt.find(k=>k.support(g,e)).component:m=(x=Oo[i])==null?void 0:x.component,!m)throw new Error(`layout ${i} is not supported.`);return d.jsxs(P,{position:"relative",...a,children:[d.jsx(m,{elements:g,data:e}),d.jsx(P,{position:"absolute",right:16,bottom:0,fontSize:12,sx:{color:"transparent","::selection":{background:"#000",color:"#fff"}},children:(v=window==null?void 0:window.blocklet)==null?void 0:v.version})]})}Ee.propTypes={brand:l.shape({name:l.node,description:l.string,logo:l.node}),navigation:l.arrayOf(l.shape({label:l.node,link:l.string})),socialMedia:l.arrayOf(l.shape({icon:l.node,link:l.string})),copyright:l.shape({owner:l.string,year:l.oneOfType([l.string,l.number])}),links:l.arrayOf(l.shape({label:l.node,link:l.string})),layout:l.oneOf(["auto","standard","plain"])};Ee.defaultProps={brand:null,navigation:null,copyright:null,socialMedia:null,links:null,layout:"auto"};function $e({meta:e,theme:t,...n}){var m,x,v,k;const{locale:r}=te()||{},o=T.useMemo(()=>{const b=Object.assign({},window.blocklet,e);try{return Pe(b)}catch(w){return console.error("Failed to format blocklet info",w,b),b}},[e]);if(!o.appName)return null;const{appLogo:s,appLogoRect:i,appName:a,appDescription:c,description:u,theme:f,copyright:p}=o,h={footerNav:$((m=o==null?void 0:o.navigation)==null?void 0:m.footer,r)||[],socialMedia:$((x=o==null?void 0:o.navigation)==null?void 0:x.social,r)||[],links:$((v=o==null?void 0:o.navigation)==null?void 0:v.bottom,r)||[]},g={brand:{name:a,description:c||u,logo:i||s},navigation:E(h.footerNav,b=>({...b,label:b.title,link:b.link}),"items"),copyright:p,socialMedia:h.socialMedia,links:h.links.map(b=>({...b,label:b.title}))};return d.jsx(re,{theme:t,children:d.jsx(Eo,{...g,...it(n,["bordered"]),$bordered:n==null?void 0:n.bordered,$bgcolor:(k=f==null?void 0:f.background)==null?void 0:k.footer})})}$e.propTypes={meta:Ce,theme:l.object};$e.defaultProps={meta:{},theme:null};const Eo=M(Ee)`
|
|
273
273
|
${({$bordered:e})=>`border-top: 1px solid ${e?A.strokeSep:"#eee"};`}
|
|
274
274
|
color: ${e=>e.theme.palette.grey[600]};
|
|
275
275
|
${({$bgcolor:e})=>e&&`background-color: ${e};`}
|
|
276
276
|
font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
|
|
277
277
|
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
278
|
-
`,Fo=st($e,{FallbackComponent:ct});function Ft({meta:e,fallbackUrl:t,invalidPathFallback:n,headerAddons:r,sessionManagerProps:o,links:s,...i}){var C;Et();const a=T.useContext(rt),c=(C=a==null?void 0:a.session)==null?void 0:C.user,u=c==null?void 0:c.role,{locale:f}=te()||{},p=T.useMemo(()=>{const j=Object.assign({},window.blocklet,e);try{return Pe(j)}catch(y){return console.error("Failed to format blocklet info",y,j),j}},[e]),{localizedNav:h,flattened:g,matchedIndex:m}=T.useMemo(()=>{var N;let j=$((N=p==null?void 0:p.navigation)==null?void 0:N.dashboard,f)||[];j=Ot(j,u),j=E(j,S=>({title:S.title,url:S.link,icon:S.icon?d.jsx("iconify-icon",{height:"100%",width:"100%",icon:S.icon}):null,external:!0,children:S.items}),"items");const y=Nt(j).filter(S=>!!S.url),I=Rt(y.map(S=>S.url));return I!==-1&&(y[I].active=!0),{localizedNav:j,flattened:y,matchedIndex:I}},[p,f,u]),x=typeof s=="function"?s(h):[...h,...s];if(T.useLayoutEffect(()=>{c&&!(g!=null&&g.length)&&t&&(window.location.href=t)},[t]),T.useLayoutEffect(()=>{c&&(g!=null&&g.length)&&m===-1&&n&&n()},[n,g,m]),!p.appName)return null;const{appLogo:v,appLogoRect:k,appName:b}=p,w=d.jsx(se,{formattedBlocklet:p,addons:r,sessionManagerProps:o});return d.jsx(hn,{title:b,fullWidth:!0,sidebarWidth:128,legacy:!1,links:x,...i,headerProps:{homeLink:K,logo:d.jsx("img",{src:k||v,alt:"logo"}),addons:w,...i.headerProps}})}Ft.propTypes={meta:Ce,fallbackUrl:l.string,invalidPathFallback:l.func,headerAddons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae,links:l.oneOfType([l.array,l.func])};Ft.defaultProps={meta:{},fallbackUrl:K,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=K}},links:[]};export{Ft as D,Fo as F,
|
|
278
|
+
`,Fo=st($e,{FallbackComponent:ct});function Ft({meta:e,fallbackUrl:t,invalidPathFallback:n,headerAddons:r,sessionManagerProps:o,links:s,...i}){var C;Et();const a=T.useContext(rt),c=(C=a==null?void 0:a.session)==null?void 0:C.user,u=c==null?void 0:c.role,{locale:f}=te()||{},p=T.useMemo(()=>{const j=Object.assign({},window.blocklet,e);try{return Pe(j)}catch(y){return console.error("Failed to format blocklet info",y,j),j}},[e]),{localizedNav:h,flattened:g,matchedIndex:m}=T.useMemo(()=>{var N;let j=$((N=p==null?void 0:p.navigation)==null?void 0:N.dashboard,f)||[];j=Ot(j,u),j=E(j,S=>({title:S.title,url:S.link,icon:S.icon?d.jsx("iconify-icon",{height:"100%",width:"100%",icon:S.icon}):null,external:!0,children:S.items}),"items");const y=Nt(j).filter(S=>!!S.url),I=Rt(y.map(S=>S.url));return I!==-1&&(y[I].active=!0),{localizedNav:j,flattened:y,matchedIndex:I}},[p,f,u]),x=typeof s=="function"?s(h):[...h,...s];if(T.useLayoutEffect(()=>{c&&!(g!=null&&g.length)&&t&&(window.location.href=t)},[t]),T.useLayoutEffect(()=>{c&&(g!=null&&g.length)&&m===-1&&n&&n()},[n,g,m]),!p.appName)return null;const{appLogo:v,appLogoRect:k,appName:b}=p,w=d.jsx(se,{formattedBlocklet:p,addons:r,sessionManagerProps:o});return d.jsx(hn,{title:b,fullWidth:!0,sidebarWidth:128,legacy:!1,links:x,...i,headerProps:{homeLink:K,logo:d.jsx("img",{src:k||v,alt:"logo"}),addons:w,...i.headerProps}})}Ft.propTypes={meta:Ce,fallbackUrl:l.string,invalidPathFallback:l.func,headerAddons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae,links:l.oneOfType([l.array,l.func])};Ft.defaultProps={meta:{},fallbackUrl:K,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=K}},links:[]};export{Ft as D,Fo as F,qo as H};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as $,P,r as w,f as ge,j as e,C as V,i as ke,u as me,q,t as je,v as ye,D as Ce,B as W,w as ve,m as L,x as Se,y as Be,z as de,A as z,E as we,d as Ae,F as De,H as Te,J as ee,K as Ee,M as T,N as te,O as y,Q as Ie,R as F,S as Le,U as Pe,V as Re}from"./index-
|
|
1
|
+
import{n as $,P,r as w,f as ge,j as e,C as V,i as ke,u as me,q,t as je,v as ye,D as Ce,B as W,w as ve,m as L,x as Se,y as Be,z as de,A as z,E as we,d as Ae,F as De,H as Te,J as ee,K as Ee,M as T,N as te,O as y,Q as Ie,R as F,S as Le,U as Pe,V as Re}from"./index-B3xG4j_m.js";import{_ as se}from"./useLocalStorage-oY64NyFX.js";import{g as _e,D as Fe}from"./index-DDz0k3Ws.js";import{E as Ne}from"./index-F8-V5r_A.js";import{u as $e,B as oe}from"./url-evaluation-COaPCQQI.js";import{D as Ue,u as Me,B as ne}from"./actions-5cGwZUC4.js";import{l as le}from"./index-cAvy7d1t.js";import{W as Oe}from"./tag-BblwJaFN.js";import{I as We,B as ze}from"./install-from-url-8E3AOsnG.js";import{B as ae}from"./app-avatar-B8i6B60Z.js";import{d as Ve}from"./Add-BtLBv8RH.js";import{S as E}from"./index-BwcvZbXh.js";import{T as re}from"./TextField-DUu48qpa.js";import{F as qe,S as Ke}from"./Select-qp0JQJcs.js";import"./FilterList-Ct9UcCML.js";import"./Delete-BEWLPqF6.js";import"./InputLabel-BKDMs5hY.js";import"./LastPage-BxVeiJ-c.js";import"./index-X6nP96CH.js";import"./redux-CLRT_Hpo.js";import"./Search-H33KEmee.js";import"./MoreVert-7yr_Whs5.js";import"./ButtonGroup-DOhNpzpa.js";import"./getValidReactChildren-CwN_gBVm.js";import"./isEqual-CKWAVZDl.js";import"./index-K_ohrRtr.js";import"./Stepper-sVD4C8Z2.js";function N({blocklet:g,skipAccessibilityCheck:c=!1,...p}){const{t:a}=w.useContext(ge),{urls:C,loading:o,recommendedUrl:m}=$e(g);if(o&&!c)return e.jsx(V,{size:12,...p});const x=c?C[0]:m;return x?e.jsx(He,{...p,children:e.jsx(Qe,{children:e.jsx(ke,{href:x,target:"_blank",className:"blocklet-interface",underline:"hover",children:a("common.open")})})}):a("blocklet.router.noAccessibleUrl")}const Qe=$.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
margin: 4px 0;
|
|
4
4
|
`,He=$.div`
|
|
@@ -12,7 +12,7 @@ import{n as $,P,r as w,f as ge,j as e,C as V,i as ke,u as me,q,t as je,v as ye,D
|
|
|
12
12
|
margin-right: 4px;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
`;N.propTypes={blocklet:P.object.isRequired,skipAccessibilityCheck:P.bool};N.defaultProps={skipAccessibilityCheck:!1};const ie={title:/^.{3,40}$/,description:/^.{3,160}$/};function K({onCancel:g,onSuccess:c}){const{info:p}=me(),{t:a}=q(),{api:C}=je(),[o,m]=ye({loading:!1,title:"",titleError:"",description:"",descriptionError:"",isConnectOpen:!1}),x=()=>{m({loading:!0,isConnectOpen:!0})},b=d=>{m({loading:!1,isConnectOpen:!1}),c(d)},v=()=>{m({loading:!1,isConnectOpen:!1})},k=d=>{const{value:n,name:r}=d.target;m({[`${r}Error`]:n&&!ie[r].test(n)?a(`blocklet.${r}ValidationError`):""})},S=d=>{const{value:n,name:r}=d.target,u=`${r}Error`;o[u]?m({[r]:n,[u]:n&&!ie[r].test(n)?a(`blocklet.${r}ValidationError`):""}):m({[r]:n})};return e.jsxs(e.Fragment,{children:[e.jsx(Ce,{title:a("blocklet.installFromCreate"),fullWidth:!0,maxWidth:"sm",onClose:()=>g(),showCloseButton:!0,open:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:d=>{d.stopPropagation(),g()},color:"inherit",children:a("common.cancel")}),e.jsxs(W,{onClick:d=>{d.stopPropagation(),x()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:o.loading||o.titleError||o.descriptionError||!o.title||!o.description,style:{marginLeft:8},children:[o.loading&&e.jsx(V,{size:16}),a("common.create")]})]}),children:e.jsx(ve,{component:"div",children:e.jsxs(L,{component:"div",children:[e.jsx(re,{style:{marginBottom:24},label:`Blocklet ${a("common.title")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,autoFocus:!0,name:"title",value:o.title,onBlur:k,onChange:S,error:!!o.titleError,helperText:o.titleError,disabled:o.loading}),e.jsx(re,{label:`Blocklet ${a("common.description")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,name:"description",value:o.description,onBlur:k,onChange:S,error:!!o.descriptionError,helperText:o.descriptionError,disabled:o.loading})]})})}),e.jsx(Se,{popup:!0,open:o.isConnectOpen,forceConnected:!1,className:"launch-from-create-auth",action:"launch-free-blocklet-by-session",checkFn:C.get,checkTimeout:5*60*1e3,webWalletUrl:Be(p),onSuccess:b,extraParams:{title:o.title,description:o.description},messages:{title:a("setup.keyPair.title"),scan:a("setup.keyPair.scan"),confirm:a("setup.keyPair.confirm"),success:a("setup.keyPair.success")},onClose:v})]})}K.propTypes={onCancel:P.func.isRequired,onSuccess:P.func.isRequired};K.defaultProps={};function Q({onCreate:g}){const c=de(),{t:p}=q(),[a,C]=w.useState(""),[o,m]=w.useState(""),[x,b]=w.useState(null),[v,k]=w.useState(null),S=()=>{b(null)},d=()=>{b({onCancel:()=>{S(),b(null)},onSuccess:()=>{S()}})},n=()=>{k({onCancel:()=>{k(null)},onSuccess:(...j)=>{k(null),g(...j)}})},r=()=>{const j=new URL("http://localhost");j.searchParams.set("restoreFrom","server"),j.searchParams.set("serverUrl",window.location.href),c(`/blocklets/restore${j.search}`)},u=()=>{c("/blocklets/restore")};return e.jsxs(e.Fragment,{children:[e.jsxs(E,{onClick:()=>c("/store"),menuButtonProps:{"data-cy":"open-install-menu"},menu:[e.jsx(E.Item,{"data-cy":"open-install-form",onClick:()=>d(),children:p("blocklet.installFromUrl")},"1"),e.jsx(E.Item,{"data-cy":"open-create-form",onClick:()=>n(),children:p("blocklet.installFromCreate")},"2"),e.jsx(E.Item,{"data-cy":"open-install-from-spaces",onClick:()=>u(),children:p("blocklet.restoreFromSpaces.title")},"3"),e.jsx(E.Item,{"data-cy":"open-install-from-spaces",onClick:()=>r(),children:p("blocklet.installFromDiskBackup")},"3")].filter(Boolean),children:[e.jsx(Ve,{}),p("blocklet.installFromMarket")]}),!!a&&e.jsx(z,{variant:"error",message:a,onClose:()=>C("")}),!!o&&e.jsx(z,{variant:"success",duration:3e3,message:o,onClose:()=>m("")}),x&&e.jsx(We,{onCancel:x.onCancel,onSuccess:x.onSuccess}),v&&e.jsx(K,{onCancel:v.onCancel,onSuccess:v.onSuccess})]})}Q.propTypes={onCreate:P.func};Q.defaultProps={onCreate:()=>{}};const I="internal",ce="external";function Bt(){return e.jsx(Ue,{children:e.jsx(Je,{})})}function Je(){const g=de(),c=me(),[p,a]=we(),{data:C,externalData:o,error:m,refresh:x,loading:b}=Ae(),{deletingBlocklets:v,addDeletingDid:k,removeDeletingDid:S,matchDeletingDid:d}=Me(),{t:n,locale:r}=q(),[u,j]=w.useState(p.get("searchText")),[pe]=se("show-external-blocklet-actions",!1),ue=[{id:I,name:n("blocklet.internal")},{id:ce,name:n("blocklet.external")}],[A,fe]=se("blocklet-type-filter",I),H=A===I?C:o,xe=(c==null?void 0:c.info.mode)!==De.NODE_MODES.SERVERLESS;d(H.map(l=>l.meta.did));const J=({action:l,blocklet:_})=>{l==="remove"&&k(_.meta.did)},X=l=>{if(l.error){z.error(l.error.message),l.action==="remove"&&S(l.blocklet.meta.did);return}l.action==="remove"&&c.refresh({silent:!0})},G=Te(l=>l.breakpoints.up("md"));let R=null;const U=H||[];if(m)R=e.jsx(ee,{
|
|
15
|
+
`;N.propTypes={blocklet:P.object.isRequired,skipAccessibilityCheck:P.bool};N.defaultProps={skipAccessibilityCheck:!1};const ie={title:/^.{3,40}$/,description:/^.{3,160}$/};function K({onCancel:g,onSuccess:c}){const{info:p}=me(),{t:a}=q(),{api:C}=je(),[o,m]=ye({loading:!1,title:"",titleError:"",description:"",descriptionError:"",isConnectOpen:!1}),x=()=>{m({loading:!0,isConnectOpen:!0})},b=d=>{m({loading:!1,isConnectOpen:!1}),c(d)},v=()=>{m({loading:!1,isConnectOpen:!1})},k=d=>{const{value:n,name:r}=d.target;m({[`${r}Error`]:n&&!ie[r].test(n)?a(`blocklet.${r}ValidationError`):""})},S=d=>{const{value:n,name:r}=d.target,u=`${r}Error`;o[u]?m({[r]:n,[u]:n&&!ie[r].test(n)?a(`blocklet.${r}ValidationError`):""}):m({[r]:n})};return e.jsxs(e.Fragment,{children:[e.jsx(Ce,{title:a("blocklet.installFromCreate"),fullWidth:!0,maxWidth:"sm",onClose:()=>g(),showCloseButton:!0,open:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:d=>{d.stopPropagation(),g()},color:"inherit",children:a("common.cancel")}),e.jsxs(W,{onClick:d=>{d.stopPropagation(),x()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:o.loading||o.titleError||o.descriptionError||!o.title||!o.description,style:{marginLeft:8},children:[o.loading&&e.jsx(V,{size:16}),a("common.create")]})]}),children:e.jsx(ve,{component:"div",children:e.jsxs(L,{component:"div",children:[e.jsx(re,{style:{marginBottom:24},label:`Blocklet ${a("common.title")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,autoFocus:!0,name:"title",value:o.title,onBlur:k,onChange:S,error:!!o.titleError,helperText:o.titleError,disabled:o.loading}),e.jsx(re,{label:`Blocklet ${a("common.description")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,name:"description",value:o.description,onBlur:k,onChange:S,error:!!o.descriptionError,helperText:o.descriptionError,disabled:o.loading})]})})}),e.jsx(Se,{popup:!0,open:o.isConnectOpen,forceConnected:!1,className:"launch-from-create-auth",action:"launch-free-blocklet-by-session",checkFn:C.get,checkTimeout:5*60*1e3,webWalletUrl:Be(p),onSuccess:b,extraParams:{title:o.title,description:o.description},messages:{title:a("setup.keyPair.title"),scan:a("setup.keyPair.scan"),confirm:a("setup.keyPair.confirm"),success:a("setup.keyPair.success")},onClose:v})]})}K.propTypes={onCancel:P.func.isRequired,onSuccess:P.func.isRequired};K.defaultProps={};function Q({onCreate:g}){const c=de(),{t:p}=q(),[a,C]=w.useState(""),[o,m]=w.useState(""),[x,b]=w.useState(null),[v,k]=w.useState(null),S=()=>{b(null)},d=()=>{b({onCancel:()=>{S(),b(null)},onSuccess:()=>{S()}})},n=()=>{k({onCancel:()=>{k(null)},onSuccess:(...j)=>{k(null),g(...j)}})},r=()=>{const j=new URL("http://localhost");j.searchParams.set("restoreFrom","server"),j.searchParams.set("serverUrl",window.location.href),c(`/blocklets/restore${j.search}`)},u=()=>{c("/blocklets/restore")};return e.jsxs(e.Fragment,{children:[e.jsxs(E,{onClick:()=>c("/store"),menuButtonProps:{"data-cy":"open-install-menu"},menu:[e.jsx(E.Item,{"data-cy":"open-install-form",onClick:()=>d(),children:p("blocklet.installFromUrl")},"1"),e.jsx(E.Item,{"data-cy":"open-create-form",onClick:()=>n(),children:p("blocklet.installFromCreate")},"2"),e.jsx(E.Item,{"data-cy":"open-install-from-spaces",onClick:()=>u(),children:p("blocklet.restoreFromSpaces.title")},"3"),e.jsx(E.Item,{"data-cy":"open-install-from-spaces",onClick:()=>r(),children:p("blocklet.installFromDiskBackup")},"3")].filter(Boolean),children:[e.jsx(Ve,{}),p("blocklet.installFromMarket")]}),!!a&&e.jsx(z,{variant:"error",message:a,onClose:()=>C("")}),!!o&&e.jsx(z,{variant:"success",duration:3e3,message:o,onClose:()=>m("")}),x&&e.jsx(We,{onCancel:x.onCancel,onSuccess:x.onSuccess}),v&&e.jsx(K,{onCancel:v.onCancel,onSuccess:v.onSuccess})]})}Q.propTypes={onCreate:P.func};Q.defaultProps={onCreate:()=>{}};const I="internal",ce="external";function Bt(){return e.jsx(Ue,{children:e.jsx(Je,{})})}function Je(){const g=de(),c=me(),[p,a]=we(),{data:C,externalData:o,error:m,refresh:x,loading:b}=Ae(),{deletingBlocklets:v,addDeletingDid:k,removeDeletingDid:S,matchDeletingDid:d}=Me(),{t:n,locale:r}=q(),[u,j]=w.useState(p.get("searchText")),[pe]=se("show-external-blocklet-actions",!1),ue=[{id:I,name:n("blocklet.internal")},{id:ce,name:n("blocklet.external")}],[A,fe]=se("blocklet-type-filter",I),H=A===I?C:o,xe=(c==null?void 0:c.info.mode)!==De.NODE_MODES.SERVERLESS;d(H.map(l=>l.meta.did));const J=({action:l,blocklet:_})=>{l==="remove"&&k(_.meta.did)},X=l=>{if(l.error){z.error(l.error.message),l.action==="remove"&&S(l.blocklet.meta.did);return}l.action==="remove"&&c.refresh({silent:!0})},G=Te(l=>l.breakpoints.up("md"));let R=null;const U=H||[];if(m)R=e.jsx(ee,{severity:"error",variant:"icon",children:e.jsxs("div",{children:[Ee(m),e.jsx(W,{onClick:()=>x({silent:!1}),children:e.jsx("span",{style:{color:"#44cdc6",textDecoration:"underline"},children:n("common.retry")})})]})});else if(U.length>0||b){const l=["installedAt","startedAt","stoppedAt","createdAt"],_=s=>{if(s.status==="starting")return new Date("2199").getTime();if(s.status==="running"){if(s.appRuntimeInfo)return s.appRuntimeInfo.startAt;if(s.startedAt)return s.startedAt.getTime()}return 0};let f=U.map(s=>(l.forEach(t=>{if(s[t]){const h=new Date(s[t]);s[t]=h}}),s)).sort((s,t)=>{const h=_(s);return _(t)-h});u&&(f=f.filter(s=>{var i;const t=T.getDisplayName(s)||"",h=((i=s.site)==null?void 0:i.domainAliases)||[],B=le.isValid(u)?le.toAddress(u):u,D=u.trim().toLocaleLowerCase();return s.appDid===B||s.appPid===B||t.toLocaleLowerCase().includes(D)||h.some(O=>{var Z;return(Z=O.value)==null?void 0:Z.toLocaleLowerCase().includes(D)})}));const M=_e("blocklets-list");M.searchText&&!u&&j(M.searchText);const be=[{label:n("common.name"),name:"meta.title",options:{customBodyRenderLite(s){const t=f[s],h=T.getAppMissingConfigs(t).length>0?"components":"overview";return e.jsx(te,{to:`/blocklets/${t.meta.did}/${h}`,className:"blocklet-name-wrapper",children:e.jsxs(L,{component:"strong",variant:"body1",className:"blocklet-name",children:[e.jsx(ae,{blocklet:t,style:{marginRight:8}}),e.jsxs(y,{children:[e.jsx(y,{children:T.getDisplayName(t)}),e.jsxs(y,{children:[e.jsx(ze,{mode:t.mode||""}),!Ie(t.controller)&&e.jsx(Oe,{type:"primary",children:n("blocklet.external")})]})]})]})},t.meta.did)}}},A===I?{label:n("common.visit"),name:"runtimeInfo.pid",align:"left",options:{sort:!1,customBodyRenderLite(s){const t=f[s];return e.jsx(N,{blocklet:t},t.meta.did)}}}:null,{label:n("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(s){const t=f[s];return t.status==="running"&&t.appRuntimeInfo?e.jsx(F,{value:t.appRuntimeInfo.startAt,locale:r},t.meta.did):""}}},{label:n("common.installedAt"),name:"installedAt",options:{customBodyRenderLite(s){const t=f[s];return t.installedAt?e.jsx(F,{value:t.installedAt.getTime(),locale:r},t.meta.did):t.createdAt?e.jsx(F,{value:t.createdAt.getTime(),locale:r},t.meta.did):""}}},{label:n("common.updatedAt"),name:"updatedAt",options:{customBodyRenderLite(s){const t=f[s];return e.jsx(F,{value:t.updatedAt,locale:r},t.meta.did)}}},{label:n("common.status"),name:"status",width:120,align:"center",options:{customBodyRenderLite(s){const t=f[s];return e.jsx(oe,{"data-cy":"blocklet-status","status-blocklet-did":t.meta.did,status:v.includes(t.meta.did)?"deleting":t.status,source:t.source,progress:t.progress},t.meta.did)}}},A===I||pe?{label:n("common.actions"),name:"",width:90,options:{sort:!1,customBodyRenderLite(s){const t=f[s];return e.jsx(ne,{blocklet:t,variant:"menu",onStart:J,onComplete:X},t.meta.did)}}}:null].filter(Boolean),Y={};G||(Y.TableBody=function(t){if(b)return e.jsx(Re,{relative:"parent",children:e.jsx(V,{})});const{page:h,rowsPerPage:B}=t,D=f.slice(h*B,(h+1)*B);return D.length?e.jsx("div",{children:D.map(i=>{const O=T.getAppMissingConfigs(i).length>0?"components":"overview";return e.jsxs(y,{className:"blocklet-item--mobile",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(ae,{className:"blocklet__avatar",blocklet:i,size:G?40:60}),e.jsxs(te,{className:"blocklet__content",to:`/blocklets/${i.meta.did}/${O}`,children:[e.jsxs(y,{display:"flex",justifyContent:"space-between",alignItems:"flex-start",children:[e.jsx(L,{component:"strong",variant:"body1",className:"blocklet__name",children:T.getDisplayName(i,!0)}),e.jsx(ne,{blocklet:i,variant:"menu",onStart:J,onComplete:X},i.meta.did)]}),e.jsxs(L,{component:"small",className:"blocklet__addons",children:[e.jsx(y,{display:"flex",alignItems:"center",children:e.jsx(N,{blocklet:i,style:{marginLeft:16,fontSize:14}})}),e.jsx(oe,{"status-blocklet-did":i.meta.did,status:i.status,source:i.source,progress:i.progress},i.meta.did)]})]})]})})}):e.jsx(Ne,{children:n("common.empty")})}),R=e.jsx(Xe,{children:e.jsx(Fe,{loading:b,className:"blocklet-list",title:e.jsx(y,{display:"flex",alignItems:"center",children:n("blocklet.index.tableTitle")}),locale:r,data:f,columns:be,durable:"blocklets-list",options:{download:!1,filter:!1,print:!1,searchPlaceholder:n("common.search"),searchAlwaysOpen:!1,sortOrder:{name:"uptime",direction:"desc"},searchDebounceTime:300,onSearchChange:s=>{j(s),a({searchText:s??""})},customSearch:()=>!0,...M,searchText:u},components:Y})})}else U.length===0&&(R=e.jsx(ee,{severity:"warning",variant:"icon",children:n("blocklet.index.noBlocklet")}));const he=o&&o.length>0;return e.jsxs(Ge,{children:[e.jsxs(L,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[e.jsxs(y,{display:"flex",alignItems:"center",children:[n("common.blocklets"),(he||A===ce)&&e.jsx(qe,{sx:{ml:1},children:e.jsx(Ke,{value:A,onChange:l=>fe(l.target.value),size:"small",children:ue.map(l=>e.jsx(Le,{value:l.id,children:n(l.name)},l.id))})})]}),e.jsx(Pe,{permission:"mutate_blocklets",children:xe&&e.jsx(Q,{onCreate:l=>{g(`/blocklets/${l.appDid}/components`)}})})]}),R]})}const Xe=$.div`
|
|
16
16
|
.blocklet-item--mobile {
|
|
17
17
|
padding: 16px 0;
|
|
18
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bK as vc,j as m,C as Z2,P as S,n as _0,r as _,eU as ib,cv as Vc,cz as tb,k as Ez,g as qb,H as Kz,cG as Cc,Z as Pc,eV as Fc,dz as jc,e7 as Yc,e8 as Ic,eW as Uc,eX as Hc,m as Kc,V as Qc,aK as Jc,aL as $c,eY as Zc,cw as gz,b9 as MA,dy as bA,s as zA}from"./index-B3xG4j_m.js";import{j as pA}from"./url-join-BxAyYKSd.js";import{S as l2}from"./Skeleton-qLcD_DNR.js";import{C as OA}from"./Close-D3TvnCuM.js";import{l as oA}from"./lottie-CcK7qdKQ.js";const cA=vc([m.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),m.jsx("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function rb({value:M,size:z,style:O,...o}){return m.jsxs(AA,{style:{width:z,height:z,...O},...o,children:[m.jsx(Z2,{variant:"determinate",role:"progressbar",value:100,size:z,"aria-label":"decorative progress bar",thickness:10,style:{color:"#dddddd"}}),m.jsx(Z2,{variant:"determinate",value:M,role:"progressbar",size:z,thickness:10,"aria-label":"main progress bar"})]})}rb.propTypes={value:S.number.isRequired,size:S.number,style:S.object};rb.defaultProps={size:10,style:{}};const AA=_0.span`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
position: relative;
|
|
4
4
|
> * {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{P as o,s as C,j as n,O as u,aK as x,aL as g,
|
|
1
|
+
import{P as o,s as C,j as n,O as u,aK as x,aL as g,ba as j,q as T}from"./index-B3xG4j_m.js";function i({icon:e,title:t,description:s,extra:E,...I}){return n.jsxs(w,{...I,children:[e,typeof t=="string"?n.jsx(u,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:t}):t,typeof s=="string"?n.jsx(u,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:s}):s,n.jsx(u,{mt:3,children:E})]})}i.propTypes={icon:o.element,title:o.oneOfType([o.string,o.element]),description:o.oneOfType([o.string,o.element]),actions:o.any,extra:o.element};i.defaultProps={icon:void 0,title:"",description:"",actions:null,extra:void 0};const w=C("div")`
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as
|
|
1
|
+
import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as A,$ as he,a0 as ye,a1 as j,a2 as ee,a3 as Ge,A as M,K as Y,h as He,H as te,a4 as qe,m as $,T as Ve,a5 as Ye,a6 as Qe,B as U,D as Ke,C as be,w as Je,J as ve,a7 as Xe,a8 as Ze,a9 as et,u as I,f as tt,aa as W,t as Z,E as st,ab as se,z as Se,v as oe,ac as ot,W as re,i as je,x as Ce,y as Q,ad as rt,ae as nt,af as Pe,ag as at,b as B,ah as it,N as lt,ai as ct,Q as dt,aj as pt,ak as Re,al as Te,am as Ee,an as De,ao as Be,ap as N,aq as Ue,ar as Oe,as as _e,at as mt}from"./index-B3xG4j_m.js";import{P as G,L as ht,A as ut,S as Ae,a as Fe}from"./index-CbJHqm-m.js";import{A as ft,D as ne,u as xt,W as gt,P as wt,L as Le,d as $e,a as Ne}from"./wait-container-BSfEt36J.js";import{_ as ue}from"./useLocalStorage-oY64NyFX.js";import{d as kt}from"./Launch-C-oETX-0.js";import{D as yt}from"./DeleteOutline-CLuHNgk7.js";import{g as bt,i as vt}from"./spaces-BXx_g7nZ.js";import{T as St}from"./TextField-DUu48qpa.js";import{i as fe}from"./isEqual-CKWAVZDl.js";import{d as jt}from"./MoreVert-7yr_Whs5.js";import{E as Ct}from"./index-F8-V5r_A.js";import"./url-join-BxAyYKSd.js";import"./Skeleton-qLcD_DNR.js";import"./Close-D3TvnCuM.js";import"./lottie-CcK7qdKQ.js";import"./DeleteOutline-y9OF7zr1.js";import"./api-BtaHDJED.js";import"./Select-qp0JQJcs.js";import"./InputLabel-BKDMs5hY.js";var Pt=We;function Rt(t){return Pt(t).toLowerCase()}var Tt=Rt;const Et=ze(Tt);function ae({children:t,selected:r}){return e.jsxs(Dt,{children:[t,e.jsx(S,{className:`selected-container ${r?"selected":""}`,children:e.jsx(ke,{className:"selected-icon"})})]})}const Dt=P(S)`
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
.selected-container {
|
|
@@ -53,17 +53,17 @@ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as $,
|
|
|
53
53
|
visibility: visible;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
`;ae.propTypes={children:V.node.isRequired,selected:V.bool};ae.defaultProps={selected:!1};const Me=x.createContext({}),{Provider:Bt,Consumer:
|
|
56
|
+
`;ae.propTypes={children:V.node.isRequired,selected:V.bool};ae.defaultProps={selected:!1};const Me=x.createContext({}),{Provider:Bt,Consumer:Rs}=Me;function ie({children:t}){const{t:r}=A(),[s,c]=ue("spaceGatewaysForRestore",[{name:"Prod DID Spaces",url:"https://www.didspaces.com/app",protected:!0},{name:"Staging DID Spaces",url:"https://spaces.staging.arcblock.io/app",protected:!0}]),[d,m]=ue("selectedSpaceGatewayForRestore",s.find(o=>o.url==="https://www.didspaces.com/app")),l=o=>{const i=s.find(g=>o.url===g.url);if(i)throw new Error(r("storage.spaces.gateway.add.duplicate",{name:i.name}));c(()=>[...s,he.cloneDeep(o)]),m(o)},h=o=>{if(o.url===d.url)throw new Error(r("storage.spaces.gateway.delete.failedForSelected"));c(()=>s.filter(i=>i.url!==o.url))},u=o=>{m(o)};return x.useEffect(()=>{async function o(){const i=await Promise.all(s.map(async g=>{const{data:n}=await ye.get(j(g.url,"/__blocklet__.js?type=json"),{timeout:5e3}).catch(O=>(console.error(O),{data:{}})),p=n.appName??g.name;return he.merge(g,{name:p})}));c(i)}o()},[]),e.jsx(Bt,{value:{spaceGateways:s,selectedSpaceGateway:d,addSpaceGateway:l,deleteSpaceGateway:h,handleSelectSpaceGateway:u},children:t})}ie.propTypes={children:T.any.isRequired};ie.defaultProps={};function Ut(){return x.useContext(Me)}function le({spaceGateway:t,onDeleteSpaceGateway:r}){const{t:s}=A(),[c,d]=x.useState(!1),[m,l]=x.useState(!1),h=(o,i)=>{o==null||o.stopPropagation(),d(i)},u=async o=>{try{o==null||o.stopPropagation(),l(!0),await r(t),d(!1)}catch(i){console.error(i),M.error(`${s("storage.spaces.gateway.delete.failed")}: ${Y(i)}`)}finally{l(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(ee,{size:"small",onClick:o=>h(o,!0),children:e.jsx(yt,{})}),e.jsx(Ge,{title:s("common.delConfirmDescription",{data:`${t==null?void 0:t.name}`}),open:c,confirmButton:{text:s("common.confirm"),props:{variant:"contained",color:"error",loading:m}},cancelButton:{text:s("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:u,onCancel:o=>h(o,!1)})]})}le.propTypes={onDeleteSpaceGateway:T.func,spaceGateway:T.shape({name:T.string.isRequired,url:T.string.isRequired,protected:T.bool}).isRequired};le.defaultProps={onDeleteSpaceGateway:()=>{}};function Ot(){const t=He(),r=te(t.breakpoints.down("md"));return{minWidth:r?300:t.breakpoints.values.sm,isMobile:r}}const _t=qe(()=>({menuName:{display:"flex",flex:1,flexDirection:"column",paddingRight:"24px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}));function ce({spaceGateway:t,selected:r,onDeleteSpaceGateway:s,onSelectGateway:c,...d}){const m=_t(),{t:l}=A(),{isMobile:h}=Ot(),u=i=>{i.stopPropagation(),window.open(t.url)},o=async()=>{await s(t)};return e.jsxs(At,{...d,children:[e.jsx(S,{display:"inline-flex",marginRight:"8px",alignItems:"center",children:e.jsx("img",{alt:t.name,src:j(t.url,"favicon.ico"),width:"48px",height:"48px"})}),e.jsxs(S,{className:m.menuName,onClick:c,children:[e.jsxs($,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:[t==null?void 0:t.name," ",r&&e.jsx(Ve,{color:"primary",style:{marginLeft:"8px"},children:l("common.selected")})]}),e.jsx($,{className:"url",component:"span",variant:"inherit",children:h?`${Ye(t==null?void 0:t.url,38)}`:`${t==null?void 0:t.url}`})]}),e.jsxs(Qe,{children:[e.jsx(ee,{onClick:u,size:"small",children:e.jsx(kt,{})}),(t==null?void 0:t.protected)!==!0&&e.jsx(le,{spaceGateway:t,onDeleteSpaceGateway:o})]})]})}const At=P(S)`
|
|
57
57
|
display: flex;
|
|
58
|
-
`;ce.propTypes={spaceGateway:T.shape({name:T.string.isRequired,url:T.string.isRequired,protected:T.bool}).isRequired,selected:T.bool,onDeleteSpaceGateway:T.func,onSelectGateway:V.func};ce.defaultProps={onDeleteSpaceGateway:()=>{},selected:!1,onSelectGateway:()=>{}};function de({onAddGateway:t,...r}){const{t:s,locale:c}
|
|
58
|
+
`;ce.propTypes={spaceGateway:T.shape({name:T.string.isRequired,url:T.string.isRequired,protected:T.bool}).isRequired,selected:T.bool,onDeleteSpaceGateway:T.func,onSelectGateway:V.func};ce.defaultProps={onDeleteSpaceGateway:()=>{},selected:!1,onSelectGateway:()=>{}};function de({onAddGateway:t,...r}){const{t:s,locale:c}=A(),[d,m]=x.useState(""),[l,h]=x.useState(!1),[u,o]=x.useState(!1),[i,g]=x.useState(""),n=async()=>{try{h(!0);const p=await bt(d,{withSearchParams:!1});if(!await vt(p))throw new Error(s("storage.spaces.gateway.add.invalidUrl"));const{data:O}=await ye.get(j(new URL(p).origin,"/__blocklet__.js?type=json")),f={name:O.appName,url:p,protected:!1};await t(f),M.success(s("storage.spaces.addedWithName",{name:f.name})),o(!1)}catch(p){g(`${s("storage.spaces.gateway.add.failed",c)}: ${Y(p)}`)}finally{h(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(U,{size:"middle",color:"primary",variant:"outlined",onClick:()=>o(!0),...r,children:s("storage.spaces.gateway.add.title")}),e.jsxs(Ke,{title:s("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:u,onClose:()=>o(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(U,{onClick:p=>{p.stopPropagation(),o(!1)},color:"inherit",children:s("common.cancel")}),e.jsxs(U,{onClick:p=>{p.stopPropagation(),n()},color:"primary","data-cy":"install-blocklet-next-step",disabled:l||!d,variant:"contained",autoFocus:!0,children:[l&&e.jsx(be,{size:16}),s("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(Je,{component:"div",children:e.jsx($,{component:"div",children:e.jsx(St,{label:s("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:d,onChange:p=>{g(null),m(p.target.value)},disabled:l,onKeyPress:async p=>{p.key==="Enter"&&(p.preventDefault(),await n())},autoFocus:!0})})})}),!!i&&e.jsx(ve,{severity:"error",style:{width:"100%"},children:i})]})]})}de.propTypes={onAddGateway:T.func};de.defaultProps={onAddGateway:()=>{}};function pe({onConnect:t,...r}){const{spaceGateways:s,selectedSpaceGateway:c,handleSelectSpaceGateway:d,addSpaceGateway:m,deleteSpaceGateway:l}=Ut(),{t:h}=A(),u=n=>{d(n)},o=async n=>{await m(n)},i=()=>{t(c)},g=async n=>{await l(n)};return e.jsxs(S,{...r,children:[e.jsx(Xe,{children:s.map(n=>{const p=(n==null?void 0:n.url)===c.url;return e.jsx(ae,{selected:p,children:e.jsx(Ze,{button:!0,selected:p,"data-cy":"get-space-endpoint-for-restore",children:e.jsx(et,{children:e.jsx(ce,{spaceGateway:n,onDeleteSpaceGateway:g,selected:p,onSelectGateway:()=>u(n)})})},n.url)})})}),e.jsxs(S,{display:"flex",marginTop:"16px",justifyContent:"center",alignItems:"center",children:[e.jsx(de,{onAddGateway:o}),e.jsx(U,{sx:{marginLeft:"16px"},size:"middle",variant:"contained",onClick:i,children:h("storage.spaces.connect.now")})]})]})}pe.propTypes={onConnect:V.func};pe.defaultProps={onConnect:()=>{}};const Ft=P("div")`
|
|
59
59
|
width: 100%;
|
|
60
60
|
height: 100%;
|
|
61
61
|
overflow-y: auto;
|
|
62
|
-
`;function
|
|
62
|
+
`;function Lt(){const{info:t}=I(),{t:r,locale:s}=x.useContext(tt),c=x.useMemo(()=>t?W(t):"",[t]),d=m=>{const l=new URL(j(m.url,"restore")),h=j(c,"blocklets/restore/verify-ownership");l.searchParams.set("redirectUrl",h),l.searchParams.set("locale",s),window.location.href=l.toString()};return e.jsx(ie,{children:e.jsxs(Ft,{children:[e.jsx(G,{title:r("blocklet.restoreFromSpaces.connect.title"),subTitle:r("blocklet.restoreFromSpaces.connect.subTitle"),onClickBack:()=>window.history.back()}),e.jsx(S,{display:"flex",justifyContent:"center",children:e.jsx(pe,{sx:{marginTop:"64px",marginBottom:"32px",width:"720px"},onConnect:d})})]})})}const $t=P("div")`
|
|
63
63
|
width: 100%;
|
|
64
64
|
height: 100%;
|
|
65
65
|
overflow-y: auto;
|
|
66
|
-
`,q="verify-app-ownership-spaces",Nt=t=>{const r=t.split("/").filter(Boolean);return r[r.length-2]};function Mt(){const{session:t}=Z(),[r]=st(),{t:s}
|
|
66
|
+
`,q="verify-app-ownership-spaces",Nt=t=>{const r=t.split("/").filter(Boolean);return r[r.length-2]};function Mt(){const{session:t}=Z(),[r]=st(),{t:s}=A(),{api:c,info:d}=I(),{api:m}=Z(),{meta:l}=se(),h=Se(),u=x.useMemo(()=>d?W(d):"",[d]),[o,i]=oe({isRestoring:!1,isComplete:!1,isOverwrite:!1,shouldReconnect:!1,exists:!1,accessUrl:"",isConnectOpen:!1,isConfirmOpen:!1,connectData:{action:"",checkFn:()=>{},extraParams:{}},connectMessages:{}}),g=r.get("launchType"),n=r.get("nftId"),p=r.get("chainHost"),O=r.get("from"),f=r.get("blocklet_meta_url"),y=r.get("launcherSessionId")||"",a=r.get("launcherUrl")||"",b=Nt(l.spaceEndpoint),E=ot.getServerAuthMethod(d,g,y,t.user),F=async(_,D)=>{const w=Array.isArray(_)?_.find(v=>!!v.sessionToken):_;w!=null&&w.sessionToken&&(nt(D(w.sessionToken)),await t.refresh()),i({isConnectOpen:!1}),setTimeout(()=>{const v=new URLSearchParams({appDid:b});[{name:"launchType",value:g},{name:"nftId",value:n},{name:"from",value:O},{name:"blocklet_meta_url",value:f},{name:"chainHost",value:p}].forEach(({name:C,value:k})=>{k&&v.set(C,k)}),h(`/blocklets/restore/restore-blocklet?${v.toString()}`)},0)},L=async(_=!1)=>{var v,C;if(!_){if(o.shouldReconnect){window.location.href=j(u,"blocklets/restore/connect-space");return}if(t.user){const k=await c.getBlocklet({input:{did:b,attachRuntimeInfo:!0}});if(k.blocklet){const R=await Pe(k.blocklet);if(R){const z=new URL(R);k.blocklet.status!=="running"&&z.searchParams.set("__start__","1"),i({shouldReconnect:!0,exists:!0,accessUrl:z.href})}return}}}if(E==="nft"){const k=new URL(window.location.href);k.pathname=j(((v=window==null?void 0:window.env)==null?void 0:v.apiPrefix)??"/",`/api/did/${q}/token`),k.searchParams.set("appDid",b),k.searchParams.set("endpoint",l.spaceEndpoint),k.searchParams.set("referrer",window.location.href),k.searchParams.set("nftId",n),k.searchParams.set("appPid",l.did);const R={autoConnect:!1,launchType:g,nftId:n};p&&(k.searchParams.set("chainHost",p),R.chainHost=p),_&&k.searchParams.set("overwrite","1");const{data:z}=await m.get(k.href);if(z.error){M.error(z.error);return}R.nw=z.url,i({isConnectOpen:!0,connectData:{action:"verify-restore-by-nft",extraParams:R},connectMessages:{title:s("blocklet.restoreFromSpaces.nftAuthDialog.title"),scan:s("blocklet.restoreFromSpaces.nftAuthDialog.scan"),confirm:s("blocklet.restoreFromSpaces.nftAuthDialog.confirm"),success:s("blocklet.restoreFromSpaces.nftAuthDialog.success")}});return}if(E==="launcher"){const{launcherSession:k,error:R}=await c.getLauncherSession({input:{launcherUrl:a,launcherSessionId:y}});k?i({isConnectOpen:!0,connectData:{action:q,extraParams:{appDid:b,appPid:l.did,endpoint:l.spaceEndpoint,referrer:window.location.href,restoreFrom:"spaces",overwrite:_?"1":void 0,launcherUrl:a,launcherSessionId:y,chainHost:p}},connectMessages:{title:s("blocklet.restoreBlocklet.verify.title"),scan:s("blocklet.restoreBlocklet.verify.scan"),confirm:s("blocklet.restoreBlocklet.verify.confirm"),success:s("blocklet.restoreBlocklet.verify.success")}}):M.error(`Launch session invalid: ${R}`);return}if(E==="session"){i({isConnectOpen:!0,connectData:{action:q,extraParams:{appDid:b,appPid:l.did,endpoint:l.spaceEndpoint,referrer:window.location.href,overwrite:_?"1":void 0,restoreFrom:"spaces"}},connectMessages:{title:s("blocklet.restoreBlocklet.verify.title"),scan:s("blocklet.restoreBlocklet.verify.scan"),confirm:s("blocklet.restoreBlocklet.verify.confirm"),success:s("blocklet.restoreBlocklet.verify.success")}});return}const D=new URL(window.location.href);D.pathname=j(((C=window==null?void 0:window.env)==null?void 0:C.apiPrefix)??"/",`/api/did/${q}/token`),D.searchParams.set("appDid",b),D.searchParams.set("appPid",l.did),D.searchParams.set("endpoint",l.spaceEndpoint),D.searchParams.set("referrer",window.location.href),D.searchParams.set("restoreFrom","spaces");const{data:w}=await m.get(D.href);t.login(F,{nw:w.url,openMode:"popup"})},K=()=>{i({isConnectOpen:!1})},J=()=>{i({isConfirmOpen:!0})},X=()=>{i({isConfirmOpen:!1,isOverwrite:!0}),L(!0)},H=()=>{i({isConfirmOpen:!1})};return x.useEffect(()=>{L()},[]),e.jsxs($t,{children:[e.jsx(G,{title:s("blocklet.restoreBlocklet.verify.title"),subTitle:s("blocklet.restoreBlocklet.verify.subTitle"),onClickBack:()=>window.history.back()}),e.jsxs(S,{textAlign:"center",mt:6,children:[e.jsx(ft,{blocklet:{meta:l},blockletMetaUrl:f}),e.jsxs(S,{mt:2,mb:2,children:[e.jsx($,{variant:"body2",children:l.title}),e.jsx(re,{did:b})]}),o.exists&&o.accessUrl&&e.jsxs(e.Fragment,{children:[e.jsx($,{component:"p",variant:"body1",gutterBottom:!0,sx:{color:"orange"},children:s("blocklet.restoreBlocklet.verify.exists")}),e.jsxs($,{component:"div",sx:{marginTop:"32px"},children:[o.accessUrl&&e.jsx(U,{variant:"contained",component:je,href:o.accessUrl,sx:{width:"160px",height:"100%"},children:s("blocklet.restoreBlocklet.verify.open")}),e.jsx(U,{variant:"contained",color:"error",onClick:J,sx:{width:"160px",height:"100%",marginLeft:"32px"},children:s("blocklet.restoreBlocklet.verify.overwrite")})]})]}),!o.exists&&e.jsx(U,{variant:"contained",disabled:o.isConnectOpen,onClick:L,sx:{width:"180px",height:"100%"},children:s(`blocklet.restoreBlocklet.verify.${o.shouldReconnect?"reconnect":"verify"}`)})]}),o.connectData.isConnectOpen&&e.jsx(ne,{appDid:b,visible:!1}),e.jsx(Ce,{popup:!0,open:o.isConnectOpen,forceConnected:!1,saveConnect:!1,action:o.connectData.action,checkFn:m.get,checkTimeout:5*60*1e3,webWalletUrl:Q(d),onSuccess:F,extraParams:o.connectData.extraParams,messages:o.connectMessages,onClose:K}),o.isConfirmOpen&&e.jsx(rt,{color:"error",title:s("blocklet.restoreBlocklet.overwrite.title"),description:s("blocklet.restoreBlocklet.overwrite.description"),confirm:s("common.confirm"),onCancel:H,onConfirm:X})]})}const xe=P(ht)`
|
|
67
67
|
&& .result-footer {
|
|
68
68
|
height: 120px;
|
|
69
69
|
> div {
|
|
@@ -85,9 +85,9 @@ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as $,
|
|
|
85
85
|
word-wrap: break-word;
|
|
86
86
|
color: ${t=>t.theme.palette.grey[500]};
|
|
87
87
|
}
|
|
88
|
-
`,Gt={[B.RESTORE_PROGRESS_STATUS.waiting]:0,[B.RESTORE_PROGRESS_STATUS.start]:1,[B.RESTORE_PROGRESS_STATUS.importData]:2,[B.RESTORE_PROGRESS_STATUS.downloading]:3,[B.RESTORE_PROGRESS_STATUS.importDataSuccess]:4,[B.RESTORE_PROGRESS_STATUS.installing]:5,[B.RESTORE_PROGRESS_STATUS.completed]:10},Ht="https://community.arcblock.io/",qt="launcher@arcblock.io";function Vt({appDid:t}){const[r,s]=x.useState(B.RESTORE_PROGRESS_STATUS.waiting),c=ct();return c.connect(),x.useEffect(()=>(c.on(B.BlockletEvents.restoreProgress,d=>{t===(d==null?void 0:d.appDid)&&s(d)}),()=>{c.off(B.BlockletEvents.restoreProgress)}),[t,c]),r}function Yt(){var _,D;const t=new URL(window.location.href),r=t.searchParams.get("appDid"),s=t.searchParams.get("launchType"),c=t.searchParams.get("nftId"),d=t.searchParams.get("fromLauncher"),m=t.searchParams.get("from"),l=t.searchParams.get("chainHost"),h=Vt({appDid:r}),[u,o]=x.useState(0),i=x.useRef(null),{meta:g}=se(),{t:n}
|
|
88
|
+
`,Gt={[B.RESTORE_PROGRESS_STATUS.waiting]:0,[B.RESTORE_PROGRESS_STATUS.start]:1,[B.RESTORE_PROGRESS_STATUS.importData]:2,[B.RESTORE_PROGRESS_STATUS.downloading]:3,[B.RESTORE_PROGRESS_STATUS.importDataSuccess]:4,[B.RESTORE_PROGRESS_STATUS.installing]:5,[B.RESTORE_PROGRESS_STATUS.completed]:10},Ht="https://community.arcblock.io/",qt="launcher@arcblock.io";function Vt({appDid:t}){const[r,s]=x.useState(B.RESTORE_PROGRESS_STATUS.waiting),c=ct();return c.connect(),x.useEffect(()=>(c.on(B.BlockletEvents.restoreProgress,d=>{t===(d==null?void 0:d.appDid)&&s(d)}),()=>{c.off(B.BlockletEvents.restoreProgress)}),[t,c]),r}function Yt(){var _,D;const t=new URL(window.location.href),r=t.searchParams.get("appDid"),s=t.searchParams.get("launchType"),c=t.searchParams.get("nftId"),d=t.searchParams.get("fromLauncher"),m=t.searchParams.get("from"),l=t.searchParams.get("chainHost"),h=Vt({appDid:r}),[u,o]=x.useState(0),i=x.useRef(null),{meta:g}=se(),{t:n}=A(),{api:p,info:O}=I(),[f,y]=oe({nextAccessUrl:"",installError:null}),a=xt(r),{status:b,eventName:E}=a,F=()=>{o(12),i.current&&(clearTimeout(i.current),i.current=null),i.current=setTimeout(()=>{p.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then(w=>{w.blocklet&&J(w.blocklet)})},500)},L=()=>{var w,v;if((v=(w=a==null?void 0:a.runtimeBlocklet)==null?void 0:w.settings)!=null&&v.initialized){o(11);return}F()},K=[n("blocklet.restoreFromSpaces.progress.waiting"),n("blocklet.restoreFromSpaces.progress.restoring"),n("blocklet.restoreFromSpaces.progress.importData"),n("blocklet.restoreFromSpaces.progress.downloading",{progress:`${((_=h==null?void 0:h.data)==null?void 0:_.completed)??100}/${((D=h==null?void 0:h.data)==null?void 0:D.total)??100}`}),n("blocklet.restoreFromSpaces.progress.importSuccess"),n("launchBlocklet.waiting.downloading"),n("launchBlocklet.waiting.verifying"),n("launchBlocklet.waiting.downloading"),n("launchBlocklet.waiting.extracting"),n(b==="upgrading"?"common.upgrading":"launchBlocklet.waiting.installing"),n("launchBlocklet.waiting.installed"),n("launchBlocklet.waiting.starting"),n("launchBlocklet.waiting.done")];x.useEffect(()=>{if(h.status===B.RESTORE_PROGRESS_STATUS.error){const w={message:h.message,name:"restoreFailed",action:"retryRestore"};fe(w,f.installError)||M.error(Y(w)),y({installError:w});return}o(Gt[h.status]||0)},[h.status]),x.useEffect(()=>{var w;if(s==="serverless"&&E===B.BlockletEvents.nftConsumed){L();return}switch(b){case"waiting":o(6);break;case"downloading":o(7);break;case"installing":case"upgrading":o(8);break;case"installed":if(s==="serverless"&&!it(a))break;L();break;case"starting":o(11);break;case"running":o(12),F();break;case"stopped":F();break;case"corrupted":case"error":{a==null||a.stopPolling();const v={message:(w=a==null?void 0:a.error)==null?void 0:w.message,name:a==null?void 0:a.eventName,action:"retryRestore"},C=(k={})=>{var R;!fe(v,f.installError)&&((R=a==null?void 0:a.error)!=null&&R.message)&&M.error(Y(a.error)),y({installError:v,...k})};p.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then(({blocklet:k})=>{var R;(R=k==null?void 0:k.settings)!=null&&R.initialized&&(v.action="retryStart"),C()}).catch(()=>{C()})}break}},[b,E,a]);const J=async w=>{const v=await Pe(w);if(dt(v))return;const C=new URL(v);C.searchParams.set("serverUrl",W(O)),w.status!=="running"&&C.searchParams.set("__start__","1"),d&&C.searchParams.set("fromLauncher",d),m&&C.searchParams.set("from",m),s&&C.searchParams.set("launchType",s),c&&C.searchParams.set("nftId",c),l&&C.searchParams.set("chainHost",l),a==null||a.stopPolling(),y({nextAccessUrl:C.href,status:w.status,resultMessage:w.status==="running"?{variant:"success",title:n("blocklet.restoreFromSpaces.restore.completeTitle"),subTitle:"",footer:n("common.open")}:{variant:"info",title:n("blocklet.restoreFromSpaces.restore.installedTitle"),subTitle:n("blocklet.restoreFromSpaces.restore.installedSubTitle"),footer:n("common.configuration")}})},X=async()=>{y({installError:null,nextAccessUrl:""}),await p.startBlocklet({input:{did:r}}),a==null||a.startPolling()};if(f.installError){const w={retryRestore:e.jsx(U,{variant:"contained",className:"bottom-button","data-cy":"retry-install",component:lt,to:`/blocklets/restore/verify-ownership${window.location.search}`,children:n("common.retry")}),retryStart:e.jsx(U,{variant:"contained",className:"bottom-button","data-cy":"retry-start",onClick:()=>X(),children:n("common.retry")})},v=f.installError.name?f.installError.name.replace("blocklet.",""):"installFailed";return e.jsx(xe,{variant:"error",title:g==null?void 0:g.title,subTitle:e.jsxs(Wt,{children:[e.jsx("div",{children:n(`launchBlocklet.error.${v}`)}),f.installError.message&&e.jsx("div",{className:"error-desc",children:n("common.errorMessage")+f.installError.message})]}),footer:e.jsxs(ge,{children:[w[f.installError.action],s==="serverless"&&e.jsx("div",{style:{marginTop:"24px"},dangerouslySetInnerHTML:{__html:n("blocklet.restoreFromSpaces.restore.support",{communityLink:Ht,supportEmail:qt})}})]})})}const H=!!f.nextAccessUrl;return It("render",{status:b,eventName:E,launchType:s,runtimeBlockletState:a,state:f}),e.jsxs(zt,{children:[!H&&e.jsxs(e.Fragment,{children:[e.jsx(G,{title:n("blocklet.restoreBlocklet.restore.title"),subTitle:n("blocklet.restoreFromSpaces.restore.subTitle")}),e.jsxs(gt,{children:[e.jsx(ut,{increaseSpeed:.3,messageLoop:!1,message:e.jsx(wt,{steps:K,stepIndex:u,autoGrowth:u===10?1e3:4e3})}),[5,7,8].includes(u)&&e.jsx(ne,{appDid:r})]})]}),H&&e.jsx(xe,{variant:f.resultMessage.variant,title:f.resultMessage.title,subTitle:f.resultMessage.subTitle,footer:e.jsx(ge,{children:e.jsx(U,{variant:"contained",style:{width:"200px"},component:je,href:f.nextAccessUrl,children:f.resultMessage.footer})})})]})}const ge=P(S)`
|
|
89
89
|
padding-top: 24px;
|
|
90
|
-
`;function Ie(){return e.jsx(Yt,{})}function Qt(){const t=te(p=>p.breakpoints.down("md")),{t:r,locale:s}
|
|
90
|
+
`;function Ie(){return e.jsx(Yt,{})}function Qt(){const t=te(p=>p.breakpoints.down("md")),{t:r,locale:s}=A(),{info:c}=I(),d=pt(),{meta:m}=se(),l=x.useMemo(()=>c?W(c):"",[c]),h=Q(c),u=j(Re(),"/blocklets/restore"),o=[{key:"verify-ownership",name:r("blocklet.restoreBlocklet.verify.title"),path:j(u,"verify-ownership")},{key:"restore-blocklet",name:r("blocklet.restoreFromSpaces.restore.title"),path:j(u,"restore-blocklet")}];let i=[];Et(d.get("from"))==="launcher"?i=[{key:"purchase-space",name:r("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:r("launchBlocklet.steps.prepareSpace")},...o]:i=[{key:"connect-space",name:r("blocklet.restoreFromSpaces.connect.title"),path:j(u,"connect-space")},{key:"select-blocklet",name:r("blocklet.restoreFromSpaces.selectBlocklet.title")},...o];const g=()=>{l&&window.open(l)},n=e.jsx(Xt,{className:`${l?"logo-can-click":""}`,children:e.jsx(Le,{onClick:g,logo:t?e.jsx(Ne,{width:"32",height:"32"}):e.jsx($e,{width:"128",height:"48"})})});return e.jsx(Ae,{steps:i,children:e.jsx(Fe,{blockletMeta:m,locale:s,useOfSkeleton:!1,navLogo:n,navSubTitle:r("blocklet.restoreFromSpaces.navSubTitle"),loading:!1,headerEndAddons:e.jsx(Te,{webWalletUrl:h,SessionContext:Ee}),pcWidth:"80%",style:{height:"100%"},logoUrl:m==null?void 0:m.logo,children:e.jsxs(Jt,{children:[e.jsx(De,{styles:Kt}),e.jsxs(Be,{children:[e.jsx(N,{path:"connect-space",element:e.jsx(Lt,{})}),e.jsx(N,{path:"verify-ownership",element:e.jsx(Mt,{})}),e.jsx(N,{path:"restore-blocklet",element:e.jsx(Ie,{})}),e.jsx(N,{path:"*",element:e.jsx(Ue,{to:"connect-space",replace:!0})})]})]})})})}const Kt=Oe`
|
|
91
91
|
html,
|
|
92
92
|
body,
|
|
93
93
|
#root,
|
|
@@ -113,7 +113,7 @@ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as $,
|
|
|
113
113
|
&.logo-can-click {
|
|
114
114
|
cursor: pointer;
|
|
115
115
|
}
|
|
116
|
-
`;function me({onSelect:t}){const{api:r}=I(),{t:s,locale:c}
|
|
116
|
+
`;function me({onSelect:t}){const{api:r}=I(),{t:s,locale:c}=A(),[d,m]=x.useState(!1),[l,h]=x.useState([]),[u,o]=x.useState(""),[i,g]=x.useState(null),n=Se(),p=async()=>{try{m(!0),g(!1);const{getBlocklets:{blocklets:a},getBlockletsFromBackup:{backups:b}}=await r.doBatchQuery({getBlocklets:{input:{}},getBlockletsFromBackup:{input:{}}});h((b||[]).filter(E=>!(a||[]).some(F=>{var L;return E.appPid===((L=F.meta)==null?void 0:L.did)})).sort((E,F)=>F.createdAt-E.createdAt).slice(0,200)),m(!1)}catch(a){m(!1),g(a.message)}};x.useEffect(()=>{p()},[]);const O=()=>{const a=l.find(E=>E.appDid===u);t({did:a.appDid,name:a.appDid,title:a.name});const b=new URL(window.location.href);b.searchParams.set("appDid",a.appDid),b.searchParams.set("appName",a.name),n(`/blocklets/restore/verify-ownership${b.search}`)},f=a=>{o(a.appDid)};let y=null;return i?y=e.jsx(ve,{severity:"error",style:{width:"100%",marginTop:8},children:i}):d?y=e.jsx(be,{size:16}):l.length?y=e.jsx(es,{children:l.map(a=>e.jsxs(ts,{className:`middle-font-size space ${u===a.appDid?"selected":""}`,onClick:()=>f(a),children:[e.jsxs("div",{className:"left",children:[e.jsx("div",{className:"header",children:e.jsx(S,{sx:{width:40,height:40},children:e.jsx(_e,{did:a.appDid,size:40})})}),e.jsxs("div",{className:"body",children:[e.jsx($,{className:"text",children:a.name}),e.jsx($,{className:"text middle-font-size",children:e.jsx(re,{responsive:!1,compact:!0,inline:!0,copyable:!1,size:12,did:a.appDid})})]}),e.jsxs(S,{color:"text.secondary",className:"footer small-font-size",children:[s("blocklet.restoreFromServer.backupIn")," ",mt(a.createdAt,c)]})]}),e.jsx("div",{className:"right",children:e.jsx("div",{className:"more",children:e.jsx(ee,{onClick:()=>{},className:"more-btn",size:"large","aria-label":"more functions",children:e.jsx(jt,{color:"disabled"})})})}),e.jsx("div",{className:"selected-container",children:e.jsx(ke,{className:"selected-icon"})})]},a.appDid))}):y=e.jsx(Ct,{children:s("common.empty")}),e.jsxs(Zt,{style:{width:"100%"},children:[e.jsx(G,{title:s("blocklet.restoreFromServer.selectTitle"),subTitle:s("blocklet.restoreFromServer.description")}),e.jsx(S,{mt:4,mx:3,className:"main-body",children:y}),e.jsx(S,{className:"main-footer",display:"flex",justifyContent:"center",children:e.jsx(U,{sx:{width:"180px",height:"100%"},onClick:a=>{a.stopPropagation(),O()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:d||i||!u,children:s("common.restore")})})]})}me.propTypes={onSelect:T.func};me.defaultProps={onSelect:()=>{}};const Zt=P(S)`
|
|
117
117
|
.main-body {
|
|
118
118
|
height: 50vh;
|
|
119
119
|
${t=>t.theme.breakpoints.down("md")} {
|
|
@@ -281,7 +281,7 @@ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as $,
|
|
|
281
281
|
width: 100%;
|
|
282
282
|
height: 100%;
|
|
283
283
|
overflow-y: auto;
|
|
284
|
-
`,we="verify-app-ownership-disk";function os(){const t=new URL(window.location.href),r=t.searchParams.get("appDid"),s=t.searchParams.get("appName"),{t:c}
|
|
284
|
+
`,we="verify-app-ownership-disk";function os(){const t=new URL(window.location.href),r=t.searchParams.get("appDid"),s=t.searchParams.get("appName"),{t:c}=A(),{api:d,info:m}=I(),{session:l,api:h}=Z(),u=x.useMemo(()=>m?W(m):"",[m]),[o,i]=oe({isRestoring:!1,isComplete:!1,connectData:{isConnectOpen:!1,action:"",checkFn:()=>{},extraParams:{}}}),g=async()=>{if((await d.getBlocklet({input:{did:r}})).blocklet){M.error(`Blocklet ${s}(${r}) already exists`),i({shouldReconnect:!0});return}i({connectData:{isConnectOpen:!0,action:we,extraParams:{appDid:r,restoreFrom:"disk"}}})},n=()=>{i({connectData:{isConnectOpen:!1}}),setTimeout(()=>{const f=new URL(j(u,`blocklets/restore/restore-blocklet${window.location.search}`));window.location.href=f.href},0)},p=async()=>{var f;if(!l.user){const y=new URL(window.location.href);y.pathname=j(((f=window==null?void 0:window.env)==null?void 0:f.apiPrefix)??"/",`/api/did/${we}/token`),y.searchParams.set("appDid",r),y.searchParams.set("restoreFrom","disk");const{data:a}=await h.get(y.href);l.login(n,{nw:a.url,openMode:"popup"});return}await g()},O=()=>{i({connectData:{isConnectOpen:!1}})};return x.useEffect(()=>{p()},[]),e.jsxs(ss,{children:[e.jsx(G,{title:c("blocklet.restoreBlocklet.verify.title"),subTitle:c("blocklet.restoreBlocklet.verify.subTitle")}),e.jsxs(S,{textAlign:"center",mt:6,children:[e.jsx(_e,{did:r,size:128}),e.jsxs(S,{mt:2,mb:2,children:[e.jsx($,{variant:"body2",children:s}),e.jsx(re,{did:r})]}),e.jsx(U,{variant:"contained",disabled:o.connectData.isConnectOpen,onClick:p,sx:{width:"180px",height:"100%"},children:c(`blocklet.restoreBlocklet.verify.${o.shouldReconnect?"reconnect":"verify"}`)})]}),o.connectData.isConnectOpen&&e.jsx(ne,{appDid:r,visible:!1}),e.jsx(Ce,{popup:!0,open:o.connectData.isConnectOpen,forceConnected:!1,saveConnect:!1,action:o.connectData.action,checkFn:h.get,checkTimeout:5*60*1e3,webWalletUrl:Q(m),onSuccess:n,extraParams:o.connectData.extraParams,messages:{title:c("blocklet.restoreBlocklet.verify.title"),scan:c("blocklet.restoreBlocklet.verify.scan"),confirm:c("blocklet.restoreBlocklet.verify.confirm"),success:c("blocklet.restoreBlocklet.verify.success")},onClose:O})]})}function rs(){const t=te(n=>n.breakpoints.down("md")),{t:r,locale:s}=A(),{info:c}=I(),{meta:d,setMeta:m}=x.useState({}),l=x.useMemo(()=>c?W(c):"",[c]),h=Q(c),u=j(Re(),"/blocklets/restore"),o=[{key:"select",name:r("blocklet.restoreFromServer.selectTitle"),path:j(u,"select")},{key:"verify-ownership",name:r("blocklet.restoreBlocklet.verify.title"),path:j(u,"verify-ownership")},{key:"restore-blocklet",name:r("blocklet.restoreBlocklet.restore.title"),path:j(u,"restore-blocklet")}],i=()=>{l&&window.open(l)},g=e.jsx(is,{className:`${l?"logo-can-click":""}`,children:e.jsx(Le,{onClick:i,logo:t?e.jsx(Ne,{width:"32",height:"32"}):e.jsx($e,{width:"128",height:"48"})})});return e.jsx(Ae,{steps:o,children:e.jsx(Fe,{blockletMeta:{...d,registryUrl:""},locale:s,useOfSkeleton:!1,navLogo:g,headerEndAddons:e.jsx(Te,{webWalletUrl:h,SessionContext:Ee}),pcWidth:"80%",style:{height:"100%"},logoUrl:d==null?void 0:d.logo,children:e.jsxs(as,{children:[e.jsx(De,{styles:ns}),e.jsxs(Be,{children:[e.jsx(N,{path:"select",element:e.jsx(me,{onSelect:m})}),e.jsx(N,{path:"verify-ownership",element:e.jsx(os,{})}),e.jsx(N,{path:"restore-blocklet",element:e.jsx(Ie,{})}),e.jsx(N,{path:"*",element:e.jsx(Ue,{to:`select${window.location.search}`,replace:!0})})]})]})})})}const ns=Oe`
|
|
285
285
|
html,
|
|
286
286
|
body,
|
|
287
287
|
#root,
|
|
@@ -306,4 +306,4 @@ import{g as ze,X as We,n as P,O as S,Y as V,j as e,Z as ke,r as x,P as T,q as $,
|
|
|
306
306
|
&.logo-can-click {
|
|
307
307
|
cursor: pointer;
|
|
308
308
|
}
|
|
309
|
-
`;function
|
|
309
|
+
`;function Ts(){const{search:t}=window.location;return t.includes("restoreFrom=server")?e.jsx(rs,{}):e.jsx(Qt,{})}export{Ts as default};
|