@abtnode/blocklet-services 1.16.44-beta-20250529-004636-15e80e20 → 1.16.44-beta-20250601-083116-288e5ea5

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.
Files changed (150) hide show
  1. package/api/routes/blocklet.js +3 -1
  2. package/api/services/static.js +37 -6
  3. package/dist/assets/{AdapterDayjs-CDDcwz3P.js → AdapterDayjs-Dy2dI4ee.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-DPqiF9Rw.js → ArrowDropDown-D8DSLfND.js} +1 -1
  5. package/dist/assets/{CheckCircle-Caqp5gKY.js → CheckCircle-Dv9ESLSx.js} +1 -1
  6. package/dist/assets/{ChevronLeft-DONyUbIg.js → ChevronLeft-7uRDOkJ0.js} +1 -1
  7. package/dist/assets/{ChevronRight-DgAwWLdY.js → ChevronRight-DF2CPRSp.js} +1 -1
  8. package/dist/assets/{DeleteOutline-DpNyWtNL.js → DeleteOutline-MvcW8wMe.js} +1 -1
  9. package/dist/assets/{Done-BTd13H2U.js → Done-NWTNth4h.js} +1 -1
  10. package/dist/assets/{Download-Bm8sKXA2.js → Download-4GZsn6dX.js} +1 -1
  11. package/dist/assets/{Edit-CUl1Rt8i.js → Edit-rnQ_3wHK.js} +1 -1
  12. package/dist/assets/{Error-DEKvwVoF.js → Error-RKBXSgDA.js} +1 -1
  13. package/dist/assets/{ExpandLess-t1cH-Bc4.js → ExpandLess-DeQLEewB.js} +1 -1
  14. package/dist/assets/{Google-Bn3zPWiu.js → Google-BFBQ7QOU.js} +1 -1
  15. package/dist/assets/{Home-C3ax1tQ7.js → Home-nxfCo0la.js} +1 -1
  16. package/dist/assets/{InfoOutlined-D3XnF0Vg.js → InfoOutlined-DwH0ULaz.js} +1 -1
  17. package/dist/assets/{Launch-Dz9mQnYC.js → Launch-CKjiZEMR.js} +1 -1
  18. package/dist/assets/{LaunchOutlined-E7HcQu_6.js → LaunchOutlined-Mxl2EzJD.js} +1 -1
  19. package/dist/assets/{MoreHoriz-DpKn_fkc.js → MoreHoriz-Bb60Z0iy.js} +1 -1
  20. package/dist/assets/{PlayArrow-CDOOUxMp.js → PlayArrow-DSHRafhE.js} +1 -1
  21. package/dist/assets/{TuneOutlined-D0gGDoIJ.js → TuneOutlined-C_bRiMjO.js} +1 -1
  22. package/dist/assets/{ViewList-C8G9e3ft.js → ViewList-B9N1x-5o.js} +1 -1
  23. package/dist/assets/{access-control-eEjmzQYf.js → access-control-B5entF50.js} +1 -1
  24. package/dist/assets/{actions-DP7pj6xB.js → actions-t0ZB56yH.js} +1 -1
  25. package/dist/assets/{add-component-core-pJP41zEE.js → add-component-core-BS3YTsy5.js} +1 -1
  26. package/dist/assets/{add-resource-CZeL421l.js → add-resource-DrFqIfnP.js} +1 -1
  27. package/dist/assets/{addon-CRj4Enw7.js → addon-DQC7Plj9.js} +1 -1
  28. package/dist/assets/{advanced-P0pT0XgG.js → advanced-DO1hLdXY.js} +1 -1
  29. package/dist/assets/{appearance-DeIbdwlo.js → appearance-Bf8ha2QN.js} +1 -1
  30. package/dist/assets/{audit-logs-DdN0-QQr.js → audit-logs-BmFsZWcQ.js} +1 -1
  31. package/dist/assets/{authorize-C_rSdM9R.js → authorize-C1krxa_8.js} +1 -1
  32. package/dist/assets/{base32-WurN0cIW.js → base32-CCf_iIfG.js} +1 -1
  33. package/dist/assets/{branding-HedBd6t0.js → branding-BsDB7rHi.js} +6 -6
  34. package/dist/assets/{branding-C6umqmKR.js → branding-DunUmlvH.js} +2 -2
  35. package/dist/assets/{bundle-avatar-B9he3Bf1.js → bundle-avatar-BTHmZ3_i.js} +1 -1
  36. package/dist/assets/{button-_1HExv7r.js → button-mmNFGQSs.js} +1 -1
  37. package/dist/assets/{click-to-copy-R7MF4AwY.js → click-to-copy-Fl7LHxeC.js} +1 -1
  38. package/dist/assets/{collapse-l9wHY9gJ.js → collapse-dxBbW7k2.js} +1 -1
  39. package/dist/assets/complete-CxDgHoQk.js +39 -0
  40. package/dist/assets/{component-cssFwqtY.js → component-BnKz-jfM.js} +61 -61
  41. package/dist/assets/{config-eQ2Et0RC.js → config-DuKJ9oR4.js} +1 -1
  42. package/dist/assets/{config-Cd14MJHa.js → config-WLdkaHr-.js} +1 -1
  43. package/dist/assets/config-navigation-CvCO7Fuh.js +26 -0
  44. package/dist/assets/{config-space-CQ7Atb1l.js → config-space-C_xex8-t.js} +1 -1
  45. package/dist/assets/{confirm-Tue92P8p.js → confirm-t4d18Hpz.js} +1 -1
  46. package/dist/assets/connect-Cv9tvvms.js +5 -0
  47. package/dist/assets/{connect-PdQoyrqe.js → connect-GdnRXixM.js} +1 -1
  48. package/dist/assets/{connect-to-FvVJBIsZ.js → connect-to-r0pjWPe7.js} +1 -1
  49. package/dist/assets/{dashboard-BhR1WNzF.js → dashboard-CEB4GFys.js} +3 -3
  50. package/dist/assets/{delete-confirm-CHnQ2leb.js → delete-confirm-DCJdTGPZ.js} +1 -1
  51. package/dist/assets/{did-address-Dq-4__HB.js → did-address-BJCF3XU3.js} +1 -1
  52. package/dist/assets/domain-Dkw0nuHL.js +9 -0
  53. package/dist/assets/{domain-action-card-Jvzi8kyL.js → domain-action-card-DnB964Ah.js} +1 -1
  54. package/dist/assets/domains-D6W7Zk5a.js +1 -0
  55. package/dist/assets/dot-DX56IFTM.js +7 -0
  56. package/dist/assets/{email-z4l1k3Mi.js → email-DY9qiGnc.js} +1 -1
  57. package/dist/assets/{exchange-passport-DSoEjAA_.js → exchange-passport-BOpw7kFp.js} +1 -1
  58. package/dist/assets/{fuel-CzrPInoR.js → fuel-CMua6nrK.js} +1 -1
  59. package/dist/assets/{gen-access-key-BU2nGVgA.js → gen-access-key-FrO6nmvQ.js} +1 -1
  60. package/dist/assets/{get-safe-url-Q70tRxL7.js → get-safe-url-BRxk530J.js} +1 -1
  61. package/dist/assets/{get-safe-url-c4iAcpvA.js → get-safe-url-DHdoXqD0.js} +1 -1
  62. package/dist/assets/{home-BZ8WpcWZ.js → home-C2Db_IXV.js} +1 -1
  63. package/dist/assets/{iframe-Dl8NEFc5.js → iframe-Bpfqnuq5.js} +1 -1
  64. package/dist/assets/{index-C3le1atN.js → index-0epbdrMx.js} +1 -1
  65. package/dist/assets/{index-B_NDUfon.js → index-3aRBjK5P.js} +30 -30
  66. package/dist/assets/{index-D0F0qx_R.js → index-ALHbqsn2.js} +1 -1
  67. package/dist/assets/{index-C1XrZATd.js → index-B7PoXGHo.js} +8 -8
  68. package/dist/assets/{index-klBzz5vO.js → index-B9IGWqlM.js} +1 -1
  69. package/dist/assets/{index-D2a97Hdb.js → index-BchkF3oT.js} +3 -3
  70. package/dist/assets/{index-BKKwhjBs.js → index-BkScmF5I.js} +1 -1
  71. package/dist/assets/{index-NQMMaHuW.js → index-BrhW0YAX.js} +1 -1
  72. package/dist/assets/{index-m831cH-_.js → index-ChEmNV9t.js} +1 -1
  73. package/dist/assets/{index-P2m0RlAs.js → index-DESkMgoq.js} +1 -1
  74. package/dist/assets/{index-ChHy6AQ7.js → index-DH-xhSUy.js} +1 -1
  75. package/dist/assets/{index-BUHyq-oP.js → index-DHmaMW97.js} +1 -1
  76. package/dist/assets/index-DIzYQ8YY.js +1 -0
  77. package/dist/assets/{index-D1kTR2xk.js → index-DTLUTgmo.js} +1 -1
  78. package/dist/assets/{index-I6_gMaPh.js → index-DjmlNqL1.js} +1 -1
  79. package/dist/assets/{index-DutfRO7F.js → index-DkNMM_jp.js} +1 -1
  80. package/dist/assets/{index-5EytSaVA.js → index-Dq0Wocff.js} +1 -1
  81. package/dist/assets/{index-DrHUHp5S.js → index-HT1eRd1i.js} +1 -1
  82. package/dist/assets/{index-hkk3GUEf.js → index-bu2nusyV.js} +1 -1
  83. package/dist/assets/index-xbFMe1Dq.js +99 -0
  84. package/dist/assets/{invitation-CGjIZ62g.js → invitation-DqS1y9EI.js} +1 -1
  85. package/dist/assets/{invite-CS_4jRwt.js → invite-Do31CPZ_.js} +1 -1
  86. package/dist/assets/{issue-passport-B6-OzJX7.js → issue-passport-BawbYt3J.js} +1 -1
  87. package/dist/assets/{item-CuLwkmbx.js → item-CPlmWuOr.js} +1 -1
  88. package/dist/assets/{landing-page-DrVLCVAm.js → landing-page-k0HqFOEl.js} +1 -1
  89. package/dist/assets/{layout-CNC_rrzE.js → layout-CneuYz3Y.js} +1 -1
  90. package/dist/assets/list-C3bba0fZ.js +2 -0
  91. package/dist/assets/{list-BTBbj1K4.js → list-DqFW_ONs.js} +1 -1
  92. package/dist/assets/localization-B18AVgXP.js +1 -0
  93. package/dist/assets/{log-29oTWiWO.js → log-B7EGR5B1.js} +1 -1
  94. package/dist/assets/{logger-BAVOmOw2.js → logger-C5_0IJ1n.js} +1 -1
  95. package/dist/assets/{login-C52vMwpY.js → login-CmoMzUKP.js} +1 -1
  96. package/dist/assets/{login-oauth-callback-BrnNJIOK.js → login-oauth-callback-6CWB9fPF.js} +1 -1
  97. package/dist/assets/{logo-uploader-Cir_HrSm.js → logo-uploader-BGnE-EpW.js} +3 -3
  98. package/dist/assets/{lost-passport-C2-kDXqq.js → lost-passport-BIGYYNZH.js} +1 -1
  99. package/dist/assets/{open-window-Bl24RBAD.js → open-window-DAuoY35p.js} +1 -1
  100. package/dist/assets/{overview-BKOb0zVP.js → overview-DO_rMORL.js} +1 -1
  101. package/dist/assets/{page-header-BWqvvXOk.js → page-header-CzGtYXZB.js} +1 -1
  102. package/dist/assets/{passport-item-OEfv-Vh7.js → passport-item-B0b6IIEi.js} +1 -1
  103. package/dist/assets/{permission-DSHe73ba.js → permission-CG_0ilL-.js} +1 -1
  104. package/dist/assets/{preferences-BzGNV3pM.js → preferences-nmcizF2n.js} +1 -1
  105. package/dist/assets/{profile-embed-iA-d50c3.js → profile-embed-D9vov7el.js} +1 -1
  106. package/dist/assets/{publish-resource-DayX-x8-.js → publish-resource-BAxsxiDk.js} +1 -1
  107. package/dist/assets/{react-beautiful-dnd.esm-Ck4xzwyU.js → react-beautiful-dnd.esm-vqdGm7Q2.js} +1 -1
  108. package/dist/assets/{runtime-BbgMhX7n.js → runtime-4wAQAE28.js} +1 -1
  109. package/dist/assets/sanitize-CC0-oYfL.js +2 -0
  110. package/dist/assets/sdk-DnmwcxEc.js +1 -0
  111. package/dist/assets/{security-DFHcsUZl.js → security-BO4vz2A4.js} +1 -1
  112. package/dist/assets/{session-C_8V_o-O.js → session-yHau46Qm.js} +1 -1
  113. package/dist/assets/setup-C9eWBBt5.js +30 -0
  114. package/dist/assets/{spaces-DApg1wzn.js → spaces-WDzH-r9r.js} +1 -1
  115. package/dist/assets/{start-B8F850CZ.js → start-CvbMSa4N.js} +1 -1
  116. package/dist/assets/{starting-progress-BHUTOY2b.js → starting-progress-BWNdTquJ.js} +1 -1
  117. package/dist/assets/{status-D5JgbTyM.js → status-B87zOhDx.js} +1 -1
  118. package/dist/assets/{step-actions-1pM57149.js → step-actions-qe5T0fbR.js} +1 -1
  119. package/dist/assets/{studio-1mTu0Fgs.js → studio-COaDgEOK.js} +1 -1
  120. package/dist/assets/{switch-control-CpCSorUo.js → switch-control-DvnJyz2a.js} +1 -1
  121. package/dist/assets/{table-tips-BfSSGl9N.js → table-tips-3qAdlLSz.js} +1 -1
  122. package/dist/assets/{traffic-Dvs1P0Re.js → traffic-CSdm4uyu.js} +1 -1
  123. package/dist/assets/{transfer-bax-fMxe.js → transfer-DsmSmlf-.js} +1 -1
  124. package/dist/assets/{unsubscribe-DwUfpwja.js → unsubscribe-BBPlZQOy.js} +1 -1
  125. package/dist/assets/{use-blocklet-logo-BZU9LLmz.js → use-blocklet-logo-vRumIAeK.js} +1 -1
  126. package/dist/assets/useAsync-Dv214fz8.js +1 -0
  127. package/dist/assets/useAsync-KYUBhVsb.js +1 -0
  128. package/dist/assets/{useLocalStorage-D6gvgmEW.js → useLocalStorage-DiA2Rpy-.js} +1 -1
  129. package/dist/assets/{user-center-DQ_Kc4sL.js → user-center-p3JKDvby.js} +3 -3
  130. package/dist/assets/{util-DMfPwzVN.js → util-CKnnktVh.js} +1 -1
  131. package/dist/assets/{util-BiCOL9ao.js → util-SIt5hlfb.js} +1 -1
  132. package/dist/assets/{vendor-arcblock-BlrkGjK9.js → vendor-arcblock-BPZ1V4pg.js} +1 -1
  133. package/dist/assets/{vendor-ux-did-connect-2jRoUb28.js → vendor-ux-did-connect-CJ8Q_v7u.js} +2 -2
  134. package/dist/assets/{wrap-locale-0GIFYj8p.js → wrap-locale-Dz5tBqNC.js} +1 -1
  135. package/dist/index.html +3 -3
  136. package/dist/service-worker.js +1 -1
  137. package/package.json +30 -30
  138. package/dist/assets/complete-D7dveRTo.js +0 -39
  139. package/dist/assets/config-navigation-0pU9J0da.js +0 -26
  140. package/dist/assets/connect-Cm-sTMiW.js +0 -5
  141. package/dist/assets/domain-FY9-unAU.js +0 -9
  142. package/dist/assets/domains-CiBZW8yk.js +0 -1
  143. package/dist/assets/dot-itVN8XTt.js +0 -7
  144. package/dist/assets/index-DC3jOsuk.js +0 -99
  145. package/dist/assets/index-DQD2rqsI.js +0 -1
  146. package/dist/assets/list-BNMEncjS.js +0 -2
  147. package/dist/assets/localization-Bb0kc8SQ.js +0 -1
  148. package/dist/assets/sdk-DeS3iq37.js +0 -1
  149. package/dist/assets/setup-Do62jucF.js +0 -30
  150. package/dist/assets/useAsync-510ntT1B.js +0 -1
@@ -1,4 +1,4 @@
1
- var Fo=a=>{throw TypeError(a)};var vo=(a,u,_)=>u.has(a)||Fo("Cannot "+_);var sn=(a,u,_)=>(vo(a,u,"read from private field"),_?_.call(a):u.get(a)),Oi=(a,u,_)=>u.has(a)?Fo("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(a):u.set(a,_),Jn=(a,u,_,E)=>(vo(a,u,"write to private field"),E?E.call(a,_):u.set(a,_),_),Dn=(a,u,_)=>(vo(a,u,"access private method"),_);var bo=(a,u,_,E)=>({set _(S){Jn(a,u,S,_)},get _(){return sn(a,u,E)}});import{g as getDefaultExportFromCjs,r as reactExports,e as commonjsGlobal,a as getAugmentedNamespace,b as React,d as reactDomExports}from"./vendor-react-DEoibe3W.js";import{b as isEmpty,c as isNil,o as omitBy,s as set$1,e as get$3,n as noop$6,f as isBoolean$1,h as isString$1,j as isNumber$1,k as isObject$l,u as upperFirst,l as camelCase,m as isNull$1,p as padEnd,q as padStart$1,B as Buffer$C,r as require$$0$8,v as process$1,w as bnExports$3,x as isEqual$3,y as pick,z as withQuery,A as joinURL,C as isObject$m,D as omit$1,E as axios,F as debug$5,G as Buffer$1$1,H as isString$2,I as isUndefined$2,J as pick$1,K as trim$5,L as browserExports$1,M as cloneDeep,N as intersection$1,O as isFunction$3,P as sortBy,Q as unionBy,R as defaultsDeep,S as dayjs_minExports,a as defaultDayjs,g as global$1,T as find$1}from"./vendor-utils-rHXShPKm.js";import{Y as deepmerge$1,Z as createTheme$1,$ as responsiveFontSizes,H as PropTypes,j as jsxRuntimeExports,a0 as StyledEngineProvider,a1 as ThemeProvider$1,a2 as CssBaseline,e as useTheme,a3 as GlobalStyles$2,s as styled$1,a4 as utils$p,C as Collapse,a5 as Slide,a6 as emphasize,a7 as SvgIcon,a8 as ClickAwayListener,a9 as interopRequireDefaultExports,I as IconButton,v as useMediaQuery,T as Typography$1,t as DialogContent,z as DialogActions,D as Dialog$1,aa as Box,ab as CircularProgress,y as Button,ac as _inheritsLoose$2,ad as Tooltip,ae as green,af as tooltipClasses,ag as Check$1,ah as newStyled,ai as Skeleton,aj as DialogTitle,ak as Alert$2,O as TextField,al as Stack,am as Backdrop,an as Drawer,ao as SwipeableDrawer,E as Chip,L as List,A as ListItem,ap as Menu,q as MenuItem,X as Divider,aq as ImageListItem,P as Popper,F as Fade,w as Paper,M as MenuList,ar as LinearProgress,m as alpha$1,as as blueGrey,at as Container$9,au as Paper$1,av as Table,aw as Tooltip$1,ax as styles,ay as emotionSerialize_esm,az as emotionUtils_browser_esm,aA as emotionCache_browser_esm,aB as emotionReact_browser_esm,aC as Typography$2,aD as TableBody,aE as TableCell,aF as TableRow,aG as Checkbox,aH as IconButton$1,aI as Button$1,aJ as FormControl,aK as FormControlLabel,aL as FormGroup,aM as Grid$1,aN as Input,aO as InputLabel,aP as ListItemText,aQ as MenuItem$1,aR as Select,aS as TextField$1,aT as Chip$1,aU as TableFooter,aV as TablePagination,aW as InputBase,aX as Toolbar,aY as TableHead,aZ as TableSortLabel,a_ as toPropertyKey$5,a$ as hoistStatics,b0 as Popover,b1 as Grow,b2 as propTypesExports,l as clsx$2,b3 as Popover$1,b4 as ListItemIcon,b5 as ListItemText$1,b6 as css,W as Tab,U as Tabs$1}from"./vendor-mui-core-BV2FUxWJ.js";import{C as Cookies,u as useMemoizedFn,a as useReactive,_ as __decorate,c as copy,b as useSize,d as useLatest,e as useDebounceFn,f as useCreation,g as useInterval$1,h as useDebounce,i as useAsyncEffect,j as useLocalStorageState,k as useUpdate,l as useRequest,m as useMount,n as usePrevious,o as useUpdateEffect}from"./vendor-hooks-BgUTpb6X.js";import{l as lottie}from"./lottie-web-jYmAQWuC.js";const scriptRel="modulepreload",assetsURL=function(a){return"/.well-known/service/static/"+a},seen={},__vitePreload=function(u,_,E){let S=Promise.resolve();if(_&&_.length>0){document.getElementsByTagName("link");const C=document.querySelector("meta[property=csp-nonce]"),T=(C==null?void 0:C.nonce)||(C==null?void 0:C.getAttribute("nonce"));S=Promise.allSettled(_.map(P=>{if(P=assetsURL(P),P in seen)return;seen[P]=!0;const O=P.endsWith(".css"),D=O?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${P}"]${D}`))return;const M=document.createElement("link");if(M.rel=O?"stylesheet":scriptRel,O||(M.as="script"),M.crossOrigin="",M.href=P,T&&M.setAttribute("nonce",T),document.head.appendChild(M),O)return new Promise((B,U)=>{M.addEventListener("load",B),M.addEventListener("error",()=>U(new Error(`Unable to preload CSS for ${P}`)))})}))}return S.then(C=>{for(const T of C||[]){if(T.status!=="rejected")continue;const P=new Event("vite:preloadError",{cancelable:!0});if(P.payload=T.reason,window.dispatchEvent(P),!P.defaultPrevented)throw T.reason}return u()})};var webfontloader$1={exports:{}};(function(a){(function(){function u(Be,Ye,Lt){return Be.call.apply(Be.bind,arguments)}function _(Be,Ye,Lt){if(!Be)throw Error();if(2<arguments.length){var tt=Array.prototype.slice.call(arguments,2);return function(){var bt=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(bt,tt),Be.apply(Ye,bt)}}return function(){return Be.apply(Ye,arguments)}}function E(Be,Ye,Lt){return E=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?u:_,E.apply(null,arguments)}var S=Date.now||function(){return+new Date};function C(Be,Ye){this.a=Be,this.o=Ye||Be,this.c=this.o.document}var T=!!window.FontFace;function P(Be,Ye,Lt,tt){if(Ye=Be.c.createElement(Ye),Lt)for(var bt in Lt)Lt.hasOwnProperty(bt)&&(bt=="style"?Ye.style.cssText=Lt[bt]:Ye.setAttribute(bt,Lt[bt]));return tt&&Ye.appendChild(Be.c.createTextNode(tt)),Ye}function O(Be,Ye,Lt){Be=Be.c.getElementsByTagName(Ye)[0],Be||(Be=document.documentElement),Be.insertBefore(Lt,Be.lastChild)}function D(Be){Be.parentNode&&Be.parentNode.removeChild(Be)}function M(Be,Ye,Lt){Ye=Ye||[],Lt=Lt||[];for(var tt=Be.className.split(/\s+/),bt=0;bt<Ye.length;bt+=1){for(var rr=!1,Ot=0;Ot<tt.length;Ot+=1)if(Ye[bt]===tt[Ot]){rr=!0;break}rr||tt.push(Ye[bt])}for(Ye=[],bt=0;bt<tt.length;bt+=1){for(rr=!1,Ot=0;Ot<Lt.length;Ot+=1)if(tt[bt]===Lt[Ot]){rr=!0;break}rr||Ye.push(tt[bt])}Be.className=Ye.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function B(Be,Ye){for(var Lt=Be.className.split(/\s+/),tt=0,bt=Lt.length;tt<bt;tt++)if(Lt[tt]==Ye)return!0;return!1}function U(Be){return Be.o.location.hostname||Be.a.location.hostname}function H(Be,Ye,Lt){function tt(){Ht&&bt&&rr&&(Ht(Ot),Ht=null)}Ye=P(Be,"link",{rel:"stylesheet",href:Ye,media:"all"});var bt=!1,rr=!0,Ot=null,Ht=Lt||null;T?(Ye.onload=function(){bt=!0,tt()},Ye.onerror=function(){bt=!0,Ot=Error("Stylesheet failed to load"),tt()}):setTimeout(function(){bt=!0,tt()},0),O(Be,"head",Ye)}function J(Be,Ye,Lt,tt){var bt=Be.c.getElementsByTagName("head")[0];if(bt){var rr=P(Be,"script",{src:Ye}),Ot=!1;return rr.onload=rr.onreadystatechange=function(){Ot||this.readyState&&this.readyState!="loaded"&&this.readyState!="complete"||(Ot=!0,Lt&&Lt(null),rr.onload=rr.onreadystatechange=null,rr.parentNode.tagName=="HEAD"&&bt.removeChild(rr))},bt.appendChild(rr),setTimeout(function(){Ot||(Ot=!0,Lt&&Lt(Error("Script load timeout")))},tt||5e3),rr}return null}function X(){this.a=0,this.c=null}function ie(Be){return Be.a++,function(){Be.a--,de(Be)}}function oe(Be,Ye){Be.c=Ye,de(Be)}function de(Be){Be.a==0&&Be.c&&(Be.c(),Be.c=null)}function ce(Be){this.a=Be||"-"}ce.prototype.c=function(Be){for(var Ye=[],Lt=0;Lt<arguments.length;Lt++)Ye.push(arguments[Lt].replace(/[\W_]+/g,"").toLowerCase());return Ye.join(this.a)};function le(Be,Ye){this.c=Be,this.f=4,this.a="n";var Lt=(Ye||"n4").match(/^([nio])([1-9])$/i);Lt&&(this.a=Lt[1],this.f=parseInt(Lt[2],10))}function fe(Be){return we(Be)+" "+(Be.f+"00")+" 300px "+pe(Be.c)}function pe(Be){var Ye=[];Be=Be.split(/,\s*/);for(var Lt=0;Lt<Be.length;Lt++){var tt=Be[Lt].replace(/['"]/g,"");tt.indexOf(" ")!=-1||/^\d/.test(tt)?Ye.push("'"+tt+"'"):Ye.push(tt)}return Ye.join(",")}function Se(Be){return Be.a+Be.f}function we(Be){var Ye="normal";return Be.a==="o"?Ye="oblique":Be.a==="i"&&(Ye="italic"),Ye}function xe(Be){var Ye=4,Lt="n",tt=null;return Be&&((tt=Be.match(/(normal|oblique|italic)/i))&&tt[1]&&(Lt=tt[1].substr(0,1).toLowerCase()),(tt=Be.match(/([1-9]00|normal|bold)/i))&&tt[1]&&(/bold/i.test(tt[1])?Ye=7:/[1-9]00/.test(tt[1])&&(Ye=parseInt(tt[1].substr(0,1),10)))),Lt+Ye}function me(Be,Ye){this.c=Be,this.f=Be.o.document.documentElement,this.h=Ye,this.a=new ce("-"),this.j=Ye.events!==!1,this.g=Ye.classes!==!1}function be(Be){Be.g&&M(Be.f,[Be.a.c("wf","loading")]),Z(Be,"loading")}function $e(Be){if(Be.g){var Ye=B(Be.f,Be.a.c("wf","active")),Lt=[],tt=[Be.a.c("wf","loading")];Ye||Lt.push(Be.a.c("wf","inactive")),M(Be.f,Lt,tt)}Z(Be,"inactive")}function Z(Be,Ye,Lt){Be.j&&Be.h[Ye]&&(Lt?Be.h[Ye](Lt.c,Se(Lt)):Be.h[Ye]())}function I(){this.c={}}function L(Be,Ye,Lt){var tt=[],bt;for(bt in Ye)if(Ye.hasOwnProperty(bt)){var rr=Be.c[bt];rr&&tt.push(rr(Ye[bt],Lt))}return tt}function F(Be,Ye){this.c=Be,this.f=Ye,this.a=P(this.c,"span",{"aria-hidden":"true"},this.f)}function N(Be){O(Be.c,"body",Be.a)}function V(Be){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+pe(Be.c)+";"+("font-style:"+we(Be)+";font-weight:"+(Be.f+"00")+";")}function ee(Be,Ye,Lt,tt,bt,rr){this.g=Be,this.j=Ye,this.a=tt,this.c=Lt,this.f=bt||3e3,this.h=rr||void 0}ee.prototype.start=function(){var Be=this.c.o.document,Ye=this,Lt=S(),tt=new Promise(function(Ot,Ht){function wr(){S()-Lt>=Ye.f?Ht():Be.fonts.load(fe(Ye.a),Ye.h).then(function(Ut){1<=Ut.length?Ot():setTimeout(wr,25)},function(){Ht()})}wr()}),bt=null,rr=new Promise(function(Ot,Ht){bt=setTimeout(Ht,Ye.f)});Promise.race([rr,tt]).then(function(){bt&&(clearTimeout(bt),bt=null),Ye.g(Ye.a)},function(){Ye.j(Ye.a)})};function ne(Be,Ye,Lt,tt,bt,rr,Ot){this.v=Be,this.B=Ye,this.c=Lt,this.a=tt,this.s=Ot||"BESbswy",this.f={},this.w=bt||3e3,this.u=rr||null,this.m=this.j=this.h=this.g=null,this.g=new F(this.c,this.s),this.h=new F(this.c,this.s),this.j=new F(this.c,this.s),this.m=new F(this.c,this.s),Be=new le(this.a.c+",serif",Se(this.a)),Be=V(Be),this.g.a.style.cssText=Be,Be=new le(this.a.c+",sans-serif",Se(this.a)),Be=V(Be),this.h.a.style.cssText=Be,Be=new le("serif",Se(this.a)),Be=V(Be),this.j.a.style.cssText=Be,Be=new le("sans-serif",Se(this.a)),Be=V(Be),this.m.a.style.cssText=Be,N(this.g),N(this.h),N(this.j),N(this.m)}var Q={D:"serif",C:"sans-serif"},j=null;function Y(){if(j===null){var Be=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);j=!!Be&&(536>parseInt(Be[1],10)||parseInt(Be[1],10)===536&&11>=parseInt(Be[2],10))}return j}ne.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=S(),ae(this)};function Ae(Be,Ye,Lt){for(var tt in Q)if(Q.hasOwnProperty(tt)&&Ye===Be.f[Q[tt]]&&Lt===Be.f[Q[tt]])return!0;return!1}function ae(Be){var Ye=Be.g.a.offsetWidth,Lt=Be.h.a.offsetWidth,tt;(tt=Ye===Be.f.serif&&Lt===Be.f["sans-serif"])||(tt=Y()&&Ae(Be,Ye,Lt)),tt?S()-Be.A>=Be.w?Y()&&Ae(Be,Ye,Lt)&&(Be.u===null||Be.u.hasOwnProperty(Be.a.c))?ge(Be,Be.v):ge(Be,Be.B):he(Be):ge(Be,Be.v)}function he(Be){setTimeout(E(function(){ae(this)},Be),50)}function ge(Be,Ye){setTimeout(E(function(){D(this.g.a),D(this.h.a),D(this.j.a),D(this.m.a),Ye(this.a)},Be),0)}function Ee(Be,Ye,Lt){this.c=Be,this.a=Ye,this.f=0,this.m=this.j=!1,this.s=Lt}var _e=null;Ee.prototype.g=function(Be){var Ye=this.a;Ye.g&&M(Ye.f,[Ye.a.c("wf",Be.c,Se(Be).toString(),"active")],[Ye.a.c("wf",Be.c,Se(Be).toString(),"loading"),Ye.a.c("wf",Be.c,Se(Be).toString(),"inactive")]),Z(Ye,"fontactive",Be),this.m=!0,Oe(this)},Ee.prototype.h=function(Be){var Ye=this.a;if(Ye.g){var Lt=B(Ye.f,Ye.a.c("wf",Be.c,Se(Be).toString(),"active")),tt=[],bt=[Ye.a.c("wf",Be.c,Se(Be).toString(),"loading")];Lt||tt.push(Ye.a.c("wf",Be.c,Se(Be).toString(),"inactive")),M(Ye.f,tt,bt)}Z(Ye,"fontinactive",Be),Oe(this)};function Oe(Be){--Be.f==0&&Be.j&&(Be.m?(Be=Be.a,Be.g&&M(Be.f,[Be.a.c("wf","active")],[Be.a.c("wf","loading"),Be.a.c("wf","inactive")]),Z(Be,"active")):$e(Be.a))}function se(Be){this.j=Be,this.a=new I,this.h=0,this.f=this.g=!0}se.prototype.load=function(Be){this.c=new C(this.j,Be.context||this.j),this.g=Be.events!==!1,this.f=Be.classes!==!1,ye(this,new me(this.c,Be),Be)};function te(Be,Ye,Lt,tt,bt){var rr=--Be.h==0;(Be.f||Be.g)&&setTimeout(function(){var Ot=bt||null,Ht=tt||null||{};if(Lt.length===0&&rr)$e(Ye.a);else{Ye.f+=Lt.length,rr&&(Ye.j=rr);var wr,Ut=[];for(wr=0;wr<Lt.length;wr++){var Yt=Lt[wr],Ur=Ht[Yt.c],nr=Ye.a,or=Yt;if(nr.g&&M(nr.f,[nr.a.c("wf",or.c,Se(or).toString(),"loading")]),Z(nr,"fontloading",or),nr=null,_e===null)if(window.FontFace){var or=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),un=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);_e=or?42<parseInt(or[1],10):!un}else _e=!1;_e?nr=new ee(E(Ye.g,Ye),E(Ye.h,Ye),Ye.c,Yt,Ye.s,Ur):nr=new ne(E(Ye.g,Ye),E(Ye.h,Ye),Ye.c,Yt,Ye.s,Ot,Ur),Ut.push(nr)}for(wr=0;wr<Ut.length;wr++)Ut[wr].start()}},0)}function ye(Be,Ye,Lt){var bt=[],tt=Lt.timeout;be(Ye);var bt=L(Be.a,Lt,Be.c),rr=new Ee(Be.c,Ye,tt);for(Be.h=bt.length,Ye=0,Lt=bt.length;Ye<Lt;Ye++)bt[Ye].load(function(Ot,Ht,wr){te(Be,rr,Ot,Ht,wr)})}function ve(Be,Ye){this.c=Be,this.a=Ye}ve.prototype.load=function(Be){function Ye(){if(rr["__mti_fntLst"+tt]){var Ot=rr["__mti_fntLst"+tt](),Ht=[],wr;if(Ot)for(var Ut=0;Ut<Ot.length;Ut++){var Yt=Ot[Ut].fontfamily;Ot[Ut].fontStyle!=null&&Ot[Ut].fontWeight!=null?(wr=Ot[Ut].fontStyle+Ot[Ut].fontWeight,Ht.push(new le(Yt,wr))):Ht.push(new le(Yt))}Be(Ht)}else setTimeout(function(){Ye()},50)}var Lt=this,tt=Lt.a.projectId,bt=Lt.a.version;if(tt){var rr=Lt.c.o;J(this.c,(Lt.a.api||"https://fast.fonts.net/jsapi")+"/"+tt+".js"+(bt?"?v="+bt:""),function(Ot){Ot?Be([]):(rr["__MonotypeConfiguration__"+tt]=function(){return Lt.a},Ye())}).id="__MonotypeAPIScript__"+tt}else Be([])};function Pe(Be,Ye){this.c=Be,this.a=Ye}Pe.prototype.load=function(Be){var Ye,Lt,tt=this.a.urls||[],bt=this.a.families||[],rr=this.a.testStrings||{},Ot=new X;for(Ye=0,Lt=tt.length;Ye<Lt;Ye++)H(this.c,tt[Ye],ie(Ot));var Ht=[];for(Ye=0,Lt=bt.length;Ye<Lt;Ye++)if(tt=bt[Ye].split(":"),tt[1])for(var wr=tt[1].split(","),Ut=0;Ut<wr.length;Ut+=1)Ht.push(new le(tt[0],wr[Ut]));else Ht.push(new le(tt[0]));oe(Ot,function(){Be(Ht,rr)})};function He(Be,Ye){Be?this.c=Be:this.c=Ne,this.a=[],this.f=[],this.g=Ye||""}var Ne="https://fonts.googleapis.com/css";function Ie(Be,Ye){for(var Lt=Ye.length,tt=0;tt<Lt;tt++){var bt=Ye[tt].split(":");bt.length==3&&Be.f.push(bt.pop());var rr="";bt.length==2&&bt[1]!=""&&(rr=":"),Be.a.push(bt.join(rr))}}function Le(Be){if(Be.a.length==0)throw Error("No fonts to load!");if(Be.c.indexOf("kit=")!=-1)return Be.c;for(var Ye=Be.a.length,Lt=[],tt=0;tt<Ye;tt++)Lt.push(Be.a[tt].replace(/ /g,"+"));return Ye=Be.c+"?family="+Lt.join("%7C"),0<Be.f.length&&(Ye+="&subset="+Be.f.join(",")),0<Be.g.length&&(Ye+="&text="+encodeURIComponent(Be.g)),Ye}function Ge(Be){this.f=Be,this.a=[],this.c={}}var ze={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},vt={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},xt={i:"i",italic:"i",n:"n",normal:"n"},wt=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function Bt(Be){for(var Ye=Be.f.length,Lt=0;Lt<Ye;Lt++){var tt=Be.f[Lt].split(":"),bt=tt[0].replace(/\+/g," "),rr=["n4"];if(2<=tt.length){var Ot,Ht=tt[1];if(Ot=[],Ht)for(var Ht=Ht.split(","),wr=Ht.length,Ut=0;Ut<wr;Ut++){var Yt;if(Yt=Ht[Ut],Yt.match(/^[\w-]+$/)){var Ur=wt.exec(Yt.toLowerCase());if(Ur==null)Yt="";else{if(Yt=Ur[2],Yt=Yt==null||Yt==""?"n":xt[Yt],Ur=Ur[1],Ur==null||Ur=="")Ur="4";else var nr=vt[Ur],Ur=nr||(isNaN(Ur)?"4":Ur.substr(0,1));Yt=[Yt,Ur].join("")}}else Yt="";Yt&&Ot.push(Yt)}0<Ot.length&&(rr=Ot),tt.length==3&&(tt=tt[2],Ot=[],tt=tt?tt.split(","):Ot,0<tt.length&&(tt=ze[tt[0]])&&(Be.c[bt]=tt))}for(Be.c[bt]||(tt=ze[bt])&&(Be.c[bt]=tt),tt=0;tt<rr.length;tt+=1)Be.a.push(new le(bt,rr[tt]))}}function ht(Be,Ye){this.c=Be,this.a=Ye}var st={Arimo:!0,Cousine:!0,Tinos:!0};ht.prototype.load=function(Be){var Ye=new X,Lt=this.c,tt=new He(this.a.api,this.a.text),bt=this.a.families;Ie(tt,bt);var rr=new Ge(bt);Bt(rr),H(Lt,Le(tt),ie(Ye)),oe(Ye,function(){Be(rr.a,rr.c,st)})};function Nt(Be,Ye){this.c=Be,this.a=Ye}Nt.prototype.load=function(Be){var Ye=this.a.id,Lt=this.c.o;Ye?J(this.c,(this.a.api||"https://use.typekit.net")+"/"+Ye+".js",function(tt){if(tt)Be([]);else if(Lt.Typekit&&Lt.Typekit.config&&Lt.Typekit.config.fn){tt=Lt.Typekit.config.fn;for(var bt=[],rr=0;rr<tt.length;rr+=2)for(var Ot=tt[rr],Ht=tt[rr+1],wr=0;wr<Ht.length;wr++)bt.push(new le(Ot,Ht[wr]));try{Lt.Typekit.load({events:!1,classes:!1,async:!0})}catch{}Be(bt)}},2e3):Be([])};function ut(Be,Ye){this.c=Be,this.f=Ye,this.a=[]}ut.prototype.load=function(Be){var Ye=this.f.id,Lt=this.c.o,tt=this;Ye?(Lt.__webfontfontdeckmodule__||(Lt.__webfontfontdeckmodule__={}),Lt.__webfontfontdeckmodule__[Ye]=function(bt,rr){for(var Ot=0,Ht=rr.fonts.length;Ot<Ht;++Ot){var wr=rr.fonts[Ot];tt.a.push(new le(wr.name,xe("font-weight:"+wr.weight+";font-style:"+wr.style)))}Be(tt.a)},J(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+U(this.c)+"/"+Ye+".js",function(bt){bt&&Be([])})):Be([])};var $t=new se(window);$t.a.c.custom=function(Be,Ye){return new Pe(Ye,Be)},$t.a.c.fontdeck=function(Be,Ye){return new ut(Ye,Be)},$t.a.c.monotype=function(Be,Ye){return new ve(Ye,Be)},$t.a.c.typekit=function(Be,Ye){return new Nt(Ye,Be)},$t.a.c.google=function(Be,Ye){return new ht(Ye,Be)};var Zt={load:E($t.load,$t)};a.exports?a.exports=Zt:(window.WebFont=Zt,window.WebFontConfig&&$t.load(window.WebFontConfig))})()})(webfontloader$1);var webfontloaderExports=webfontloader$1.exports;const webfontloader=getDefaultExportFromCjs(webfontloaderExports);var __create=Object.create,__defProp$7=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__getOwnPropNames$1=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp$3=Object.prototype.hasOwnProperty,__commonJS=(a,u)=>function(){return u||(0,a[__getOwnPropNames$1(a)[0]])((u={exports:{}}).exports,u),u.exports},__copyProps$1=(a,u,_,E)=>{if(u&&typeof u=="object"||typeof u=="function")for(let S of __getOwnPropNames$1(u))!__hasOwnProp$3.call(a,S)&&S!==_&&__defProp$7(a,S,{get:()=>u[S],enumerable:!(E=__getOwnPropDesc$1(u,S))||E.enumerable});return a},__toESM=(a,u,_)=>(_=a!=null?__create(__getProtoOf(a)):{},__copyProps$1(!a||!a.__esModule?__defProp$7(_,"default",{value:a,enumerable:!0}):_,a)),require_cjs=__commonJS({"../../node_modules/deepmerge/dist/cjs.js"(a,u){var _=function(le){return E(le)&&!S(le)};function E(ce){return!!ce&&typeof ce=="object"}function S(ce){var le=Object.prototype.toString.call(ce);return le==="[object RegExp]"||le==="[object Date]"||P(ce)}var C=typeof Symbol=="function"&&Symbol.for,T=C?Symbol.for("react.element"):60103;function P(ce){return ce.$$typeof===T}function O(ce){return Array.isArray(ce)?[]:{}}function D(ce,le){return le.clone!==!1&&le.isMergeableObject(ce)?oe(O(ce),ce,le):ce}function M(ce,le,fe){return ce.concat(le).map(function(pe){return D(pe,fe)})}function B(ce,le){if(!le.customMerge)return oe;var fe=le.customMerge(ce);return typeof fe=="function"?fe:oe}function U(ce){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(ce).filter(function(le){return Object.propertyIsEnumerable.call(ce,le)}):[]}function H(ce){return Object.keys(ce).concat(U(ce))}function J(ce,le){try{return le in ce}catch{return!1}}function X(ce,le){return J(ce,le)&&!(Object.hasOwnProperty.call(ce,le)&&Object.propertyIsEnumerable.call(ce,le))}function ie(ce,le,fe){var pe={};return fe.isMergeableObject(ce)&&H(ce).forEach(function(Se){pe[Se]=D(ce[Se],fe)}),H(le).forEach(function(Se){X(ce,Se)||(J(ce,Se)&&fe.isMergeableObject(le[Se])?pe[Se]=B(Se,fe)(ce[Se],le[Se],fe):pe[Se]=D(le[Se],fe))}),pe}function oe(ce,le,fe){fe=fe||{},fe.arrayMerge=fe.arrayMerge||M,fe.isMergeableObject=fe.isMergeableObject||_,fe.cloneUnlessOtherwiseSpecified=D;var pe=Array.isArray(le),Se=Array.isArray(ce),we=pe===Se;return we?pe?fe.arrayMerge(ce,le,fe):ie(ce,le,fe):D(le,fe)}oe.all=function(le,fe){if(!Array.isArray(le))throw new Error("first argument should be an array");return le.reduce(function(pe,Se){return oe(pe,Se,fe)},{})};var de=oe;u.exports=de}});function formatMuiErrorMessage(a,...u){const _=new URL(`https://mui.com/production-error/?code=${a}`);return u.forEach(E=>_.searchParams.append("args[]",E)),`Minified MUI error #${a}; visit ${_} for the full message.`}function clamp(a,u=Number.MIN_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER){return Math.max(u,Math.min(a,_))}var clamp_default=clamp;function clampWrapper(a,u=0,_=1){return clamp_default(a,u,_)}function hexToRgb(a){a=a.slice(1);const u=new RegExp(`.{1,${a.length>=6?2:1}}`,"g");let _=a.match(u);return _&&_[0].length===1&&(_=_.map(E=>E+E)),_?`rgb${_.length===4?"a":""}(${_.map((E,S)=>S<3?parseInt(E,16):Math.round(parseInt(E,16)/255*1e3)/1e3).join(", ")})`:""}function decomposeColor(a){if(a.type)return a;if(a.charAt(0)==="#")return decomposeColor(hexToRgb(a));const u=a.indexOf("("),_=a.substring(0,u);if(!["rgb","rgba","hsl","hsla","color"].includes(_))throw new Error(formatMuiErrorMessage(9,a));let E=a.substring(u+1,a.length-1),S;if(_==="color"){if(E=E.split(" "),S=E.shift(),E.length===4&&E[3].charAt(0)==="/"&&(E[3]=E[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(S))throw new Error(formatMuiErrorMessage(10,S))}else E=E.split(",");return E=E.map(C=>parseFloat(C)),{type:_,values:E,colorSpace:S}}function recomposeColor(a){const{type:u,colorSpace:_}=a;let{values:E}=a;return u.includes("rgb")?E=E.map((S,C)=>C<3?parseInt(S,10):S):u.includes("hsl")&&(E[1]=`${E[1]}%`,E[2]=`${E[2]}%`),u.includes("color")?E=`${_} ${E.join(" ")}`:E=`${E.join(", ")}`,`${u}(${E})`}function alpha(a,u){return a=decomposeColor(a),u=clampWrapper(u),(a.type==="rgb"||a.type==="hsl")&&(a.type+="a"),a.type==="color"?a.values[3]=`/${u}`:a.values[3]=u,recomposeColor(a)}var import_deepmerge=__toESM(require_cjs()),BLOCKLET_THEME_PREFER_KEY="blocklet_theme_prefer",merge$2=(a,u)=>(0,import_deepmerge.default)(a,u,{arrayMerge:(_,E)=>E});function isValidThemeMode(a){return a==="light"||a==="dark"}function getDefaultThemePrefer(a){var C;const _=new URLSearchParams(window.location.search).get("theme");if(isValidThemeMode(_))return _;const E=sessionStorage.getItem(BLOCKLET_THEME_PREFER_KEY);if(isValidThemeMode(E))return E;const S=(C=Object.assign({},window.blocklet,a).theme)==null?void 0:C.prefer;if(S==="light"||S==="dark")return S;if(S==="system"){const T=localStorage.getItem(BLOCKLET_THEME_PREFER_KEY);return isValidThemeMode(T)?T:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return"light"}var DEFAULT_FONTS=["Roboto","Helvetica","Arial","sans-serif"],shadows=["none","0px 1px 2px 0px rgba(24,24,27,0.06),0px 1px 3px 0px rgba(24,24,27,0.03)","0px 1.5px 3px 0px rgba(24,24,27,0.07),0px 1px 4px 0px rgba(24,24,27,0.035)","0px 2px 4px 0px rgba(24,24,27,0.08),0px 1.5px 5px 0px rgba(24,24,27,0.04)","0px 2px 8px 0px rgba(24,24,27,0.09),0px 2px 6px 0px rgba(24,24,27,0.045)","0px 2.5px 10px 0px rgba(24,24,27,0.10),0px 2px 7px 0px rgba(24,24,27,0.05)","0px 3px 12px 0px rgba(24,24,27,0.11),0px 2.5px 8px 0px rgba(24,24,27,0.055)","0px 3.5px 14px 0px rgba(24,24,27,0.12),0px 3px 9px 0px rgba(24,24,27,0.06)","0px 4px 16px 0px rgba(24,24,27,0.13),0px 3.5px 10px 0px rgba(24,24,27,0.065)","0px 4.5px 18px 0px rgba(24,24,27,0.14),0px 4px 11px 0px rgba(24,24,27,0.07)","0px 5px 20px 0px rgba(24,24,27,0.15),0px 4.5px 12px 0px rgba(24,24,27,0.075)","0px 5.5px 22px 0px rgba(24,24,27,0.16),0px 5px 13px 0px rgba(24,24,27,0.08)","0px 6px 24px 0px rgba(24,24,27,0.17),0px 5.5px 14px 0px rgba(24,24,27,0.085)","0px 6.5px 26px 0px rgba(24,24,27,0.18),0px 6px 15px 0px rgba(24,24,27,0.09)","0px 7px 28px 0px rgba(24,24,27,0.19),0px 6.5px 16px 0px rgba(24,24,27,0.095)","0px 7.5px 30px 0px rgba(24,24,27,0.20),0px 7px 17px 0px rgba(24,24,27,0.10)","0px 8px 32px 0px rgba(24,24,27,0.21),0px 7.5px 18px 0px rgba(24,24,27,0.105)","0px 8.5px 34px 0px rgba(24,24,27,0.22),0px 8px 19px 0px rgba(24,24,27,0.11)","0px 9px 36px 0px rgba(24,24,27,0.23),0px 8.5px 20px 0px rgba(24,24,27,0.115)","0px 9.5px 38px 0px rgba(24,24,27,0.24),0px 9px 21px 0px rgba(24,24,27,0.12)","0px 10px 40px 0px rgba(24,24,27,0.25),0px 9.5px 22px 0px rgba(24,24,27,0.125)","0px 10.5px 42px 0px rgba(24,24,27,0.26),0px 10px 23px 0px rgba(24,24,27,0.13)","0px 11px 44px 0px rgba(24,24,27,0.27),0px 10.5px 24px 0px rgba(24,24,27,0.135)","0px 11.5px 46px 0px rgba(24,24,27,0.28),0px 11px 25px 0px rgba(24,24,27,0.14)","0px 12px 48px 0px rgba(24,24,27,0.29),0px 11.5px 26px 0px rgba(24,24,27,0.145)"],BLOCKLET_THEME_LIGHT={palette:{mode:"light",primary:{main:"#00bba7",contrastText:"#fff",light:"#00d5be",dark:"#009689"},secondary:{main:"#00b8db",contrastText:"#fff",light:"#00d3f3",dark:"#0092bb"},error:{main:"#fb2c36",contrastText:"#fff",light:"#ff6467",dark:"#e7000b"},warning:{main:"#ff6900",contrastText:"#fff",light:"#ff8904",dark:"#f54900"},info:{main:"#2b7fff",contrastText:"#fff",light:"#51a2ff",dark:"#155dfc"},success:{main:"#00c950",contrastText:"#fff",light:"#05df72",dark:"#00a63e"},grey:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f47",800:"#27272a",900:"#18181b",A100:"#09090b",A200:"#09090b",A400:"#09090b",A700:"#09090b"},text:{primary:"#18181b",secondary:"#71717b",disabled:"#d4d4d8",hint:"#d4d4d8",contrast:"#fff"},divider:"#ececef",background:{default:"#fff",paper:"#fff"},common:{black:"#000",white:"#fff"},action:{active:"rgba(24, 24, 27, 0.54)",hover:"rgba(24, 24, 27, 0.04)",hoverOpacity:.04,selected:"rgba(24, 24, 27, 0.08)",selectedOpacity:.08,disabled:"rgba(24, 24, 27, 0.26)",disabledBackground:"rgba(24, 24, 27, 0.12)",disabledOpacity:.38,focus:"rgba(24, 24, 27, 0.12)",focusOpacity:.12,activatedOpacity:.12},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},did:{primary:"#4598FA",secondary:"#49C3AD"}},shape:{borderRadius:8},typography:{fontSize:14,fontFamily:DEFAULT_FONTS.join(","),button:{fontWeight:700,textTransform:"none"},allVariants:{textTransform:"none"},color:{main:"#18181b",gray:"#71717b"},h1:{fontSize:"1.875rem",lineHeight:1.2,fontWeight:700,textTransform:"none"},h2:{fontSize:"1.5rem",lineHeight:1.3333333,fontWeight:700,textTransform:"none"},h3:{fontSize:"1.25rem",lineHeight:1.4,fontWeight:700,textTransform:"none"},h4:{fontSize:"1.125rem",lineHeight:1.55,fontWeight:600,textTransform:"none"},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:700,textTransform:"none"},h6:{fontSize:"0.875rem",lineHeight:1.43,fontWeight:700,textTransform:"none"},subtitle1:{fontSize:"1rem",lineHeight:1.43,fontWeight:500,textTransform:"none"},subtitle2:{fontSize:"0.875rem",lineHeight:1.43,fontWeight:500,textTransform:"none"},body1:{fontSize:"1rem",lineHeight:1.5,fontWeight:400,textTransform:"none"},body2:{fontSize:"0.875rem",lineHeight:1.43,fontWeight:400,textTransform:"none"},caption:{fontSize:"0.75rem",lineHeight:1.33,fontWeight:400,textTransform:"none"},overline:{fontSize:"0.75rem",lineHeight:1.33,fontWeight:500,textTransform:"none"}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}},shadows,components:{MuiButton:{styleOverrides:{root:{boxShadow:"none"}}},MuiTextField:{styleOverrides:{root:({theme:a})=>({"& .MuiOutlinedInput-root":{"& .MuiOutlinedInput-notchedOutline":{borderColor:a.palette.grey[300]},"&:hover:not(.Mui-focused):not(.Mui-error) .MuiOutlinedInput-notchedOutline":{borderColor:a.palette.grey[400]}},"& .MuiInput-root":{"&:before":{borderColor:a.palette.grey[300]},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderColor:a.palette.grey[400]}}})}},MuiButtonGroup:{styleOverrides:{root:{boxShadow:"none"}}},MuiTableCell:{styleOverrides:{sizeSmall:{borderBottomWidth:"0",paddingTop:"8px",paddingBottom:"8px",paddingLeft:0,paddingRight:"20px"},sizeMedium:{borderBottomWidth:"0",paddingTop:"14px",paddingBottom:"14px",paddingLeft:0,paddingRight:"30px"},head:({theme:a})=>({textTransform:"uppercase",color:a.palette.grey[900]}),body:({theme:a})=>({color:a.palette.grey[900]})}},MuiTableRow:{styleOverrides:{root:{"&:nth-child(even)":{backgroundColor:"rgba(0, 0, 0, 0.02)"}},head:{backgroundColor:"transparent"}}},MuiTooltip:{styleOverrides:{tooltip:({theme:a})=>({backgroundColor:a.palette.grey[500],color:a.palette.text.contrast}),arrow:({theme:a})=>({color:a.palette.grey[500]})}},MuiPaper:{styleOverrides:{root:({theme:a})=>({boxShadow:`inset 0 0 0 1px ${a.palette.action.hover}`})}},MuiAlert:{styleOverrides:{filledError:({theme:a})=>({color:a.palette.common.white,fontWeight:300}),filledInfo:({theme:a})=>({color:a.palette.common.white,fontWeight:300}),filledSuccess:({theme:a})=>({color:a.palette.common.white,fontWeight:300}),filledWarning:({theme:a})=>({color:a.palette.common.white,fontWeight:300})}}}},BLOCKLET_THEME_DARK=merge$2(BLOCKLET_THEME_LIGHT,{palette:{mode:"dark",common:{black:"#000",white:"#fff"},primary:{main:"#00d5be",contrastText:"#f4f4f5",light:"#4ce3d0",dark:"#00a89a"},secondary:{main:"#00d3f3",contrastText:"#f4f4f5",light:"#51e1ff",dark:"#00a2c0"},error:{main:"#ff6467",contrastText:"#f4f4f5",light:"#ff9598",dark:"#e7000b"},warning:{main:"#ff8904",contrastText:"#f4f4f5",light:"#ffa644",dark:"#f54900"},info:{main:"#51a2ff",contrastText:"#f4f4f5",light:"#83c3ff",dark:"#1570e5"},success:{main:"#05df72",contrastText:"#f4f4f5",light:"#56e799",dark:"#00b24a"},grey:{50:"#18181b",100:"#27272a",200:"#3f3f47",300:"#52525c",400:"#71717b",500:"#9f9fa9",600:"#d4d4d8",700:"#e4e4e7",800:"#f4f4f5",900:"#fafafa",A100:"#f8f8fa",A200:"#f8f8fa",A400:"#f8f8fa",A700:"#f8f8fa"},text:{primary:"#ffffff",secondary:"#A1a1aa",disabled:"#52525c",hint:"#71717b",contrast:"#18181b"},divider:"#27272A",background:{default:"#121212",paper:"#18181b"},action:{active:"rgba(255, 255, 255, 0.54)",hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}},typography:{color:{main:"#fff",gray:"#9e9e9e"}},shadows,components:{MuiTableCell:{styleOverrides:{head:({theme:a})=>({textTransform:"uppercase",color:a.palette.grey[300]}),body:({theme:a})=>({color:a.palette.grey[300]})}},MuiTableRow:{styleOverrides:{root:{"&:nth-child(even)":{backgroundColor:"rgba(255, 255, 255, 0.02)"}}}},MuiTooltip:{styleOverrides:{tooltip:({theme:a})=>({backgroundColor:a.palette.grey[500],color:a.palette.text.contrast}),arrow:({theme:a})=>({color:a.palette.grey[500]})}},MuiPaper:{styleOverrides:{root:({theme:a})=>({boxShadow:`inset 0 0 0 1px ${a.palette.action.hover}`})}},MuiAlert:{styleOverrides:{standardError:({theme:a})=>({backgroundColor:alpha(a.palette.error.main,.25),color:a.palette.warning.light,"& .MuiAlert-icon":{color:a.palette.warning.light}}),standardInfo:({theme:a})=>({backgroundColor:alpha(a.palette.info.main,.25),color:a.palette.info.light,"& .MuiAlert-icon":{color:a.palette.info.light}}),standardWarning:({theme:a})=>({backgroundColor:alpha(a.palette.warning.main,.25),color:a.palette.warning.light,"& .MuiAlert-icon":{color:a.palette.warning.light}}),standardSuccess:({theme:a})=>({backgroundColor:alpha(a.palette.success.main,.25),color:a.palette.success.light,"& .MuiAlert-icon":{color:a.palette.success.light}})}},MuiSwitch:{styleOverrides:{switchBase:({theme:a})=>({"&:not(.Mui-checked)":{"& + .MuiSwitch-track":{backgroundColor:a.palette.grey[200],opacity:1},"& > .MuiSwitch-thumb":{backgroundColor:a.palette.grey[700]}},"&.Mui-disabled":{"& + .MuiSwitch-track":{opacity:.3},"&:not(.Mui-checked) > .MuiSwitch-thumb":{backgroundColor:a.palette.grey[300]}}})}}}}),paletteLight={divider:"rgba(18, 22, 24, 0.06)",action:{hover:"#FAFAFA",selected:"#F4F4F5"}},paletteDark={divider:"rgba(255, 255, 255, 0.06)",action:{hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)"}},DID_CONNECT_THEME_LIGHT=merge$2(BLOCKLET_THEME_LIGHT,{palette:paletteLight}),DID_CONNECT_THEME_DARK=merge$2(BLOCKLET_THEME_DARK,{palette:paletteDark});function base$4(a){if(a.length>=255)throw new TypeError("Alphabet too long");for(var u=new Uint8Array(256),_=0;_<u.length;_++)u[_]=255;for(var E=0;E<a.length;E++){var S=a.charAt(E),C=S.charCodeAt(0);if(u[C]!==255)throw new TypeError(S+" is ambiguous");u[C]=E}var T=a.length,P=a.charAt(0),O=Math.log(T)/Math.log(256),D=Math.log(256)/Math.log(T);function M(H){if(H instanceof Uint8Array||(ArrayBuffer.isView(H)?H=new Uint8Array(H.buffer,H.byteOffset,H.byteLength):Array.isArray(H)&&(H=Uint8Array.from(H))),!(H instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(H.length===0)return"";for(var J=0,X=0,ie=0,oe=H.length;ie!==oe&&H[ie]===0;)ie++,J++;for(var de=(oe-ie)*D+1>>>0,ce=new Uint8Array(de);ie!==oe;){for(var le=H[ie],fe=0,pe=de-1;(le!==0||fe<X)&&pe!==-1;pe--,fe++)le+=256*ce[pe]>>>0,ce[pe]=le%T>>>0,le=le/T>>>0;if(le!==0)throw new Error("Non-zero carry");X=fe,ie++}for(var Se=de-X;Se!==de&&ce[Se]===0;)Se++;for(var we=P.repeat(J);Se<de;++Se)we+=a.charAt(ce[Se]);return we}function B(H){if(typeof H!="string")throw new TypeError("Expected String");if(H.length===0)return new Uint8Array;for(var J=0,X=0,ie=0;H[J]===P;)X++,J++;for(var oe=(H.length-J)*O+1>>>0,de=new Uint8Array(oe);H[J];){var ce=u[H.charCodeAt(J)];if(ce===255)return;for(var le=0,fe=oe-1;(ce!==0||le<ie)&&fe!==-1;fe--,le++)ce+=T*de[fe]>>>0,de[fe]=ce%256>>>0,ce=ce/256>>>0;if(ce!==0)throw new Error("Non-zero carry");ie=le,J++}for(var pe=oe-ie;pe!==oe&&de[pe]===0;)pe++;for(var Se=new Uint8Array(X+(oe-pe)),we=X;pe!==oe;)Se[we++]=de[pe++];return Se}function U(H){var J=B(H);if(J)return J;throw new Error("Non-base"+T+" character")}return{encode:M,decodeUnsafe:B,decode:U}}var src=base$4;const basex=src,ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var bs58=basex(ALPHABET);const base58=getDefaultExportFromCjs(bs58);var __defProp$6=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$1=Object.getOwnPropertySymbols,__hasOwnProp$2=Object.prototype.hasOwnProperty,__propIsEnum$1=Object.prototype.propertyIsEnumerable,__defNormalProp$6=(a,u,_)=>u in a?__defProp$6(a,u,{enumerable:!0,configurable:!0,writable:!0,value:_}):a[u]=_,__spreadValues$1=(a,u)=>{for(var _ in u||(u={}))__hasOwnProp$2.call(u,_)&&__defNormalProp$6(a,_,u[_]);if(__getOwnPropSymbols$1)for(var _ of __getOwnPropSymbols$1(u))__propIsEnum$1.call(u,_)&&__defNormalProp$6(a,_,u[_]);return a},__spreadProps=(a,u)=>__defProps(a,__getOwnPropDescs(u)),__objRest$1=(a,u)=>{var _={};for(var E in a)__hasOwnProp$2.call(a,E)&&u.indexOf(E)<0&&(_[E]=a[E]);if(a!=null&&__getOwnPropSymbols$1)for(var E of __getOwnPropSymbols$1(a))u.indexOf(E)<0&&__propIsEnum$1.call(a,E)&&(_[E]=a[E]);return _},colors$3=["#E94E4E","#E41115","#E96B4E","#E5502E","#E98F4E","#E57A2E","#E98F4E","#E5A82E","#DACD5D","#DAC825","#BDD13D","#C8E31C","#AEE94E","#7FD558","#52CC19","#4FC469","#59DE9C","#19CC73","#5ED9D1","#19CCC0","#4ED7E9","#19B7CC","#45ACE8","#1C97DE","#4E68E9","#2E4DE5","#7F4EE9","#682EE5","#BE65E7","#AF40E2","#DF58C2","#E94E8F"];const TOTAL_COLORS=32,TOTAL_POSITIONS=64,SHAPE_SIZE_RATIO=.25,REVERSED_ASPECT_RATIO=.7,RoleType={ACCOUNT:0,APPLICATION:3,ASSET:6,TOKEN:17},Shape={RECTANGLE:0,SQUARE:1,HEXAGON:2,CIRCLE:3},ElementType={CANVAS:0,SVG:1},easeOutBack=(a,u=1.70158)=>{const _=a/1-1;return _*_*((u+1)*_+u)+1},calcBorderRadius=a=>a>80?10:Math.floor(.1*a+2),getElementType=a=>{if(a){const{tagName:u}=a;if(/^svg$/i.test(u))return ElementType.SVG;if(/^canvas$/i.test(u)&&"getContext"in a)return ElementType.CANVAS}throw new Error(`Expected a svg or canvas element, got ${a}`)},animate=(a={})=>{const{callback:u,duration:_=1e3,onComplete:E=()=>{},ease:S=easeOutBack}=a;let C=null,T=0,P=null;const O=()=>{P&&(cancelAnimationFrame(P),P=null)},D=M=>{C||(C=M),M-C>=_?(T=1,E()):(T=S((M-C)/_),P=requestAnimationFrame(D)),u(T)};return requestAnimationFrame(D),O},genUniqueID=(a="")=>`${a}_${Math.floor(Math.random()*1e4)}_${Date.now()}`,DEFAULT_OPTIONS={width:200,height:200,xLines:8,yLines:8};class Grid{constructor(u){this.options=Object.assign({},DEFAULT_OPTIONS,u),this.init()}get gapX(){return this.options.width/(this.options.yLines+1)}get gapY(){return this.options.height/(this.options.xLines+1)}init(){const{xLines:u,yLines:_}=this.options;this.xOffsets=[...new Array(u)].map((E,S)=>(S+1)*this.gapX-this.options.width/2),this.yOffsets=[...new Array(_)].map((E,S)=>(S+1)*this.gapY-this.options.height/2)}getOffset(u,_){return[this.xOffsets[u],this.yOffsets[_]]}}class CanvasRenderer{constructor(u,_){this.ctx=u;const E=_.size||Math.min(u.canvas.width,u.canvas.height)||100;u.canvas.width=E,u.canvas.height=E;const S=new Grid({width:E,height:E,xLines:8,yLines:8});this.config=__spreadProps(__spreadValues$1({},_),{size:E,positions:_.positions.map(C=>S.getOffset(C[0],C[1])),shapeSize:E*SHAPE_SIZE_RATIO})}render(){this.draw(this.config.positions)}draw(u){const{ctx:_}=this,{size:E,color:S,shapeSize:C,opacity:T,shape:P}=this.config,O=calcBorderRadius(E);switch(_.clearRect(0,0,E,E),P){case Shape.RECTANGLE:{this.drawRoundedRect(_,0,E*(1-REVERSED_ASPECT_RATIO)/2,E,E*REVERSED_ASPECT_RATIO,O,!1,!1);break}case Shape.HEXAGON:{this.drawHexagon(_,E/2,E/2,E/2,0);break}case Shape.CIRCLE:{_.arc(E/2,E/2,E/2,0,Math.PI*2);break}case Shape.SQUARE:default:this.drawRoundedRect(_,0,0,E,E,O,!1,!1)}_.clip(),_.fillStyle=S,_.fillRect(0,0,E,E),_.save(),_.translate(E/2,E/2),u.forEach(([D,M])=>this.drawHexagon(_,D,M,C,T)),_.restore()}animate(u={}){const{duration:_=1e3,onComplete:E=()=>{}}=u,{positions:S}=this.config;return animate({duration:_,onComplete:E,callback:C=>{this.draw(S.map(T=>[C*T[0],C*T[1]]))}})}drawHexagon(u,_,E,S,C){const T=2*Math.PI/6;u.beginPath();for(let P=0;P<6;P++)u.lineTo(_+S*Math.cos(T*(P-1.5)),E+S*Math.sin(T*(P-1.5)));u.closePath(),u.fillStyle=`rgba(255, 255, 255, ${C})`,u.fill()}drawRoundedRect(u,_,E,S,C,T=10,P=!1,O=!0){const D=typeof T=="number"?{tl:T,tr:T,br:T,bl:T}:__spreadValues$1({tl:0,tr:0,br:0,bl:0},T);u.beginPath(),u.moveTo(_+D.tl,E),u.lineTo(_+S-D.tr,E),u.quadraticCurveTo(_+S,E,_+S,E+D.tr),u.lineTo(_+S,E+C-D.br),u.quadraticCurveTo(_+S,E+C,_+S-D.br,E+C),u.lineTo(_+D.bl,E+C),u.quadraticCurveTo(_,E+C,_,E+C-D.bl),u.lineTo(_,E+D.tl),u.quadraticCurveTo(_,E,_+D.tl,E),u.closePath(),P&&u.fill(),O&&u.stroke()}}const XMLNS="http://www.w3.org/2000/svg";function svgValue(a){return Math.round(a*10)/10}class SvgRenderer{constructor(u,_){this.el=u,this.config=_;const E=_.size||Math.min(Number(u.getAttribute("width"))||100,Number(u.getAttribute("height"))||100);u.setAttribute("viewBox",`0 0 ${E} ${E}`);const S=new Grid({width:E,height:E,xLines:8,yLines:8});this.config=__spreadProps(__spreadValues$1({},_),{size:E,positions:_.positions.map(C=>{const[T,P]=S.getOffset(C[0],C[1]);return[svgValue(T),svgValue(P)]}),shapeSize:svgValue(E*SHAPE_SIZE_RATIO)}),this.points=this.calcPoints(E/2,E/2,this.config.shapeSize)}setBackground(){const{size:u,color:_,shape:E}=this.config,S=calcBorderRadius(u);let C;switch(E){case Shape.RECTANGLE:{C=this.drawRoundedRect(0,svgValue(u*(1-REVERSED_ASPECT_RATIO)/2),u,svgValue(u*REVERSED_ASPECT_RATIO),S);break}case Shape.HEXAGON:{const D=this.calcPoints(u/2,u/2,u/2);C=this.drawHexagon(D);break}case Shape.CIRCLE:{C=this.createElement("circle",{cx:u/2,cy:u/2,r:u/2});break}case Shape.SQUARE:default:C=this.drawRoundedRect(0,0,u,u,S)}const T=genUniqueID("clip-path"),P=this.createElement("clipPath",{id:T},[C]);this.el.appendChild(this.createElement("defs",{},[P]));const O=this.createElement("g",{"clip-path":`url(#${T})`},this.createElement("rect",{x:0,y:0,width:u,height:u,fill:_}));this.g=O,this.el.appendChild(O)}render(){this.el.innerHTML="",this.setBackground(),this.drawHexagons(this.config.positions)}drawHexagons(u){const{opacity:_}=this.config;this.hexagons||(this.hexagons=u.map(()=>{const E=this.drawHexagon(this.points,_);return this.g.appendChild(E),E})),this.hexagons.forEach((E,S)=>{E.setAttribute("transform",`translate(${u[S][0]} ${u[S][1]})`)})}animate(u={}){const{duration:_=1e3,onComplete:E=()=>{}}=u,{positions:S}=this.config;return this.setBackground(),animate({duration:_,onComplete:E,callback:C=>{this.drawHexagons(S.map(T=>[C*T[0],C*T[1]]))}})}calcPoints(u,_,E){const S=2*Math.PI/6,C=[];for(let T=0;T<6;T++)C.push([u+E*Math.cos(S*(T-1.5)),_+E*Math.sin(S*(T-1.5))]);return C.map(T=>[svgValue(T[0]),svgValue(T[1])])}getPointsStr(u){return u.map(_=>`${svgValue(_[0])},${svgValue(_[1])}`).join(" ")}drawHexagon(u,_){return this.createElement("polygon",{points:this.getPointsStr(u),transformOrigin:"center",style:{fill:"#fff",fillOpacity:_}})}drawRoundedRect(u,_,E,S,C=10,T="none"){return this.createElement("rect",{x:u,y:_,width:E,height:S,rx:C,ry:C,fill:T})}createElement(u,_={},E=[]){const S=document.createElementNS(XMLNS,u),C=_,{style:T={}}=C,P=__objRest$1(C,["style"]);return Object.keys(P).forEach(O=>{S.setAttribute(O,P[O])}),Object.keys(T).forEach(O=>{S.style[O]=T[O]}),Array.isArray(E)||(E=[E]),E.forEach(O=>S.appendChild(O)),S}}class DIDParsingError extends Error{constructor(u,_){super(u,_),this.name="DIDParsingError"}}const parseRoleType=a=>a.slice(0,1)>>>2,isBase58btc=a=>typeof a!="string"?!1:a[0]==="z",decodeDid=a=>{if(!isBase58btc(a))throw new Error(`Invalid DID string: ${a}`);return base58.decode(a.slice(1))},parseDID=a=>{try{const u=decodeDid(a),_=parseRoleType(u),E=u.slice(2),S=E.slice(0,8).reduce((P,O)=>P+O,0)%TOTAL_COLORS,C=E.slice(8),T=[...new Array(8)].map((P,O)=>(C[O*2]+C[O*2+1])%TOTAL_POSITIONS);return{colorIndex:S,positionIndexes:T,roleType:_}}catch(u){throw new DIDParsingError(`Failed to parse DID, ${a}`,{cause:u})}},getDIDMotifInfo=a=>{const{colorIndex:u,positionIndexes:_,roleType:E}=parseDID(a);return{color:colors$3[u],positions:_.map(S=>[Math.floor(S/8),S%8]),roleType:E}},getMotifShapeType=(a,u)=>{if(Object.values(Shape).indexOf(a)>-1)return a;const E={[RoleType.ACCOUNT]:Shape.RECTANGLE,[RoleType.APPLICATION]:Shape.SQUARE,[RoleType.ASSET]:Shape.HEXAGON,[RoleType.TOKEN]:Shape.CIRCLE}[u];return!E&&E!==0?Shape.SQUARE:E},getConfiguration=(a,u)=>{const _=u,{opacity:E=.5,shape:S}=_,C=__objRest$1(_,["opacity","shape"]),{color:T,positions:P,roleType:O}=getDIDMotifInfo(a);return __spreadValues$1({color:T,positions:P,opacity:E,shape:getMotifShapeType(S,O)},C)},update$1=(a,u,_={})=>{try{const E=getConfiguration(u,_),C=getElementType(a)===ElementType.CANVAS?new CanvasRenderer(a.getContext("2d"),E):new SvgRenderer(a,E),{animation:T}=_;T?C.animate(typeof T=="object"?T:{}):C.render()}catch(E){if(E instanceof DIDParsingError)console.error(E.message),console.error(E.cause);else throw E}},toDataURL=(a,u)=>{const _=getConfiguration(a,u),E=document.createElement("canvas");return new CanvasRenderer(E.getContext("2d"),_).render(),E.toDataURL()},toSvg=(a,u={})=>{const _=__spreadProps(__spreadValues$1({},getConfiguration(a,u)),{size:u.size||100}),E=document.createElementNS("http://www.w3.org/2000/svg","svg");return new SvgRenderer(E,_).render(),E.outerHTML},didMotif_es=Object.freeze(Object.defineProperty({__proto__:null,Shape,colors:colors$3,getConfiguration,getDIDMotifInfo,parseDID,toDataURL,toSvg,update:update$1},Symbol.toStringTag,{value:"Module"}));var retry$2={};function RetryOperation(a,u){typeof u=="boolean"&&(u={forever:u}),this._originalTimeouts=JSON.parse(JSON.stringify(a)),this._timeouts=a,this._options=u||{},this._maxRetryTime=u&&u.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var retry_operation=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(a){if(this._timeout&&clearTimeout(this._timeout),!a)return!1;var u=new Date().getTime();if(a&&u-this._operationStart>=this._maxRetryTime)return this._errors.push(a),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(a);var _=this._timeouts.shift();if(_===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),_=this._cachedTimeouts.slice(-1);else return!1;var E=this;return this._timer=setTimeout(function(){E._attempts++,E._operationTimeoutCb&&(E._timeout=setTimeout(function(){E._operationTimeoutCb(E._attempts)},E._operationTimeout),E._options.unref&&E._timeout.unref()),E._fn(E._attempts)},_),this._options.unref&&this._timer.unref(),!0};RetryOperation.prototype.attempt=function(a,u){this._fn=a,u&&(u.timeout&&(this._operationTimeout=u.timeout),u.cb&&(this._operationTimeoutCb=u.cb));var _=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){_._operationTimeoutCb()},_._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(a){console.log("Using RetryOperation.try() is deprecated"),this.attempt(a)};RetryOperation.prototype.start=function(a){console.log("Using RetryOperation.start() is deprecated"),this.attempt(a)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var a={},u=null,_=0,E=0;E<this._errors.length;E++){var S=this._errors[E],C=S.message,T=(a[C]||0)+1;a[C]=T,T>=_&&(u=S,_=T)}return u};(function(a){var u=retry_operation;a.operation=function(_){var E=a.timeouts(_);return new u(E,{forever:_&&(_.forever||_.retries===1/0),unref:_&&_.unref,maxRetryTime:_&&_.maxRetryTime})},a.timeouts=function(_){if(_ instanceof Array)return[].concat(_);var E={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var S in _)E[S]=_[S];if(E.minTimeout>E.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var C=[],T=0;T<E.retries;T++)C.push(this.createTimeout(T,E));return _&&_.forever&&!C.length&&C.push(this.createTimeout(T,E)),C.sort(function(P,O){return P-O}),C},a.createTimeout=function(_,E){var S=E.randomize?Math.random()+1:1,C=Math.round(S*Math.max(E.minTimeout,1)*Math.pow(E.factor,_));return C=Math.min(C,E.maxTimeout),C},a.wrap=function(_,E,S){if(E instanceof Array&&(S=E,E=null),!S){S=[];for(var C in _)typeof _[C]=="function"&&S.push(C)}for(var T=0;T<S.length;T++){var P=S[T],O=_[P];_[P]=(function(M){var B=a.operation(E),U=Array.prototype.slice.call(arguments,1),H=U.pop();U.push(function(J){B.retry(J)||(J&&(arguments[0]=B.mainError()),H.apply(this,arguments))}),B.attempt(function(){M.apply(_,U)})}).bind(_,O),_[P].options=E}}})(retry$2);var retry=retry$2;const retry$1=getDefaultExportFromCjs(retry),objectToString$3=Object.prototype.toString,isError$1=a=>objectToString$3.call(a)==="[object Error]",errorMessages=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function isNetworkError(a){return a&&isError$1(a)&&a.name==="TypeError"&&typeof a.message=="string"?a.message==="Load failed"?a.stack===void 0:errorMessages.has(a.message):!1}const cssKeywords={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},reverseKeywords={};for(const a of Object.keys(cssKeywords))reverseKeywords[cssKeywords[a]]=a;const convert$1={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},LAB_FT=(6/29)**3;for(const a of Object.keys(convert$1)){if(!("channels"in convert$1[a]))throw new Error("missing channels property: "+a);if(!("labels"in convert$1[a]))throw new Error("missing channel labels property: "+a);if(convert$1[a].labels.length!==convert$1[a].channels)throw new Error("channel and label counts mismatch: "+a);const{channels:u,labels:_}=convert$1[a];delete convert$1[a].channels,delete convert$1[a].labels,Object.defineProperty(convert$1[a],"channels",{value:u}),Object.defineProperty(convert$1[a],"labels",{value:_})}convert$1.rgb.hsl=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,S=Math.min(u,_,E),C=Math.max(u,_,E),T=C-S;let P,O;switch(C){case S:{P=0;break}case u:{P=(_-E)/T;break}case _:{P=2+(E-u)/T;break}case E:{P=4+(u-_)/T;break}}P=Math.min(P*60,360),P<0&&(P+=360);const D=(S+C)/2;return C===S?O=0:D<=.5?O=T/(C+S):O=T/(2-C-S),[P,O*100,D*100]};convert$1.rgb.hsv=function(a){let u,_,E,S,C;const T=a[0]/255,P=a[1]/255,O=a[2]/255,D=Math.max(T,P,O),M=D-Math.min(T,P,O),B=function(U){return(D-U)/6/M+1/2};if(M===0)S=0,C=0;else{switch(C=M/D,u=B(T),_=B(P),E=B(O),D){case T:{S=E-_;break}case P:{S=1/3+u-E;break}case O:{S=2/3+_-u;break}}S<0?S+=1:S>1&&(S-=1)}return[S*360,C*100,D*100]};convert$1.rgb.hwb=function(a){const u=a[0],_=a[1];let E=a[2];const S=convert$1.rgb.hsl(a)[0],C=1/255*Math.min(u,Math.min(_,E));return E=1-1/255*Math.max(u,Math.max(_,E)),[S,C*100,E*100]};convert$1.rgb.cmyk=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,S=Math.min(1-u,1-_,1-E),C=(1-u-S)/(1-S)||0,T=(1-_-S)/(1-S)||0,P=(1-E-S)/(1-S)||0;return[C*100,T*100,P*100,S*100]};function comparativeDistance(a,u){return(a[0]-u[0])**2+(a[1]-u[1])**2+(a[2]-u[2])**2}convert$1.rgb.keyword=function(a){const u=reverseKeywords[a];if(u)return u;let _=Number.POSITIVE_INFINITY,E;for(const S of Object.keys(cssKeywords)){const C=cssKeywords[S],T=comparativeDistance(a,C);T<_&&(_=T,E=S)}return E};convert$1.keyword.rgb=function(a){return cssKeywords[a]};convert$1.rgb.xyz=function(a){let u=a[0]/255,_=a[1]/255,E=a[2]/255;u=u>.04045?((u+.055)/1.055)**2.4:u/12.92,_=_>.04045?((_+.055)/1.055)**2.4:_/12.92,E=E>.04045?((E+.055)/1.055)**2.4:E/12.92;const S=u*.4124564+_*.3575761+E*.1804375,C=u*.2126729+_*.7151522+E*.072175,T=u*.0193339+_*.119192+E*.9503041;return[S*100,C*100,T*100]};convert$1.rgb.lab=function(a){const u=convert$1.rgb.xyz(a);let _=u[0],E=u[1],S=u[2];_/=95.047,E/=100,S/=108.883,_=_>LAB_FT?_**(1/3):7.787*_+16/116,E=E>LAB_FT?E**(1/3):7.787*E+16/116,S=S>LAB_FT?S**(1/3):7.787*S+16/116;const C=116*E-16,T=500*(_-E),P=200*(E-S);return[C,T,P]};convert$1.hsl.rgb=function(a){const u=a[0]/360,_=a[1]/100,E=a[2]/100;let S,C;if(_===0)return C=E*255,[C,C,C];const T=E<.5?E*(1+_):E+_-E*_,P=2*E-T,O=[0,0,0];for(let D=0;D<3;D++)S=u+1/3*-(D-1),S<0&&S++,S>1&&S--,6*S<1?C=P+(T-P)*6*S:2*S<1?C=T:3*S<2?C=P+(T-P)*(2/3-S)*6:C=P,O[D]=C*255;return O};convert$1.hsl.hsv=function(a){const u=a[0];let _=a[1]/100,E=a[2]/100,S=_;const C=Math.max(E,.01);E*=2,_*=E<=1?E:2-E,S*=C<=1?C:2-C;const T=(E+_)/2,P=E===0?2*S/(C+S):2*_/(E+_);return[u,P*100,T*100]};convert$1.hsv.rgb=function(a){const u=a[0]/60,_=a[1]/100;let E=a[2]/100;const S=Math.floor(u)%6,C=u-Math.floor(u),T=255*E*(1-_),P=255*E*(1-_*C),O=255*E*(1-_*(1-C));switch(E*=255,S){case 0:return[E,O,T];case 1:return[P,E,T];case 2:return[T,E,O];case 3:return[T,P,E];case 4:return[O,T,E];case 5:return[E,T,P]}};convert$1.hsv.hsl=function(a){const u=a[0],_=a[1]/100,E=a[2]/100,S=Math.max(E,.01);let C,T;T=(2-_)*E;const P=(2-_)*S;return C=_*S,C/=P<=1?P:2-P,C=C||0,T/=2,[u,C*100,T*100]};convert$1.hwb.rgb=function(a){const u=a[0]/360;let _=a[1]/100,E=a[2]/100;const S=_+E;let C;S>1&&(_/=S,E/=S);const T=Math.floor(6*u),P=1-E;C=6*u-T,T&1&&(C=1-C);const O=_+C*(P-_);let D,M,B;switch(T){default:case 6:case 0:{D=P,M=O,B=_;break}case 1:{D=O,M=P,B=_;break}case 2:{D=_,M=P,B=O;break}case 3:{D=_,M=O,B=P;break}case 4:{D=O,M=_,B=P;break}case 5:{D=P,M=_,B=O;break}}return[D*255,M*255,B*255]};convert$1.cmyk.rgb=function(a){const u=a[0]/100,_=a[1]/100,E=a[2]/100,S=a[3]/100,C=1-Math.min(1,u*(1-S)+S),T=1-Math.min(1,_*(1-S)+S),P=1-Math.min(1,E*(1-S)+S);return[C*255,T*255,P*255]};convert$1.xyz.rgb=function(a){const u=a[0]/100,_=a[1]/100,E=a[2]/100;let S,C,T;return S=u*3.2404542+_*-1.5371385+E*-.4985314,C=u*-.969266+_*1.8760108+E*.041556,T=u*.0556434+_*-.2040259+E*1.0572252,S=S>.0031308?1.055*S**(1/2.4)-.055:S*12.92,C=C>.0031308?1.055*C**(1/2.4)-.055:C*12.92,T=T>.0031308?1.055*T**(1/2.4)-.055:T*12.92,S=Math.min(Math.max(0,S),1),C=Math.min(Math.max(0,C),1),T=Math.min(Math.max(0,T),1),[S*255,C*255,T*255]};convert$1.xyz.lab=function(a){let u=a[0],_=a[1],E=a[2];u/=95.047,_/=100,E/=108.883,u=u>LAB_FT?u**(1/3):7.787*u+16/116,_=_>LAB_FT?_**(1/3):7.787*_+16/116,E=E>LAB_FT?E**(1/3):7.787*E+16/116;const S=116*_-16,C=500*(u-_),T=200*(_-E);return[S,C,T]};convert$1.lab.xyz=function(a){const u=a[0],_=a[1],E=a[2];let S,C,T;C=(u+16)/116,S=_/500+C,T=C-E/200;const P=C**3,O=S**3,D=T**3;return C=P>LAB_FT?P:(C-16/116)/7.787,S=O>LAB_FT?O:(S-16/116)/7.787,T=D>LAB_FT?D:(T-16/116)/7.787,S*=95.047,C*=100,T*=108.883,[S,C,T]};convert$1.lab.lch=function(a){const u=a[0],_=a[1],E=a[2];let S;S=Math.atan2(E,_)*360/2/Math.PI,S<0&&(S+=360);const T=Math.sqrt(_*_+E*E);return[u,T,S]};convert$1.lch.lab=function(a){const u=a[0],_=a[1],S=a[2]/360*2*Math.PI,C=_*Math.cos(S),T=_*Math.sin(S);return[u,C,T]};convert$1.rgb.ansi16=function(a,u=null){const[_,E,S]=a;let C=u===null?convert$1.rgb.hsv(a)[2]:u;if(C=Math.round(C/50),C===0)return 30;let T=30+(Math.round(S/255)<<2|Math.round(E/255)<<1|Math.round(_/255));return C===2&&(T+=60),T};convert$1.hsv.ansi16=function(a){return convert$1.rgb.ansi16(convert$1.hsv.rgb(a),a[2])};convert$1.rgb.ansi256=function(a){const u=a[0],_=a[1],E=a[2];return u>>4===_>>4&&_>>4===E>>4?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(_/255*5)+Math.round(E/255*5)};convert$1.ansi16.rgb=function(a){a=a[0];let u=a%10;if(u===0||u===7)return a>50&&(u+=3.5),u=u/10.5*255,[u,u,u];const _=(Math.trunc(a>50)+1)*.5,E=(u&1)*_*255,S=(u>>1&1)*_*255,C=(u>>2&1)*_*255;return[E,S,C]};convert$1.ansi256.rgb=function(a){if(a=a[0],a>=232){const C=(a-232)*10+8;return[C,C,C]}a-=16;let u;const _=Math.floor(a/36)/5*255,E=Math.floor((u=a%36)/6)/5*255,S=u%6/5*255;return[_,E,S]};convert$1.rgb.hex=function(a){const _=(((Math.round(a[0])&255)<<16)+((Math.round(a[1])&255)<<8)+(Math.round(a[2])&255)).toString(16).toUpperCase();return"000000".slice(_.length)+_};convert$1.hex.rgb=function(a){const u=a.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!u)return[0,0,0];let _=u[0];u[0].length===3&&(_=[..._].map(P=>P+P).join(""));const E=Number.parseInt(_,16),S=E>>16&255,C=E>>8&255,T=E&255;return[S,C,T]};convert$1.rgb.hcg=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,S=Math.max(Math.max(u,_),E),C=Math.min(Math.min(u,_),E),T=S-C;let P;const O=T<1?C/(1-T):0;return T<=0?P=0:S===u?P=(_-E)/T%6:S===_?P=2+(E-u)/T:P=4+(u-_)/T,P/=6,P%=1,[P*360,T*100,O*100]};convert$1.hsl.hcg=function(a){const u=a[1]/100,_=a[2]/100,E=_<.5?2*u*_:2*u*(1-_);let S=0;return E<1&&(S=(_-.5*E)/(1-E)),[a[0],E*100,S*100]};convert$1.hsv.hcg=function(a){const u=a[1]/100,_=a[2]/100,E=u*_;let S=0;return E<1&&(S=(_-E)/(1-E)),[a[0],E*100,S*100]};convert$1.hcg.rgb=function(a){const u=a[0]/360,_=a[1]/100,E=a[2]/100;if(_===0)return[E*255,E*255,E*255];const S=[0,0,0],C=u%1*6,T=C%1,P=1-T;let O=0;switch(Math.floor(C)){case 0:{S[0]=1,S[1]=T,S[2]=0;break}case 1:{S[0]=P,S[1]=1,S[2]=0;break}case 2:{S[0]=0,S[1]=1,S[2]=T;break}case 3:{S[0]=0,S[1]=P,S[2]=1;break}case 4:{S[0]=T,S[1]=0,S[2]=1;break}default:S[0]=1,S[1]=0,S[2]=P}return O=(1-_)*E,[(_*S[0]+O)*255,(_*S[1]+O)*255,(_*S[2]+O)*255]};convert$1.hcg.hsv=function(a){const u=a[1]/100,_=a[2]/100,E=u+_*(1-u);let S=0;return E>0&&(S=u/E),[a[0],S*100,E*100]};convert$1.hcg.hsl=function(a){const u=a[1]/100,E=a[2]/100*(1-u)+.5*u;let S=0;return E>0&&E<.5?S=u/(2*E):E>=.5&&E<1&&(S=u/(2*(1-E))),[a[0],S*100,E*100]};convert$1.hcg.hwb=function(a){const u=a[1]/100,_=a[2]/100,E=u+_*(1-u);return[a[0],(E-u)*100,(1-E)*100]};convert$1.hwb.hcg=function(a){const u=a[1]/100,E=1-a[2]/100,S=E-u;let C=0;return S<1&&(C=(E-S)/(1-S)),[a[0],S*100,C*100]};convert$1.apple.rgb=function(a){return[a[0]/65535*255,a[1]/65535*255,a[2]/65535*255]};convert$1.rgb.apple=function(a){return[a[0]/255*65535,a[1]/255*65535,a[2]/255*65535]};convert$1.gray.rgb=function(a){return[a[0]/100*255,a[0]/100*255,a[0]/100*255]};convert$1.gray.hsl=function(a){return[0,0,a[0]]};convert$1.gray.hsv=convert$1.gray.hsl;convert$1.gray.hwb=function(a){return[0,100,a[0]]};convert$1.gray.cmyk=function(a){return[0,0,0,a[0]]};convert$1.gray.lab=function(a){return[a[0],0,0]};convert$1.gray.hex=function(a){const u=Math.round(a[0]/100*255)&255,E=((u<<16)+(u<<8)+u).toString(16).toUpperCase();return"000000".slice(E.length)+E};convert$1.rgb.gray=function(a){return[(a[0]+a[1]+a[2])/3/255*100]};function buildGraph(){const a={},u=Object.keys(convert$1);for(let{length:_}=u,E=0;E<_;E++)a[u[E]]={distance:-1,parent:null};return a}function deriveBFS(a){const u=buildGraph(),_=[a];for(u[a].distance=0;_.length>0;){const E=_.pop(),S=Object.keys(convert$1[E]);for(let{length:C}=S,T=0;T<C;T++){const P=S[T],O=u[P];O.distance===-1&&(O.distance=u[E].distance+1,O.parent=E,_.unshift(P))}}return u}function link(a,u){return function(_){return u(a(_))}}function wrapConversion(a,u){const _=[u[a].parent,a];let E=convert$1[u[a].parent][a],S=u[a].parent;for(;u[S].parent;)_.unshift(u[S].parent),E=link(convert$1[u[S].parent][S],E),S=u[S].parent;return E.conversion=_,E}function route(a){const u=deriveBFS(a),_={},E=Object.keys(u);for(let{length:S}=E,C=0;C<S;C++){const T=E[C];u[T].parent!==null&&(_[T]=wrapConversion(T,u))}return _}const convert={},models=Object.keys(convert$1);function wrapRaw(a){const u=function(..._){const E=_[0];return E==null?E:(E.length>1&&(_=E),a(_))};return"conversion"in a&&(u.conversion=a.conversion),u}function wrapRounded(a){const u=function(..._){const E=_[0];if(E==null)return E;E.length>1&&(_=E);const S=a(_);if(typeof S=="object")for(let{length:C}=S,T=0;T<C;T++)S[T]=Math.round(S[T]);return S};return"conversion"in a&&(u.conversion=a.conversion),u}for(const a of models){convert[a]={},Object.defineProperty(convert[a],"channels",{value:convert$1[a].channels}),Object.defineProperty(convert[a],"labels",{value:convert$1[a].labels});const u=route(a),_=Object.keys(u);for(const E of _){const S=u[E];convert[a][E]=wrapRounded(S),convert[a][E].raw=wrapRaw(S)}}const BLOCKLET_SERVICE_PATH_PREFIX$1="/.well-known/service",RELAY_SOCKET_PREFIX$1="/.well-known/service",DASHBOARD_URL=`${BLOCKLET_SERVICE_PATH_PREFIX$1}/admin`,PROFILE_URL=`${BLOCKLET_SERVICE_PATH_PREFIX$1}/user`,DID_SPACE_URL=`${BLOCKLET_SERVICE_PATH_PREFIX$1}/user/did-spaces`,NAVIGATION_URL=`${BLOCKLET_SERVICE_PATH_PREFIX$1}/admin/navigation`,DID_PREFIX$1="did:abt:",PASSPORT_STATUS={VALID:"valid",REVOKED:"revoked"},LOGIN_PROVIDER={EMAIL:"email",AUTH0:"auth0",APPLE:"apple",GITHUB:"github",GOOGLE:"google",WALLET:"wallet",NFT:"nft",PASSKEY:"passkey"},LOGIN_PROVIDER_NAME={[LOGIN_PROVIDER.EMAIL]:"Email",[LOGIN_PROVIDER.AUTH0]:"Auth0",[LOGIN_PROVIDER.APPLE]:"Apple",[LOGIN_PROVIDER.GITHUB]:"Github",[LOGIN_PROVIDER.GOOGLE]:"Google",[LOGIN_PROVIDER.WALLET]:"DID Wallet",[LOGIN_PROVIDER.NFT]:"NFT",[LOGIN_PROVIDER.PASSKEY]:"Passkey"},OAUTH_PROVIDER={email:"Email",auth0:"Auth0",apple:"Apple",github:"Github",google:"Google"},DID_CONNECT_SMALL_WIDTH=360,DID_CONNECT_MEDIUM_WIDTH=576,cacheBlockletData={};function getMaster(a=window.blocklet){var _;return(((_=a==null?void 0:a.settings)==null?void 0:_.federated)||{}).master}function getConfig$1(a=window.blocklet){var _;return(((_=a==null?void 0:a.settings)==null?void 0:_.federated)||{}).config}function getFederatedEnabled(a=window.blocklet){const u=getConfig$1(a);return(u==null?void 0:u.status)==="approved"}function getFederatedApp(a=window.blocklet){const u=getMaster(a);return!isEmpty(u)?{appId:u.appId,appName:u.appName,appDescription:u.appDescription,appLogo:u.appLogo,appPid:u.appPid,appUrl:u.appUrl,version:u.version,sourceAppPid:u.appPid,provider:"wallet"}:null}function getCurrentApp(a=window.blocklet){return a?{appId:a.appId,appName:a.appName,appDescription:a.appDescription,appLogo:a.appLogo,appPid:a.appPid,appUrl:a.appUrl,currentAppUrl:a===window.blocklet?window.location.origin:void 0,version:a.version,sourceAppPid:null,provider:"wallet"}:window.env?(a=window.env,{appId:a.appId,appName:a.appName,appDescription:a.appDescription,appUrl:a.baseUrl,currentAppUrl:window.location.origin,sourceAppPid:null,provider:"wallet",type:"server"}):null}function getApps(a){const u=[],_=getFederatedApp(a),E=getCurrentApp(a),S=getFederatedEnabled(a);return E&&u.push(E),_&&(_==null?void 0:_.appId)!==(E==null?void 0:E.appId)&&S&&u.push(_),u.reverse()}async function getBlockletData(a,u=!1){if(!u&&cacheBlockletData[a])return cacheBlockletData[a];try{const _=new URL("__blocklet__.js",a);_.searchParams.set("type","json");const S=await(await fetch(_.href)).json();return cacheBlockletData[a]=S,S}catch(_){return console.error(`Failed to get blocklet data: ${a}`,_),null}}let dateTool=null;const IP_V4_REGEX=/^(\d{1,3}\.){3}\d{1,3}(:\d+)?$/,commonSLDs=new Set(["co","com","net","org","gov","edu","ac"]),commonCcTLDs=new Set(["uk","au","cn","nz","za","in","br","mx","fr","it","ca"]);function isTwoSegmentTLD(a){if(!a)return!1;const u=a.split(".");if(u.length<2)return!1;const _=u[u.length-2],E=u[u.length-1];return commonSLDs.has(_)&&commonCcTLDs.has(E)}function resolveRootDomain(){const{host:a}=window.location;if(!a||IP_V4_REGEX.test(a))return"";const _=a.split(":")[0].split(".");if(_.length===1)return"";if(_.length>2){const E=_.slice(-2).join(".");if(isTwoSegmentTLD(E))return`.${_.slice(-3).join(".")}`}return`.${_.slice(-2).join(".")}`}function stringifyQuery(a={}){return new URLSearchParams(a).toString()}function getCookieOptions(a=1){let u=a;typeof u=="number"&&(u={expireInDays:u}),u.path===void 0&&(u.path="/"),u.expireInDays||(u.expireInDays=1);const _={expires:u.expireInDays,path:u.path,domain:u.domain||"",sameSite:u.sameSite||"Lax",secure:u.secure!==!1};return(typeof window>"u"||u.domain||u.returnDomain===!1)&&u.returnDomain===!1&&delete _.domain,_}const getColor=a=>a.color?a.color:a.dark?a.theme.palette.common.white:a.theme.palette.text.primary;function mergeProps(a,u,_=[]){const E=Object.assign({},a);return Object.keys(u.defaultProps||{}).forEach(S=>{typeof E[S]=="string"&&E[S].indexOf("::prop::")===0&&(E[S]=u.defaultProps[S])}),Array.isArray(_)&&_.forEach(S=>{if(typeof E[S]=="string")try{E[S]=JSON.parse(E[S])}catch{}}),Object.keys(E).forEach(S=>{typeof E[S]=="string"&&E[S].indexOf("::prop::")===0&&(E[S]="")}),E}function setDateTool(a){dateTool=a}const createDateFormatter=a=>(u,{locale:_,tz:E,isUtc:S}={})=>{if(dateTool===null)throw new Error("call setDateTool to set the date tool library, such as: setDateTool(dayjs)");if(isNil(u)||u==="")return"-";let C=dateTool(u);return E&&(C=C.tz(E)),S&&(C=C.utc()),typeof _<"u"&&(C=C.locale(_)),C.format(a)};function formatToDatetime(a,{locale:u="en",tz:_,isUtc:E=!1}={}){return createDateFormatter("lll")(a,{locale:u,tz:_,isUtc:E})}function detectWalletExtension(){const a=(window==null?void 0:window.ABT_DEV)||window.ABT;return a&&typeof a.open=="function"?a:null}function openWebWallet({webWalletUrl:a,action:u="login",locale:_="en",url:E,windowFeatures:S,appInfo:C,memberAppInfo:T}){const P=detectWalletExtension();if(P)return P.open({action:u,locale:_,url:encodeURIComponent(E),appInfo:{...C},memberAppInfo:{...T}}),{type:"extension"};const O={toolbar:"no",location:"no",status:"no",menubar:"no",scrollbars:"yes",resizable:"yes",width:414,height:736},D=`${a}?action=${u}&locale=${_}&url=${encodeURIComponent(E)}`,M=Object.assign({},O,S),B=H=>H.innerWidth||H.document.documentElement.clientWidth||H.document.body.clientWidth;if(!("left"in M)){const H=B(window.top||window),J=window.screenLeft||window.screenX;M.left=H+J-M.width}if(!("top"in M)){const H=window.screenTop||window.screenY;M.top=H}const U=Object.keys(M).map(H=>`${H}=${M[H]}`).join(",");return window.open(D,"targetWindow",U),{type:"web"}}const getFontSize=a=>a&&Number(a)>=12?`${Number(a)}px`:"inherit",isEthereumDid$1=a=>{const u=a.replace(DID_PREFIX$1,"");return!!/^(0x)?[0-9a-f]{40}$/i.test(u)},appendParams=(a,u)=>{if(!u)return a;try{const _=new URL(a,window.location.origin);return Object.keys(u).forEach(E=>{_.searchParams.set(E,String(u[E]))}),_.origin===window.location.origin?_.pathname+_.search:_.href}catch{return a}},getUserAvatar=(a,u=48)=>a&&(a.indexOf(BLOCKLET_SERVICE_PATH_PREFIX$1)>=0?appendParams(a,{imageFilter:"resize",w:u,h:u}):a),sleep$2=(a=0)=>new Promise(u=>{setTimeout(()=>{u()},a)}),isUrl$2=a=>/^https?:\/\//.test(a),visitorIdKey$1="vid",visitorIdKeyLegacy="__visitor_id",getVisitorId$1=()=>Cookies.get(visitorIdKey$1)||localStorage.getItem(visitorIdKeyLegacy),setVisitorId=a=>{a===null?Cookies.remove(visitorIdKey$1,{sameSite:"None",secure:!0}):Cookies.set(visitorIdKey$1,a,{sameSite:"None",secure:!0,expires:365})},ensureVisitorId=()=>{let a=localStorage.getItem(visitorIdKeyLegacy);if(a&&(localStorage.removeItem(visitorIdKeyLegacy),setVisitorId(a)),!getVisitorId$1()){if(!getFederatedEnabled())try{if(window.crypto&&typeof window.crypto.randomUUID=="function")a=window.crypto.randomUUID();else{const u=new Uint8Array(16);if(window.crypto&&typeof window.crypto.getRandomValues=="function")window.crypto.getRandomValues(u);else for(let E=0;E<16;E++)u[E]=Math.floor(Math.random()*256);const _=Array.from(u).map(E=>E.toString(16).padStart(2,"0"));a=[_.slice(0,4).join(""),_.slice(4,6).join(""),_.slice(6,8).join(""),_.slice(8,10).join(""),_.slice(10,16).join("")].join("-")}}catch{a=`${Date.now()}-${Math.random().toString(36).substring(2,15)}`}a&&setVisitorId(a)}},getDIDColor=a=>{if(isEthereumDid$1(a)){const u=Uint8Array.from(a.slice(2).match(/.{1,2}/g).map(_=>parseInt(_,16))).slice(0,8).reduce((_,E)=>_+E,0)%colors$3.length;return colors$3[u]}try{const u=getDIDMotifInfo(a);return u==null?void 0:u.color}catch{return null}},getTranslation=(a,u,_={})=>{const{fallbackLocale:E="en",defaultValue:S="unknown"}=_;if(typeof a=="string")return a;let C;return u&&(C=a[u]),(!C||typeof C!="string")&&(C=a[E]),(!C||typeof C!="string")&&(C=S),C},cleanedObj=a=>omitBy(a,isNil);function hexToRgba(a,u=1){const[_,E,S]=convert.hex.rgb(a);return`rgba(${_}, ${E}, ${S}, ${u})`}function deepmergeAll(a,u){if(!Array.isArray(a))throw new Error("First argument should be an array");return a.length===0?{}:a.length===1?a[0]:a.reduce((_,E)=>deepmerge$1(_,E,u))}function isTheme(a){return a&&typeof a=="object"&&a.palette&&typeof a.palette.getContrastText=="function"}function isUxTheme(a){return isTheme(a)&&a.__isUxTheme__===!0}function collectFontFamilies(a,u=new Set){return!a||typeof a!="object"||(typeof a.fontFamily=="string"&&a.fontFamily.replace(/"/g,"").split(",").map(_=>_.trim()).filter(Boolean).forEach(_=>u.add(_)),Object.values(a).forEach(_=>{typeof _=="object"&&collectFontFamilies(_,u)})),u}const prevFonts=new Set(DEFAULT_FONTS.concat("inherit"));function loadFonts(a){const u=a.filter(E=>!prevFonts.has(E));if(u.length===0)return Promise.resolve(!0);u.forEach(E=>prevFonts.add(E));const _=u.length-1;return u[_]=`${u[_]}&display=swap`,new Promise(E=>{webfontloader.load({google:{families:u},active:()=>E(!0),inactive:()=>E(!0),fontinactive:(S,C)=>{prevFonts.delete(S),console.warn(`font ${S} ${C} download failed`)}})})}function createDefaultThemeOptions(a="light"){return a==="dark"?BLOCKLET_THEME_DARK:BLOCKLET_THEME_LIGHT}function lazyCreateDefaultTheme(a){let u=null;return()=>{var E,S;if(u)return u;const _=deepmerge$1(createDefaultThemeOptions(a),((S=(E=window.blocklet)==null?void 0:E.theme)==null?void 0:S[a])??{});return u=createTheme$1(_),u}}const normalizeUserThemeOptions=({palette:a,components:u,overrides:_,...E})=>({palette:a,components:{..._,...u},...E}),defaultUxThemeOptions={themeName:"ArcBlock",pageWidth:"md",disableBlockletTheme:!1,colors:{white:"#FFFFFF",dark:"#4A707C",gray:"#222222",minor:"#9B9B9B",darkText:"#DCDCDC",background:"#F7F8F8",yellow:"#FFCF71",green:"#44cdc6",red:"#D0021B",blue:"#4E6AF6",primary:"#222222",black:"#222222",secondary:"#44cdc6",mint:"#44cdc6",textSecondary:"#4A4A4A",active:"#5b9025",danger:"#D0021B",lightGrey:"#BCBCBC"}},create$e=(...a)=>{var U,H,J;const u=getDefaultThemePrefer(),_=lazyCreateDefaultTheme(u),E=a.reduce((X,ie)=>deepmerge$1(X,normalizeUserThemeOptions(typeof ie=="function"?ie(_()):ie)),normalizeUserThemeOptions(defaultUxThemeOptions)),S=E.mode||((U=E.palette)==null?void 0:U.mode)||u,C=((J=(H=window.blocklet)==null?void 0:H.theme)==null?void 0:J[S])??{},T=createDefaultThemeOptions(S),{disableBlockletTheme:P}=E,O=deepmergeAll([T,!P&&cleanedObj(C),cleanedObj(E),{mode:S,palette:{mode:S}}].filter(Boolean)),D=createTheme$1(O);D.__isUxTheme__=!0;const M=collectFontFamilies(D.typography);return loadFonts(Array.from(M)),responsiveFontSizes(D,{breakpoints:["xs","sm","md","lg"],disableAlign:!1,factor:3,variants:["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]})},createTheme=create$e,subscribers=new Set;let patched=!1,lastHref="";const isBrowser=typeof window<"u";function notifyIfChanged(){if(!isBrowser)return;const a=window.location.href;a!==lastHref&&(lastHref=a,subscribers.forEach(u=>u(window.location)))}function patchHistoryOnce(){if(!isBrowser||patched)return;patched=!0;const a=history.pushState;history.pushState=function(...E){const S=a.apply(this,E);return notifyIfChanged(),S};const u=history.replaceState;history.replaceState=function(...E){const S=u.apply(this,E);return notifyIfChanged(),S},window.addEventListener("popstate",notifyIfChanged),window.addEventListener("hashchange",notifyIfChanged)}function subscribeUrlChange(a){return isBrowser&&(patchHistoryOnce(),subscribers.add(a)),()=>{subscribers.delete(a)}}function extractLocation(a){return{href:a.href,origin:a.origin,host:a.host,hostname:a.hostname,pathname:a.pathname,port:a.port,protocol:a.protocol,search:a.search,hash:a.hash}}const defaultLocation={href:"",origin:"",host:"",hostname:"",port:"",protocol:"",pathname:"",search:"",hash:""};function useLocationState(){const[a,u]=reactExports.useState(()=>isBrowser?extractLocation(window.location):defaultLocation);return reactExports.useEffect(()=>{if(isBrowser)return subscribeUrlChange(_=>{u(extractLocation(_))})},[]),a}const defaultTheme=createTheme(),ColorSchemeContext=reactExports.createContext({});function useColorScheme(){return reactExports.useContext(ColorSchemeContext)}const resolveMode=a=>a?a==="system"?getDefaultThemePrefer({theme:{prefer:"system"}}):a:getDefaultThemePrefer();function DarkSchemeStyles({className:a}){const u=useTheme();if(u.palette.mode==="dark"){const _="transparent",E=u.palette.grey[300],S=(a||"").trim().split(/\s+/).filter(Boolean).map(D=>D.startsWith(".")?D:`.${D}`).join(" "),C=S?`${S}::-webkit-scrollbar, ${S} *::-webkit-scrollbar`:"*::-webkit-scrollbar",T=S?`${S}::-webkit-scrollbar-track, ${S} *::-webkit-scrollbar-track`:"*::-webkit-scrollbar-track",P=S?`${S}::-webkit-scrollbar-thumb, ${S} *::-webkit-scrollbar-thumb`:"*::-webkit-scrollbar-thumb",O=S?`${S}, ${S} *`:"*";return jsxRuntimeExports.jsx(GlobalStyles$2,{styles:{"@supports selector(::-webkit-scrollbar)":{[C]:{width:"12px",height:"12px"},[T]:{background:_},[P]:{background:E,borderRadius:"6px",border:"2px solid",borderColor:_,backgroundClip:"padding-box","&:hover":{background:u.palette.grey[400],backgroundClip:"padding-box"}}},"@supports not selector(::-webkit-scrollbar)":{[O]:{scrollbarWidth:"auto",scrollbarColor:`${E} ${_}`}}}})}return null}function BaseThemeProvider({children:a,theme:u=defaultTheme,injectFirst:_=!0,darkSchemeClass:E=""}){const S=reactExports.useMemo(()=>typeof u=="function"||isTheme(u)?u:createTheme(u),[u]);return jsxRuntimeExports.jsx(StyledEngineProvider,{injectFirst:_,children:jsxRuntimeExports.jsxs(ThemeProvider$1,{theme:S,children:[jsxRuntimeExports.jsx(CssBaseline,{}),jsxRuntimeExports.jsx(DarkSchemeStyles,{className:E}),a]})})}function ColorSchemeProvider({children:a,theme:u,prefer:_,disableBlockletTheme:E=!1,...S}){const[C,T]=reactExports.useState(()=>resolveMode(_)),P=useTheme(),O=useLocationState(),D=reactExports.useMemo(()=>{let J={};const X=lazyCreateDefaultTheme(C);if(u)if(typeof u=="function"){const ie=X();isUxTheme(P)?J={...u(P,{mode:C})}:J={...u(ie,{mode:C})}}else J={...u};return set$1(J,"palette.mode",C),set$1(J,"mode",C),J},[C,u,P]),M=reactExports.useMemo(()=>createTheme({...D,disableBlockletTheme:E}),[D,E]),B=reactExports.useCallback(()=>{const J=C==="light"?"dark":"light";T(J),localStorage.setItem(BLOCKLET_THEME_PREFER_KEY,J)},[C,T]),U=reactExports.useCallback(J=>{C!==J&&(T(J),localStorage.setItem(BLOCKLET_THEME_PREFER_KEY,J))},[C,T]),H=reactExports.useMemo(()=>({mode:C,toggleMode:B,changeMode:U,prefer:_}),[C,_,B,U]);return reactExports.useEffect(()=>{T(resolveMode(_))},[_,T,O.search]),reactExports.useEffect(()=>{const J=new URLSearchParams(O.search).get("theme");isValidThemeMode(J)&&sessionStorage.setItem(BLOCKLET_THEME_PREFER_KEY,J)},[O.search]),jsxRuntimeExports.jsx(ColorSchemeContext.Provider,{value:H,children:jsxRuntimeExports.jsx(BaseThemeProvider,{theme:M,...S,children:a})})}function ThemeProvider({children:a,prefer:u,enableColorScheme:_=!1,...E}){const{toggleMode:S}=useColorScheme();return _||u||!S?jsxRuntimeExports.jsx(ColorSchemeProvider,{prefer:u,...E,children:a}):jsxRuntimeExports.jsx(BaseThemeProvider,{...E,children:a})}ThemeProvider.propTypes={children:PropTypes.any,theme:PropTypes.any,injectFirst:PropTypes.bool,darkSchemeClass:PropTypes.string,enableColorScheme:PropTypes.bool};const isTransientProp=a=>a.startsWith("$"),styled=(a,u)=>styled$1(a,{...u,shouldForwardProp:_=>u!=null&&u.shouldForwardProp?u.shouldForwardProp(_)&&!isTransientProp(_):!isTransientProp(_)});function Center({children:a,relative:u="screen"}){let _={};return u==="parent"&&(_={width:"100%",height:"100%"}),jsxRuntimeExports.jsx(Div,{style:_,children:a})}const Div=styled("div")`
1
+ var Fo=a=>{throw TypeError(a)};var vo=(a,u,_)=>u.has(a)||Fo("Cannot "+_);var sn=(a,u,_)=>(vo(a,u,"read from private field"),_?_.call(a):u.get(a)),Oi=(a,u,_)=>u.has(a)?Fo("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(a):u.set(a,_),Jn=(a,u,_,E)=>(vo(a,u,"write to private field"),E?E.call(a,_):u.set(a,_),_),Dn=(a,u,_)=>(vo(a,u,"access private method"),_);var bo=(a,u,_,E)=>({set _(S){Jn(a,u,S,_)},get _(){return sn(a,u,E)}});import{g as getDefaultExportFromCjs,r as reactExports,e as commonjsGlobal,a as getAugmentedNamespace,b as React,d as reactDomExports}from"./vendor-react-DEoibe3W.js";import{b as isEmpty,c as isNil,o as omitBy,s as set$1,e as get$3,n as noop$6,f as isBoolean$1,h as isString$1,j as isNumber$1,k as isObject$l,u as upperFirst,l as camelCase,m as isNull$1,p as padEnd,q as padStart$1,B as Buffer$C,r as require$$0$8,v as process$1,w as bnExports$3,x as isEqual$3,y as pick,z as withQuery,A as joinURL,C as isObject$m,D as omit$1,E as axios,F as debug$5,G as Buffer$1$1,H as isString$2,I as isUndefined$2,J as pick$1,K as trim$5,L as browserExports$1,M as cloneDeep,N as intersection$1,O as isFunction$3,P as sortBy,Q as unionBy,R as defaultsDeep,S as dayjs_minExports,a as defaultDayjs,g as global$1,T as find$1}from"./vendor-utils-rHXShPKm.js";import{Y as deepmerge$1,Z as createTheme$1,$ as responsiveFontSizes,H as PropTypes,j as jsxRuntimeExports,a0 as StyledEngineProvider,a1 as ThemeProvider$1,a2 as CssBaseline,e as useTheme,a3 as GlobalStyles$2,s as styled$1,a4 as utils$p,C as Collapse,a5 as Slide,a6 as emphasize,a7 as SvgIcon,a8 as ClickAwayListener,a9 as interopRequireDefaultExports,I as IconButton,v as useMediaQuery,T as Typography$1,t as DialogContent,z as DialogActions,D as Dialog$1,aa as Box,ab as CircularProgress,y as Button,ac as _inheritsLoose$2,ad as Tooltip,ae as green,af as tooltipClasses,ag as Check$1,ah as newStyled,ai as Skeleton,aj as DialogTitle,ak as Alert$2,O as TextField,al as Stack,am as Backdrop,an as Drawer,ao as SwipeableDrawer,E as Chip,L as List,A as ListItem,ap as Menu,q as MenuItem,X as Divider,aq as ImageListItem,P as Popper,F as Fade,w as Paper,M as MenuList,ar as LinearProgress,m as alpha$1,as as blueGrey,at as Container$9,au as Paper$1,av as Table,aw as Tooltip$1,ax as styles,ay as emotionSerialize_esm,az as emotionUtils_browser_esm,aA as emotionCache_browser_esm,aB as emotionReact_browser_esm,aC as Typography$2,aD as TableBody,aE as TableCell,aF as TableRow,aG as Checkbox,aH as IconButton$1,aI as Button$1,aJ as FormControl,aK as FormControlLabel,aL as FormGroup,aM as Grid$1,aN as Input,aO as InputLabel,aP as ListItemText,aQ as MenuItem$1,aR as Select,aS as TextField$1,aT as Chip$1,aU as TableFooter,aV as TablePagination,aW as InputBase,aX as Toolbar,aY as TableHead,aZ as TableSortLabel,a_ as toPropertyKey$5,a$ as hoistStatics,b0 as Popover,b1 as Grow,b2 as propTypesExports,l as clsx$2,b3 as Popover$1,b4 as ListItemIcon,b5 as ListItemText$1,b6 as css,W as Tab,U as Tabs$1}from"./vendor-mui-core-BV2FUxWJ.js";import{C as Cookies,u as useMemoizedFn,a as useReactive,_ as __decorate,c as copy,b as useSize,d as useLatest,e as useDebounceFn,f as useCreation,g as useInterval$1,h as useDebounce,i as useAsyncEffect,j as useLocalStorageState,k as useUpdate,l as useRequest,m as useMount,n as usePrevious,o as useUpdateEffect}from"./vendor-hooks-BgUTpb6X.js";import{l as lottie}from"./lottie-web-jYmAQWuC.js";const scriptRel="modulepreload",assetsURL=function(a){return"/.well-known/service/static/"+a},seen={},__vitePreload=function(u,_,E){let S=Promise.resolve();if(_&&_.length>0){document.getElementsByTagName("link");const C=document.querySelector("meta[property=csp-nonce]"),T=(C==null?void 0:C.nonce)||(C==null?void 0:C.getAttribute("nonce"));S=Promise.allSettled(_.map(P=>{if(P=assetsURL(P),P in seen)return;seen[P]=!0;const O=P.endsWith(".css"),D=O?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${P}"]${D}`))return;const M=document.createElement("link");if(M.rel=O?"stylesheet":scriptRel,O||(M.as="script"),M.crossOrigin="",M.href=P,T&&M.setAttribute("nonce",T),document.head.appendChild(M),O)return new Promise((B,U)=>{M.addEventListener("load",B),M.addEventListener("error",()=>U(new Error(`Unable to preload CSS for ${P}`)))})}))}return S.then(C=>{for(const T of C||[]){if(T.status!=="rejected")continue;const P=new Event("vite:preloadError",{cancelable:!0});if(P.payload=T.reason,window.dispatchEvent(P),!P.defaultPrevented)throw T.reason}return u()})};var webfontloader$1={exports:{}};(function(a){(function(){function u(Be,Ye,Lt){return Be.call.apply(Be.bind,arguments)}function _(Be,Ye,Lt){if(!Be)throw Error();if(2<arguments.length){var tt=Array.prototype.slice.call(arguments,2);return function(){var bt=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(bt,tt),Be.apply(Ye,bt)}}return function(){return Be.apply(Ye,arguments)}}function E(Be,Ye,Lt){return E=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?u:_,E.apply(null,arguments)}var S=Date.now||function(){return+new Date};function C(Be,Ye){this.a=Be,this.o=Ye||Be,this.c=this.o.document}var T=!!window.FontFace;function P(Be,Ye,Lt,tt){if(Ye=Be.c.createElement(Ye),Lt)for(var bt in Lt)Lt.hasOwnProperty(bt)&&(bt=="style"?Ye.style.cssText=Lt[bt]:Ye.setAttribute(bt,Lt[bt]));return tt&&Ye.appendChild(Be.c.createTextNode(tt)),Ye}function O(Be,Ye,Lt){Be=Be.c.getElementsByTagName(Ye)[0],Be||(Be=document.documentElement),Be.insertBefore(Lt,Be.lastChild)}function D(Be){Be.parentNode&&Be.parentNode.removeChild(Be)}function M(Be,Ye,Lt){Ye=Ye||[],Lt=Lt||[];for(var tt=Be.className.split(/\s+/),bt=0;bt<Ye.length;bt+=1){for(var rr=!1,Ot=0;Ot<tt.length;Ot+=1)if(Ye[bt]===tt[Ot]){rr=!0;break}rr||tt.push(Ye[bt])}for(Ye=[],bt=0;bt<tt.length;bt+=1){for(rr=!1,Ot=0;Ot<Lt.length;Ot+=1)if(tt[bt]===Lt[Ot]){rr=!0;break}rr||Ye.push(tt[bt])}Be.className=Ye.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function B(Be,Ye){for(var Lt=Be.className.split(/\s+/),tt=0,bt=Lt.length;tt<bt;tt++)if(Lt[tt]==Ye)return!0;return!1}function U(Be){return Be.o.location.hostname||Be.a.location.hostname}function H(Be,Ye,Lt){function tt(){Ht&&bt&&rr&&(Ht(Ot),Ht=null)}Ye=P(Be,"link",{rel:"stylesheet",href:Ye,media:"all"});var bt=!1,rr=!0,Ot=null,Ht=Lt||null;T?(Ye.onload=function(){bt=!0,tt()},Ye.onerror=function(){bt=!0,Ot=Error("Stylesheet failed to load"),tt()}):setTimeout(function(){bt=!0,tt()},0),O(Be,"head",Ye)}function J(Be,Ye,Lt,tt){var bt=Be.c.getElementsByTagName("head")[0];if(bt){var rr=P(Be,"script",{src:Ye}),Ot=!1;return rr.onload=rr.onreadystatechange=function(){Ot||this.readyState&&this.readyState!="loaded"&&this.readyState!="complete"||(Ot=!0,Lt&&Lt(null),rr.onload=rr.onreadystatechange=null,rr.parentNode.tagName=="HEAD"&&bt.removeChild(rr))},bt.appendChild(rr),setTimeout(function(){Ot||(Ot=!0,Lt&&Lt(Error("Script load timeout")))},tt||5e3),rr}return null}function X(){this.a=0,this.c=null}function ie(Be){return Be.a++,function(){Be.a--,de(Be)}}function oe(Be,Ye){Be.c=Ye,de(Be)}function de(Be){Be.a==0&&Be.c&&(Be.c(),Be.c=null)}function ce(Be){this.a=Be||"-"}ce.prototype.c=function(Be){for(var Ye=[],Lt=0;Lt<arguments.length;Lt++)Ye.push(arguments[Lt].replace(/[\W_]+/g,"").toLowerCase());return Ye.join(this.a)};function le(Be,Ye){this.c=Be,this.f=4,this.a="n";var Lt=(Ye||"n4").match(/^([nio])([1-9])$/i);Lt&&(this.a=Lt[1],this.f=parseInt(Lt[2],10))}function fe(Be){return we(Be)+" "+(Be.f+"00")+" 300px "+pe(Be.c)}function pe(Be){var Ye=[];Be=Be.split(/,\s*/);for(var Lt=0;Lt<Be.length;Lt++){var tt=Be[Lt].replace(/['"]/g,"");tt.indexOf(" ")!=-1||/^\d/.test(tt)?Ye.push("'"+tt+"'"):Ye.push(tt)}return Ye.join(",")}function Se(Be){return Be.a+Be.f}function we(Be){var Ye="normal";return Be.a==="o"?Ye="oblique":Be.a==="i"&&(Ye="italic"),Ye}function xe(Be){var Ye=4,Lt="n",tt=null;return Be&&((tt=Be.match(/(normal|oblique|italic)/i))&&tt[1]&&(Lt=tt[1].substr(0,1).toLowerCase()),(tt=Be.match(/([1-9]00|normal|bold)/i))&&tt[1]&&(/bold/i.test(tt[1])?Ye=7:/[1-9]00/.test(tt[1])&&(Ye=parseInt(tt[1].substr(0,1),10)))),Lt+Ye}function me(Be,Ye){this.c=Be,this.f=Be.o.document.documentElement,this.h=Ye,this.a=new ce("-"),this.j=Ye.events!==!1,this.g=Ye.classes!==!1}function be(Be){Be.g&&M(Be.f,[Be.a.c("wf","loading")]),Z(Be,"loading")}function $e(Be){if(Be.g){var Ye=B(Be.f,Be.a.c("wf","active")),Lt=[],tt=[Be.a.c("wf","loading")];Ye||Lt.push(Be.a.c("wf","inactive")),M(Be.f,Lt,tt)}Z(Be,"inactive")}function Z(Be,Ye,Lt){Be.j&&Be.h[Ye]&&(Lt?Be.h[Ye](Lt.c,Se(Lt)):Be.h[Ye]())}function I(){this.c={}}function L(Be,Ye,Lt){var tt=[],bt;for(bt in Ye)if(Ye.hasOwnProperty(bt)){var rr=Be.c[bt];rr&&tt.push(rr(Ye[bt],Lt))}return tt}function F(Be,Ye){this.c=Be,this.f=Ye,this.a=P(this.c,"span",{"aria-hidden":"true"},this.f)}function N(Be){O(Be.c,"body",Be.a)}function V(Be){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+pe(Be.c)+";"+("font-style:"+we(Be)+";font-weight:"+(Be.f+"00")+";")}function ee(Be,Ye,Lt,tt,bt,rr){this.g=Be,this.j=Ye,this.a=tt,this.c=Lt,this.f=bt||3e3,this.h=rr||void 0}ee.prototype.start=function(){var Be=this.c.o.document,Ye=this,Lt=S(),tt=new Promise(function(Ot,Ht){function wr(){S()-Lt>=Ye.f?Ht():Be.fonts.load(fe(Ye.a),Ye.h).then(function(Ut){1<=Ut.length?Ot():setTimeout(wr,25)},function(){Ht()})}wr()}),bt=null,rr=new Promise(function(Ot,Ht){bt=setTimeout(Ht,Ye.f)});Promise.race([rr,tt]).then(function(){bt&&(clearTimeout(bt),bt=null),Ye.g(Ye.a)},function(){Ye.j(Ye.a)})};function ne(Be,Ye,Lt,tt,bt,rr,Ot){this.v=Be,this.B=Ye,this.c=Lt,this.a=tt,this.s=Ot||"BESbswy",this.f={},this.w=bt||3e3,this.u=rr||null,this.m=this.j=this.h=this.g=null,this.g=new F(this.c,this.s),this.h=new F(this.c,this.s),this.j=new F(this.c,this.s),this.m=new F(this.c,this.s),Be=new le(this.a.c+",serif",Se(this.a)),Be=V(Be),this.g.a.style.cssText=Be,Be=new le(this.a.c+",sans-serif",Se(this.a)),Be=V(Be),this.h.a.style.cssText=Be,Be=new le("serif",Se(this.a)),Be=V(Be),this.j.a.style.cssText=Be,Be=new le("sans-serif",Se(this.a)),Be=V(Be),this.m.a.style.cssText=Be,N(this.g),N(this.h),N(this.j),N(this.m)}var Q={D:"serif",C:"sans-serif"},j=null;function Y(){if(j===null){var Be=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);j=!!Be&&(536>parseInt(Be[1],10)||parseInt(Be[1],10)===536&&11>=parseInt(Be[2],10))}return j}ne.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=S(),ae(this)};function Ae(Be,Ye,Lt){for(var tt in Q)if(Q.hasOwnProperty(tt)&&Ye===Be.f[Q[tt]]&&Lt===Be.f[Q[tt]])return!0;return!1}function ae(Be){var Ye=Be.g.a.offsetWidth,Lt=Be.h.a.offsetWidth,tt;(tt=Ye===Be.f.serif&&Lt===Be.f["sans-serif"])||(tt=Y()&&Ae(Be,Ye,Lt)),tt?S()-Be.A>=Be.w?Y()&&Ae(Be,Ye,Lt)&&(Be.u===null||Be.u.hasOwnProperty(Be.a.c))?ge(Be,Be.v):ge(Be,Be.B):he(Be):ge(Be,Be.v)}function he(Be){setTimeout(E(function(){ae(this)},Be),50)}function ge(Be,Ye){setTimeout(E(function(){D(this.g.a),D(this.h.a),D(this.j.a),D(this.m.a),Ye(this.a)},Be),0)}function Ee(Be,Ye,Lt){this.c=Be,this.a=Ye,this.f=0,this.m=this.j=!1,this.s=Lt}var _e=null;Ee.prototype.g=function(Be){var Ye=this.a;Ye.g&&M(Ye.f,[Ye.a.c("wf",Be.c,Se(Be).toString(),"active")],[Ye.a.c("wf",Be.c,Se(Be).toString(),"loading"),Ye.a.c("wf",Be.c,Se(Be).toString(),"inactive")]),Z(Ye,"fontactive",Be),this.m=!0,Oe(this)},Ee.prototype.h=function(Be){var Ye=this.a;if(Ye.g){var Lt=B(Ye.f,Ye.a.c("wf",Be.c,Se(Be).toString(),"active")),tt=[],bt=[Ye.a.c("wf",Be.c,Se(Be).toString(),"loading")];Lt||tt.push(Ye.a.c("wf",Be.c,Se(Be).toString(),"inactive")),M(Ye.f,tt,bt)}Z(Ye,"fontinactive",Be),Oe(this)};function Oe(Be){--Be.f==0&&Be.j&&(Be.m?(Be=Be.a,Be.g&&M(Be.f,[Be.a.c("wf","active")],[Be.a.c("wf","loading"),Be.a.c("wf","inactive")]),Z(Be,"active")):$e(Be.a))}function se(Be){this.j=Be,this.a=new I,this.h=0,this.f=this.g=!0}se.prototype.load=function(Be){this.c=new C(this.j,Be.context||this.j),this.g=Be.events!==!1,this.f=Be.classes!==!1,ye(this,new me(this.c,Be),Be)};function te(Be,Ye,Lt,tt,bt){var rr=--Be.h==0;(Be.f||Be.g)&&setTimeout(function(){var Ot=bt||null,Ht=tt||null||{};if(Lt.length===0&&rr)$e(Ye.a);else{Ye.f+=Lt.length,rr&&(Ye.j=rr);var wr,Ut=[];for(wr=0;wr<Lt.length;wr++){var Yt=Lt[wr],Ur=Ht[Yt.c],nr=Ye.a,or=Yt;if(nr.g&&M(nr.f,[nr.a.c("wf",or.c,Se(or).toString(),"loading")]),Z(nr,"fontloading",or),nr=null,_e===null)if(window.FontFace){var or=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),un=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);_e=or?42<parseInt(or[1],10):!un}else _e=!1;_e?nr=new ee(E(Ye.g,Ye),E(Ye.h,Ye),Ye.c,Yt,Ye.s,Ur):nr=new ne(E(Ye.g,Ye),E(Ye.h,Ye),Ye.c,Yt,Ye.s,Ot,Ur),Ut.push(nr)}for(wr=0;wr<Ut.length;wr++)Ut[wr].start()}},0)}function ye(Be,Ye,Lt){var bt=[],tt=Lt.timeout;be(Ye);var bt=L(Be.a,Lt,Be.c),rr=new Ee(Be.c,Ye,tt);for(Be.h=bt.length,Ye=0,Lt=bt.length;Ye<Lt;Ye++)bt[Ye].load(function(Ot,Ht,wr){te(Be,rr,Ot,Ht,wr)})}function ve(Be,Ye){this.c=Be,this.a=Ye}ve.prototype.load=function(Be){function Ye(){if(rr["__mti_fntLst"+tt]){var Ot=rr["__mti_fntLst"+tt](),Ht=[],wr;if(Ot)for(var Ut=0;Ut<Ot.length;Ut++){var Yt=Ot[Ut].fontfamily;Ot[Ut].fontStyle!=null&&Ot[Ut].fontWeight!=null?(wr=Ot[Ut].fontStyle+Ot[Ut].fontWeight,Ht.push(new le(Yt,wr))):Ht.push(new le(Yt))}Be(Ht)}else setTimeout(function(){Ye()},50)}var Lt=this,tt=Lt.a.projectId,bt=Lt.a.version;if(tt){var rr=Lt.c.o;J(this.c,(Lt.a.api||"https://fast.fonts.net/jsapi")+"/"+tt+".js"+(bt?"?v="+bt:""),function(Ot){Ot?Be([]):(rr["__MonotypeConfiguration__"+tt]=function(){return Lt.a},Ye())}).id="__MonotypeAPIScript__"+tt}else Be([])};function Pe(Be,Ye){this.c=Be,this.a=Ye}Pe.prototype.load=function(Be){var Ye,Lt,tt=this.a.urls||[],bt=this.a.families||[],rr=this.a.testStrings||{},Ot=new X;for(Ye=0,Lt=tt.length;Ye<Lt;Ye++)H(this.c,tt[Ye],ie(Ot));var Ht=[];for(Ye=0,Lt=bt.length;Ye<Lt;Ye++)if(tt=bt[Ye].split(":"),tt[1])for(var wr=tt[1].split(","),Ut=0;Ut<wr.length;Ut+=1)Ht.push(new le(tt[0],wr[Ut]));else Ht.push(new le(tt[0]));oe(Ot,function(){Be(Ht,rr)})};function He(Be,Ye){Be?this.c=Be:this.c=Ne,this.a=[],this.f=[],this.g=Ye||""}var Ne="https://fonts.googleapis.com/css";function Ie(Be,Ye){for(var Lt=Ye.length,tt=0;tt<Lt;tt++){var bt=Ye[tt].split(":");bt.length==3&&Be.f.push(bt.pop());var rr="";bt.length==2&&bt[1]!=""&&(rr=":"),Be.a.push(bt.join(rr))}}function Le(Be){if(Be.a.length==0)throw Error("No fonts to load!");if(Be.c.indexOf("kit=")!=-1)return Be.c;for(var Ye=Be.a.length,Lt=[],tt=0;tt<Ye;tt++)Lt.push(Be.a[tt].replace(/ /g,"+"));return Ye=Be.c+"?family="+Lt.join("%7C"),0<Be.f.length&&(Ye+="&subset="+Be.f.join(",")),0<Be.g.length&&(Ye+="&text="+encodeURIComponent(Be.g)),Ye}function Ge(Be){this.f=Be,this.a=[],this.c={}}var ze={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},vt={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},xt={i:"i",italic:"i",n:"n",normal:"n"},wt=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function Bt(Be){for(var Ye=Be.f.length,Lt=0;Lt<Ye;Lt++){var tt=Be.f[Lt].split(":"),bt=tt[0].replace(/\+/g," "),rr=["n4"];if(2<=tt.length){var Ot,Ht=tt[1];if(Ot=[],Ht)for(var Ht=Ht.split(","),wr=Ht.length,Ut=0;Ut<wr;Ut++){var Yt;if(Yt=Ht[Ut],Yt.match(/^[\w-]+$/)){var Ur=wt.exec(Yt.toLowerCase());if(Ur==null)Yt="";else{if(Yt=Ur[2],Yt=Yt==null||Yt==""?"n":xt[Yt],Ur=Ur[1],Ur==null||Ur=="")Ur="4";else var nr=vt[Ur],Ur=nr||(isNaN(Ur)?"4":Ur.substr(0,1));Yt=[Yt,Ur].join("")}}else Yt="";Yt&&Ot.push(Yt)}0<Ot.length&&(rr=Ot),tt.length==3&&(tt=tt[2],Ot=[],tt=tt?tt.split(","):Ot,0<tt.length&&(tt=ze[tt[0]])&&(Be.c[bt]=tt))}for(Be.c[bt]||(tt=ze[bt])&&(Be.c[bt]=tt),tt=0;tt<rr.length;tt+=1)Be.a.push(new le(bt,rr[tt]))}}function ht(Be,Ye){this.c=Be,this.a=Ye}var st={Arimo:!0,Cousine:!0,Tinos:!0};ht.prototype.load=function(Be){var Ye=new X,Lt=this.c,tt=new He(this.a.api,this.a.text),bt=this.a.families;Ie(tt,bt);var rr=new Ge(bt);Bt(rr),H(Lt,Le(tt),ie(Ye)),oe(Ye,function(){Be(rr.a,rr.c,st)})};function Nt(Be,Ye){this.c=Be,this.a=Ye}Nt.prototype.load=function(Be){var Ye=this.a.id,Lt=this.c.o;Ye?J(this.c,(this.a.api||"https://use.typekit.net")+"/"+Ye+".js",function(tt){if(tt)Be([]);else if(Lt.Typekit&&Lt.Typekit.config&&Lt.Typekit.config.fn){tt=Lt.Typekit.config.fn;for(var bt=[],rr=0;rr<tt.length;rr+=2)for(var Ot=tt[rr],Ht=tt[rr+1],wr=0;wr<Ht.length;wr++)bt.push(new le(Ot,Ht[wr]));try{Lt.Typekit.load({events:!1,classes:!1,async:!0})}catch{}Be(bt)}},2e3):Be([])};function ut(Be,Ye){this.c=Be,this.f=Ye,this.a=[]}ut.prototype.load=function(Be){var Ye=this.f.id,Lt=this.c.o,tt=this;Ye?(Lt.__webfontfontdeckmodule__||(Lt.__webfontfontdeckmodule__={}),Lt.__webfontfontdeckmodule__[Ye]=function(bt,rr){for(var Ot=0,Ht=rr.fonts.length;Ot<Ht;++Ot){var wr=rr.fonts[Ot];tt.a.push(new le(wr.name,xe("font-weight:"+wr.weight+";font-style:"+wr.style)))}Be(tt.a)},J(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+U(this.c)+"/"+Ye+".js",function(bt){bt&&Be([])})):Be([])};var $t=new se(window);$t.a.c.custom=function(Be,Ye){return new Pe(Ye,Be)},$t.a.c.fontdeck=function(Be,Ye){return new ut(Ye,Be)},$t.a.c.monotype=function(Be,Ye){return new ve(Ye,Be)},$t.a.c.typekit=function(Be,Ye){return new Nt(Ye,Be)},$t.a.c.google=function(Be,Ye){return new ht(Ye,Be)};var Zt={load:E($t.load,$t)};a.exports?a.exports=Zt:(window.WebFont=Zt,window.WebFontConfig&&$t.load(window.WebFontConfig))})()})(webfontloader$1);var webfontloaderExports=webfontloader$1.exports;const webfontloader=getDefaultExportFromCjs(webfontloaderExports);var __create=Object.create,__defProp$7=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__getOwnPropNames$1=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp$3=Object.prototype.hasOwnProperty,__commonJS=(a,u)=>function(){return u||(0,a[__getOwnPropNames$1(a)[0]])((u={exports:{}}).exports,u),u.exports},__copyProps$1=(a,u,_,E)=>{if(u&&typeof u=="object"||typeof u=="function")for(let S of __getOwnPropNames$1(u))!__hasOwnProp$3.call(a,S)&&S!==_&&__defProp$7(a,S,{get:()=>u[S],enumerable:!(E=__getOwnPropDesc$1(u,S))||E.enumerable});return a},__toESM=(a,u,_)=>(_=a!=null?__create(__getProtoOf(a)):{},__copyProps$1(!a||!a.__esModule?__defProp$7(_,"default",{value:a,enumerable:!0}):_,a)),require_cjs=__commonJS({"../../node_modules/deepmerge/dist/cjs.js"(a,u){var _=function(le){return E(le)&&!S(le)};function E(ce){return!!ce&&typeof ce=="object"}function S(ce){var le=Object.prototype.toString.call(ce);return le==="[object RegExp]"||le==="[object Date]"||P(ce)}var C=typeof Symbol=="function"&&Symbol.for,T=C?Symbol.for("react.element"):60103;function P(ce){return ce.$$typeof===T}function O(ce){return Array.isArray(ce)?[]:{}}function D(ce,le){return le.clone!==!1&&le.isMergeableObject(ce)?oe(O(ce),ce,le):ce}function M(ce,le,fe){return ce.concat(le).map(function(pe){return D(pe,fe)})}function B(ce,le){if(!le.customMerge)return oe;var fe=le.customMerge(ce);return typeof fe=="function"?fe:oe}function U(ce){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(ce).filter(function(le){return Object.propertyIsEnumerable.call(ce,le)}):[]}function H(ce){return Object.keys(ce).concat(U(ce))}function J(ce,le){try{return le in ce}catch{return!1}}function X(ce,le){return J(ce,le)&&!(Object.hasOwnProperty.call(ce,le)&&Object.propertyIsEnumerable.call(ce,le))}function ie(ce,le,fe){var pe={};return fe.isMergeableObject(ce)&&H(ce).forEach(function(Se){pe[Se]=D(ce[Se],fe)}),H(le).forEach(function(Se){X(ce,Se)||(J(ce,Se)&&fe.isMergeableObject(le[Se])?pe[Se]=B(Se,fe)(ce[Se],le[Se],fe):pe[Se]=D(le[Se],fe))}),pe}function oe(ce,le,fe){fe=fe||{},fe.arrayMerge=fe.arrayMerge||M,fe.isMergeableObject=fe.isMergeableObject||_,fe.cloneUnlessOtherwiseSpecified=D;var pe=Array.isArray(le),Se=Array.isArray(ce),we=pe===Se;return we?pe?fe.arrayMerge(ce,le,fe):ie(ce,le,fe):D(le,fe)}oe.all=function(le,fe){if(!Array.isArray(le))throw new Error("first argument should be an array");return le.reduce(function(pe,Se){return oe(pe,Se,fe)},{})};var de=oe;u.exports=de}});function formatMuiErrorMessage(a,...u){const _=new URL(`https://mui.com/production-error/?code=${a}`);return u.forEach(E=>_.searchParams.append("args[]",E)),`Minified MUI error #${a}; visit ${_} for the full message.`}function clamp(a,u=Number.MIN_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER){return Math.max(u,Math.min(a,_))}var clamp_default=clamp;function clampWrapper(a,u=0,_=1){return clamp_default(a,u,_)}function hexToRgb(a){a=a.slice(1);const u=new RegExp(`.{1,${a.length>=6?2:1}}`,"g");let _=a.match(u);return _&&_[0].length===1&&(_=_.map(E=>E+E)),_?`rgb${_.length===4?"a":""}(${_.map((E,S)=>S<3?parseInt(E,16):Math.round(parseInt(E,16)/255*1e3)/1e3).join(", ")})`:""}function decomposeColor(a){if(a.type)return a;if(a.charAt(0)==="#")return decomposeColor(hexToRgb(a));const u=a.indexOf("("),_=a.substring(0,u);if(!["rgb","rgba","hsl","hsla","color"].includes(_))throw new Error(formatMuiErrorMessage(9,a));let E=a.substring(u+1,a.length-1),S;if(_==="color"){if(E=E.split(" "),S=E.shift(),E.length===4&&E[3].charAt(0)==="/"&&(E[3]=E[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(S))throw new Error(formatMuiErrorMessage(10,S))}else E=E.split(",");return E=E.map(C=>parseFloat(C)),{type:_,values:E,colorSpace:S}}function recomposeColor(a){const{type:u,colorSpace:_}=a;let{values:E}=a;return u.includes("rgb")?E=E.map((S,C)=>C<3?parseInt(S,10):S):u.includes("hsl")&&(E[1]=`${E[1]}%`,E[2]=`${E[2]}%`),u.includes("color")?E=`${_} ${E.join(" ")}`:E=`${E.join(", ")}`,`${u}(${E})`}function alpha(a,u){return a=decomposeColor(a),u=clampWrapper(u),(a.type==="rgb"||a.type==="hsl")&&(a.type+="a"),a.type==="color"?a.values[3]=`/${u}`:a.values[3]=u,recomposeColor(a)}var import_deepmerge=__toESM(require_cjs()),BLOCKLET_THEME_PREFER_KEY="blocklet_theme_prefer",merge$2=(a,u)=>(0,import_deepmerge.default)(a,u,{arrayMerge:(_,E)=>E});function isValidThemeMode(a){return a==="light"||a==="dark"}function getDefaultThemePrefer(a){var C;const _=new URLSearchParams(window.location.search).get("theme");if(isValidThemeMode(_))return _;const E=sessionStorage.getItem(BLOCKLET_THEME_PREFER_KEY);if(isValidThemeMode(E))return E;const S=(C=Object.assign({},window.blocklet,a).theme)==null?void 0:C.prefer;if(S==="light"||S==="dark")return S;if(S==="system"){const T=localStorage.getItem(BLOCKLET_THEME_PREFER_KEY);return isValidThemeMode(T)?T:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return"light"}var DEFAULT_FONTS=["Roboto","Helvetica","Arial","sans-serif"],shadows=["none","0px 1px 2px 0px rgba(24,24,27,0.06),0px 1px 3px 0px rgba(24,24,27,0.03)","0px 1.5px 3px 0px rgba(24,24,27,0.07),0px 1px 4px 0px rgba(24,24,27,0.035)","0px 2px 4px 0px rgba(24,24,27,0.08),0px 1.5px 5px 0px rgba(24,24,27,0.04)","0px 2px 8px 0px rgba(24,24,27,0.09),0px 2px 6px 0px rgba(24,24,27,0.045)","0px 2.5px 10px 0px rgba(24,24,27,0.10),0px 2px 7px 0px rgba(24,24,27,0.05)","0px 3px 12px 0px rgba(24,24,27,0.11),0px 2.5px 8px 0px rgba(24,24,27,0.055)","0px 3.5px 14px 0px rgba(24,24,27,0.12),0px 3px 9px 0px rgba(24,24,27,0.06)","0px 4px 16px 0px rgba(24,24,27,0.13),0px 3.5px 10px 0px rgba(24,24,27,0.065)","0px 4.5px 18px 0px rgba(24,24,27,0.14),0px 4px 11px 0px rgba(24,24,27,0.07)","0px 5px 20px 0px rgba(24,24,27,0.15),0px 4.5px 12px 0px rgba(24,24,27,0.075)","0px 5.5px 22px 0px rgba(24,24,27,0.16),0px 5px 13px 0px rgba(24,24,27,0.08)","0px 6px 24px 0px rgba(24,24,27,0.17),0px 5.5px 14px 0px rgba(24,24,27,0.085)","0px 6.5px 26px 0px rgba(24,24,27,0.18),0px 6px 15px 0px rgba(24,24,27,0.09)","0px 7px 28px 0px rgba(24,24,27,0.19),0px 6.5px 16px 0px rgba(24,24,27,0.095)","0px 7.5px 30px 0px rgba(24,24,27,0.20),0px 7px 17px 0px rgba(24,24,27,0.10)","0px 8px 32px 0px rgba(24,24,27,0.21),0px 7.5px 18px 0px rgba(24,24,27,0.105)","0px 8.5px 34px 0px rgba(24,24,27,0.22),0px 8px 19px 0px rgba(24,24,27,0.11)","0px 9px 36px 0px rgba(24,24,27,0.23),0px 8.5px 20px 0px rgba(24,24,27,0.115)","0px 9.5px 38px 0px rgba(24,24,27,0.24),0px 9px 21px 0px rgba(24,24,27,0.12)","0px 10px 40px 0px rgba(24,24,27,0.25),0px 9.5px 22px 0px rgba(24,24,27,0.125)","0px 10.5px 42px 0px rgba(24,24,27,0.26),0px 10px 23px 0px rgba(24,24,27,0.13)","0px 11px 44px 0px rgba(24,24,27,0.27),0px 10.5px 24px 0px rgba(24,24,27,0.135)","0px 11.5px 46px 0px rgba(24,24,27,0.28),0px 11px 25px 0px rgba(24,24,27,0.14)","0px 12px 48px 0px rgba(24,24,27,0.29),0px 11.5px 26px 0px rgba(24,24,27,0.145)"],BLOCKLET_THEME_LIGHT={palette:{mode:"light",primary:{main:"#00bba7",contrastText:"#fff",light:"#00d5be",dark:"#009689"},secondary:{main:"#00b8db",contrastText:"#fff",light:"#00d3f3",dark:"#0092bb"},error:{main:"#fb2c36",contrastText:"#fff",light:"#ff6467",dark:"#e7000b"},warning:{main:"#ff6900",contrastText:"#fff",light:"#ff8904",dark:"#f54900"},info:{main:"#2b7fff",contrastText:"#fff",light:"#51a2ff",dark:"#155dfc"},success:{main:"#00c950",contrastText:"#fff",light:"#05df72",dark:"#00a63e"},grey:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f47",800:"#27272a",900:"#18181b",A100:"#09090b",A200:"#09090b",A400:"#09090b",A700:"#09090b"},text:{primary:"#18181b",secondary:"#71717b",disabled:"#d4d4d8",hint:"#d4d4d8",contrast:"#fff"},divider:"#ececef",background:{default:"#fff",paper:"#fff"},common:{black:"#000",white:"#fff"},action:{active:"rgba(24, 24, 27, 0.54)",hover:"rgba(24, 24, 27, 0.04)",hoverOpacity:.04,selected:"rgba(24, 24, 27, 0.08)",selectedOpacity:.08,disabled:"rgba(24, 24, 27, 0.26)",disabledBackground:"rgba(24, 24, 27, 0.12)",disabledOpacity:.38,focus:"rgba(24, 24, 27, 0.12)",focusOpacity:.12,activatedOpacity:.12},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},did:{primary:"#4598FA",secondary:"#49C3AD"}},shape:{borderRadius:8},typography:{fontSize:14,fontFamily:DEFAULT_FONTS.join(","),button:{fontWeight:700,textTransform:"none"},allVariants:{textTransform:"none"},color:{main:"#18181b",gray:"#71717b"},h1:{fontSize:"1.875rem",lineHeight:1.2,fontWeight:700,textTransform:"none"},h2:{fontSize:"1.5rem",lineHeight:1.3333333,fontWeight:700,textTransform:"none"},h3:{fontSize:"1.25rem",lineHeight:1.4,fontWeight:700,textTransform:"none"},h4:{fontSize:"1.125rem",lineHeight:1.55,fontWeight:600,textTransform:"none"},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:700,textTransform:"none"},h6:{fontSize:"0.875rem",lineHeight:1.43,fontWeight:700,textTransform:"none"},subtitle1:{fontSize:"1rem",lineHeight:1.43,fontWeight:500,textTransform:"none"},subtitle2:{fontSize:"0.875rem",lineHeight:1.43,fontWeight:500,textTransform:"none"},body1:{fontSize:"1rem",lineHeight:1.5,fontWeight:400,textTransform:"none"},body2:{fontSize:"0.875rem",lineHeight:1.43,fontWeight:400,textTransform:"none"},caption:{fontSize:"0.75rem",lineHeight:1.33,fontWeight:400,textTransform:"none"},overline:{fontSize:"0.75rem",lineHeight:1.33,fontWeight:500,textTransform:"none"}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}},shadows,components:{MuiButton:{styleOverrides:{root:{boxShadow:"none"}}},MuiTextField:{styleOverrides:{root:({theme:a})=>({"& .MuiOutlinedInput-root":{"& .MuiOutlinedInput-notchedOutline":{borderColor:a.palette.grey[300]},"&:hover:not(.Mui-focused):not(.Mui-error) .MuiOutlinedInput-notchedOutline":{borderColor:a.palette.grey[400]}},"& .MuiInput-root":{"&:before":{borderColor:a.palette.grey[300]},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderColor:a.palette.grey[400]}}})}},MuiButtonGroup:{styleOverrides:{root:{boxShadow:"none"}}},MuiTableCell:{styleOverrides:{sizeSmall:{borderBottomWidth:"0",paddingTop:"8px",paddingBottom:"8px",paddingLeft:0,paddingRight:"20px"},sizeMedium:{borderBottomWidth:"0",paddingTop:"14px",paddingBottom:"14px",paddingLeft:0,paddingRight:"30px"},head:({theme:a})=>({textTransform:"uppercase",color:a.palette.grey[900]}),body:({theme:a})=>({color:a.palette.grey[900]})}},MuiTableRow:{styleOverrides:{root:{"&:nth-child(even)":{backgroundColor:"rgba(0, 0, 0, 0.02)"}},head:{backgroundColor:"transparent"}}},MuiTooltip:{styleOverrides:{tooltip:({theme:a})=>({backgroundColor:a.palette.grey[500],color:a.palette.text.contrast}),arrow:({theme:a})=>({color:a.palette.grey[500]})}},MuiPaper:{styleOverrides:{root:({theme:a})=>({boxShadow:`inset 0 0 0 1px ${a.palette.action.hover}`})}},MuiAlert:{styleOverrides:{filledError:({theme:a})=>({color:a.palette.common.white,fontWeight:300}),filledInfo:({theme:a})=>({color:a.palette.common.white,fontWeight:300}),filledSuccess:({theme:a})=>({color:a.palette.common.white,fontWeight:300}),filledWarning:({theme:a})=>({color:a.palette.common.white,fontWeight:300})}}}},BLOCKLET_THEME_DARK=merge$2(BLOCKLET_THEME_LIGHT,{palette:{mode:"dark",common:{black:"#000",white:"#fff"},primary:{main:"#00d5be",contrastText:"#121212",light:"#4ce3d0",dark:"#00a89a"},secondary:{main:"#00d3f3",contrastText:"#121212",light:"#51e1ff",dark:"#00a2c0"},error:{main:"#ff6467",contrastText:"#121212",light:"#ff9598",dark:"#e7000b"},warning:{main:"#ff8904",contrastText:"#121212",light:"#ffa644",dark:"#f54900"},info:{main:"#51a2ff",contrastText:"#121212",light:"#83c3ff",dark:"#1570e5"},success:{main:"#05df72",contrastText:"#121212",light:"#56e799",dark:"#00b24a"},grey:{50:"#18181b",100:"#27272a",200:"#3f3f47",300:"#52525c",400:"#71717b",500:"#9f9fa9",600:"#d4d4d8",700:"#e4e4e7",800:"#f4f4f5",900:"#fafafa",A100:"#f8f8fa",A200:"#f8f8fa",A400:"#f8f8fa",A700:"#f8f8fa"},text:{primary:"#ffffff",secondary:"#A1a1aa",disabled:"#52525c",hint:"#71717b",contrast:"#18181b"},divider:"#27272A",background:{default:"#121212",paper:"#18181b"},action:{active:"rgba(255, 255, 255, 0.54)",hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}},typography:{color:{main:"#fff",gray:"#9e9e9e"}},shadows,components:{MuiTableCell:{styleOverrides:{head:({theme:a})=>({textTransform:"uppercase",color:a.palette.grey[300]}),body:({theme:a})=>({color:a.palette.grey[300]})}},MuiTableRow:{styleOverrides:{root:{"&:nth-child(even)":{backgroundColor:"rgba(255, 255, 255, 0.02)"}}}},MuiTooltip:{styleOverrides:{tooltip:({theme:a})=>({backgroundColor:a.palette.grey[500],color:a.palette.text.contrast}),arrow:({theme:a})=>({color:a.palette.grey[500]})}},MuiPaper:{styleOverrides:{root:({theme:a})=>({boxShadow:`inset 0 0 0 1px ${a.palette.action.hover}`})}},MuiAlert:{styleOverrides:{standardError:({theme:a})=>({backgroundColor:alpha(a.palette.error.main,.25),color:a.palette.warning.light,"& .MuiAlert-icon":{color:a.palette.warning.light}}),standardInfo:({theme:a})=>({backgroundColor:alpha(a.palette.info.main,.25),color:a.palette.info.light,"& .MuiAlert-icon":{color:a.palette.info.light}}),standardWarning:({theme:a})=>({backgroundColor:alpha(a.palette.warning.main,.25),color:a.palette.warning.light,"& .MuiAlert-icon":{color:a.palette.warning.light}}),standardSuccess:({theme:a})=>({backgroundColor:alpha(a.palette.success.main,.25),color:a.palette.success.light,"& .MuiAlert-icon":{color:a.palette.success.light}})}},MuiSwitch:{styleOverrides:{switchBase:({theme:a})=>({"&:not(.Mui-checked)":{"& + .MuiSwitch-track":{backgroundColor:a.palette.grey[200],opacity:1},"& > .MuiSwitch-thumb":{backgroundColor:a.palette.grey[700]}},"&.Mui-disabled":{"& + .MuiSwitch-track":{opacity:.3},"&:not(.Mui-checked) > .MuiSwitch-thumb":{backgroundColor:a.palette.grey[300]}}})}}}}),paletteLight={divider:"rgba(18, 22, 24, 0.06)",action:{hover:"#FAFAFA",selected:"#F4F4F5"}},paletteDark={divider:"rgba(255, 255, 255, 0.06)",action:{hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)"}},DID_CONNECT_THEME_LIGHT=merge$2(BLOCKLET_THEME_LIGHT,{palette:paletteLight}),DID_CONNECT_THEME_DARK=merge$2(BLOCKLET_THEME_DARK,{palette:paletteDark});function base$4(a){if(a.length>=255)throw new TypeError("Alphabet too long");for(var u=new Uint8Array(256),_=0;_<u.length;_++)u[_]=255;for(var E=0;E<a.length;E++){var S=a.charAt(E),C=S.charCodeAt(0);if(u[C]!==255)throw new TypeError(S+" is ambiguous");u[C]=E}var T=a.length,P=a.charAt(0),O=Math.log(T)/Math.log(256),D=Math.log(256)/Math.log(T);function M(H){if(H instanceof Uint8Array||(ArrayBuffer.isView(H)?H=new Uint8Array(H.buffer,H.byteOffset,H.byteLength):Array.isArray(H)&&(H=Uint8Array.from(H))),!(H instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(H.length===0)return"";for(var J=0,X=0,ie=0,oe=H.length;ie!==oe&&H[ie]===0;)ie++,J++;for(var de=(oe-ie)*D+1>>>0,ce=new Uint8Array(de);ie!==oe;){for(var le=H[ie],fe=0,pe=de-1;(le!==0||fe<X)&&pe!==-1;pe--,fe++)le+=256*ce[pe]>>>0,ce[pe]=le%T>>>0,le=le/T>>>0;if(le!==0)throw new Error("Non-zero carry");X=fe,ie++}for(var Se=de-X;Se!==de&&ce[Se]===0;)Se++;for(var we=P.repeat(J);Se<de;++Se)we+=a.charAt(ce[Se]);return we}function B(H){if(typeof H!="string")throw new TypeError("Expected String");if(H.length===0)return new Uint8Array;for(var J=0,X=0,ie=0;H[J]===P;)X++,J++;for(var oe=(H.length-J)*O+1>>>0,de=new Uint8Array(oe);H[J];){var ce=u[H.charCodeAt(J)];if(ce===255)return;for(var le=0,fe=oe-1;(ce!==0||le<ie)&&fe!==-1;fe--,le++)ce+=T*de[fe]>>>0,de[fe]=ce%256>>>0,ce=ce/256>>>0;if(ce!==0)throw new Error("Non-zero carry");ie=le,J++}for(var pe=oe-ie;pe!==oe&&de[pe]===0;)pe++;for(var Se=new Uint8Array(X+(oe-pe)),we=X;pe!==oe;)Se[we++]=de[pe++];return Se}function U(H){var J=B(H);if(J)return J;throw new Error("Non-base"+T+" character")}return{encode:M,decodeUnsafe:B,decode:U}}var src=base$4;const basex=src,ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var bs58=basex(ALPHABET);const base58=getDefaultExportFromCjs(bs58);var __defProp$6=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$1=Object.getOwnPropertySymbols,__hasOwnProp$2=Object.prototype.hasOwnProperty,__propIsEnum$1=Object.prototype.propertyIsEnumerable,__defNormalProp$6=(a,u,_)=>u in a?__defProp$6(a,u,{enumerable:!0,configurable:!0,writable:!0,value:_}):a[u]=_,__spreadValues$1=(a,u)=>{for(var _ in u||(u={}))__hasOwnProp$2.call(u,_)&&__defNormalProp$6(a,_,u[_]);if(__getOwnPropSymbols$1)for(var _ of __getOwnPropSymbols$1(u))__propIsEnum$1.call(u,_)&&__defNormalProp$6(a,_,u[_]);return a},__spreadProps=(a,u)=>__defProps(a,__getOwnPropDescs(u)),__objRest$1=(a,u)=>{var _={};for(var E in a)__hasOwnProp$2.call(a,E)&&u.indexOf(E)<0&&(_[E]=a[E]);if(a!=null&&__getOwnPropSymbols$1)for(var E of __getOwnPropSymbols$1(a))u.indexOf(E)<0&&__propIsEnum$1.call(a,E)&&(_[E]=a[E]);return _},colors$3=["#E94E4E","#E41115","#E96B4E","#E5502E","#E98F4E","#E57A2E","#E98F4E","#E5A82E","#DACD5D","#DAC825","#BDD13D","#C8E31C","#AEE94E","#7FD558","#52CC19","#4FC469","#59DE9C","#19CC73","#5ED9D1","#19CCC0","#4ED7E9","#19B7CC","#45ACE8","#1C97DE","#4E68E9","#2E4DE5","#7F4EE9","#682EE5","#BE65E7","#AF40E2","#DF58C2","#E94E8F"];const TOTAL_COLORS=32,TOTAL_POSITIONS=64,SHAPE_SIZE_RATIO=.25,REVERSED_ASPECT_RATIO=.7,RoleType={ACCOUNT:0,APPLICATION:3,ASSET:6,TOKEN:17},Shape={RECTANGLE:0,SQUARE:1,HEXAGON:2,CIRCLE:3},ElementType={CANVAS:0,SVG:1},easeOutBack=(a,u=1.70158)=>{const _=a/1-1;return _*_*((u+1)*_+u)+1},calcBorderRadius=a=>a>80?10:Math.floor(.1*a+2),getElementType=a=>{if(a){const{tagName:u}=a;if(/^svg$/i.test(u))return ElementType.SVG;if(/^canvas$/i.test(u)&&"getContext"in a)return ElementType.CANVAS}throw new Error(`Expected a svg or canvas element, got ${a}`)},animate=(a={})=>{const{callback:u,duration:_=1e3,onComplete:E=()=>{},ease:S=easeOutBack}=a;let C=null,T=0,P=null;const O=()=>{P&&(cancelAnimationFrame(P),P=null)},D=M=>{C||(C=M),M-C>=_?(T=1,E()):(T=S((M-C)/_),P=requestAnimationFrame(D)),u(T)};return requestAnimationFrame(D),O},genUniqueID=(a="")=>`${a}_${Math.floor(Math.random()*1e4)}_${Date.now()}`,DEFAULT_OPTIONS={width:200,height:200,xLines:8,yLines:8};class Grid{constructor(u){this.options=Object.assign({},DEFAULT_OPTIONS,u),this.init()}get gapX(){return this.options.width/(this.options.yLines+1)}get gapY(){return this.options.height/(this.options.xLines+1)}init(){const{xLines:u,yLines:_}=this.options;this.xOffsets=[...new Array(u)].map((E,S)=>(S+1)*this.gapX-this.options.width/2),this.yOffsets=[...new Array(_)].map((E,S)=>(S+1)*this.gapY-this.options.height/2)}getOffset(u,_){return[this.xOffsets[u],this.yOffsets[_]]}}class CanvasRenderer{constructor(u,_){this.ctx=u;const E=_.size||Math.min(u.canvas.width,u.canvas.height)||100;u.canvas.width=E,u.canvas.height=E;const S=new Grid({width:E,height:E,xLines:8,yLines:8});this.config=__spreadProps(__spreadValues$1({},_),{size:E,positions:_.positions.map(C=>S.getOffset(C[0],C[1])),shapeSize:E*SHAPE_SIZE_RATIO})}render(){this.draw(this.config.positions)}draw(u){const{ctx:_}=this,{size:E,color:S,shapeSize:C,opacity:T,shape:P}=this.config,O=calcBorderRadius(E);switch(_.clearRect(0,0,E,E),P){case Shape.RECTANGLE:{this.drawRoundedRect(_,0,E*(1-REVERSED_ASPECT_RATIO)/2,E,E*REVERSED_ASPECT_RATIO,O,!1,!1);break}case Shape.HEXAGON:{this.drawHexagon(_,E/2,E/2,E/2,0);break}case Shape.CIRCLE:{_.arc(E/2,E/2,E/2,0,Math.PI*2);break}case Shape.SQUARE:default:this.drawRoundedRect(_,0,0,E,E,O,!1,!1)}_.clip(),_.fillStyle=S,_.fillRect(0,0,E,E),_.save(),_.translate(E/2,E/2),u.forEach(([D,M])=>this.drawHexagon(_,D,M,C,T)),_.restore()}animate(u={}){const{duration:_=1e3,onComplete:E=()=>{}}=u,{positions:S}=this.config;return animate({duration:_,onComplete:E,callback:C=>{this.draw(S.map(T=>[C*T[0],C*T[1]]))}})}drawHexagon(u,_,E,S,C){const T=2*Math.PI/6;u.beginPath();for(let P=0;P<6;P++)u.lineTo(_+S*Math.cos(T*(P-1.5)),E+S*Math.sin(T*(P-1.5)));u.closePath(),u.fillStyle=`rgba(255, 255, 255, ${C})`,u.fill()}drawRoundedRect(u,_,E,S,C,T=10,P=!1,O=!0){const D=typeof T=="number"?{tl:T,tr:T,br:T,bl:T}:__spreadValues$1({tl:0,tr:0,br:0,bl:0},T);u.beginPath(),u.moveTo(_+D.tl,E),u.lineTo(_+S-D.tr,E),u.quadraticCurveTo(_+S,E,_+S,E+D.tr),u.lineTo(_+S,E+C-D.br),u.quadraticCurveTo(_+S,E+C,_+S-D.br,E+C),u.lineTo(_+D.bl,E+C),u.quadraticCurveTo(_,E+C,_,E+C-D.bl),u.lineTo(_,E+D.tl),u.quadraticCurveTo(_,E,_+D.tl,E),u.closePath(),P&&u.fill(),O&&u.stroke()}}const XMLNS="http://www.w3.org/2000/svg";function svgValue(a){return Math.round(a*10)/10}class SvgRenderer{constructor(u,_){this.el=u,this.config=_;const E=_.size||Math.min(Number(u.getAttribute("width"))||100,Number(u.getAttribute("height"))||100);u.setAttribute("viewBox",`0 0 ${E} ${E}`);const S=new Grid({width:E,height:E,xLines:8,yLines:8});this.config=__spreadProps(__spreadValues$1({},_),{size:E,positions:_.positions.map(C=>{const[T,P]=S.getOffset(C[0],C[1]);return[svgValue(T),svgValue(P)]}),shapeSize:svgValue(E*SHAPE_SIZE_RATIO)}),this.points=this.calcPoints(E/2,E/2,this.config.shapeSize)}setBackground(){const{size:u,color:_,shape:E}=this.config,S=calcBorderRadius(u);let C;switch(E){case Shape.RECTANGLE:{C=this.drawRoundedRect(0,svgValue(u*(1-REVERSED_ASPECT_RATIO)/2),u,svgValue(u*REVERSED_ASPECT_RATIO),S);break}case Shape.HEXAGON:{const D=this.calcPoints(u/2,u/2,u/2);C=this.drawHexagon(D);break}case Shape.CIRCLE:{C=this.createElement("circle",{cx:u/2,cy:u/2,r:u/2});break}case Shape.SQUARE:default:C=this.drawRoundedRect(0,0,u,u,S)}const T=genUniqueID("clip-path"),P=this.createElement("clipPath",{id:T},[C]);this.el.appendChild(this.createElement("defs",{},[P]));const O=this.createElement("g",{"clip-path":`url(#${T})`},this.createElement("rect",{x:0,y:0,width:u,height:u,fill:_}));this.g=O,this.el.appendChild(O)}render(){this.el.innerHTML="",this.setBackground(),this.drawHexagons(this.config.positions)}drawHexagons(u){const{opacity:_}=this.config;this.hexagons||(this.hexagons=u.map(()=>{const E=this.drawHexagon(this.points,_);return this.g.appendChild(E),E})),this.hexagons.forEach((E,S)=>{E.setAttribute("transform",`translate(${u[S][0]} ${u[S][1]})`)})}animate(u={}){const{duration:_=1e3,onComplete:E=()=>{}}=u,{positions:S}=this.config;return this.setBackground(),animate({duration:_,onComplete:E,callback:C=>{this.drawHexagons(S.map(T=>[C*T[0],C*T[1]]))}})}calcPoints(u,_,E){const S=2*Math.PI/6,C=[];for(let T=0;T<6;T++)C.push([u+E*Math.cos(S*(T-1.5)),_+E*Math.sin(S*(T-1.5))]);return C.map(T=>[svgValue(T[0]),svgValue(T[1])])}getPointsStr(u){return u.map(_=>`${svgValue(_[0])},${svgValue(_[1])}`).join(" ")}drawHexagon(u,_){return this.createElement("polygon",{points:this.getPointsStr(u),transformOrigin:"center",style:{fill:"#fff",fillOpacity:_}})}drawRoundedRect(u,_,E,S,C=10,T="none"){return this.createElement("rect",{x:u,y:_,width:E,height:S,rx:C,ry:C,fill:T})}createElement(u,_={},E=[]){const S=document.createElementNS(XMLNS,u),C=_,{style:T={}}=C,P=__objRest$1(C,["style"]);return Object.keys(P).forEach(O=>{S.setAttribute(O,P[O])}),Object.keys(T).forEach(O=>{S.style[O]=T[O]}),Array.isArray(E)||(E=[E]),E.forEach(O=>S.appendChild(O)),S}}class DIDParsingError extends Error{constructor(u,_){super(u,_),this.name="DIDParsingError"}}const parseRoleType=a=>a.slice(0,1)>>>2,isBase58btc=a=>typeof a!="string"?!1:a[0]==="z",decodeDid=a=>{if(!isBase58btc(a))throw new Error(`Invalid DID string: ${a}`);return base58.decode(a.slice(1))},parseDID=a=>{try{const u=decodeDid(a),_=parseRoleType(u),E=u.slice(2),S=E.slice(0,8).reduce((P,O)=>P+O,0)%TOTAL_COLORS,C=E.slice(8),T=[...new Array(8)].map((P,O)=>(C[O*2]+C[O*2+1])%TOTAL_POSITIONS);return{colorIndex:S,positionIndexes:T,roleType:_}}catch(u){throw new DIDParsingError(`Failed to parse DID, ${a}`,{cause:u})}},getDIDMotifInfo=a=>{const{colorIndex:u,positionIndexes:_,roleType:E}=parseDID(a);return{color:colors$3[u],positions:_.map(S=>[Math.floor(S/8),S%8]),roleType:E}},getMotifShapeType=(a,u)=>{if(Object.values(Shape).indexOf(a)>-1)return a;const E={[RoleType.ACCOUNT]:Shape.RECTANGLE,[RoleType.APPLICATION]:Shape.SQUARE,[RoleType.ASSET]:Shape.HEXAGON,[RoleType.TOKEN]:Shape.CIRCLE}[u];return!E&&E!==0?Shape.SQUARE:E},getConfiguration=(a,u)=>{const _=u,{opacity:E=.5,shape:S}=_,C=__objRest$1(_,["opacity","shape"]),{color:T,positions:P,roleType:O}=getDIDMotifInfo(a);return __spreadValues$1({color:T,positions:P,opacity:E,shape:getMotifShapeType(S,O)},C)},update$1=(a,u,_={})=>{try{const E=getConfiguration(u,_),C=getElementType(a)===ElementType.CANVAS?new CanvasRenderer(a.getContext("2d"),E):new SvgRenderer(a,E),{animation:T}=_;T?C.animate(typeof T=="object"?T:{}):C.render()}catch(E){if(E instanceof DIDParsingError)console.error(E.message),console.error(E.cause);else throw E}},toDataURL=(a,u)=>{const _=getConfiguration(a,u),E=document.createElement("canvas");return new CanvasRenderer(E.getContext("2d"),_).render(),E.toDataURL()},toSvg=(a,u={})=>{const _=__spreadProps(__spreadValues$1({},getConfiguration(a,u)),{size:u.size||100}),E=document.createElementNS("http://www.w3.org/2000/svg","svg");return new SvgRenderer(E,_).render(),E.outerHTML},didMotif_es=Object.freeze(Object.defineProperty({__proto__:null,Shape,colors:colors$3,getConfiguration,getDIDMotifInfo,parseDID,toDataURL,toSvg,update:update$1},Symbol.toStringTag,{value:"Module"}));var retry$2={};function RetryOperation(a,u){typeof u=="boolean"&&(u={forever:u}),this._originalTimeouts=JSON.parse(JSON.stringify(a)),this._timeouts=a,this._options=u||{},this._maxRetryTime=u&&u.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var retry_operation=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(a){if(this._timeout&&clearTimeout(this._timeout),!a)return!1;var u=new Date().getTime();if(a&&u-this._operationStart>=this._maxRetryTime)return this._errors.push(a),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(a);var _=this._timeouts.shift();if(_===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),_=this._cachedTimeouts.slice(-1);else return!1;var E=this;return this._timer=setTimeout(function(){E._attempts++,E._operationTimeoutCb&&(E._timeout=setTimeout(function(){E._operationTimeoutCb(E._attempts)},E._operationTimeout),E._options.unref&&E._timeout.unref()),E._fn(E._attempts)},_),this._options.unref&&this._timer.unref(),!0};RetryOperation.prototype.attempt=function(a,u){this._fn=a,u&&(u.timeout&&(this._operationTimeout=u.timeout),u.cb&&(this._operationTimeoutCb=u.cb));var _=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){_._operationTimeoutCb()},_._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(a){console.log("Using RetryOperation.try() is deprecated"),this.attempt(a)};RetryOperation.prototype.start=function(a){console.log("Using RetryOperation.start() is deprecated"),this.attempt(a)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var a={},u=null,_=0,E=0;E<this._errors.length;E++){var S=this._errors[E],C=S.message,T=(a[C]||0)+1;a[C]=T,T>=_&&(u=S,_=T)}return u};(function(a){var u=retry_operation;a.operation=function(_){var E=a.timeouts(_);return new u(E,{forever:_&&(_.forever||_.retries===1/0),unref:_&&_.unref,maxRetryTime:_&&_.maxRetryTime})},a.timeouts=function(_){if(_ instanceof Array)return[].concat(_);var E={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var S in _)E[S]=_[S];if(E.minTimeout>E.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var C=[],T=0;T<E.retries;T++)C.push(this.createTimeout(T,E));return _&&_.forever&&!C.length&&C.push(this.createTimeout(T,E)),C.sort(function(P,O){return P-O}),C},a.createTimeout=function(_,E){var S=E.randomize?Math.random()+1:1,C=Math.round(S*Math.max(E.minTimeout,1)*Math.pow(E.factor,_));return C=Math.min(C,E.maxTimeout),C},a.wrap=function(_,E,S){if(E instanceof Array&&(S=E,E=null),!S){S=[];for(var C in _)typeof _[C]=="function"&&S.push(C)}for(var T=0;T<S.length;T++){var P=S[T],O=_[P];_[P]=(function(M){var B=a.operation(E),U=Array.prototype.slice.call(arguments,1),H=U.pop();U.push(function(J){B.retry(J)||(J&&(arguments[0]=B.mainError()),H.apply(this,arguments))}),B.attempt(function(){M.apply(_,U)})}).bind(_,O),_[P].options=E}}})(retry$2);var retry=retry$2;const retry$1=getDefaultExportFromCjs(retry),objectToString$3=Object.prototype.toString,isError$1=a=>objectToString$3.call(a)==="[object Error]",errorMessages=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function isNetworkError(a){return a&&isError$1(a)&&a.name==="TypeError"&&typeof a.message=="string"?a.message==="Load failed"?a.stack===void 0:errorMessages.has(a.message):!1}const cssKeywords={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},reverseKeywords={};for(const a of Object.keys(cssKeywords))reverseKeywords[cssKeywords[a]]=a;const convert$1={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},LAB_FT=(6/29)**3;for(const a of Object.keys(convert$1)){if(!("channels"in convert$1[a]))throw new Error("missing channels property: "+a);if(!("labels"in convert$1[a]))throw new Error("missing channel labels property: "+a);if(convert$1[a].labels.length!==convert$1[a].channels)throw new Error("channel and label counts mismatch: "+a);const{channels:u,labels:_}=convert$1[a];delete convert$1[a].channels,delete convert$1[a].labels,Object.defineProperty(convert$1[a],"channels",{value:u}),Object.defineProperty(convert$1[a],"labels",{value:_})}convert$1.rgb.hsl=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,S=Math.min(u,_,E),C=Math.max(u,_,E),T=C-S;let P,O;switch(C){case S:{P=0;break}case u:{P=(_-E)/T;break}case _:{P=2+(E-u)/T;break}case E:{P=4+(u-_)/T;break}}P=Math.min(P*60,360),P<0&&(P+=360);const D=(S+C)/2;return C===S?O=0:D<=.5?O=T/(C+S):O=T/(2-C-S),[P,O*100,D*100]};convert$1.rgb.hsv=function(a){let u,_,E,S,C;const T=a[0]/255,P=a[1]/255,O=a[2]/255,D=Math.max(T,P,O),M=D-Math.min(T,P,O),B=function(U){return(D-U)/6/M+1/2};if(M===0)S=0,C=0;else{switch(C=M/D,u=B(T),_=B(P),E=B(O),D){case T:{S=E-_;break}case P:{S=1/3+u-E;break}case O:{S=2/3+_-u;break}}S<0?S+=1:S>1&&(S-=1)}return[S*360,C*100,D*100]};convert$1.rgb.hwb=function(a){const u=a[0],_=a[1];let E=a[2];const S=convert$1.rgb.hsl(a)[0],C=1/255*Math.min(u,Math.min(_,E));return E=1-1/255*Math.max(u,Math.max(_,E)),[S,C*100,E*100]};convert$1.rgb.cmyk=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,S=Math.min(1-u,1-_,1-E),C=(1-u-S)/(1-S)||0,T=(1-_-S)/(1-S)||0,P=(1-E-S)/(1-S)||0;return[C*100,T*100,P*100,S*100]};function comparativeDistance(a,u){return(a[0]-u[0])**2+(a[1]-u[1])**2+(a[2]-u[2])**2}convert$1.rgb.keyword=function(a){const u=reverseKeywords[a];if(u)return u;let _=Number.POSITIVE_INFINITY,E;for(const S of Object.keys(cssKeywords)){const C=cssKeywords[S],T=comparativeDistance(a,C);T<_&&(_=T,E=S)}return E};convert$1.keyword.rgb=function(a){return cssKeywords[a]};convert$1.rgb.xyz=function(a){let u=a[0]/255,_=a[1]/255,E=a[2]/255;u=u>.04045?((u+.055)/1.055)**2.4:u/12.92,_=_>.04045?((_+.055)/1.055)**2.4:_/12.92,E=E>.04045?((E+.055)/1.055)**2.4:E/12.92;const S=u*.4124564+_*.3575761+E*.1804375,C=u*.2126729+_*.7151522+E*.072175,T=u*.0193339+_*.119192+E*.9503041;return[S*100,C*100,T*100]};convert$1.rgb.lab=function(a){const u=convert$1.rgb.xyz(a);let _=u[0],E=u[1],S=u[2];_/=95.047,E/=100,S/=108.883,_=_>LAB_FT?_**(1/3):7.787*_+16/116,E=E>LAB_FT?E**(1/3):7.787*E+16/116,S=S>LAB_FT?S**(1/3):7.787*S+16/116;const C=116*E-16,T=500*(_-E),P=200*(E-S);return[C,T,P]};convert$1.hsl.rgb=function(a){const u=a[0]/360,_=a[1]/100,E=a[2]/100;let S,C;if(_===0)return C=E*255,[C,C,C];const T=E<.5?E*(1+_):E+_-E*_,P=2*E-T,O=[0,0,0];for(let D=0;D<3;D++)S=u+1/3*-(D-1),S<0&&S++,S>1&&S--,6*S<1?C=P+(T-P)*6*S:2*S<1?C=T:3*S<2?C=P+(T-P)*(2/3-S)*6:C=P,O[D]=C*255;return O};convert$1.hsl.hsv=function(a){const u=a[0];let _=a[1]/100,E=a[2]/100,S=_;const C=Math.max(E,.01);E*=2,_*=E<=1?E:2-E,S*=C<=1?C:2-C;const T=(E+_)/2,P=E===0?2*S/(C+S):2*_/(E+_);return[u,P*100,T*100]};convert$1.hsv.rgb=function(a){const u=a[0]/60,_=a[1]/100;let E=a[2]/100;const S=Math.floor(u)%6,C=u-Math.floor(u),T=255*E*(1-_),P=255*E*(1-_*C),O=255*E*(1-_*(1-C));switch(E*=255,S){case 0:return[E,O,T];case 1:return[P,E,T];case 2:return[T,E,O];case 3:return[T,P,E];case 4:return[O,T,E];case 5:return[E,T,P]}};convert$1.hsv.hsl=function(a){const u=a[0],_=a[1]/100,E=a[2]/100,S=Math.max(E,.01);let C,T;T=(2-_)*E;const P=(2-_)*S;return C=_*S,C/=P<=1?P:2-P,C=C||0,T/=2,[u,C*100,T*100]};convert$1.hwb.rgb=function(a){const u=a[0]/360;let _=a[1]/100,E=a[2]/100;const S=_+E;let C;S>1&&(_/=S,E/=S);const T=Math.floor(6*u),P=1-E;C=6*u-T,T&1&&(C=1-C);const O=_+C*(P-_);let D,M,B;switch(T){default:case 6:case 0:{D=P,M=O,B=_;break}case 1:{D=O,M=P,B=_;break}case 2:{D=_,M=P,B=O;break}case 3:{D=_,M=O,B=P;break}case 4:{D=O,M=_,B=P;break}case 5:{D=P,M=_,B=O;break}}return[D*255,M*255,B*255]};convert$1.cmyk.rgb=function(a){const u=a[0]/100,_=a[1]/100,E=a[2]/100,S=a[3]/100,C=1-Math.min(1,u*(1-S)+S),T=1-Math.min(1,_*(1-S)+S),P=1-Math.min(1,E*(1-S)+S);return[C*255,T*255,P*255]};convert$1.xyz.rgb=function(a){const u=a[0]/100,_=a[1]/100,E=a[2]/100;let S,C,T;return S=u*3.2404542+_*-1.5371385+E*-.4985314,C=u*-.969266+_*1.8760108+E*.041556,T=u*.0556434+_*-.2040259+E*1.0572252,S=S>.0031308?1.055*S**(1/2.4)-.055:S*12.92,C=C>.0031308?1.055*C**(1/2.4)-.055:C*12.92,T=T>.0031308?1.055*T**(1/2.4)-.055:T*12.92,S=Math.min(Math.max(0,S),1),C=Math.min(Math.max(0,C),1),T=Math.min(Math.max(0,T),1),[S*255,C*255,T*255]};convert$1.xyz.lab=function(a){let u=a[0],_=a[1],E=a[2];u/=95.047,_/=100,E/=108.883,u=u>LAB_FT?u**(1/3):7.787*u+16/116,_=_>LAB_FT?_**(1/3):7.787*_+16/116,E=E>LAB_FT?E**(1/3):7.787*E+16/116;const S=116*_-16,C=500*(u-_),T=200*(_-E);return[S,C,T]};convert$1.lab.xyz=function(a){const u=a[0],_=a[1],E=a[2];let S,C,T;C=(u+16)/116,S=_/500+C,T=C-E/200;const P=C**3,O=S**3,D=T**3;return C=P>LAB_FT?P:(C-16/116)/7.787,S=O>LAB_FT?O:(S-16/116)/7.787,T=D>LAB_FT?D:(T-16/116)/7.787,S*=95.047,C*=100,T*=108.883,[S,C,T]};convert$1.lab.lch=function(a){const u=a[0],_=a[1],E=a[2];let S;S=Math.atan2(E,_)*360/2/Math.PI,S<0&&(S+=360);const T=Math.sqrt(_*_+E*E);return[u,T,S]};convert$1.lch.lab=function(a){const u=a[0],_=a[1],S=a[2]/360*2*Math.PI,C=_*Math.cos(S),T=_*Math.sin(S);return[u,C,T]};convert$1.rgb.ansi16=function(a,u=null){const[_,E,S]=a;let C=u===null?convert$1.rgb.hsv(a)[2]:u;if(C=Math.round(C/50),C===0)return 30;let T=30+(Math.round(S/255)<<2|Math.round(E/255)<<1|Math.round(_/255));return C===2&&(T+=60),T};convert$1.hsv.ansi16=function(a){return convert$1.rgb.ansi16(convert$1.hsv.rgb(a),a[2])};convert$1.rgb.ansi256=function(a){const u=a[0],_=a[1],E=a[2];return u>>4===_>>4&&_>>4===E>>4?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(_/255*5)+Math.round(E/255*5)};convert$1.ansi16.rgb=function(a){a=a[0];let u=a%10;if(u===0||u===7)return a>50&&(u+=3.5),u=u/10.5*255,[u,u,u];const _=(Math.trunc(a>50)+1)*.5,E=(u&1)*_*255,S=(u>>1&1)*_*255,C=(u>>2&1)*_*255;return[E,S,C]};convert$1.ansi256.rgb=function(a){if(a=a[0],a>=232){const C=(a-232)*10+8;return[C,C,C]}a-=16;let u;const _=Math.floor(a/36)/5*255,E=Math.floor((u=a%36)/6)/5*255,S=u%6/5*255;return[_,E,S]};convert$1.rgb.hex=function(a){const _=(((Math.round(a[0])&255)<<16)+((Math.round(a[1])&255)<<8)+(Math.round(a[2])&255)).toString(16).toUpperCase();return"000000".slice(_.length)+_};convert$1.hex.rgb=function(a){const u=a.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!u)return[0,0,0];let _=u[0];u[0].length===3&&(_=[..._].map(P=>P+P).join(""));const E=Number.parseInt(_,16),S=E>>16&255,C=E>>8&255,T=E&255;return[S,C,T]};convert$1.rgb.hcg=function(a){const u=a[0]/255,_=a[1]/255,E=a[2]/255,S=Math.max(Math.max(u,_),E),C=Math.min(Math.min(u,_),E),T=S-C;let P;const O=T<1?C/(1-T):0;return T<=0?P=0:S===u?P=(_-E)/T%6:S===_?P=2+(E-u)/T:P=4+(u-_)/T,P/=6,P%=1,[P*360,T*100,O*100]};convert$1.hsl.hcg=function(a){const u=a[1]/100,_=a[2]/100,E=_<.5?2*u*_:2*u*(1-_);let S=0;return E<1&&(S=(_-.5*E)/(1-E)),[a[0],E*100,S*100]};convert$1.hsv.hcg=function(a){const u=a[1]/100,_=a[2]/100,E=u*_;let S=0;return E<1&&(S=(_-E)/(1-E)),[a[0],E*100,S*100]};convert$1.hcg.rgb=function(a){const u=a[0]/360,_=a[1]/100,E=a[2]/100;if(_===0)return[E*255,E*255,E*255];const S=[0,0,0],C=u%1*6,T=C%1,P=1-T;let O=0;switch(Math.floor(C)){case 0:{S[0]=1,S[1]=T,S[2]=0;break}case 1:{S[0]=P,S[1]=1,S[2]=0;break}case 2:{S[0]=0,S[1]=1,S[2]=T;break}case 3:{S[0]=0,S[1]=P,S[2]=1;break}case 4:{S[0]=T,S[1]=0,S[2]=1;break}default:S[0]=1,S[1]=0,S[2]=P}return O=(1-_)*E,[(_*S[0]+O)*255,(_*S[1]+O)*255,(_*S[2]+O)*255]};convert$1.hcg.hsv=function(a){const u=a[1]/100,_=a[2]/100,E=u+_*(1-u);let S=0;return E>0&&(S=u/E),[a[0],S*100,E*100]};convert$1.hcg.hsl=function(a){const u=a[1]/100,E=a[2]/100*(1-u)+.5*u;let S=0;return E>0&&E<.5?S=u/(2*E):E>=.5&&E<1&&(S=u/(2*(1-E))),[a[0],S*100,E*100]};convert$1.hcg.hwb=function(a){const u=a[1]/100,_=a[2]/100,E=u+_*(1-u);return[a[0],(E-u)*100,(1-E)*100]};convert$1.hwb.hcg=function(a){const u=a[1]/100,E=1-a[2]/100,S=E-u;let C=0;return S<1&&(C=(E-S)/(1-S)),[a[0],S*100,C*100]};convert$1.apple.rgb=function(a){return[a[0]/65535*255,a[1]/65535*255,a[2]/65535*255]};convert$1.rgb.apple=function(a){return[a[0]/255*65535,a[1]/255*65535,a[2]/255*65535]};convert$1.gray.rgb=function(a){return[a[0]/100*255,a[0]/100*255,a[0]/100*255]};convert$1.gray.hsl=function(a){return[0,0,a[0]]};convert$1.gray.hsv=convert$1.gray.hsl;convert$1.gray.hwb=function(a){return[0,100,a[0]]};convert$1.gray.cmyk=function(a){return[0,0,0,a[0]]};convert$1.gray.lab=function(a){return[a[0],0,0]};convert$1.gray.hex=function(a){const u=Math.round(a[0]/100*255)&255,E=((u<<16)+(u<<8)+u).toString(16).toUpperCase();return"000000".slice(E.length)+E};convert$1.rgb.gray=function(a){return[(a[0]+a[1]+a[2])/3/255*100]};function buildGraph(){const a={},u=Object.keys(convert$1);for(let{length:_}=u,E=0;E<_;E++)a[u[E]]={distance:-1,parent:null};return a}function deriveBFS(a){const u=buildGraph(),_=[a];for(u[a].distance=0;_.length>0;){const E=_.pop(),S=Object.keys(convert$1[E]);for(let{length:C}=S,T=0;T<C;T++){const P=S[T],O=u[P];O.distance===-1&&(O.distance=u[E].distance+1,O.parent=E,_.unshift(P))}}return u}function link(a,u){return function(_){return u(a(_))}}function wrapConversion(a,u){const _=[u[a].parent,a];let E=convert$1[u[a].parent][a],S=u[a].parent;for(;u[S].parent;)_.unshift(u[S].parent),E=link(convert$1[u[S].parent][S],E),S=u[S].parent;return E.conversion=_,E}function route(a){const u=deriveBFS(a),_={},E=Object.keys(u);for(let{length:S}=E,C=0;C<S;C++){const T=E[C];u[T].parent!==null&&(_[T]=wrapConversion(T,u))}return _}const convert={},models=Object.keys(convert$1);function wrapRaw(a){const u=function(..._){const E=_[0];return E==null?E:(E.length>1&&(_=E),a(_))};return"conversion"in a&&(u.conversion=a.conversion),u}function wrapRounded(a){const u=function(..._){const E=_[0];if(E==null)return E;E.length>1&&(_=E);const S=a(_);if(typeof S=="object")for(let{length:C}=S,T=0;T<C;T++)S[T]=Math.round(S[T]);return S};return"conversion"in a&&(u.conversion=a.conversion),u}for(const a of models){convert[a]={},Object.defineProperty(convert[a],"channels",{value:convert$1[a].channels}),Object.defineProperty(convert[a],"labels",{value:convert$1[a].labels});const u=route(a),_=Object.keys(u);for(const E of _){const S=u[E];convert[a][E]=wrapRounded(S),convert[a][E].raw=wrapRaw(S)}}const BLOCKLET_SERVICE_PATH_PREFIX$1="/.well-known/service",RELAY_SOCKET_PREFIX$1="/.well-known/service",DASHBOARD_URL=`${BLOCKLET_SERVICE_PATH_PREFIX$1}/admin`,PROFILE_URL=`${BLOCKLET_SERVICE_PATH_PREFIX$1}/user`,DID_SPACE_URL=`${BLOCKLET_SERVICE_PATH_PREFIX$1}/user/did-spaces`,NAVIGATION_URL=`${BLOCKLET_SERVICE_PATH_PREFIX$1}/admin/navigation`,DID_PREFIX$1="did:abt:",PASSPORT_STATUS={VALID:"valid",REVOKED:"revoked"},LOGIN_PROVIDER={EMAIL:"email",AUTH0:"auth0",APPLE:"apple",GITHUB:"github",GOOGLE:"google",WALLET:"wallet",NFT:"nft",PASSKEY:"passkey"},LOGIN_PROVIDER_NAME={[LOGIN_PROVIDER.EMAIL]:"Email",[LOGIN_PROVIDER.AUTH0]:"Auth0",[LOGIN_PROVIDER.APPLE]:"Apple",[LOGIN_PROVIDER.GITHUB]:"Github",[LOGIN_PROVIDER.GOOGLE]:"Google",[LOGIN_PROVIDER.WALLET]:"DID Wallet",[LOGIN_PROVIDER.NFT]:"NFT",[LOGIN_PROVIDER.PASSKEY]:"Passkey"},OAUTH_PROVIDER={email:"Email",auth0:"Auth0",apple:"Apple",github:"Github",google:"Google"},DID_CONNECT_SMALL_WIDTH=360,DID_CONNECT_MEDIUM_WIDTH=576,cacheBlockletData={};function getMaster(a=window.blocklet){var _;return(((_=a==null?void 0:a.settings)==null?void 0:_.federated)||{}).master}function getConfig$1(a=window.blocklet){var _;return(((_=a==null?void 0:a.settings)==null?void 0:_.federated)||{}).config}function getFederatedEnabled(a=window.blocklet){const u=getConfig$1(a);return(u==null?void 0:u.status)==="approved"}function getFederatedApp(a=window.blocklet){const u=getMaster(a);return!isEmpty(u)?{appId:u.appId,appName:u.appName,appDescription:u.appDescription,appLogo:u.appLogo,appPid:u.appPid,appUrl:u.appUrl,version:u.version,sourceAppPid:u.appPid,provider:"wallet"}:null}function getCurrentApp(a=window.blocklet){return a?{appId:a.appId,appName:a.appName,appDescription:a.appDescription,appLogo:a.appLogo,appPid:a.appPid,appUrl:a.appUrl,currentAppUrl:a===window.blocklet?window.location.origin:void 0,version:a.version,sourceAppPid:null,provider:"wallet"}:window.env?(a=window.env,{appId:a.appId,appName:a.appName,appDescription:a.appDescription,appUrl:a.baseUrl,currentAppUrl:window.location.origin,sourceAppPid:null,provider:"wallet",type:"server"}):null}function getApps(a){const u=[],_=getFederatedApp(a),E=getCurrentApp(a),S=getFederatedEnabled(a);return E&&u.push(E),_&&(_==null?void 0:_.appId)!==(E==null?void 0:E.appId)&&S&&u.push(_),u.reverse()}async function getBlockletData(a,u=!1){if(!u&&cacheBlockletData[a])return cacheBlockletData[a];try{const _=new URL("__blocklet__.js",a);_.searchParams.set("type","json");const S=await(await fetch(_.href)).json();return cacheBlockletData[a]=S,S}catch(_){return console.error(`Failed to get blocklet data: ${a}`,_),null}}let dateTool=null;const IP_V4_REGEX=/^(\d{1,3}\.){3}\d{1,3}(:\d+)?$/,commonSLDs=new Set(["co","com","net","org","gov","edu","ac"]),commonCcTLDs=new Set(["uk","au","cn","nz","za","in","br","mx","fr","it","ca"]);function isTwoSegmentTLD(a){if(!a)return!1;const u=a.split(".");if(u.length<2)return!1;const _=u[u.length-2],E=u[u.length-1];return commonSLDs.has(_)&&commonCcTLDs.has(E)}function resolveRootDomain(){const{host:a}=window.location;if(!a||IP_V4_REGEX.test(a))return"";const _=a.split(":")[0].split(".");if(_.length===1)return"";if(_.length>2){const E=_.slice(-2).join(".");if(isTwoSegmentTLD(E))return`.${_.slice(-3).join(".")}`}return`.${_.slice(-2).join(".")}`}function stringifyQuery(a={}){return new URLSearchParams(a).toString()}function getCookieOptions(a=1){let u=a;typeof u=="number"&&(u={expireInDays:u}),u.path===void 0&&(u.path="/"),u.expireInDays||(u.expireInDays=1);const _={expires:u.expireInDays,path:u.path,domain:u.domain||"",sameSite:u.sameSite||"Lax",secure:u.secure!==!1};return(typeof window>"u"||u.domain||u.returnDomain===!1)&&u.returnDomain===!1&&delete _.domain,_}const getColor=a=>a.color?a.color:a.dark?a.theme.palette.common.white:a.theme.palette.text.primary;function mergeProps(a,u,_=[]){const E=Object.assign({},a);return Object.keys(u.defaultProps||{}).forEach(S=>{typeof E[S]=="string"&&E[S].indexOf("::prop::")===0&&(E[S]=u.defaultProps[S])}),Array.isArray(_)&&_.forEach(S=>{if(typeof E[S]=="string")try{E[S]=JSON.parse(E[S])}catch{}}),Object.keys(E).forEach(S=>{typeof E[S]=="string"&&E[S].indexOf("::prop::")===0&&(E[S]="")}),E}function setDateTool(a){dateTool=a}const createDateFormatter=a=>(u,{locale:_,tz:E,isUtc:S}={})=>{if(dateTool===null)throw new Error("call setDateTool to set the date tool library, such as: setDateTool(dayjs)");if(isNil(u)||u==="")return"-";let C=dateTool(u);return E&&(C=C.tz(E)),S&&(C=C.utc()),typeof _<"u"&&(C=C.locale(_)),C.format(a)};function formatToDatetime(a,{locale:u="en",tz:_,isUtc:E=!1}={}){return createDateFormatter("lll")(a,{locale:u,tz:_,isUtc:E})}function detectWalletExtension(){const a=(window==null?void 0:window.ABT_DEV)||window.ABT;return a&&typeof a.open=="function"?a:null}function openWebWallet({webWalletUrl:a,action:u="login",locale:_="en",url:E,windowFeatures:S,appInfo:C,memberAppInfo:T}){const P=detectWalletExtension();if(P)return P.open({action:u,locale:_,url:encodeURIComponent(E),appInfo:{...C},memberAppInfo:{...T}}),{type:"extension"};const O={toolbar:"no",location:"no",status:"no",menubar:"no",scrollbars:"yes",resizable:"yes",width:414,height:736},D=`${a}?action=${u}&locale=${_}&url=${encodeURIComponent(E)}`,M=Object.assign({},O,S),B=H=>H.innerWidth||H.document.documentElement.clientWidth||H.document.body.clientWidth;if(!("left"in M)){const H=B(window.top||window),J=window.screenLeft||window.screenX;M.left=H+J-M.width}if(!("top"in M)){const H=window.screenTop||window.screenY;M.top=H}const U=Object.keys(M).map(H=>`${H}=${M[H]}`).join(",");return window.open(D,"targetWindow",U),{type:"web"}}const getFontSize=a=>a&&Number(a)>=12?`${Number(a)}px`:"inherit",isEthereumDid$1=a=>{const u=a.replace(DID_PREFIX$1,"");return!!/^(0x)?[0-9a-f]{40}$/i.test(u)},appendParams=(a,u)=>{if(!u)return a;try{const _=new URL(a,window.location.origin);return Object.keys(u).forEach(E=>{_.searchParams.set(E,String(u[E]))}),_.origin===window.location.origin?_.pathname+_.search:_.href}catch{return a}},getUserAvatar=(a,u=48)=>a&&(a.indexOf(BLOCKLET_SERVICE_PATH_PREFIX$1)>=0?appendParams(a,{imageFilter:"resize",w:u,h:u}):a),sleep$2=(a=0)=>new Promise(u=>{setTimeout(()=>{u()},a)}),isUrl$2=a=>/^https?:\/\//.test(a),visitorIdKey$1="vid",visitorIdKeyLegacy="__visitor_id",getVisitorId$1=()=>Cookies.get(visitorIdKey$1)||localStorage.getItem(visitorIdKeyLegacy),setVisitorId=a=>{a===null?Cookies.remove(visitorIdKey$1,{sameSite:"None",secure:!0}):Cookies.set(visitorIdKey$1,a,{sameSite:"None",secure:!0,expires:365})},ensureVisitorId=()=>{let a=localStorage.getItem(visitorIdKeyLegacy);if(a&&(localStorage.removeItem(visitorIdKeyLegacy),setVisitorId(a)),!getVisitorId$1()){if(!getFederatedEnabled())try{if(window.crypto&&typeof window.crypto.randomUUID=="function")a=window.crypto.randomUUID();else{const u=new Uint8Array(16);if(window.crypto&&typeof window.crypto.getRandomValues=="function")window.crypto.getRandomValues(u);else for(let E=0;E<16;E++)u[E]=Math.floor(Math.random()*256);const _=Array.from(u).map(E=>E.toString(16).padStart(2,"0"));a=[_.slice(0,4).join(""),_.slice(4,6).join(""),_.slice(6,8).join(""),_.slice(8,10).join(""),_.slice(10,16).join("")].join("-")}}catch{a=`${Date.now()}-${Math.random().toString(36).substring(2,15)}`}a&&setVisitorId(a)}},getDIDColor=a=>{if(isEthereumDid$1(a)){const u=Uint8Array.from(a.slice(2).match(/.{1,2}/g).map(_=>parseInt(_,16))).slice(0,8).reduce((_,E)=>_+E,0)%colors$3.length;return colors$3[u]}try{const u=getDIDMotifInfo(a);return u==null?void 0:u.color}catch{return null}},getTranslation=(a,u,_={})=>{const{fallbackLocale:E="en",defaultValue:S="unknown"}=_;if(typeof a=="string")return a;let C;return u&&(C=a[u]),(!C||typeof C!="string")&&(C=a[E]),(!C||typeof C!="string")&&(C=S),C},cleanedObj=a=>omitBy(a,isNil);function hexToRgba(a,u=1){const[_,E,S]=convert.hex.rgb(a);return`rgba(${_}, ${E}, ${S}, ${u})`}function deepmergeAll(a,u){if(!Array.isArray(a))throw new Error("First argument should be an array");return a.length===0?{}:a.length===1?a[0]:a.reduce((_,E)=>deepmerge$1(_,E,u))}function isTheme(a){return a&&typeof a=="object"&&a.palette&&typeof a.palette.getContrastText=="function"}function isUxTheme(a){return isTheme(a)&&a.__isUxTheme__===!0}function collectFontFamilies(a,u=new Set){return!a||typeof a!="object"||(typeof a.fontFamily=="string"&&a.fontFamily.replace(/"/g,"").split(",").map(_=>_.trim()).filter(Boolean).forEach(_=>u.add(_)),Object.values(a).forEach(_=>{typeof _=="object"&&collectFontFamilies(_,u)})),u}const prevFonts=new Set(DEFAULT_FONTS.concat("inherit"));function loadFonts(a){const u=a.filter(E=>!prevFonts.has(E));if(u.length===0)return Promise.resolve(!0);u.forEach(E=>prevFonts.add(E));const _=u.length-1;return u[_]=`${u[_]}&display=swap`,new Promise(E=>{webfontloader.load({google:{families:u},active:()=>E(!0),inactive:()=>E(!0),fontinactive:(S,C)=>{prevFonts.delete(S),console.warn(`font ${S} ${C} download failed`)}})})}function createDefaultThemeOptions(a="light"){return a==="dark"?BLOCKLET_THEME_DARK:BLOCKLET_THEME_LIGHT}function lazyCreateDefaultTheme(a){let u=null;return()=>{var E,S;if(u)return u;const _=deepmerge$1(createDefaultThemeOptions(a),((S=(E=window.blocklet)==null?void 0:E.theme)==null?void 0:S[a])??{});return u=createTheme$1(_),u}}const normalizeUserThemeOptions=({palette:a,components:u,overrides:_,...E})=>({palette:a,components:{..._,...u},...E}),defaultUxThemeOptions={themeName:"ArcBlock",pageWidth:"md",disableBlockletTheme:!1,colors:{white:"#FFFFFF",dark:"#4A707C",gray:"#222222",minor:"#9B9B9B",darkText:"#DCDCDC",background:"#F7F8F8",yellow:"#FFCF71",green:"#44cdc6",red:"#D0021B",blue:"#4E6AF6",primary:"#222222",black:"#222222",secondary:"#44cdc6",mint:"#44cdc6",textSecondary:"#4A4A4A",active:"#5b9025",danger:"#D0021B",lightGrey:"#BCBCBC"}},create$e=(...a)=>{var U,H,J;const u=getDefaultThemePrefer(),_=lazyCreateDefaultTheme(u),E=a.reduce((X,ie)=>deepmerge$1(X,normalizeUserThemeOptions(typeof ie=="function"?ie(_()):ie)),normalizeUserThemeOptions(defaultUxThemeOptions)),S=E.mode||((U=E.palette)==null?void 0:U.mode)||u,C=((J=(H=window.blocklet)==null?void 0:H.theme)==null?void 0:J[S])??{},T=createDefaultThemeOptions(S),{disableBlockletTheme:P}=E,O=deepmergeAll([T,!P&&cleanedObj(C),cleanedObj(E),{mode:S,palette:{mode:S}}].filter(Boolean)),D=createTheme$1(O);D.__isUxTheme__=!0;const M=collectFontFamilies(D.typography);return loadFonts(Array.from(M)),responsiveFontSizes(D,{breakpoints:["xs","sm","md","lg"],disableAlign:!1,factor:3,variants:["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]})},createTheme=create$e,subscribers=new Set;let patched=!1,lastHref="";const isBrowser=typeof window<"u";function notifyIfChanged(){if(!isBrowser)return;const a=window.location.href;a!==lastHref&&(lastHref=a,subscribers.forEach(u=>u(window.location)))}function patchHistoryOnce(){if(!isBrowser||patched)return;patched=!0;const a=history.pushState;history.pushState=function(...E){const S=a.apply(this,E);return notifyIfChanged(),S};const u=history.replaceState;history.replaceState=function(...E){const S=u.apply(this,E);return notifyIfChanged(),S},window.addEventListener("popstate",notifyIfChanged),window.addEventListener("hashchange",notifyIfChanged)}function subscribeUrlChange(a){return isBrowser&&(patchHistoryOnce(),subscribers.add(a)),()=>{subscribers.delete(a)}}function extractLocation(a){return{href:a.href,origin:a.origin,host:a.host,hostname:a.hostname,pathname:a.pathname,port:a.port,protocol:a.protocol,search:a.search,hash:a.hash}}const defaultLocation={href:"",origin:"",host:"",hostname:"",port:"",protocol:"",pathname:"",search:"",hash:""};function useLocationState(){const[a,u]=reactExports.useState(()=>isBrowser?extractLocation(window.location):defaultLocation);return reactExports.useEffect(()=>{if(isBrowser)return subscribeUrlChange(_=>{u(extractLocation(_))})},[]),a}const defaultTheme=createTheme(),ColorSchemeContext=reactExports.createContext({});function useColorScheme(){return reactExports.useContext(ColorSchemeContext)}const resolveMode=a=>a?a==="system"?getDefaultThemePrefer({theme:{prefer:"system"}}):a:getDefaultThemePrefer();function DarkSchemeStyles({className:a}){const u=useTheme();if(u.palette.mode==="dark"){const _="transparent",E=u.palette.grey[300],S=(a||"").trim().split(/\s+/).filter(Boolean).map(D=>D.startsWith(".")?D:`.${D}`).join(" "),C=S?`${S}::-webkit-scrollbar, ${S} *::-webkit-scrollbar`:"*::-webkit-scrollbar",T=S?`${S}::-webkit-scrollbar-track, ${S} *::-webkit-scrollbar-track`:"*::-webkit-scrollbar-track",P=S?`${S}::-webkit-scrollbar-thumb, ${S} *::-webkit-scrollbar-thumb`:"*::-webkit-scrollbar-thumb",O=S?`${S}, ${S} *`:"*";return jsxRuntimeExports.jsx(GlobalStyles$2,{styles:{"@supports selector(::-webkit-scrollbar)":{[C]:{width:"12px",height:"12px"},[T]:{background:_},[P]:{background:E,borderRadius:"6px",border:"2px solid",borderColor:_,backgroundClip:"padding-box","&:hover":{background:u.palette.grey[400],backgroundClip:"padding-box"}}},"@supports not selector(::-webkit-scrollbar)":{[O]:{scrollbarWidth:"auto",scrollbarColor:`${E} ${_}`}}}})}return null}function BaseThemeProvider({children:a,theme:u=defaultTheme,injectFirst:_=!0,darkSchemeClass:E=""}){const S=reactExports.useMemo(()=>typeof u=="function"||isTheme(u)?u:createTheme(u),[u]);return jsxRuntimeExports.jsx(StyledEngineProvider,{injectFirst:_,children:jsxRuntimeExports.jsxs(ThemeProvider$1,{theme:S,children:[jsxRuntimeExports.jsx(CssBaseline,{}),jsxRuntimeExports.jsx(DarkSchemeStyles,{className:E}),a]})})}function ColorSchemeProvider({children:a,theme:u,prefer:_,disableBlockletTheme:E=!1,...S}){const[C,T]=reactExports.useState(()=>resolveMode(_)),P=useTheme(),O=useLocationState(),D=reactExports.useRef(null),M=reactExports.useMemo(()=>{let X={};const ie=lazyCreateDefaultTheme(C);if(u)if(typeof u=="function"){const oe=ie();isUxTheme(P)?X={...u(P,{mode:C})}:X={...u(oe,{mode:C})}}else X={...u};return set$1(X,"palette.mode",C),set$1(X,"mode",C),X},[C,u,P]),B=reactExports.useMemo(()=>createTheme({...M,disableBlockletTheme:E}),[M,E]),U=reactExports.useCallback(()=>{const X=C==="light"?"dark":"light";T(X),sessionStorage.removeItem(BLOCKLET_THEME_PREFER_KEY),localStorage.setItem(BLOCKLET_THEME_PREFER_KEY,X)},[C,T]),H=reactExports.useCallback(X=>{C!==X&&(T(X),sessionStorage.removeItem(BLOCKLET_THEME_PREFER_KEY),localStorage.setItem(BLOCKLET_THEME_PREFER_KEY,X))},[C,T]),J=reactExports.useMemo(()=>({mode:C,toggleMode:U,changeMode:H,prefer:_}),[C,_,U,H]);return reactExports.useEffect(()=>{T(resolveMode(_))},[_,T,O.search]),reactExports.useEffect(()=>{const X=new URLSearchParams(O.search).get("theme");isValidThemeMode(X)&&sessionStorage.setItem(BLOCKLET_THEME_PREFER_KEY,X)},[O.search]),reactExports.useEffect(()=>{D.current||(D.current=document.querySelector('meta[name="theme-color"]'));const X=B.palette.background.default;if(D.current)D.current.setAttribute("content",X);else{const ie=document.createElement("meta");ie.name="theme-color",ie.content=X,document.head.appendChild(ie),D.current=ie}},[B.palette.background.default]),jsxRuntimeExports.jsx(ColorSchemeContext.Provider,{value:J,children:jsxRuntimeExports.jsx(BaseThemeProvider,{theme:B,...S,children:a})})}function ThemeProvider({children:a,prefer:u,enableColorScheme:_=!1,...E}){const{toggleMode:S}=useColorScheme();return _||u||!S?jsxRuntimeExports.jsx(ColorSchemeProvider,{prefer:u,...E,children:a}):jsxRuntimeExports.jsx(BaseThemeProvider,{...E,children:a})}ThemeProvider.propTypes={children:PropTypes.any,theme:PropTypes.any,injectFirst:PropTypes.bool,darkSchemeClass:PropTypes.string,enableColorScheme:PropTypes.bool};const isTransientProp=a=>a.startsWith("$"),styled=(a,u)=>styled$1(a,{...u,shouldForwardProp:_=>u!=null&&u.shouldForwardProp?u.shouldForwardProp(_)&&!isTransientProp(_):!isTransientProp(_)});function Center({children:a,relative:u="screen"}){let _={};return u==="parent"&&(_={width:"100%",height:"100%"}),jsxRuntimeExports.jsx(Div,{style:_,children:a})}const Div=styled("div")`
2
2
  flex: 1;
3
3
  width: 100vw;
4
4
  height: 100vh;
@@ -246,7 +246,7 @@ ${S}-----END CERTIFICATE-----
246
246
  }
247
247
  `,DidAddressWrapper=reactExports.forwardRef(({responsive:a=!0,...u},_)=>a?jsxRuntimeExports.jsx(ResponsiveDidAddress,{...u,ref:_}):jsxRuntimeExports.jsx(DidAddress,{...u,ref:_}));var observerMap=new Map,RootIds=new WeakMap,rootId=0,unsupportedValue=void 0;function getRootId(a){return a?(RootIds.has(a)||(rootId+=1,RootIds.set(a,rootId.toString())),RootIds.get(a)):"0"}function optionsToId(a){return Object.keys(a).sort().filter(function(u){return a[u]!==void 0}).map(function(u){return u+"_"+(u==="root"?getRootId(a.root):a[u])}).toString()}function createObserver(a){var u=optionsToId(a),_=observerMap.get(u);if(!_){var E=new Map,S,C=new IntersectionObserver(function(T){T.forEach(function(P){var O,D=P.isIntersecting&&S.some(function(M){return P.intersectionRatio>=M});a.trackVisibility&&typeof P.isVisible>"u"&&(P.isVisible=D),(O=E.get(P.target))==null||O.forEach(function(M){M(D,P)})})},a);S=C.thresholds||(Array.isArray(a.threshold)?a.threshold:[a.threshold||0]),_={id:u,observer:C,elements:E},observerMap.set(u,_)}return _}function observe(a,u,_,E){if(_===void 0&&(_={}),E===void 0&&(E=unsupportedValue),typeof window.IntersectionObserver>"u"&&E!==void 0){var S=a.getBoundingClientRect();return u(E,{isIntersecting:E,target:a,intersectionRatio:typeof _.threshold=="number"?_.threshold:0,time:0,boundingClientRect:S,intersectionRect:S,rootBounds:S}),function(){}}var C=createObserver(_),T=C.id,P=C.observer,O=C.elements,D=O.get(a)||[];return O.has(a)||O.set(a,D),D.push(u),P.observe(a),function(){D.splice(D.indexOf(u),1),D.length===0&&(O.delete(a),P.unobserve(a)),O.size===0&&(P.disconnect(),observerMap.delete(T))}}function useInView(a){var u=a===void 0?{}:a,_=u.threshold,E=u.delay,S=u.trackVisibility,C=u.rootMargin,T=u.root,P=u.triggerOnce,O=u.skip,D=u.initialInView,M=u.fallbackInView,B=reactExports.useRef(),U=reactExports.useState({inView:!!D}),H=U[0],J=U[1],X=reactExports.useCallback(function(oe){B.current!==void 0&&(B.current(),B.current=void 0),!O&&oe&&(B.current=observe(oe,function(de,ce){J({inView:de,entry:ce}),ce.isIntersecting&&P&&B.current&&(B.current(),B.current=void 0)},{root:T,rootMargin:C,threshold:_,trackVisibility:S,delay:E},M))},[Array.isArray(_)?_.toString():_,T,C,P,O,S,M,E]);reactExports.useEffect(function(){!B.current&&H.entry&&!P&&!O&&J({inView:!!D})});var ie=[X,H.inView,H.entry];return ie.ref=ie[0],ie.inView=ie[1],ie.entry=ie[2],ie}const data$y={width:24,height:24,body:'<path fill="currentColor" d="M2.725 21q-.275 0-.5-.138t-.35-.362q-.125-.225-.138-.488t.138-.512l9.25-16q.15-.25.388-.375T12 3q.25 0 .488.125t.387.375l9.25 16q.15.25.138.513t-.138.487q-.125.225-.35.363t-.5.137H2.725ZM12 18q.425 0 .713-.288T13 17q0-.425-.288-.713T12 16q-.425 0-.713.288T11 17q0 .425.288.713T12 18Zm0-3q.425 0 .713-.288T13 14v-3q0-.425-.288-.713T12 10q-.425 0-.713.288T11 11v3q0 .425.288.713T12 15Z"/>'},data$x={width:24,height:24,body:'<path fill="currentColor" d="M5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.588 1.413T19 21H5Zm2-4h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17Z"/>'},mergeSx=(...a)=>a.reduce((_,E)=>E?Array.isArray(E)?_.concat(E):_.concat([E]):_,[]),PREFIX$1="Img",classes$1={root:`${PREFIX$1}-root`};function Img({lazy:a,width:u,height:_,repeat:E,ratio:S,alt:C,size:T,position:P,src:O,placeholder:D,fallback:M,style:B,className:U,onError:H,onSuccess:J,...X}){const[ie,oe]=a?useInView({threshold:0,triggerOnce:!0}):[null,!0],[de,ce]=reactExports.useState("init"),le=reactExports.useMemo(()=>{switch(de){case"init":case"loading":return D;case"error":return M;case"loaded":return O;default:return null}},[D,M,O,de]),fe=u&&_?100*_/u:S*100,pe=reactExports.useMemo(()=>({backgroundImage:le?`url(${le})`:"",backgroundPosition:P,backgroundSize:T,backgroundRepeat:E,paddingTop:`${fe}%`}),[le,P,T,de]),Se={...B,display:"inline-block",width:u?`${u}px`:"100%"};function we(){const xe=new Image;xe.src=O,ce("loading"),xe.onload=()=>{ce("loaded"),J()},xe.onerror=me=>{ce("error"),H(me)}}return reactExports.useEffect(()=>{oe&&we()},[oe]),jsxRuntimeExports.jsx(Box,{"data-id":"2",ref:ie,style:Se,className:"arcblock_ux_img-wrapper",...X,sx:mergeSx({[`& .${classes$1.root}`]:{position:"relative",overflow:"hidden","& .image--state, & .image--img":{minWidth:"100%",minHeight:"100%",position:"absolute",top:0,left:"50%",transform:"translateX(-50%)"},"& .image--state":{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",color:"#999",background:"#eee",width:"100%",height:"100%"},"& .image--img":{opacity:0,visibility:"hidden"},"& .image--icon":{fontSize:30,maxWidth:"80%",maxHeight:"80%"}}},X.sx),children:jsxRuntimeExports.jsxs("div",{className:`image ${U} ${classes$1.root}`,style:pe,children:[!M&&de==="error"&&jsxRuntimeExports.jsx("div",{className:"image--state",title:"loading image",children:jsxRuntimeExports.jsx(Icon$2,{icon:data$y,className:"image--icon"})}),!D&&de==="loading"&&jsxRuntimeExports.jsx("div",{className:"image--state",title:"Image load error",children:jsxRuntimeExports.jsx(Icon$2,{icon:data$x,className:"image--icon"})}),de==="loaded"&&jsxRuntimeExports.jsx("img",{className:"image--img",src:O,alt:C})]})})}Img.propTypes={src:PropTypes.string.isRequired,alt:PropTypes.string,size:PropTypes.string,position:PropTypes.string,style:PropTypes.object,ratio:PropTypes.number,repeat:PropTypes.string,width:PropTypes.number,height:PropTypes.number,lazy:PropTypes.bool,placeholder:PropTypes.string,fallback:PropTypes.string,className:PropTypes.string,onError:PropTypes.func,onSuccess:PropTypes.func};Img.defaultProps={alt:null,size:"cover",position:"top center",repeat:"no-repeat",style:null,ratio:1,width:null,height:null,lazy:!0,placeholder:null,fallback:null,className:"",onError:noop$6,onSuccess:noop$6};function DIDMotif({did:a,size:u,animation:_,shape:E,responsive:S,...C}){const T=reactExports.useRef(null);if(reactExports.useLayoutEffect(()=>{update$1(T.current,a,{size:u,animation:_,shape:E})},[a,u,E]),S){const P={...C.style,width:"100%"};return jsxRuntimeExports.jsx(Box,{component:"svg",ref:T,...C,style:P,className:"arc-avatar-did-motif"})}return jsxRuntimeExports.jsx(Box,{component:"span",...C,style:{display:"inline-block",width:u,height:u,...C.style},className:"arc-avatar-did-motif",children:jsxRuntimeExports.jsx(Box,{component:"svg",ref:T,style:{width:"100%"}})})}DIDMotif.propTypes={did:PropTypes.string.isRequired,size:PropTypes.number,animation:PropTypes.bool,responsive:PropTypes.bool,shape:PropTypes.number};DIDMotif.defaultProps={size:200,animation:!1,responsive:!1,shape:null};const randseed=new Array(4);function seedrand(a){for(let u=0;u<randseed.length;u++)randseed[u]=0;for(let u=0;u<a.length;u++)randseed[u%4]=(randseed[u%4]<<5)-randseed[u%4]+a.charCodeAt(u)}function rand(){const a=randseed[0]^randseed[0]<<11;return randseed[0]=randseed[1],randseed[1]=randseed[2],randseed[2]=randseed[3],randseed[3]=randseed[3]^randseed[3]>>19^a^a>>8,(randseed[3]>>>0)/(1<<31>>>0)}function createColor(){const a=Math.floor(rand()*360),u=`${rand()*60+40}%`,_=`${(rand()+rand()+rand()+rand())*25}%`;return`hsl(${a},${u},${_})`}function createImageData(a){const u=a,_=a,E=Math.ceil(u/2),S=u-E,C=[];for(let T=0;T<_;T++){let P=[];for(let D=0;D<E;D++)P[D]=Math.floor(rand()*2.3);const O=P.slice(0,S);O.reverse(),P=P.concat(O);for(let D=0;D<P.length;D++)C.push(P[D])}return C}function createCanvas(a,u,_,E,S){const C=document.createElement("canvas"),T=Math.sqrt(a.length);C.width=C.height=T*_;const P=C.getContext("2d");P.fillStyle=E,P.fillRect(0,0,C.width,C.height),P.fillStyle=u;for(let O=0;O<a.length;O++){const D=Math.floor(O/T),M=O%T;P.fillStyle=a[O]===1?u:S,a[O]&&P.fillRect(M*_,D*_,_,_)}return C}function createIcon(a){a=a||{};const u=a.size||8,_=a.scale||4,E=a.seed||Math.floor(Math.random()*10**16).toString(16);seedrand(E);const S=a.color||createColor(),C=a.bgcolor||createColor(),T=a.spotcolor||createColor(),P=createImageData(u);return createCanvas(P,S,_,C,T)}const blockies={createIcon};function Avatar(a){const[u,_]=reactExports.useState(!1),E=mergeProps(a,Avatar,[]),{did:S="",size:C,src:T,variant:P,animation:O,shape:D,blockiesPadding:M,responsive:B,...U}=E,H=reactExports.useMemo(()=>isEthereumDid$1(S)?blockies.createIcon({seed:S.replace(DID_PREFIX$1,"").toLowerCase(),size:8,scale:16}).toDataURL():null,[S]);if(T&&!u)return jsxRuntimeExports.jsx(Img,{width:C,src:T,alt:S,onError:()=>_(!0),...U,className:`avatar-img--${P} ${(U==null?void 0:U.className)||""}`,sx:{"& .avatar-img--rounded":{borderRadius:"4px",overflow:"hidden"},"& .avatar-img--circle":{borderRadius:"100%",overflow:"hidden"},...U.sx}});if(H){if(M){const J=C>24?4:2;return jsxRuntimeExports.jsx(Box,{...U,sx:{display:"flex",alignItems:"center",width:C,height:C,".blocky-icon-inner":{boxSizing:"border-box",display:"flex",justifyContent:"center",alignItems:"center",width:C,height:C*.7,borderRadius:`${Math.min(10,Math.floor(.1*C+2))}px`,background:"#ddd"},...U.sx},children:jsxRuntimeExports.jsx("div",{className:"blocky-icon-inner",children:jsxRuntimeExports.jsx(Img,{width:C*.7-J*2,src:H,alt:S})})})}return jsxRuntimeExports.jsx(Img,{...U,width:C,src:H,alt:S,style:{marginRight:4}})}if(S)return jsxRuntimeExports.jsx(DIDMotif,{did:S.replace(DID_PREFIX$1,""),size:C,animation:O,shape:Shape[(D||"").toUpperCase()],responsive:B,...U});throw new Error(`Invalid DID: ${S}`)}Avatar.propTypes={did:PropTypes.string,size:PropTypes.number,variant:PropTypes.oneOf(["circle","rounded","default"]),animation:PropTypes.bool,shape:PropTypes.oneOf(["","rectangle","square","hexagon","circle"]),blockiesPadding:PropTypes.bool,responsive:PropTypes.bool};Avatar.defaultProps={did:"",size:36,variant:"default",animation:!1,shape:"",blockiesPadding:!0,responsive:!1};function AvatarWithErrorBoundary(a){const u=a.size||36,_={rounded:"4px",circle:"100%"}[a.variant]||0;return jsxRuntimeExports.jsx(ErrorBoundary,{fallbackRender:()=>jsxRuntimeExports.jsx(Box,{width:u,height:u,bgcolor:"grey.300",borderRadius:_}),children:jsxRuntimeExports.jsx(Avatar,{...a})})}AvatarWithErrorBoundary.propTypes=Avatar.propTypes;const translations$9={en:{scanQrcode:"Scan with DID Wallet to view the {role}",download:"Download",downloadTips:"Don't have DID Wallet ?"},zh:{scanQrcode:"使用 DID Wallet 扫码查看该 {role}",download:"下载",downloadTips:"没有 DID Wallet ?"}},DEFAULT_CHAIN_ID="xenon-2020-01-15",CHAIN_ID_MAP={main:DEFAULT_CHAIN_ID,"main.abtnetwork.io":DEFAULT_CHAIN_ID,"beta.abtnetwork.io":"beta"},getFontColor=(a,u,_)=>_?getDIDColor(a):u.color,isSquareMotif=a=>!{0:!0,6:!0,17:!0}[a],getRoleName=a=>{if(a===lib$4.types.RoleType.ROLE_ANY)return"DID";const[u]=Object.entries(lib$4.types.RoleType).find(_=>_[1]===a)||[];return u?u.toLowerCase().replace(/role_(\S)/g,(_,E)=>E.toUpperCase()):"DID"},getAvatarSize=(a,u,_)=>u||isSquareMotif(a.roleType)?_*.75:_;function useDIDInfo({did:a,showAvatar:u}){const _=isEthereumDid$1(a),E=_?void 0:getDIDMotifInfo(a),S=useCreation(()=>_?a:`${DID_PREFIX$1}${a}`,[a,_]),C=useMemoizedFn((T,P)=>[jsxRuntimeExports.jsx("span",{style:{flex:"0 0 auto",color:getFontColor(a,E,_)},children:"DID:"},`${P}-prefix-did-${T}`),jsxRuntimeExports.jsxs("span",{className:"did-address-text",children:[_?"ETH":"ABT",":"]},`${P}-prefix-abt-${T}`),u&&jsxRuntimeExports.jsx(AvatarWithErrorBoundary,{src:"",did:a,size:getAvatarSize(E,_,T||18),style:{display:"inline-flex",alignItems:"center",marginLeft:2,marginRight:4},blockiesPadding:!1,className:"did-address-avatar"},`${P}-avatar-${T}`)]);return{isEthDid:_,didMotifInfo:E,content:S,getPrepend:C}}const DID=reactExports.forwardRef((a,u)=>{const{did:_,chainId:E,roleType:S,showAvatar:C=!0,showQrcode:T=!1,locale:P="en",size:O=0,component:D="span",copyable:M=!0,responsive:B=!0,showCopyButtonInTooltip:U=!1,inline:H=!1,append:J=null,compact:X=!1,startChars:ie=6,endChars:oe=6,style:de,className:ce,sx:le}=a,fe={size:O,component:D,copyable:M,responsive:B,showCopyButtonInTooltip:U,inline:H,append:J,compact:X,startChars:ie,endChars:oe,style:de,className:ce,sx:le},pe=reactExports.useRef(null),{content:Se,getPrepend:we}=useDIDInfo({did:_,showAvatar:C}),[xe,me]=reactExports.useState(!1),be=useMemoizedFn(()=>{me(!1)}),$e=useMemoizedFn(Z=>{Z.stopPropagation(),Z.preventDefault(),me(!0)});return reactExports.useImperativeHandle(u,()=>new Proxy({openQRCode:()=>me(!0),closeQRCode:()=>me(!1)},{get(Z,I){var L;return Z[I]||((L=pe==null?void 0:pe.current)==null?void 0:L[I])}})),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(DidAddressWrapper,{locale:P,content:Se,...fe,ref:pe,prepend:we(fe.size,"address"),append:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[T?jsxRuntimeExports.jsx(Box,{id:"did-qrcode-button",component:Icon$2,icon:data$z,onClick:$e,sx:{flexShrink:0,cursor:"pointer",ml:.5,color:"text.secondary"}}):null,fe.append]}),children:_},"address"),jsxRuntimeExports.jsx(DIDDialog,{did:_,chainId:E,roleType:S,showAvatar:C,open:xe,onClose:be,...fe})]})});function DIDDialog({did:a,chainId:u,roleType:_,showAvatar:E=!0,open:S,fullScreen:C=!1,fullWidth:T=!1,scroll:P="paper",onClose:O,locale:D="en",...M}){const B=useMemoizedFn((le,fe={})=>translate(translations$9,le,D,"en",fe)),{isEthDid:U,content:H,didMotifInfo:J,getPrepend:X}=useDIDInfo({did:a,showAvatar:E}),ie=useCreation(()=>["zh","en"].includes(D)?`https://www.didwallet.io/${D}`:"https://www.didwallet.io/en",[D]),oe=useCreation(()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[B("downloadTips")," ",jsxRuntimeExports.jsx(Box,{component:"a",href:ie,target:"_blank",rel:"noreferrer",sx:{color:"secondary.main",textDecoration:"none","&:hover":{textDecoration:"underline"}},children:B("download")})]}),[ie]),de=useCreation(()=>{var le;if(u)return CHAIN_ID_MAP[u]||u;if(U)return"1";try{const fe=(le=window.blocklet)==null?void 0:le.CHAIN_HOST,pe=new URL(fe).hostname;if(pe)return CHAIN_ID_MAP[pe]||DEFAULT_CHAIN_ID}catch(fe){console.warn("Failed to parse chainHost:",fe)}return DEFAULT_CHAIN_ID},[U,u]),ce=useCreation(()=>U?`ethereum:abtwallet.io/i?address=${H}&action=didRecognize&chainID=${de}`:`abt://abtwallet.io/i?did=${H}&action=didRecognize&chainID=${de}`,[H,U,de]);return jsxRuntimeExports.jsx(Dialog$1,{open:S,onClose:O,fullScreen:C,fullWidth:T,scroll:P,maxWidth:"sm",PaperProps:{sx:{boxShadow:"none",borderRadius:"12px"}},children:jsxRuntimeExports.jsxs(DialogContent,{align:"center",sx:{p:3},children:[jsxRuntimeExports.jsx(Typography$1,{sx:{mb:2,fontWeight:500,fontSize:18},children:B("scanQrcode",{role:getRoleName(_||(J==null?void 0:J.roleType))})}),jsxRuntimeExports.jsx(QRCode$1,{value:ce,size:256,renderAs:"svg",level:"M"}),jsxRuntimeExports.jsx(Box,{sx:{mt:1.5,textAlign:"center"},children:jsxRuntimeExports.jsx(DidAddressWrapper,{locale:D,content:H,prepend:X(16,"dialog"),...M,size:16,copyable:!0,children:a},"dialog-address")}),jsxRuntimeExports.jsx(Typography$1,{variant:"body2",sx:{color:"text.secondary",fontSize:"12px",mt:1},children:oe})]})})}const getCurrentAppPid=a=>{var u;return(a==null?void 0:a.sourceAppPid)||((u=window==null?void 0:window.blocklet)==null?void 0:u.appPid)};function getConnectedAccounts$1(a){var u;return(a==null?void 0:a.connectedAccounts)||((u=a==null?void 0:a.extraConfigs)==null?void 0:u.connectedAccounts)||[]}function getSourceProvider$1(a){var u;return(a==null?void 0:a.sourceProvider)||((u=a==null?void 0:a.extraConfigs)==null?void 0:u.sourceProvider)||"wallet"}function getWallet$1(a){return getConnectedAccounts$1(a).find(E=>E.provider==="wallet")}function getWalletDid$1(a){const u=getWallet$1(a);return u==null?void 0:u.did}var lib$2={},dsbridge={};Object.defineProperty(dsbridge,"__esModule",{value:!0});dsbridge.default=void 0;var bridge={call:function a(u,_,E){var S="";typeof _=="function"&&(E=_,_={});var C={data:_===void 0?null:_};if(typeof E=="function"){var T="dscb"+window.dscb++;window[T]=E,C._dscbstub=T}return C=JSON.stringify(C),window._dsbridge?S=_dsbridge.call(u,C):(window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)&&(S=prompt("_dsbridge="+u,C)),JSON.parse(S||"{}").data},register:function a(u,_,E){var S=E?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){bridge.call("_dsb.dsinit")},0)),typeof _=="object"?S._obs[u]=_:S[u]=_},registerAsyn:function a(u,_){this.register(u,_,!0)},hasNativeMethod:function a(u,_){return this.call("_dsb.hasNativeMethod",{name:u,type:_||"all"})},disableJavascriptDialogBlock:function a(u){this.call("_dsb.disableJavascriptDialogBlock",{disable:u!==!1})},canUseBridge(){return!!(window._dsbridge||window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)}};(function(){if(!bridge.canUseBridge()||window._dsf)return;const a=window.close;var u={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:bridge,close:function(){bridge.call("_dsb.closePage"),a()},_handleMessageFromNative:function(S){var C=JSON.parse(S.data),T={id:S.callbackId,complete:!0},P=this._dsf[S.method],O=this._dsaf[S.method],D=function(de,ce){T.data=de.apply(ce,C),bridge.call("_dsb.returnValue",T)},M=function(de,ce){C.push(function(le,fe){T.data=le,T.complete=fe!==!1,bridge.call("_dsb.returnValue",T)}),de.apply(ce,C)};if(P)D(P,this._dsf);else if(O)M(O,this._dsaf);else{var B=S.method.split(".");if(B.length<2)return;var U=B.pop(),H=B.join("."),J=this._dsf._obs,X=J[H]||{},ie=X[U];if(ie&&typeof ie=="function"){D(ie,X);return}if(J=this._dsaf._obs,X=J[H]||{},ie=X[U],ie&&typeof ie=="function"){M(ie,X);return}}}};for(var _ in u)window[_]=u[_];bridge.register("_hasJavascriptMethod",function(E,S){var C=E.split(".");if(C.length<2)return!!(_dsf[C]||_dsaf[C]);var E=C.pop(),T=C.join("."),P=_dsf._obs[T]||_dsaf._obs[T];return P&&!!P[E]})})();dsbridge.default=bridge;Object.defineProperty(lib$2,"__esModule",{value:!0});var default_1$b=lib$2.default=void 0,_dsbridge$1=_interopRequireDefault$e(dsbridge);function _interopRequireDefault$e(a){return a&&a.__esModule?a:{default:a}}function ownKeys$8(a,u){var _=Object.keys(a);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(a);u&&(E=E.filter(function(S){return Object.getOwnPropertyDescriptor(a,S).enumerable})),_.push.apply(_,E)}return _}function _objectSpread$5(a){for(var u=1;u<arguments.length;u++){var _=arguments[u]!=null?arguments[u]:{};u%2?ownKeys$8(Object(_),!0).forEach(function(E){_defineProperty$a(a,E,_[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(_)):ownKeys$8(Object(_)).forEach(function(E){Object.defineProperty(a,E,Object.getOwnPropertyDescriptor(_,E))})}return a}function _defineProperty$a(a,u,_){return(u=_toPropertyKey$2(u))in a?Object.defineProperty(a,u,{value:_,enumerable:!0,configurable:!0,writable:!0}):a[u]=_,a}function _toPropertyKey$2(a){var u=_toPrimitive$2(a,"string");return typeof u=="symbol"?u:u+""}function _toPrimitive$2(a,u){if(typeof a!="object"||!a)return a;var _=a[Symbol.toPrimitive];if(_!==void 0){var E=_.call(a,u||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(a)}const BRIDGE_VERSION="1";default_1$b=lib$2.default={register(){_dsbridge$1.default.canUseBridge()?_dsbridge$1.default.register(...arguments):console.warn("dsbridge is not available")},registerAsyn(){_dsbridge$1.default.canUseBridge()?_dsbridge$1.default.registerAsyn(...arguments):console.warn("dsbridge is not available")},call(){_dsbridge$1.default.call(...arguments)},asyncCall(){for(var a=arguments.length,u=new Array(a),_=0;_<a;_++)u[_]=arguments[_];return new Promise((E,S)=>{_dsbridge$1.default.call(...u,C=>{try{const T=JSON.parse(C);if(T.code===0){const P=JSON.parse(T.data);E(P)}else S(new Error(T.error))}catch{E(C)}})})},shareMessage(a){const{content:u,imgUrl:_,success:E,fail:S}=a;if(!u&&!_){S("params error");return}_dsbridge$1.default.call("arcShare",JSON.stringify({content:u,imgUrl:_}),C=>{const T=JSON.parse(C);T&&T.code===0?typeof E=="function"&&E(C):typeof S=="function"&&S(C)})},showLoading(){_dsbridge$1.default.call("arcShowLoading")},hideLoading(){_dsbridge$1.default.call("arcHideLoading")},showToast(a){a&&typeof a=="string"&&_dsbridge$1.default.call("arcToast",a)},chooseImgs(a){const{limit:u,success:_,fail:E}=a;_dsbridge$1.default.call("arcChooseImgs",JSON.stringify({limit:u}),S=>{const C=JSON.parse(S);C&&C.code===0?typeof _=="function"&&_(S):typeof E=="function"&&E(S)})},previewImgs(a){const{imgs:u}=a;!u||u.length===0||_dsbridge$1.default.call("arcPreviewImgs",JSON.stringify(a))},isSetPWD(a){const{success:u,fail:_}=a;_dsbridge$1.default.call("arcIsSetPWD","",E=>{const S=JSON.parse(E);S&&S.code===0?typeof u=="function"&&u(E):typeof _=="function"&&_(E)})},isCodeABOk(a){const{success:u,fail:_}=a;_dsbridge$1.default.call("arcIsCodeABOk","",E=>{const S=JSON.parse(E);S&&S.code===0?typeof u=="function"&&u(E):typeof _=="function"&&_(E)})},callArc(a){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise((_,E)=>{const C=["arc",a].join("__"),T=_objectSpread$5(_objectSpread$5({},u),{},{_version:BRIDGE_VERSION});_dsbridge$1.default.call(C,T,P=>{try{const O=JSON.parse(P);if((O==null?void 0:O._version)===BRIDGE_VERSION)if(O.code===0)try{const D=JSON.parse(O.data);_(D)}catch{console.warn("Failed to parse result.data"),_(O.data)}else E(new Error(O.error));else _(O)}catch{console.warn("Failed to parse resString"),_(P)}})})},registerBlocklet(a){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>{};if(_dsbridge$1.default.canUseBridge()){const E=["blocklet",a].join("__");_dsbridge$1.default.registerAsyn(E,function(){for(var S=arguments.length,C=new Array(S),T=0;T<S;T++)C[T]=arguments[T];const P=C.map(O=>{try{return JSON.parse(O)}catch{return O}});u(...P)})}else console.warn("dsbridge is not available")}};class CookieStorageEngine{constructor(u,_){this.storageKey=u,this.options=_||{}}setToken(u){return Cookies.set(this.storageKey,u,{...getCookieOptions(this.options)})}getToken(){return Cookies.get(this.storageKey)}removeToken(){return Cookies.remove(this.storageKey,getCookieOptions(this.options))}}function e$1(a){this.message=a}e$1.prototype=new Error,e$1.prototype.name="InvalidCharacterError";var r$2=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(a){var u=String(a).replace(/=+$/,"");if(u.length%4==1)throw new e$1("'atob' failed: The string to be decoded is not correctly encoded.");for(var _,E,S=0,C=0,T="";E=u.charAt(C++);~E&&(_=S%4?64*_+E:E,S++%4)?T+=String.fromCharCode(255&_>>(-2*S&6)):0)E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(E);return T};function t$2(a){var u=a.replace(/-/g,"+").replace(/_/g,"/");switch(u.length%4){case 0:break;case 2:u+="==";break;case 3:u+="=";break;default:throw"Illegal base64url string!"}try{return function(_){return decodeURIComponent(r$2(_).replace(/(.)/g,function(E,S){var C=S.charCodeAt(0).toString(16).toUpperCase();return C.length<2&&(C="0"+C),"%"+C}))}(u)}catch{return r$2(u)}}function n$1(a){this.message=a}function o(a,u){if(typeof a!="string")throw new n$1("Invalid token specified");var _=(u=u||{}).header===!0?0:1;try{return JSON.parse(t$2(a.split(".")[_]))}catch(E){throw new n$1("Invalid token specified: "+E.message)}}n$1.prototype=new Error,n$1.prototype.name="InvalidTokenError";class LocalStorageEngine{constructor(u){this.storageKey=u}setToken(u){if(!(typeof window>"u"||typeof window.localStorage>"u"))return localStorage.setItem(this.storageKey,u)}getToken(){if(typeof window>"u"||typeof window.localStorage>"u")return;const u=localStorage.getItem(this.storageKey);let _,E;try{if({value:_,exp:E}=JSON.parse(u),E===void 0||_===void 0)return u}catch{_=u}try{E=o(_).exp}catch{return}if(!(new Date().getTime()>E*1e3))return _}removeToken(){if(!(typeof window>"u"||typeof window.localStorage>"u"))return localStorage.removeItem(this.storageKey)}}function createStorage(a="did.auth.token",u="ls",_={}){if(!a)throw new Error("storageKey must be specified to create a storage");let E=null;if(u==="ls")E=new LocalStorageEngine(a);else if(u==="cookie")E=new CookieStorageEngine(a,_);else throw new Error("storageEngine must be ls or cookie");return{getToken:E.getToken.bind(E),setToken:E.setToken.bind(E),removeToken:E.removeToken.bind(E),engine:u,key:a}}const overheadLength=tweetnacl.box.publicKeyLength+tweetnacl.box.overheadLength,ERROR_MSG_INPUT="Input must be an string, Buffer or Uint8Array";function normalizeInput(a){let u;if(a instanceof Uint8Array)u=a;else if(typeof a=="string")u=new TextEncoder().encode(a);else throw new Error(ERROR_MSG_INPUT);return u}function toHex(a){return Array.prototype.map.call(a,function(u){return(u<16?"0":"")+u.toString(16)}).join("")}function uint32ToHex(a){return(4294967296+a).toString(16).substring(1)}function debugPrint(a,u,_){let E=`
248
248
  `+a+" = ";for(let S=0;S<u.length;S+=2){if(_===32)E+=uint32ToHex(u[S]).toUpperCase(),E+=" ",E+=uint32ToHex(u[S+1]).toUpperCase();else if(_===64)E+=uint32ToHex(u[S+1]).toUpperCase(),E+=uint32ToHex(u[S]).toUpperCase();else throw new Error("Invalid size "+_);S%6===4?E+=`
249
- `+new Array(a.length+4).join(" "):S<u.length-2&&(E+=" ")}console.log(E)}function testSpeed(a,u,_){let E=new Date().getTime();const S=new Uint8Array(u);for(let T=0;T<u;T++)S[T]=T%256;const C=new Date().getTime();console.log("Generated random input in "+(C-E)+"ms"),E=C;for(let T=0;T<_;T++){const P=a(S),O=new Date().getTime(),D=O-E;E=O,console.log("Hashed in "+D+"ms: "+P.substring(0,20)+"..."),console.log(Math.round(u/(1<<20)/(D/1e3)*100)/100+" MB PER SECOND")}}var util$2={normalizeInput,toHex,debugPrint,testSpeed};const util$1=util$2;function ADD64AA(a,u,_){const E=a[u]+a[_];let S=a[u+1]+a[_+1];E>=4294967296&&S++,a[u]=E,a[u+1]=S}function ADD64AC(a,u,_,E){let S=a[u]+_;_<0&&(S+=4294967296);let C=a[u+1]+E;S>=4294967296&&C++,a[u]=S,a[u+1]=C}function B2B_GET32(a,u){return a[u]^a[u+1]<<8^a[u+2]<<16^a[u+3]<<24}function B2B_G(a,u,_,E,S,C){const T=m$1[S],P=m$1[S+1],O=m$1[C],D=m$1[C+1];ADD64AA(v$1,a,u),ADD64AC(v$1,a,T,P);let M=v$1[E]^v$1[a],B=v$1[E+1]^v$1[a+1];v$1[E]=B,v$1[E+1]=M,ADD64AA(v$1,_,E),M=v$1[u]^v$1[_],B=v$1[u+1]^v$1[_+1],v$1[u]=M>>>24^B<<8,v$1[u+1]=B>>>24^M<<8,ADD64AA(v$1,a,u),ADD64AC(v$1,a,O,D),M=v$1[E]^v$1[a],B=v$1[E+1]^v$1[a+1],v$1[E]=M>>>16^B<<16,v$1[E+1]=B>>>16^M<<16,ADD64AA(v$1,_,E),M=v$1[u]^v$1[_],B=v$1[u+1]^v$1[_+1],v$1[u]=B>>>31^M<<1,v$1[u+1]=M>>>31^B<<1}const BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],SIGMA82=new Uint8Array(SIGMA8.map(function(a){return a*2})),v$1=new Uint32Array(32),m$1=new Uint32Array(32);function blake2bCompress(a,u){let _=0;for(_=0;_<16;_++)v$1[_]=a.h[_],v$1[_+16]=BLAKE2B_IV32[_];for(v$1[24]=v$1[24]^a.t,v$1[25]=v$1[25]^a.t/4294967296,u&&(v$1[28]=~v$1[28],v$1[29]=~v$1[29]),_=0;_<32;_++)m$1[_]=B2B_GET32(a.b,4*_);for(_=0;_<12;_++)B2B_G(0,8,16,24,SIGMA82[_*16+0],SIGMA82[_*16+1]),B2B_G(2,10,18,26,SIGMA82[_*16+2],SIGMA82[_*16+3]),B2B_G(4,12,20,28,SIGMA82[_*16+4],SIGMA82[_*16+5]),B2B_G(6,14,22,30,SIGMA82[_*16+6],SIGMA82[_*16+7]),B2B_G(0,10,20,30,SIGMA82[_*16+8],SIGMA82[_*16+9]),B2B_G(2,12,22,24,SIGMA82[_*16+10],SIGMA82[_*16+11]),B2B_G(4,14,16,26,SIGMA82[_*16+12],SIGMA82[_*16+13]),B2B_G(6,8,18,28,SIGMA82[_*16+14],SIGMA82[_*16+15]);for(_=0;_<16;_++)a.h[_]=a.h[_]^v$1[_]^v$1[_+16]}const parameterBlock=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function blake2bInit(a,u,_,E){if(a===0||a>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(u&&u.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(_&&_.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(E&&E.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const S={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:a};parameterBlock.fill(0),parameterBlock[0]=a,u&&(parameterBlock[1]=u.length),parameterBlock[2]=1,parameterBlock[3]=1,_&&parameterBlock.set(_,32),E&&parameterBlock.set(E,48);for(let C=0;C<16;C++)S.h[C]=BLAKE2B_IV32[C]^B2B_GET32(parameterBlock,C*4);return u&&(blake2bUpdate(S,u),S.c=128),S}function blake2bUpdate(a,u){for(let _=0;_<u.length;_++)a.c===128&&(a.t+=a.c,blake2bCompress(a,!1),a.c=0),a.b[a.c++]=u[_]}function blake2bFinal(a){for(a.t+=a.c;a.c<128;)a.b[a.c++]=0;blake2bCompress(a,!0);const u=new Uint8Array(a.outlen);for(let _=0;_<a.outlen;_++)u[_]=a.h[_>>2]>>8*(_&3);return u}function blake2b(a,u,_,E,S){_=_||64,a=util$1.normalizeInput(a),E&&(E=util$1.normalizeInput(E)),S&&(S=util$1.normalizeInput(S));const C=blake2bInit(_,u,E,S);return blake2bUpdate(C,a),blake2bFinal(C)}function blake2bHex(a,u,_,E,S){const C=blake2b(a,u,_,E,S);return util$1.toHex(C)}var blake2b_1={blake2b,blake2bHex,blake2bInit,blake2bUpdate,blake2bFinal};const blake=getDefaultExportFromCjs(blake2b_1);function nonce(a,u){var _=blake.blake2bInit(tweetnacl.box.nonceLength,null);return blake.blake2bUpdate(_,a),blake.blake2bUpdate(_,u),blake.blake2bFinal(_)}function zero(a){for(var u=0;u<a.length;u++)a[u]=0}function seal(a,u){var _=new Uint8Array(overheadLength+a.length),E=tweetnacl.box.keyPair();_.set(E.publicKey);var S=nonce(E.publicKey,u),C=tweetnacl.box(a,S,u,E.secretKey);return _.set(C,E.publicKey.length),zero(E.secretKey),_}function open(a,u,_){var E=a.subarray(0,tweetnacl.box.publicKeyLength),S=nonce(E,u),C=a.subarray(tweetnacl.box.publicKeyLength);return tweetnacl.box.open(C,S,E,_)}const SealedBox={seal,open};class CustomError extends Error{}function getSafeUrl(a,{throwOnError:u=!0,returnRaw:_=!1,allowProtocols:E=["https:","http:"],allowDomains:S=void 0}={}){var C;S===void 0&&(S=((C=window.blocklet)==null?void 0:C.domainAliases)||[],S.push(window.location.href));try{let T;a.startsWith("/")?T=window.location.origin:a.startsWith("./")&&(T=window.location.href);const P=new URL(a,T),O=S&&S.map(D=>{try{return new URL(D).hostname}catch{return new URL(`https://${D}`).hostname}});if(E!==null&&!E.includes(P.protocol)){if(console.error(`Invalid protocol: ${P.protocol}`),u)throw new CustomError(`Invalid protocol: ${P.protocol}`);return null}if(O!==null&&!O.includes(P.hostname)){if(console.error(`Invalid host: ${P.hostname}`),u)throw new CustomError(`Invalid host: ${P.hostname}`);return null}return _?a:P.href}catch(T){if(T instanceof CustomError){if(u)throw T;return null}if(console.error(`Failed to convert url: ${a}`),u)throw new Error(`Failed to convert url: ${a}`);return null}}const createDebug=debug$5,createLogger$1=a=>new Proxy(window.console,{get(u,_){return(...E)=>{try{return["log","debug","info","warn","error"].includes(_)?u[_](a,...E):u[_]instanceof Function?u[_](...E):u[_]}catch(S){console.error(`Logger error in ${a}:`,S);return}}}}),name="@arcblock/did-connect",version$3="2.13.55",description="Client side library to work with DID Connect by ArcBlock.",keywords$1=["react","arcblock","component"],author="wangshijun<wangshijun2010@gmail.com>",homepage="https://github.com/ArcBlock/ux#readme",license="Apache-2.0",main="lib/index.js",module="lib/index.js",repository={type:"git",url:"git+https://github.com/ArcBlock/ux.git"},scripts={lint:"eslint src tests --ext js --ext jsx","lint:fix":"npm run lint -- --fix",build:"babel --config-file ./babel.config.es.js src --out-dir lib --copy-files --no-copy-ignored",autoexports:"node tools/auto-exports.js",watch:"babel --config-file ./babel.config.es.js src --out-dir lib -w --copy-files --no-copy-ignored",precommit:"CI=1 npm run lint",prepush:"CI=1 npm run lint",prepublish:"npm run build",test:"node tools/jest.js",coverage:"npm run test -- --coverage"},bugs={url:"https://github.com/ArcBlock/ux/issues"},dependencies={"@arcblock/bridge":"^2.13.55","@arcblock/did":"^1.20.11","@arcblock/icons":"^2.13.55","@arcblock/react-hooks":"^2.13.55","@arcblock/ws":"^1.20.11","@fontsource/lexend":"^5.1.1","@iconify-icons/logos":"^1.2.36","@iconify-icons/material-symbols":"^1.2.58","@iconify/react":"^5.2.0","@simplewebauthn/browser":"^13.0.0",ahooks:"^3.7.10",axios:"^1.7.5","base64-url":"^2.3.3",buffer:"^6.0.3","color-convert":"^3.0.1","core-js":"^3.25.5",eventemitter3:"^5.0.1",flat:"^5.0.2","js-cookie":"^2.2.1","jwt-decode":"^3.1.2",lodash:"^4.17.21","mdi-material-ui":"^7.5.0","p-queue":"^6.6.2","p-retry":"^6.2.1","p-wait-for":"^5.0.2","path-to-regexp":"^1.8.0",semver:"^7.6.3",tweetnacl:"^1.0.3","tweetnacl-sealedbox-js":"^1.2.0",ufo:"^1.5.3"},peerDependencies={"@arcblock/ux":"^2.11.48","@blocklet/js-sdk":"^1.16.41","@blocklet/theme":"^2.13.12","@emotion/react":"^11.10.4","@emotion/styled":"^11.10.4","@mui/material":"^5.15.0",react:"^18.2.0","react-dom":"^18.2.0"},publishConfig={access:"public"},devDependencies={"@babel/cli":"^7.19.3","@babel/core":"^7.19.3","@babel/preset-env":"^7.19.3","@babel/preset-react":"^7.18.6","eslint-plugin-react-hooks":"^4.6.0",glob:"^10.3.3",jest:"^29.7.0"},gitHead="fd8de005ce497660cbf1ea7378cf0d725b45fe87",pkg={name,version:version$3,description,keywords:keywords$1,author,homepage,license,main,module,repository,scripts,bugs,dependencies,peerDependencies,publishConfig,devDependencies,gitHead},DEFAULT_TIMEOUT$1=5*60,DEFAULT_WINDOW_TIMEOUT=30*60,BLOCKLET_SERVICE_PATH_PREFIX="/.well-known/service",SESSION_TOKEN_STORAGE_KEY="login_token",REFRESH_TOKEN_STORAGE_KEY="refresh_token",RELAY_SOCKET_PREFIX="/.well-known/service",API_DID_PREFIX="/api/did",DID_CONNECT_URL_PARAMS_NAME="__did-connect__",BUSY_STATUS=["scanned","succeed","error","busy"],EXT_DOWNLOAD_URL={chrome:"https://chromewebstore.google.com/detail/did-wallet/ibjflpbmadchofnbpppegdbnifdgincp",edge:"https://microsoftedge.microsoft.com/addons/detail/did-wallet/hjgoblidjnnnamdkinbichnfbmghmafd"},CHECK_STATUS_INTERVAL=2*1e3,VERIFY_CODE_LENGTH$2=6,LANG_COOKIE_NAME="nf_lang",CHECK_INTERVAL_TIME=1e3;class NotOpenError extends Error{constructor(){super("Failed to open popup")}}const providerName="wallet_url",getWebWalletUrl=()=>{var a,u;return window.localStorage.getItem(providerName)||((a=window.env)==null?void 0:a.webWalletUrl)||((u=window.blocklet)==null?void 0:u.webWalletUrl)||"https://web.abtwallet.io/"},checkSameProtocol=a=>{const{protocol:u}=window.location;let _="";try{_=new URL(a).protocol}catch{_=""}return u===_},{version:version$2}=pkg,debug$2=createDebug("did-connect"),logger$2=createLogger$1("did-connect");function unescape$1(a){return(a+"===".slice((a.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/")}function escape$2(a){return a.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}const encodeConnectUrl=a=>escape$2(window.btoa(a)),decodeConnectUrl=a=>window.atob(unescape$1(a)),parseTokenFromConnectUrl=a=>{const u=new URL(a),_=decodeURIComponent(u.searchParams.get("url"));return new URL(_).searchParams.get("_t_")},getAppId$1=(a,u)=>{var E,S,C;let _=u==null?void 0:u.publisher;if(!_){if(a!=null&&a.agentDid)return a.agentDid;_=a==null?void 0:a.publisher}return _?_.replace("did:abt:",""):((E=globalThis.blocklet)==null?void 0:E.appPid)||((S=globalThis.blocklet)==null?void 0:S.appId)||((C=globalThis.env)==null?void 0:C.appId)||""},getConnectedInfo=a=>{var _;const u={connected_did:a.did||"",connected_pk:a.pk||"",connected_app:getAppId$1(a.appInfo,a.memberAppInfo)};return(_=a==null?void 0:a.connectedWallet)!=null&&_.os&&(u.connected_wallet_os=a.connectedWallet.os),u},updateConnectedInfo=(a,u=!1)=>{if(!a)return;u||(a=getConnectedInfo(a));const _=getCookieOptions({expireInDays:7,returnDomain:!1});!isNil(a.connected_did)&&!isNil(a.connected_pk)&&lib$3.isValid(a.connected_did)&&lib$3.isFromPublicKey(a.connected_did,a.connected_pk)&&(Cookies.set("connected_did",a.connected_did,_),Cookies.set("connected_pk",a.connected_pk,_)),!isNil(a.connected_app)&&lib$3.isValid(a.connected_app)&&Cookies.set("connected_app",a.connected_app,_),a.connected_wallet_os&&Cookies.set("connected_wallet_os",a.connected_wallet_os,_)},encodeKey=a=>escape$2(Buffer$1$1.from(a).toString("base64")),decodeKey=a=>Uint8Array.from(Buffer$1$1.from(unescape$1(a),"base64")),decrypt$1=(a,u,_)=>{const E=SealedBox.open(Uint8Array.from(Buffer$1$1.from(a,"base64")),decodeKey(u),decodeKey(_));return JSON.parse(Buffer$1$1.from(E).toString("utf8"))},encrypt=(a,u)=>Buffer$1$1.from(SealedBox.seal(Uint8Array.from(Buffer$1$1.from(a)),decodeKey(u))).toString("base64"),parseNextWorkflow=(a,u="_t_")=>{const _=new URL(a),E={baseUrl:_.origin,prefix:_.pathname.replace(/\/auth$/,""),token:_.searchParams.get(u)||""};if(!E.baseUrl)throw new Error("Invalid next workflow: origin empty");if(!E.token)throw new Error("Invalid next workflow: token not found");return E},getApiErrorMessage=(a,u)=>{var S,C;let _=a.message;const{response:E}=a;return E&&(_=((S=E.data)==null?void 0:S.error)||((C=E.data)==null?void 0:C.message)||E.data||u,_=typeof _=="object"?u:_),_},getWebAuthnErrorMessage=(a,u,_)=>{if(!a)return a;if(!a.name)return getApiErrorMessage(a,u);switch(a.name){case"NotAllowedError":return _?_("webauthn.error.canceled"):"Authentication was canceled";case"SecurityError":return _?_("webauthn.error.security"):"A security error occurred during authentication";case"NotSupportedError":return _?_("webauthn.error.notSupported"):"This browser does not support passkey authentication";case"AbortError":return _?_("webauthn.error.aborted"):"Authentication was aborted";default:return console.warn("Unhandled WebAuthn error type:",a.name),getApiErrorMessage(a,u)}},createAxios=(a={},{lazy:u=!1,lazyTime:_=300}={})=>{const E={...a.headers,"x-did-connect-version":version$2},S=createAxios$2({...a,headers:E},{lazy:u,lazyTime:_});return S.interceptors.request.use(C=>{const T=getVisitorId$1();return T&&(C.headers["x-blocklet-visitor-id"]=T),C}),S},sleep=(a=0)=>new Promise(u=>{setTimeout(()=>{u()},a)});function getBrowserLang(){if(typeof window>"u")return null;const a=window.navigator.languages&&window.navigator.languages[0]||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage||window.navigator.systemLanguage||null;return{"zh-CN":"zh","zh-TW":"zh",zh:"zh",en:"en"}[a]||"en"}function formatCacheTtl(a,u){return[void 0,null,""].includes(a)?u:a/86400}async function decodeUrlParams(){const a=window.location.href;try{const u=new URL(a),_=u.searchParams.get(DID_CONNECT_URL_PARAMS_NAME);if(_){u.searchParams.delete(DID_CONNECT_URL_PARAMS_NAME);const E=JSON.parse(Buffer$1$1.from(_,"base64").toString("utf-8"));if(isString$2(E.forceConnected)&&isUndefined$2(E.sourceAppPid)){const C=await new BlockletSDK().user.getUserPublicInfo({did:E.forceConnected});isUndefined$2(C==null?void 0:C.sourceAppPid)||(E.sourceAppPid=C.sourceAppPid)}return{params:E,url:u.href}}}catch{console.warn("Failed to decode did-connect url params")}return{params:null,url:a}}const openPopup=(a,{width:u=680,height:_=720,name:E="did-connect:popup",offsetX:S=0,offsetY:C=0}={})=>{const T=getSafeUrl(a,{allowDomains:null}),P=window.screenX+(window.innerWidth-u)/2+S,O=window.screenY+(window.innerHeight-_)/2+C,D=[`left=${P}`,`top=${O}`,`width=${u}`,`height=${_}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],M=window.open("",E,D.join(","));if(M===null)throw new NotOpenError;return M.location.href=withQuery(T,{opener:window.location.origin}),M},runPopup=a=>new Promise((u,_)=>{let E,S;const C=({data:T})=>{if(T&&T.type==="authorization_response"){if(T!=null&&T.error){console.error(T.error);return}setTimeout(()=>{var P;(P=a.popup)==null||P.close(),clearTimeout(S),clearInterval(E),window.removeEventListener("message",C,!1),u(T)},a.closeTimeout||0)}};S=setTimeout(()=>{clearInterval(E),_(new Error("Timeout")),window.removeEventListener("message",C,!1)},(a.timeoutInSeconds||DEFAULT_WINDOW_TIMEOUT)*1e3),E=setInterval(()=>{var T;(T=a.popup)!=null&&T.closed&&(clearInterval(E),clearTimeout(S),window.removeEventListener("message",C,!1),_(new Error("Popup closed")))},1e3),window.addEventListener("message",C)});function WindowFocusAware({callback:a}){const u=useDebounceFn(a),_=useMemoizedFn(()=>{document.hidden||u.run()});return reactExports.useEffect(()=>(window.addEventListener("focus",u.run),document.addEventListener("visibilitychange",_),()=>{window.removeEventListener("focus",u.run),document.removeEventListener("visibilitychange",_)}),[]),null}WindowFocusAware.propTypes={callback:PropTypes.func.isRequired};var Uo;const DID_SPACES_BASE_URL=((Uo=window==null?void 0:window.blocklet)==null?void 0:Uo.DID_SPACES_BASE_URL)||"https://www.didspaces.com/app",DID_SPACES_DID="z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf";class Space{constructor({token:u}){this.token=u,this.prefix=this.getPrefix()}async createForOAuthAccount(){const{data:u}=await axios.put(joinURL(this.prefix,"/api/space/createForOAuthAccount"),{},{headers:{Authorization:`Bearer ${this.token}`,"x-csrf-token":getCSRFToken()}});return u}async authorizeAppForOAuthAccount({extraParams:u}){await this.createForOAuthAccount();const{data:_}=await axios.put(joinURL(this.prefix,"/api/space/authorizeAppForOAuthAccount"),{app:{metadata:{},...u}},{headers:{Authorization:`Bearer ${this.token}`,"x-csrf-token":getCSRFToken()}});return _}getPrefix(){const u=window.blocklet.componentMountPoints.find(_=>_.did===DID_SPACES_DID);return u==null?void 0:u.mountPoint}}function CardSelector({list:a=[],width:u=300,height:_=400,cardSpace:E=40,onSelect:S=noop$6,defaultIndex:C=0}){const[T,P]=reactExports.useState(0),[O,D]=reactExports.useState(0),M=reactExports.useRef(null),B=X=>{if(!(X<0||X>a.length-1)){if(P(X),M.current){const ie=M.current.clientWidth;D(X*(u+E)-(ie-u)/2+E*.5)}S(X)}};reactExports.useEffect(()=>{var X;B(C),(X=M.current)==null||X.addEventListener("touchmove",ie=>ie.preventDefault(),{passive:!1})},[]);let U;const H=X=>{U=X.touches[0].clientX},J=X=>{const ie=X.changedTouches[0],oe=U-ie.clientX;Math.abs(oe)>60&&(oe>0?B(T+1):B(T-1))};return jsxRuntimeExports.jsx(Container$7,{ref:M,onTouchStart:H,onTouchEnd:J,children:jsxRuntimeExports.jsx("div",{className:"card-container",style:{transform:`translate(${-O}px, 0)`},children:a.map((X,ie)=>X instanceof Function?jsxRuntimeExports.jsx("div",{className:`card-item ${ie===T?"selected":""}`,style:{width:u,height:_,margin:E/2},onClick:()=>B(ie),children:X(ie)},ie):jsxRuntimeExports.jsx("div",{className:`card-item ${ie===T?"selected":""}`,style:{width:u,height:_,margin:E/2},onClick:()=>B(ie),children:jsxRuntimeExports.jsx("img",{src:X.src,alt:X.name})},ie))})})}const Container$7=newStyled.div`
249
+ `+new Array(a.length+4).join(" "):S<u.length-2&&(E+=" ")}console.log(E)}function testSpeed(a,u,_){let E=new Date().getTime();const S=new Uint8Array(u);for(let T=0;T<u;T++)S[T]=T%256;const C=new Date().getTime();console.log("Generated random input in "+(C-E)+"ms"),E=C;for(let T=0;T<_;T++){const P=a(S),O=new Date().getTime(),D=O-E;E=O,console.log("Hashed in "+D+"ms: "+P.substring(0,20)+"..."),console.log(Math.round(u/(1<<20)/(D/1e3)*100)/100+" MB PER SECOND")}}var util$2={normalizeInput,toHex,debugPrint,testSpeed};const util$1=util$2;function ADD64AA(a,u,_){const E=a[u]+a[_];let S=a[u+1]+a[_+1];E>=4294967296&&S++,a[u]=E,a[u+1]=S}function ADD64AC(a,u,_,E){let S=a[u]+_;_<0&&(S+=4294967296);let C=a[u+1]+E;S>=4294967296&&C++,a[u]=S,a[u+1]=C}function B2B_GET32(a,u){return a[u]^a[u+1]<<8^a[u+2]<<16^a[u+3]<<24}function B2B_G(a,u,_,E,S,C){const T=m$1[S],P=m$1[S+1],O=m$1[C],D=m$1[C+1];ADD64AA(v$1,a,u),ADD64AC(v$1,a,T,P);let M=v$1[E]^v$1[a],B=v$1[E+1]^v$1[a+1];v$1[E]=B,v$1[E+1]=M,ADD64AA(v$1,_,E),M=v$1[u]^v$1[_],B=v$1[u+1]^v$1[_+1],v$1[u]=M>>>24^B<<8,v$1[u+1]=B>>>24^M<<8,ADD64AA(v$1,a,u),ADD64AC(v$1,a,O,D),M=v$1[E]^v$1[a],B=v$1[E+1]^v$1[a+1],v$1[E]=M>>>16^B<<16,v$1[E+1]=B>>>16^M<<16,ADD64AA(v$1,_,E),M=v$1[u]^v$1[_],B=v$1[u+1]^v$1[_+1],v$1[u]=B>>>31^M<<1,v$1[u+1]=M>>>31^B<<1}const BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],SIGMA82=new Uint8Array(SIGMA8.map(function(a){return a*2})),v$1=new Uint32Array(32),m$1=new Uint32Array(32);function blake2bCompress(a,u){let _=0;for(_=0;_<16;_++)v$1[_]=a.h[_],v$1[_+16]=BLAKE2B_IV32[_];for(v$1[24]=v$1[24]^a.t,v$1[25]=v$1[25]^a.t/4294967296,u&&(v$1[28]=~v$1[28],v$1[29]=~v$1[29]),_=0;_<32;_++)m$1[_]=B2B_GET32(a.b,4*_);for(_=0;_<12;_++)B2B_G(0,8,16,24,SIGMA82[_*16+0],SIGMA82[_*16+1]),B2B_G(2,10,18,26,SIGMA82[_*16+2],SIGMA82[_*16+3]),B2B_G(4,12,20,28,SIGMA82[_*16+4],SIGMA82[_*16+5]),B2B_G(6,14,22,30,SIGMA82[_*16+6],SIGMA82[_*16+7]),B2B_G(0,10,20,30,SIGMA82[_*16+8],SIGMA82[_*16+9]),B2B_G(2,12,22,24,SIGMA82[_*16+10],SIGMA82[_*16+11]),B2B_G(4,14,16,26,SIGMA82[_*16+12],SIGMA82[_*16+13]),B2B_G(6,8,18,28,SIGMA82[_*16+14],SIGMA82[_*16+15]);for(_=0;_<16;_++)a.h[_]=a.h[_]^v$1[_]^v$1[_+16]}const parameterBlock=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function blake2bInit(a,u,_,E){if(a===0||a>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(u&&u.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(_&&_.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(E&&E.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const S={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:a};parameterBlock.fill(0),parameterBlock[0]=a,u&&(parameterBlock[1]=u.length),parameterBlock[2]=1,parameterBlock[3]=1,_&&parameterBlock.set(_,32),E&&parameterBlock.set(E,48);for(let C=0;C<16;C++)S.h[C]=BLAKE2B_IV32[C]^B2B_GET32(parameterBlock,C*4);return u&&(blake2bUpdate(S,u),S.c=128),S}function blake2bUpdate(a,u){for(let _=0;_<u.length;_++)a.c===128&&(a.t+=a.c,blake2bCompress(a,!1),a.c=0),a.b[a.c++]=u[_]}function blake2bFinal(a){for(a.t+=a.c;a.c<128;)a.b[a.c++]=0;blake2bCompress(a,!0);const u=new Uint8Array(a.outlen);for(let _=0;_<a.outlen;_++)u[_]=a.h[_>>2]>>8*(_&3);return u}function blake2b(a,u,_,E,S){_=_||64,a=util$1.normalizeInput(a),E&&(E=util$1.normalizeInput(E)),S&&(S=util$1.normalizeInput(S));const C=blake2bInit(_,u,E,S);return blake2bUpdate(C,a),blake2bFinal(C)}function blake2bHex(a,u,_,E,S){const C=blake2b(a,u,_,E,S);return util$1.toHex(C)}var blake2b_1={blake2b,blake2bHex,blake2bInit,blake2bUpdate,blake2bFinal};const blake=getDefaultExportFromCjs(blake2b_1);function nonce(a,u){var _=blake.blake2bInit(tweetnacl.box.nonceLength,null);return blake.blake2bUpdate(_,a),blake.blake2bUpdate(_,u),blake.blake2bFinal(_)}function zero(a){for(var u=0;u<a.length;u++)a[u]=0}function seal(a,u){var _=new Uint8Array(overheadLength+a.length),E=tweetnacl.box.keyPair();_.set(E.publicKey);var S=nonce(E.publicKey,u),C=tweetnacl.box(a,S,u,E.secretKey);return _.set(C,E.publicKey.length),zero(E.secretKey),_}function open(a,u,_){var E=a.subarray(0,tweetnacl.box.publicKeyLength),S=nonce(E,u),C=a.subarray(tweetnacl.box.publicKeyLength);return tweetnacl.box.open(C,S,E,_)}const SealedBox={seal,open};class CustomError extends Error{}function getSafeUrl(a,{throwOnError:u=!0,returnRaw:_=!1,allowProtocols:E=["https:","http:"],allowDomains:S=void 0}={}){var C;S===void 0&&(S=((C=window.blocklet)==null?void 0:C.domainAliases)||[],S.push(window.location.href));try{let T;a.startsWith("/")?T=window.location.origin:a.startsWith("./")&&(T=window.location.href);const P=new URL(a,T),O=S&&S.map(D=>{try{return new URL(D).hostname}catch{return new URL(`https://${D}`).hostname}});if(E!==null&&!E.includes(P.protocol)){if(console.error(`Invalid protocol: ${P.protocol}`),u)throw new CustomError(`Invalid protocol: ${P.protocol}`);return null}if(O!==null&&!O.includes(P.hostname)){if(console.error(`Invalid host: ${P.hostname}`),u)throw new CustomError(`Invalid host: ${P.hostname}`);return null}return _?a:P.href}catch(T){if(T instanceof CustomError){if(u)throw T;return null}if(console.error(`Failed to convert url: ${a}`),u)throw new Error(`Failed to convert url: ${a}`);return null}}const createDebug=debug$5,createLogger$1=a=>new Proxy(window.console,{get(u,_){return(...E)=>{try{return["log","debug","info","warn","error"].includes(_)?u[_](a,...E):u[_]instanceof Function?u[_](...E):u[_]}catch(S){console.error(`Logger error in ${a}:`,S);return}}}}),name="@arcblock/did-connect",version$3="2.13.57",description="Client side library to work with DID Connect by ArcBlock.",keywords$1=["react","arcblock","component"],author="wangshijun<wangshijun2010@gmail.com>",homepage="https://github.com/ArcBlock/ux#readme",license="Apache-2.0",main="lib/index.js",module="lib/index.js",repository={type:"git",url:"git+https://github.com/ArcBlock/ux.git"},scripts={lint:"eslint src tests --ext js --ext jsx","lint:fix":"npm run lint -- --fix",build:"babel --config-file ./babel.config.es.js src --out-dir lib --copy-files --no-copy-ignored",autoexports:"node tools/auto-exports.js",watch:"babel --config-file ./babel.config.es.js src --out-dir lib -w --copy-files --no-copy-ignored",precommit:"CI=1 npm run lint",prepush:"CI=1 npm run lint",prepublish:"npm run build",test:"node tools/jest.js",coverage:"npm run test -- --coverage"},bugs={url:"https://github.com/ArcBlock/ux/issues"},dependencies={"@arcblock/bridge":"^2.13.57","@arcblock/did":"^1.20.11","@arcblock/icons":"^2.13.57","@arcblock/react-hooks":"^2.13.57","@arcblock/ws":"^1.20.11","@fontsource/lexend":"^5.1.1","@iconify-icons/logos":"^1.2.36","@iconify-icons/material-symbols":"^1.2.58","@iconify/react":"^5.2.0","@simplewebauthn/browser":"^13.0.0",ahooks:"^3.7.10",axios:"^1.7.5","base64-url":"^2.3.3",buffer:"^6.0.3","color-convert":"^3.0.1","core-js":"^3.25.5",eventemitter3:"^5.0.1",flat:"^5.0.2","js-cookie":"^2.2.1","jwt-decode":"^3.1.2",lodash:"^4.17.21","mdi-material-ui":"^7.5.0","p-queue":"^6.6.2","p-retry":"^6.2.1","p-wait-for":"^5.0.2","path-to-regexp":"^1.8.0",semver:"^7.6.3",tweetnacl:"^1.0.3","tweetnacl-sealedbox-js":"^1.2.0",ufo:"^1.5.3"},peerDependencies={"@arcblock/ux":"^2.11.48","@blocklet/js-sdk":"^1.16.41","@blocklet/theme":"^2.13.12","@emotion/react":"^11.10.4","@emotion/styled":"^11.10.4","@mui/material":"^5.15.0",react:"^18.2.0","react-dom":"^18.2.0"},publishConfig={access:"public"},devDependencies={"@babel/cli":"^7.19.3","@babel/core":"^7.19.3","@babel/preset-env":"^7.19.3","@babel/preset-react":"^7.18.6","eslint-plugin-react-hooks":"^4.6.0",glob:"^10.3.3",jest:"^29.7.0"},gitHead="780e1e0d2465208e7f53d5ba23b5cb3f84a819ae",pkg={name,version:version$3,description,keywords:keywords$1,author,homepage,license,main,module,repository,scripts,bugs,dependencies,peerDependencies,publishConfig,devDependencies,gitHead},DEFAULT_TIMEOUT$1=5*60,DEFAULT_WINDOW_TIMEOUT=30*60,BLOCKLET_SERVICE_PATH_PREFIX="/.well-known/service",SESSION_TOKEN_STORAGE_KEY="login_token",REFRESH_TOKEN_STORAGE_KEY="refresh_token",RELAY_SOCKET_PREFIX="/.well-known/service",API_DID_PREFIX="/api/did",DID_CONNECT_URL_PARAMS_NAME="__did-connect__",BUSY_STATUS=["scanned","succeed","error","busy"],EXT_DOWNLOAD_URL={chrome:"https://chromewebstore.google.com/detail/did-wallet/ibjflpbmadchofnbpppegdbnifdgincp",edge:"https://microsoftedge.microsoft.com/addons/detail/did-wallet/hjgoblidjnnnamdkinbichnfbmghmafd"},CHECK_STATUS_INTERVAL=2*1e3,VERIFY_CODE_LENGTH$2=6,LANG_COOKIE_NAME="nf_lang",CHECK_INTERVAL_TIME=1e3;class NotOpenError extends Error{constructor(){super("Failed to open popup")}}const providerName="wallet_url",getWebWalletUrl=()=>{var a,u;return window.localStorage.getItem(providerName)||((a=window.env)==null?void 0:a.webWalletUrl)||((u=window.blocklet)==null?void 0:u.webWalletUrl)||"https://web.abtwallet.io/"},checkSameProtocol=a=>{const{protocol:u}=window.location;let _="";try{_=new URL(a).protocol}catch{_=""}return u===_},{version:version$2}=pkg,debug$2=createDebug("did-connect"),logger$2=createLogger$1("did-connect");function unescape$1(a){return(a+"===".slice((a.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/")}function escape$2(a){return a.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}const encodeConnectUrl=a=>escape$2(window.btoa(a)),decodeConnectUrl=a=>window.atob(unescape$1(a)),parseTokenFromConnectUrl=a=>{const u=new URL(a),_=decodeURIComponent(u.searchParams.get("url"));return new URL(_).searchParams.get("_t_")},getAppId$1=(a,u)=>{var E,S,C;let _=u==null?void 0:u.publisher;if(!_){if(a!=null&&a.agentDid)return a.agentDid;_=a==null?void 0:a.publisher}return _?_.replace("did:abt:",""):((E=globalThis.blocklet)==null?void 0:E.appPid)||((S=globalThis.blocklet)==null?void 0:S.appId)||((C=globalThis.env)==null?void 0:C.appId)||""},getConnectedInfo=a=>{var _;const u={connected_did:a.did||"",connected_pk:a.pk||"",connected_app:getAppId$1(a.appInfo,a.memberAppInfo)};return(_=a==null?void 0:a.connectedWallet)!=null&&_.os&&(u.connected_wallet_os=a.connectedWallet.os),u},updateConnectedInfo=(a,u=!1)=>{if(!a)return;u||(a=getConnectedInfo(a));const _=getCookieOptions({expireInDays:7,returnDomain:!1});!isNil(a.connected_did)&&!isNil(a.connected_pk)&&lib$3.isValid(a.connected_did)&&lib$3.isFromPublicKey(a.connected_did,a.connected_pk)&&(Cookies.set("connected_did",a.connected_did,_),Cookies.set("connected_pk",a.connected_pk,_)),!isNil(a.connected_app)&&lib$3.isValid(a.connected_app)&&Cookies.set("connected_app",a.connected_app,_),a.connected_wallet_os&&Cookies.set("connected_wallet_os",a.connected_wallet_os,_)},encodeKey=a=>escape$2(Buffer$1$1.from(a).toString("base64")),decodeKey=a=>Uint8Array.from(Buffer$1$1.from(unescape$1(a),"base64")),decrypt$1=(a,u,_)=>{const E=SealedBox.open(Uint8Array.from(Buffer$1$1.from(a,"base64")),decodeKey(u),decodeKey(_));return JSON.parse(Buffer$1$1.from(E).toString("utf8"))},encrypt=(a,u)=>Buffer$1$1.from(SealedBox.seal(Uint8Array.from(Buffer$1$1.from(a)),decodeKey(u))).toString("base64"),parseNextWorkflow=(a,u="_t_")=>{const _=new URL(a),E={baseUrl:_.origin,prefix:_.pathname.replace(/\/auth$/,""),token:_.searchParams.get(u)||""};if(!E.baseUrl)throw new Error("Invalid next workflow: origin empty");if(!E.token)throw new Error("Invalid next workflow: token not found");return E},getApiErrorMessage=(a,u)=>{var S,C;let _=a.message;const{response:E}=a;return E&&(_=((S=E.data)==null?void 0:S.error)||((C=E.data)==null?void 0:C.message)||E.data||u,_=typeof _=="object"?u:_),_},getWebAuthnErrorMessage=(a,u,_)=>{if(!a)return a;if(!a.name)return getApiErrorMessage(a,u);switch(a.name){case"NotAllowedError":return _?_("webauthn.error.canceled"):"Authentication was canceled";case"SecurityError":return _?_("webauthn.error.security"):"A security error occurred during authentication";case"NotSupportedError":return _?_("webauthn.error.notSupported"):"This browser does not support passkey authentication";case"AbortError":return _?_("webauthn.error.aborted"):"Authentication was aborted";default:return console.warn("Unhandled WebAuthn error type:",a.name),getApiErrorMessage(a,u)}},createAxios=(a={},{lazy:u=!1,lazyTime:_=300}={})=>{const E={...a.headers,"x-did-connect-version":version$2},S=createAxios$2({...a,headers:E},{lazy:u,lazyTime:_});return S.interceptors.request.use(C=>{const T=getVisitorId$1();return T&&(C.headers["x-blocklet-visitor-id"]=T),C}),S},sleep=(a=0)=>new Promise(u=>{setTimeout(()=>{u()},a)});function getBrowserLang(){if(typeof window>"u")return null;const a=window.navigator.languages&&window.navigator.languages[0]||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage||window.navigator.systemLanguage||null;return{"zh-CN":"zh","zh-TW":"zh",zh:"zh",en:"en"}[a]||"en"}function formatCacheTtl(a,u){return[void 0,null,""].includes(a)?u:a/86400}async function decodeUrlParams(){const a=window.location.href;try{const u=new URL(a),_=u.searchParams.get(DID_CONNECT_URL_PARAMS_NAME);if(_){u.searchParams.delete(DID_CONNECT_URL_PARAMS_NAME);const E=JSON.parse(Buffer$1$1.from(_,"base64").toString("utf-8"));if(isString$2(E.forceConnected)&&isUndefined$2(E.sourceAppPid)){const C=await new BlockletSDK().user.getUserPublicInfo({did:E.forceConnected});isUndefined$2(C==null?void 0:C.sourceAppPid)||(E.sourceAppPid=C.sourceAppPid)}return{params:E,url:u.href}}}catch{console.warn("Failed to decode did-connect url params")}return{params:null,url:a}}const openPopup=(a,{width:u=680,height:_=720,name:E="did-connect:popup",offsetX:S=0,offsetY:C=0}={})=>{const T=getSafeUrl(a,{allowDomains:null}),P=window.screenX+(window.innerWidth-u)/2+S,O=window.screenY+(window.innerHeight-_)/2+C,D=[`left=${P}`,`top=${O}`,`width=${u}`,`height=${_}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],M=window.open("",E,D.join(","));if(M===null)throw new NotOpenError;return M.location.href=withQuery(T,{opener:window.location.origin}),M},runPopup=a=>new Promise((u,_)=>{let E,S;const C=({data:T})=>{if(T&&T.type==="authorization_response"){if(T!=null&&T.error){console.error(T.error);return}setTimeout(()=>{var P;(P=a.popup)==null||P.close(),clearTimeout(S),clearInterval(E),window.removeEventListener("message",C,!1),u(T)},a.closeTimeout||0)}};S=setTimeout(()=>{clearInterval(E),_(new Error("Timeout")),window.removeEventListener("message",C,!1)},(a.timeoutInSeconds||DEFAULT_WINDOW_TIMEOUT)*1e3),E=setInterval(()=>{var T;(T=a.popup)!=null&&T.closed&&(clearInterval(E),clearTimeout(S),window.removeEventListener("message",C,!1),_(new Error("Popup closed")))},1e3),window.addEventListener("message",C)});function WindowFocusAware({callback:a}){const u=useDebounceFn(a),_=useMemoizedFn(()=>{document.hidden||u.run()});return reactExports.useEffect(()=>(window.addEventListener("focus",u.run),document.addEventListener("visibilitychange",_),()=>{window.removeEventListener("focus",u.run),document.removeEventListener("visibilitychange",_)}),[]),null}WindowFocusAware.propTypes={callback:PropTypes.func.isRequired};var Uo;const DID_SPACES_BASE_URL=((Uo=window==null?void 0:window.blocklet)==null?void 0:Uo.DID_SPACES_BASE_URL)||"https://www.didspaces.com/app",DID_SPACES_DID="z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf";class Space{constructor({token:u}){this.token=u,this.prefix=this.getPrefix()}async createForOAuthAccount(){const{data:u}=await axios.put(joinURL(this.prefix,"/api/space/createForOAuthAccount"),{},{headers:{Authorization:`Bearer ${this.token}`,"x-csrf-token":getCSRFToken()}});return u}async authorizeAppForOAuthAccount({extraParams:u}){await this.createForOAuthAccount();const{data:_}=await axios.put(joinURL(this.prefix,"/api/space/authorizeAppForOAuthAccount"),{app:{metadata:{},...u}},{headers:{Authorization:`Bearer ${this.token}`,"x-csrf-token":getCSRFToken()}});return _}getPrefix(){const u=window.blocklet.componentMountPoints.find(_=>_.did===DID_SPACES_DID);return u==null?void 0:u.mountPoint}}function CardSelector({list:a=[],width:u=300,height:_=400,cardSpace:E=40,onSelect:S=noop$6,defaultIndex:C=0}){const[T,P]=reactExports.useState(0),[O,D]=reactExports.useState(0),M=reactExports.useRef(null),B=X=>{if(!(X<0||X>a.length-1)){if(P(X),M.current){const ie=M.current.clientWidth;D(X*(u+E)-(ie-u)/2+E*.5)}S(X)}};reactExports.useEffect(()=>{var X;B(C),(X=M.current)==null||X.addEventListener("touchmove",ie=>ie.preventDefault(),{passive:!1})},[]);let U;const H=X=>{U=X.touches[0].clientX},J=X=>{const ie=X.changedTouches[0],oe=U-ie.clientX;Math.abs(oe)>60&&(oe>0?B(T+1):B(T-1))};return jsxRuntimeExports.jsx(Container$7,{ref:M,onTouchStart:H,onTouchEnd:J,children:jsxRuntimeExports.jsx("div",{className:"card-container",style:{transform:`translate(${-O}px, 0)`},children:a.map((X,ie)=>X instanceof Function?jsxRuntimeExports.jsx("div",{className:`card-item ${ie===T?"selected":""}`,style:{width:u,height:_,margin:E/2},onClick:()=>B(ie),children:X(ie)},ie):jsxRuntimeExports.jsx("div",{className:`card-item ${ie===T?"selected":""}`,style:{width:u,height:_,margin:E/2},onClick:()=>B(ie),children:jsxRuntimeExports.jsx("img",{src:X.src,alt:X.name})},ie))})})}const Container$7=newStyled.div`
250
250
  overflow: hidden;
251
251
  mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
252
252
  overflow: hidden;