@abtnode/webapp 1.16.53-beta-20251011-095147-8bd212c5 → 1.16.53-beta-20251013-005429-ca3b05de
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-CeksOrhl.js → AdapterDayjs-wz3uJn5Q.js} +1 -1
- package/dist/assets/{Add-C8Lm-hkR.js → Add-Cous1ji5.js} +1 -1
- package/dist/assets/ArrowDropDown-BmpWVT5T.js +1 -0
- package/dist/assets/{Autocomplete-BQrCutXD.js → Autocomplete-rgPa6avl.js} +1 -1
- package/dist/assets/{Breadcrumbs-CjoKrRSd.js → Breadcrumbs-BkQr1wmD.js} +1 -1
- package/dist/assets/{ButtonGroup-0m6xN_hM.js → ButtonGroup-8swvzNFE.js} +1 -1
- package/dist/assets/{CSSTransition-r6UVh1d4.js → CSSTransition-BoWO2BoO.js} +1 -1
- package/dist/assets/{CallMerge-Dw8aSOXl.js → CallMerge-anZI78Di.js} +1 -1
- package/dist/assets/{CardContent-Dn4qVn0M.js → CardContent-DNK9-zja.js} +1 -1
- package/dist/assets/{ChevronLeft-vJUfXHLK.js → ChevronLeft-CJzdK2eh.js} +1 -1
- package/dist/assets/{ChevronRight-CBhWmXPb.js → ChevronRight-DLMDPIak.js} +1 -1
- package/dist/assets/{Clear-Dm80eYkN.js → Clear-DgL5cnLN.js} +1 -1
- package/dist/assets/{DeleteOutline-DBp8IxLy.js → DeleteOutline-BJandZby.js} +1 -1
- package/dist/assets/{Done-C3L_U1d0.js → Done-C1929K34.js} +1 -1
- package/dist/assets/{Edit-T8wWfQhn.js → Edit-CQdeHbZ-.js} +1 -1
- package/dist/assets/{ErrorOutline-DDgW0IIs.js → ErrorOutline-4kGDns30.js} +1 -1
- package/dist/assets/{FilterList-DOx5uN4S.js → FilterList-DcRJLB8M.js} +1 -1
- package/dist/assets/{Google-DT749Dih.js → Google-CWXy-_sb.js} +1 -1
- package/dist/assets/{HelpOutline-Y8yJx9_1.js → HelpOutline-UUyOHo3U.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-Vjm82N0l.js → KeyboardArrowDown-CgD9B0AF.js} +1 -1
- package/dist/assets/{Launch-CbU-zIFy.js → Launch-CryEv1ts.js} +1 -1
- package/dist/assets/{Link-C1xLiB79.js → Link-Dk7IQFgE.js} +1 -1
- package/dist/assets/{ListItemButton-ClnowAwh.js → ListItemButton-B2QtbVrs.js} +1 -1
- package/dist/assets/{ListSubheader-DBKVdByu.js → ListSubheader-BNX9gO02.js} +1 -1
- package/dist/assets/{LoadingButton-Cyu7epth.js → LoadingButton-D7vBmBXb.js} +1 -1
- package/dist/assets/{MoreVert-Dt9p1lZE.js → MoreVert-D4eir2r_.js} +1 -1
- package/dist/assets/{OpenInNew-SrFDopIl.js → OpenInNew-BRfvIkPw.js} +1 -1
- package/dist/assets/{Refresh-DibDVagJ.js → Refresh-CEzviXq3.js} +1 -1
- package/dist/assets/{Search-DUF2osvO.js → Search-CJFu7Gaf.js} +1 -1
- package/dist/assets/{Stepper-CTMouRdp.js → Stepper-JC9uh-tv.js} +1 -1
- package/dist/assets/{Switch-DVmHUng5.js → Switch-D89bFzHz.js} +1 -1
- package/dist/assets/{TableSearch-x3y0kzP6.js → TableSearch-I0DQoJkT.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-CDxsnBYJ.js → ToggleButtonGroup-B4BB2eWk.js} +1 -1
- package/dist/assets/{UnfoldMore-DfHvwMX2.js → UnfoldMore-Bi3VKM-P.js} +1 -1
- package/dist/assets/{Verified-RZDxPBl3.js → Verified-CNu8DyFD.js} +1 -1
- package/dist/assets/{VerifiedUser-C5GKL4NI.js → VerifiedUser-Du1UW169.js} +1 -1
- package/dist/assets/{ViewList-BIasqeLT.js → ViewList-CJ3pgiPv.js} +1 -1
- package/dist/assets/{_createAggregator-CT54gRWr.js → _createAggregator-BrIYaxG5.js} +1 -1
- package/dist/assets/{actions-Bkf_XgjE.js → actions-DiTDvakV.js} +1 -1
- package/dist/assets/{actions-BTo9FCWY.js → actions-qegZDW8a.js} +1 -1
- package/dist/assets/{agreement-V0j80REH.js → agreement-DYlE38yc.js} +1 -1
- package/dist/assets/api-DK8kaMBV.js +1 -0
- package/dist/assets/{appearance-CaphgLyB.js → appearance-DMbZwb6t.js} +1 -1
- package/dist/assets/{audit-logs-BwQjwQRC.js → audit-logs-DypXoccn.js} +1 -1
- package/dist/assets/{base-chart-C5PdAmLw.js → base-chart-BIsr5drw.js} +1 -1
- package/dist/assets/{blocklet-qrkDxr_e.js → blocklet-B517W-Ua.js} +1 -1
- package/dist/assets/{chain-CA7TjYnf.js → chain-DPDA2EQ2.js} +1 -1
- package/dist/assets/{click-to-copy-Pl4hIypx.js → click-to-copy-3JN8Y4Er.js} +1 -1
- package/dist/assets/client-CBX1Obzh.js +1 -0
- package/dist/assets/cloneDeep-Djkce8fU.js +1 -0
- package/dist/assets/{collapse-DASgp2d0.js → collapse-BKLgvOSl.js} +1 -1
- package/dist/assets/{config-navigation-DDLekmi-.js → config-navigation-BFkTbhwh.js} +3 -3
- package/dist/assets/{connect-to-Bi6Hyl3q.js → connect-to-eFzWXxED.js} +1 -1
- package/dist/assets/{cssMode-C7ESlTK9.js → cssMode-DkRpF_PR.js} +1 -1
- package/dist/assets/{delete-confirm-B-r93j03.js → delete-confirm-CDl-fsIJ.js} +1 -1
- package/dist/assets/{depsEqual-DfTLPdgg.js → depsEqual-CSi6TcQv.js} +1 -1
- package/dist/assets/{detail-BD2IFxMv.js → detail-Duk87a8e.js} +3 -3
- package/dist/assets/{domains-C4W6m2uy.js → domains-CyLqrsuU.js} +1 -1
- package/dist/assets/{download-CehHaiXA.js → download-C0UDp2VI.js} +1 -1
- package/dist/assets/{edit.svg-BLR5epzr.js → edit.svg-BePrNRJc.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-CTjwgjTJ.js +1 -0
- package/dist/assets/engine-DSc6bLAX.js +1 -0
- package/dist/assets/{freemarker2-DfzPp9s6.js → freemarker2-D5qOoEBh.js} +1 -1
- package/dist/assets/{get-safe-url-CumOcp7c.js → get-safe-url-CUMicCqh.js} +1 -1
- package/dist/assets/getValidReactChildren-B5PKhq5Y.js +1 -0
- package/dist/assets/{graphqlMode-CsAQlaEf.js → graphqlMode-BiufiH9I.js} +2 -2
- package/dist/assets/{handlebars-CA_-cqDJ.js → handlebars-C0jC6CCl.js} +1 -1
- package/dist/assets/{html-C9RxEE-e.js → html-CFsvvZoo.js} +1 -1
- package/dist/assets/{html-title-3CG5UyIt.js → html-title-DVCSq6YQ.js} +1 -1
- package/dist/assets/{htmlMode-uPtGYFj3.js → htmlMode-CosfhNHV.js} +1 -1
- package/dist/assets/{iframe-aJ3sDUVb.js → iframe-D0APLep4.js} +1 -1
- package/dist/assets/{index-CLPR7ihj.js → index-0z8Wehkl.js} +1 -1
- package/dist/assets/{index-BiOrweAN.js → index-14CzihO_.js} +1 -1
- package/dist/assets/{index-CyD53ctP.js → index-8dO6vHSp.js} +1 -1
- package/dist/assets/{index-DD8ntqdX.js → index-B3tyE5tE.js} +1 -1
- package/dist/assets/{index-BOjR9vg6.js → index-BFsyziHN.js} +1 -1
- package/dist/assets/{index-B_DdwI_f.js → index-BNZdZk2f.js} +1 -1
- package/dist/assets/{index-CLAxAmz7.js → index-BOhdDUAw.js} +1 -1
- package/dist/assets/{index-E_CTV0v0.js → index-BP2ItssN.js} +1 -1
- package/dist/assets/{index-CuYfzE9Z.js → index-Bae9JCD5.js} +1 -1
- package/dist/assets/{index-apvSg0Un.js → index-BelkuInn.js} +1 -1
- package/dist/assets/{index-BmgIzODJ.js → index-BeysmFqb.js} +1 -1
- package/dist/assets/{index-CAv2tOhi.js → index-BnsRewaA.js} +1 -1
- package/dist/assets/index-BnwXywaJ.js +1 -0
- package/dist/assets/{index-DzOEPYi6.js → index-Bp3J1Bje.js} +9 -9
- package/dist/assets/{index-CtVrHc87.js → index-C-oEFt7E.js} +1 -1
- package/dist/assets/{index-0slfmis0.js → index-C0-id_9j.js} +1 -1
- package/dist/assets/{index-CeEola33.js → index-C6h7Wn7k.js} +2 -2
- package/dist/assets/{index-w74fQNNd.js → index-CDcSsFCi.js} +1 -1
- package/dist/assets/{index-3bOYCU_O.js → index-CHCOmcv5.js} +3 -3
- package/dist/assets/{index-DIS4k28C.js → index-CazcQIXS.js} +1 -1
- package/dist/assets/{index-DX626HNP.js → index-CbcxUqJf.js} +1 -1
- package/dist/assets/{index-DQ7-a_Yl.js → index-CwJ8EMCg.js} +1 -1
- package/dist/assets/{index-BsMctdy8.js → index-D82JKtTS.js} +1 -1
- package/dist/assets/{index-BXCHVLcm.js → index-D8YITHzH.js} +1 -1
- package/dist/assets/{index-DmvJyGWn.js → index-DBBnAIQs.js} +1 -1
- package/dist/assets/{index-BIbaiVup.js → index-DDurY-dJ.js} +8 -8
- package/dist/assets/{index-3tLE8Mjd.js → index-DFYle5Dx.js} +3 -3
- package/dist/assets/{index-5b60aMk8.js → index-DMT33Ol-.js} +1 -1
- package/dist/assets/{index-UhL8ZNVc.js → index-DPFLhZbE.js} +3 -3
- package/dist/assets/{index-DUhy4qU3.js → index-DRg3WiNb.js} +1 -1
- package/dist/assets/{index-DW2RdjBK.js → index-DYwPfkqM.js} +1 -1
- package/dist/assets/{index-CEfdMhRs.js → index-Dt6-hLLE.js} +1 -1
- package/dist/assets/{index-B0iEGhMY.js → index-DufKOlby.js} +1 -1
- package/dist/assets/{index-B2EpuvFX.js → index-DvuAChUi.js} +1 -1
- package/dist/assets/{index-BdNOQK8-.js → index-DxNJKgOf.js} +1 -1
- package/dist/assets/{index-BPsgcLTY.js → index-NuRrhPxS.js} +1 -1
- package/dist/assets/{index-CS7Cpww7.js → index-OLtm4Vax.js} +1 -1
- package/dist/assets/{index-ZGV5ibHs.js → index-WMqkdikj.js} +1 -1
- package/dist/assets/{index-0Dj9yC88.js → index-XPz8QVj4.js} +1 -1
- package/dist/assets/{index-B27Mzk9d.js → index-a5z0oLm0.js} +1 -1
- package/dist/assets/{index-C-p8VUs-.js → index-djmnhckV.js} +1 -1
- package/dist/assets/{index-Bb2FNNL0.js → index-iKywF7nl.js} +1 -1
- package/dist/assets/{index-BuQjZmfi.js → index-p_tMzvnc.js} +1 -1
- package/dist/assets/{index-CsTazi5p.js → index-r-glRWC4.js} +1 -1
- package/dist/assets/{index-CoZAeEqA.js → index-vAWTvgNz.js} +1 -1
- package/dist/assets/{index-DJuZ9nhg.js → index-z2Pq7re4.js} +2 -2
- package/dist/assets/{index.esm-CUQzywxe.js → index.esm-11mV4JTB.js} +1 -1
- package/dist/assets/{install-from-url-D1dFcWCR.js → install-from-url-DDvu1So2.js} +1 -1
- package/dist/assets/{invitation-DFyK6TJC.js → invitation-CAfUwKLF.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-CiLM8lGB.js → is-path-prefix-equal-BSrFrDnM.js} +1 -1
- package/dist/assets/{item-TSYlBggO.js → item-BVShF35E.js} +1 -1
- package/dist/assets/{javascript-EM--ygX_.js → javascript-C-mWITaw.js} +1 -1
- package/dist/assets/{jsonMode-DH-rRMEi.js → jsonMode-zsidC2jX.js} +1 -1
- package/dist/assets/{liquid-CPNnvOnm.js → liquid-DLrpRYGV.js} +1 -1
- package/dist/assets/{list-header-CSkrCQnJ.js → list-header-D7AmzBnQ.js} +1 -1
- package/dist/assets/{lock.svg-f30K2Q3n.js → lock.svg-BSMyvmiX.js} +1 -1
- package/dist/assets/{log-BNvsxBZM.js → log-BUaBiHj2.js} +1 -1
- package/dist/assets/{lottie-react.esm-DrKTtVJH.js → lottie-react.esm-BECODwEW.js} +1 -1
- package/dist/assets/{mdx-D8UbuZxT.js → mdx-Dg0NgEhj.js} +1 -1
- package/dist/assets/{memory-C-FNQnOM.js → memory-CYfF9LNL.js} +1 -1
- package/dist/assets/{metric-DLT0xGvO.js → metric-D_Rq7u0J.js} +1 -1
- package/dist/assets/omit-CoM-kG66.js +1 -0
- package/dist/assets/{overview-BlGEtn8-.js → overview-Bf0RacwG.js} +1 -1
- package/dist/assets/{permission-DNpvmcDO.js → permission-CE3f6duj.js} +1 -1
- package/dist/assets/{preference-u7m9CcMY.js → preference-uMowSkVr.js} +3 -3
- package/dist/assets/{python-B8mnJBlR.js → python-D4iKigf3.js} +1 -1
- package/dist/assets/{raf-schd.esm-YM3QK6AK.js → raf-schd.esm-PaDKXX52.js} +1 -1
- package/dist/assets/{razor-DojlprmT.js → razor-a6RZRy4M.js} +1 -1
- package/dist/assets/{rotate-session-key-CeXBuq4a.js → rotate-session-key-D08RekVV.js} +1 -1
- package/dist/assets/{runtime-DGPwslIs.js → runtime-DK4a2zRH.js} +1 -1
- package/dist/assets/schema-BXwrjjXM.js +1 -0
- package/dist/assets/sdk-Z_sZEcD1.js +1 -0
- package/dist/assets/{service-MFlOMoBK.js → service-D-5L0qMb.js} +1 -1
- package/dist/assets/{shorten-label-DZAvaXjZ.js → shorten-label-CnHc5b4P.js} +1 -1
- package/dist/assets/{simple-select-BOihC2wB.js → simple-select-AxSwGalf.js} +1 -1
- package/dist/assets/{spaces-C9qYfO4e.js → spaces-cJ664FRt.js} +1 -1
- package/dist/assets/{status-DD9VFS3g.js → status-BpSJKdrt.js} +1 -1
- package/dist/assets/{status-Mggvc_gJ.js → status-CqsLbSWy.js} +1 -1
- package/dist/assets/{switch-control-C6Td5SBH.js → switch-control-DoypOh17.js} +1 -1
- package/dist/assets/{table-icons-LMjLX7nG.js → table-icons-BB3WCZ0c.js} +1 -1
- package/dist/assets/{team-CMHYwDgb.js → team-CzLA5Wke.js} +1 -1
- package/dist/assets/{toLower-CTEP5nFX.js → toLower-DwM8Y4G7.js} +1 -1
- package/dist/assets/toUpper-DkAQpneV.js +1 -0
- package/dist/assets/{traffic-z7f03zNE.js → traffic-BvD_sqrg.js} +1 -1
- package/dist/assets/{tsMode-lGeC_vCj.js → tsMode-Dk3hYncm.js} +1 -1
- package/dist/assets/{typescript-DiGD7n7I.js → typescript-BWhP65F5.js} +1 -1
- package/dist/assets/{url-evaluation-PoqA_faF.js → url-evaluation-CeV7iBRh.js} +1 -1
- package/dist/assets/{url-join-C-ehcRI1.js → url-join-CSV8j2nv.js} +1 -1
- package/dist/assets/{use-mobile-v5_YeznP.js → use-mobile-DT5aSwoH.js} +1 -1
- package/dist/assets/{use-mobile-GbhQCYjE.js → use-mobile-Dwu9jRCW.js} +1 -1
- package/dist/assets/{useAsync-C9kvrJTF.js → useAsync-d2jpJBOI.js} +1 -1
- package/dist/assets/{useAsyncRetry-C1G4OCyZ.js → useAsyncRetry-CFOUpvIi.js} +1 -1
- package/dist/assets/{useLocalStorage-rIF260NZ.js → useLocalStorage-CFg3RYoG.js} +1 -1
- package/dist/assets/{useThemeProps-CIXT-uHm.js → useThemeProps-DDkjiDuo.js} +1 -1
- package/dist/assets/{util-daXkBzvl.js → util-gAeFf-vQ.js} +1 -1
- package/dist/assets/{wait-container-DcvUvcI3.js → wait-container-DINf0squ.js} +1 -1
- package/dist/assets/{without-wallet-Cifhravr.js → without-wallet-Bpmf04-L.js} +1 -1
- package/dist/assets/{wrap-locale-CTx-eXFm.js → wrap-locale-C7tS6amm.js} +1 -1
- package/dist/assets/{xml-PLx49qdR.js → xml-CyGyMNDw.js} +1 -1
- package/dist/assets/{yaml-DrWuPUdc.js → yaml-D-MTb9Eh.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-D3yioOpG.js +0 -1
- package/dist/assets/api-CUhmsggO.js +0 -1
- package/dist/assets/client-CPdeHHs9.js +0 -1
- package/dist/assets/cloneDeep-LYTwa-JV.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-DZEVfVIs.js +0 -1
- package/dist/assets/engine-CXYcW8tV.js +0 -1
- package/dist/assets/getValidReactChildren-BKEsPaXS.js +0 -1
- package/dist/assets/index-DQq1Zt3Z.js +0 -1
- package/dist/assets/omit-Cok1Xpup.js +0 -1
- package/dist/assets/schema-KXHYgx_0.js +0 -1
- package/dist/assets/sdk-DfZRIh46.js +0 -1
- package/dist/assets/toUpper-BtDx3pcE.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as createSvgIcon,j as jsxRuntimeExports,r as reactExports$1,o,bd as getDefaultExportFromCjs,F as useMediaQuery,s as styled,dp as Skeleton,cQ as M$1,Z as CheckIcon,ay as Tooltip,dI as Button,T as Typography,M as Box,C as CircularProgress,f as useTheme,dC as isObject,f0 as mergeThemeOptions,f1 as StyledEngineProvider,f2 as ThemeProvider,f3 as ThemeProvider$1,f4 as s,Y as o$1,b8 as styled$1,f5 as CloseIcon,cF as Buffer,be as U,bF as __vitePreload,dH as noop,de as l$2}from"./index-
|
|
1
|
+
import{aF as createSvgIcon,j as jsxRuntimeExports,r as reactExports$1,o,bd as getDefaultExportFromCjs,F as useMediaQuery,s as styled,dp as Skeleton,cQ as M$1,Z as CheckIcon,ay as Tooltip,dI as Button,T as Typography,M as Box,C as CircularProgress,f as useTheme,dC as isObject,f0 as mergeThemeOptions,f1 as StyledEngineProvider,f2 as ThemeProvider,f3 as ThemeProvider$1,f4 as s,Y as o$1,b8 as styled$1,f5 as CloseIcon,cF as Buffer,be as U,bF as __vitePreload,dH as noop,de as l$2}from"./index-z2Pq7re4.js";import{j as joinUrl}from"./url-join-CSV8j2nv.js";const l$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"})),d$2=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")]),k$2=reactExports$1.createContext(),{Provider:w$3}=k$2,d$1=(C,F,V=window.location.pathname.replace(/\/$/,"/"))=>C?F?C===V:new RegExp(C).test(V):!1;function P({children:C,steps:F,mode:V="history"}){const[D,B]=reactExports$1.useState("");!D&&F.length&&B(F[0].key);const O=F.map(X=>X.children?[{key:X.key,hasChild:!0},X.children.map(at=>({parentKey:X.key,key:at.key}))]:{key:X.key}).flat(1/0),j=O.filter(X=>!X.hasChild),H=X=>{let at;const rt=O.findIndex(ft=>ft.key===D?(at=ft.parentKey,!0):!1);if(at===X)return"current";const tt=O.findIndex(ft=>ft.key===X);if(tt!==-1){if(tt===rt)return"current";if(tt<rt)return"before"}return"after"};function G(X){B(X)}function K(X){if(typeof X=="function"){const at=X(j.findIndex(rt=>rt.key===D));B(j[at].key)}else B(j[X].key)}const it=j.findIndex(X=>X.key===D);reactExports$1.useEffect(()=>{if(V==="history"){let X="";F.some(at=>at.children&&at.children.length?at.children.some(rt=>d$1(rt.path,rt.exact)?(X=rt.key,!0):!1):d$1(at.path,at.exact)?(X=at.key,!0):!1),X&&B(X)}return()=>{}},[F,V]);const ot={steps:F,totalStepsCount:j.length,getStepStatus:H,setActiveStepByKey:G,setActiveStepByIndex:K,activeStep:it,canBackToStep:X=>V==="memory"&&it!==0&&X<it};return jsxRuntimeExports.jsx(w$3,{value:ot,children:C})}function T$1(){return reactExports$1.use(k$2)}P.propTypes={children:o.any.isRequired,steps:o.array.isRequired,mode:o.string};var lib,hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var C=Object.prototype.hasOwnProperty,F=Object.prototype.toString;function V(D){if(D==null)return!0;if(typeof D=="boolean")return!1;if(typeof D=="number")return D===0;if(typeof D=="string"||typeof D=="function"||Array.isArray(D))return D.length===0;if(D instanceof Error)return D.message==="";if(D.toString==F)switch(D.toString()){case"[object File]":case"[object Map]":case"[object Set]":return D.size===0;case"[object Object]":{for(var B in D)if(C.call(D,B))return!1;return!0}}return!1}return lib=V,lib}var libExports=requireLib();const k$1=getDefaultExportFromCjs(libExports),S=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,t$1={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},a$1=C=>t$1[C]?t$1[C]:t$1.en,i=C=>C==="zh"?"启动":"Launching",g$2=C=>C?.title||C?.name||"";function T({blockletMeta:C={},subTitle:F="",logoUrl:V="",locale:D="",navLogo:B="",loading:O=!1}){const j=useMediaQuery(ot=>ot.breakpoints.down("md")),H=j?18:48,G=reactExports$1.useRef(null),[K,it]=reactExports$1.useState("");return reactExports$1.useEffect(()=>{G.current&&G.current.offsetHeight>34&&(K===""?it("middle"):K==="middle"&&it("small"))},[K]),jsxRuntimeExports.jsxs(R,{className:K==="small"?"center-mode":"",children:[j?jsxRuntimeExports.jsx("div",{className:"app-icon",children:B}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[O&&jsxRuntimeExports.jsx(I,{blockletSize:H,isMobile:j}),!O&&jsxRuntimeExports.jsx(u$1,{blockletSize:H,logoUrl:V})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[j&&F&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:F}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!j&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:F||i(D)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${K==="middle"||K==="small"?"middle-size":""}`,ref:G,children:jsxRuntimeExports.jsx(w$2,{logoUrl:V,isMobile:j,blockletMeta:C,blockletSize:H,loading:O})})]})]})]})}T.propTypes={blockletMeta:o.object,subTitle:o.any,logoUrl:o.string,locale:o.string,navLogo:o.any,loading:o.bool};function I({blockletSize:C,isMobile:F}){return F?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:C,height:C})}function u$1({logoUrl:C,blockletSize:F}){return jsxRuntimeExports.jsx(M$1,{width:F,height:F,src:C,alt:"blocklet icon",fallback:S,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${C}`)}function w$2({isMobile:C,logoUrl:F,blockletMeta:V={},blockletSize:D,loading:B}){const O=g$2(V);return B?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):k$1(V)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):C?jsxRuntimeExports.jsxs(L$1,{children:[jsxRuntimeExports.jsx(u$1,{blockletSize:D,logoUrl:F}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:g$2(V)})]}):jsxRuntimeExports.jsx(E,{className:"app-link",target:"_blank",href:joinUrl(V?.registryUrl||"",`/blocklets/${V?.did}`),title:O,children:O})}const L$1=styled.div`
|
|
2
2
|
.ellipsis-title {
|
|
3
3
|
flex: 1;
|
|
4
4
|
position: absolute;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-WMqkdikj.js","./index-BojVbZw0.js","./index-0z8Wehkl.js","./metric-D_Rq7u0J.js","./click-to-copy-3JN8Y4Er.js","./index-DufKOlby.js","./useLocalStorage-CFg3RYoG.js","./index-DxNJKgOf.js","./FilterList-DcRJLB8M.js","./CSSTransition-BoWO2BoO.js","./emotion-cache.browser.esm-CTjwgjTJ.js","./index-CwJ8EMCg.js","./redux-DfszZyTl.js","./typeof-QjJsDpFa.js","./depsEqual-CSi6TcQv.js","./index-p_tMzvnc.js","./TableSearch-I0DQoJkT.js","./Search-CJFu7Gaf.js","./Clear-DgL5cnLN.js","./MoreVert-D4eir2r_.js","./status-BpSJKdrt.js","./actions-DiTDvakV.js","./url-evaluation-CeV7iBRh.js","./get-safe-url-CUMicCqh.js","./ButtonGroup-8swvzNFE.js","./getValidReactChildren-B5PKhq5Y.js","./permission-CE3f6duj.js","./install-from-url-DDvu1So2.js","./without-wallet-Bpmf04-L.js","./index-B3tyE5tE.js","./cloneDeep-Djkce8fU.js","./Autocomplete-rgPa6avl.js","./ListSubheader-BNX9gO02.js","./ListItemButton-B2QtbVrs.js","./Stepper-JC9uh-tv.js","./Launch-CryEv1ts.js","./Add-Cous1ji5.js","./index-XPz8QVj4.js","./schema-BXwrjjXM.js","./index-DBBnAIQs.js","./toLower-DwM8Y4G7.js","./index-vAWTvgNz.js","./url-join-CSV8j2nv.js","./wait-container-DINf0squ.js","./use-mobile-Dwu9jRCW.js","./DeleteOutline-BJandZby.js","./spaces-cJ664FRt.js","./api-DK8kaMBV.js","./index-CbcxUqJf.js","./item-BVShF35E.js","./index-BFsyziHN.js","./KeyboardArrowDown-CgD9B0AF.js","./ChevronLeft-CJzdK2eh.js","./ChevronRight-DLMDPIak.js","./blocklet-B517W-Ua.js","./Verified-CNu8DyFD.js","./VerifiedUser-Du1UW169.js","./Done-C1929K34.js","./delete-confirm-CDl-fsIJ.js","./item-G0iZE90Q.css","./engine-DSc6bLAX.js","./ArrowDropDown-BmpWVT5T.js","./Breadcrumbs-BkQr1wmD.js","./index-C0-id_9j.js","./html-title-DVCSq6YQ.js","./index.esm-11mV4JTB.js","./switch-control-DoypOh17.js","./Switch-D89bFzHz.js","./Link-Dk7IQFgE.js","./logo-BKA11TRi.js","./Refresh-CEzviXq3.js","./LoadingButton-D7vBmBXb.js","./rotate-session-key-D08RekVV.js","./visuallyHidden-Dan1xhjv.js","./is-path-prefix-equal-BSrFrDnM.js","./Edit-CQdeHbZ-.js","./CallMerge-anZI78Di.js","./CardContent-DNK9-zja.js","./index-DYwPfkqM.js","./download-C0UDp2VI.js","./index-DRg3WiNb.js","./audit-logs-DypXoccn.js","./index-r-glRWC4.js","./decode-DPztD6kB.js","./index-gnjjKJuC.css","./UnfoldMore-Bi3VKM-P.js","./shorten-label-CnHc5b4P.js","./team-CzLA5Wke.js","./index-BelkuInn.js","./ViewList-CJ3pgiPv.js","./use-mobile-DT5aSwoH.js","./client-CBX1Obzh.js","./Google-CWXy-_sb.js","./AdapterDayjs-wz3uJn5Q.js","./useThemeProps-DDkjiDuo.js","./ErrorOutline-4kGDns30.js","./index-a5z0oLm0.js","./sdk-Z_sZEcD1.js","./actions-qegZDW8a.js","./index-8dO6vHSp.js","./edit.svg-BePrNRJc.js","./list-header-D7AmzBnQ.js","./chain-DPDA2EQ2.js","./ToggleButtonGroup-B4BB2eWk.js","./lock.svg-BSMyvmiX.js","./index-NuRrhPxS.js","./index-ZgkIHsf0.css","./useAsyncRetry-CFOUpvIi.js","./useAsync-d2jpJBOI.js","./detail-Duk87a8e.js","./index-djmnhckV.js","./index-iKywF7nl.js","./invitation-CAfUwKLF.js","./wrap-locale-C7tS6amm.js","./index-CHCOmcv5.js","./index-C-oEFt7E.js","./index-OLtm4Vax.js","./agreement-DYlE38yc.js","./index-DvuAChUi.js","./index-Dt6-hLLE.js","./index-CDcSsFCi.js","./traffic-BvD_sqrg.js","./iframe-D0APLep4.js","./index-DBii9-f-.js","./base-chart-BIsr5drw.js","./index-BOhdDUAw.js","./index-DRYJ0xIl.js","./memory-CYfF9LNL.js","./index-D82JKtTS.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function _mergeNamespaces(Be,Me){for(var qe=0;qe<Me.length;qe++){const He=Me[qe];if(typeof He!="string"&&!Array.isArray(He)){for(const Ge in He)if(Ge!=="default"&&!(Ge in Be)){const Je=Object.getOwnPropertyDescriptor(He,Ge);Je&&Object.defineProperty(Be,Ge,Je.get?Je:{enumerable:!0,get:()=>He[Ge]})}}}return Object.freeze(Object.defineProperty(Be,Symbol.toStringTag,{value:"Module"}))}(function(){const Me=document.createElement("link").relList;if(Me&&Me.supports&&Me.supports("modulepreload"))return;for(const Ge of document.querySelectorAll('link[rel="modulepreload"]'))He(Ge);new MutationObserver(Ge=>{for(const Je of Ge)if(Je.type==="childList")for(const Ye of Je.addedNodes)Ye.tagName==="LINK"&&Ye.rel==="modulepreload"&&He(Ye)}).observe(document,{childList:!0,subtree:!0});function qe(Ge){const Je={};return Ge.integrity&&(Je.integrity=Ge.integrity),Ge.referrerPolicy&&(Je.referrerPolicy=Ge.referrerPolicy),Ge.crossOrigin==="use-credentials"?Je.credentials="include":Ge.crossOrigin==="anonymous"?Je.credentials="omit":Je.credentials="same-origin",Je}function He(Ge){if(Ge.ep)return;Ge.ep=!0;const Je=qe(Ge);fetch(Ge.href,Je)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(Be){return Be&&Be.__esModule&&Object.prototype.hasOwnProperty.call(Be,"default")?Be.default:Be}function getAugmentedNamespace(Be){if(Object.prototype.hasOwnProperty.call(Be,"__esModule"))return Be;var Me=Be.default;if(typeof Me=="function"){var qe=function He(){var Ge=!1;try{Ge=this instanceof He}catch{}return Ge?Reflect.construct(Me,arguments,this.constructor):Me.apply(this,arguments)};qe.prototype=Me.prototype}else qe={};return Object.defineProperty(qe,"__esModule",{value:!0}),Object.keys(Be).forEach(function(He){var Ge=Object.getOwnPropertyDescriptor(Be,He);Object.defineProperty(qe,He,Ge.get?Ge:{enumerable:!0,get:function(){return Be[He]}})}),qe}var jsxRuntime={exports:{}},reactJsxRuntime_production={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -2900,4 +2900,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2900
2900
|
padding-top: 16px;
|
|
2901
2901
|
${Be=>Be.scrollable?"":"overflow: hidden"};
|
|
2902
2902
|
}
|
|
2903
|
-
`;function GlobalSubscriber(){const{t:Be}=T$7(),{session:Me}=useSessionContext$1(),{info:qe,refresh:He}=useNodeContext();return useSubscription(constantExports.TeamEvents.userUpdated,({teamDid:Ge,user:Je})=>{Ge===qe.did&&Je&&!Je.approved&&Me&&Me.user&&Me.user.did===Je.did&&(H$7.warning(Be("session.blockAccess"),{autoHideDuration:10*1e3}),Me.logout())}),useSubscription(constantExports$1.EVENTS.NOTIFICATION_CREATE,Ge=>{Ge.entityType==="node"&&He({silent:!0})}),useSubscription(constantExports$1.EVENTS.NODE_UPDATED,()=>{He({silent:!0})}),null}const authorize=({user:Be,launchType:Me,nftId:qe})=>{if(!Be)return!1;if(Me==="serverless"){if(!qe)throw new Error("nftId is required");return Be?.controller?.nftId===qe}return(Be.permissions||[]).includes("mutate_blocklets")},isServerlessBlockletInstalled=Be=>Be.isGetBlocklet&&Be.runtimeBlocklet?.controller?.consumedAt,getRestoredAccessUrl=async Be=>{const Me=getBlockletUrls({blocklet:Be});let qe="";return qe=Me.find(He=>{try{const{hostname:Ge}=new URL(He);return urlEvaluationExports.isSlpDomain(Ge)}catch(Ge){return console.error(Ge),!1}}),qe||(qe=await getAccessibleUrl(Me)),qe},LaunchBlockletContext=reactExports.createContext({}),{Provider:Provider$1,Consumer:Consumer$1}=LaunchBlockletContext;function LaunchBlockletProvider({children:Be}){const{session:Me}=useSessionContext$1(),{t:qe}=T$7(),{api:He,info:Ge}=useNodeContext(),[Je]=useSearchParams(),Ye=Je.get("launchType"),Qe=Je.get("fromLauncher"),Ze=Je.get("blocklet_meta_url")||"",nt=Je.get("nftId")||"",tt=Je.get("from")||"",rt=Je.get("launcherSessionId")||"",at=Je.get("launcherUrl")||"",ot=tt==="url",lt=tt==="empty",ut=ot||lt?"":new URL(Ze).origin,[dt,ct]=reactExports.useState({meta:null,appDid:Je.get("appDid")||null,sessionId:Je.get("sessionId")||null,isFree:!0,isExternal:!1,isInstalling:!1,isInstalled:!1,isRunning:!1,launcherSession:null,registryUrl:""}),ft=(mt,bt)=>ct(Et=>({...Et,appDid:mt,sessionId:bt})),ht=authorize({user:Me.user,launchType:Ye,nftId:nt}),[yt,gt]=reactExports.useState(null),[Ct,St]=reactExports.useState(!0),_t=reactExports.useMemo(()=>Ge?getServerUrl(Ge):"",[Ge]),Bt=async mt=>{if(!mt)throw new Error("appDid should not be empty");const{blocklet:bt}=await He.getBlocklet({input:{did:mt,attachConfig:!1}});if(!bt)return null;const Et=constantExports.BlockletStatus[bt.status],Rt=!!nt,Tt=Et<constantExports.BlockletStatus.installed,At=Et===constantExports.BlockletStatus.installed,kt=Et===constantExports.BlockletStatus.running;return ct(wt=>({...wt,isInstalled:At,isRunning:kt,isExternal:Rt,isInstalling:Tt})),{isInstalled:At,isRunning:kt,isExternal:Rt,isInstalling:Tt}},Dt=async()=>{if(St(!0),lt){ct(mt=>({...mt,meta:{title:Je.get("title")||"",description:Je.get("description")||""}})),St(!1);return}try{if(!Ze&&!lt)throw new Error(qe("common.invalidParam"));const[{meta:mt,isFree:bt,registryUrl:Et},{launcherSession:Rt,error:Tt}]=await Promise.all([He.getBlockletMetaFromUrl({input:{url:Ze,checkPrice:!0}}),rt?He.getLauncherSession({input:{launcherSessionId:rt,launcherUrl:at}}):Promise.resolve({})]);if(rt&&!Rt)throw new Error(`Launch session invalid: ${Tt}`);if(!mt)throw new Error(qe("LaunchBlockletBlocklet.error.loadMetaFailed"));let At={};ht&&dt.appDid&&(At=await Bt(dt.appDid)),ct(kt=>({...kt,...At,meta:mt,isFree:bt,registryUrl:Et,launcherSession:Rt}))}catch(mt){console.error(mt),gt(mt.message)}finally{St(!1)}};reactExports.useEffect(()=>{Me?.user?.role===constantExports$1.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&Me?.user?.controller?.nftId!==nt&&Me.logout(),Dt()},[]),reactExports.useEffect(()=>{Ct||!dt.meta||(ht?dt.appDid&&Bt(dt.appDid).catch(mt=>{H$7.error(mt.message)}):(ct(mt=>({...mt,isInstalled:!1,isRunning:!1,isExternal:!1})),gt(null)))},[ht]);const Ot={meta:dt.meta,isFree:dt.isFree,appDid:dt.appDid,sessionId:dt.sessionId,isInstalling:dt.isInstalling,isInstalled:dt.isInstalled,isExternal:dt.isExternal,isRunning:dt.isRunning,serverUrl:_t,storeUrl:dt.registryUrl||ut,blockletMetaUrl:Ze,fromLauncher:Qe,loading:Ct,error:yt,api:He,getBlocklet:Bt,setAppDid:ft,launcherUrl:at,launcherSession:dt.launcherSession,launcherSessionId:rt,launchType:Ye};return jsxRuntimeExports.jsx(Provider$1,{value:Ot,children:Be})}function useLaunchBlockletContext(){return reactExports.useContext(LaunchBlockletContext)}var useAsyncExports=requireUseAsync();const useAsync=getDefaultExportFromCjs$1(useAsyncExports);function useQuery(){return new URLSearchParams(useLocation().search)}const BlockletAppContext=reactExports.createContext(),{Provider,Consumer}=BlockletAppContext;function BlockletAppProvider({children:Be}){const qe=useQuery().get("blocklet_meta_url"),He=useAsync(async()=>{const{data:Je}=await axios.get(qe);return Je});if(He.loading)return jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(CircularProgress,{})});const Ge={meta:He.value,error:He.error};return jsxRuntimeExports.jsx(Provider,{value:Ge,children:Be})}BlockletAppProvider.propTypes={children:o$i.any.isRequired};function useBlockletAppContext(){return reactExports.useContext(BlockletAppContext)}const Dashboard=reactExports.lazy(()=>__vitePreload(()=>import("./index-ZGV5ibHs.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),BlockletList=reactExports.lazy(()=>__vitePreload(()=>import("./index-B0iEGhMY.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,2,31,32,33,34,35,36,37,38]),import.meta.url)),BlockletRestore=reactExports.lazy(()=>__vitePreload(()=>import("./index-DmvJyGWn.js"),__vite__mapDeps([39,40,41,42,43,44,23,6,35,45,46,47,19,15]),import.meta.url)),BlockletStore=reactExports.lazy(()=>__vitePreload(()=>import("./index-DX626HNP.js"),__vite__mapDeps([48,6,49,50,51,52,53,17,15,54,31,32,55,56,36,35,57,45,58,4,19,23,24,25,59,60,26,61,62]),import.meta.url)),Settings=reactExports.lazy(()=>__vitePreload(()=>import("./index-0slfmis0.js"),__vite__mapDeps([63,64,61,65,66,67,26,7,8,9,10,11,12,13,14,15,16,17,18,19,68,22,58,4,2,69,6,70,71,72,73,36,20,74,53,75,76,77]),import.meta.url)),LogPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-DW2RdjBK.js"),__vite__mapDeps([78,79,24,25,6]),import.meta.url)),TeamPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-DUhy4qU3.js"),__vite__mapDeps([80,64,81,15,16,17,18,6,82,83,84,85,86,87,54,22,88,36,89,7,8,9,10,11,12,13,14,19,90,91,37,24,25,65,92,30,31,32,26,4,93,94,73,2,55,45,95,96,97,50,44,98,99,100,101,102,103,104,75,105,106,1,58,107,108]),import.meta.url)),BlockletDetail=reactExports.lazy(()=>__vitePreload(()=>import("./detail-BD2IFxMv.js"),__vite__mapDeps([109,64,20,21,6,19,22,23,24,25,26,54,110,87,62]),import.meta.url)),EULAPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-BiOrweAN.js"),[],import.meta.url)),Notifications=reactExports.lazy(()=>__vitePreload(()=>import("./index-CAv2tOhi.js"),[],import.meta.url)),IssuePassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-Bb2FNNL0.js"),__vite__mapDeps([111,112,110,96,10,97,113,23]),import.meta.url)),LostPassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-3bOYCU_O.js"),__vite__mapDeps([114,89,57,96,10,113,23,34]),import.meta.url)),ExchangePassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-CtVrHc87.js"),__vite__mapDeps([115,113,23]),import.meta.url)),BlockletLauncher=reactExports.lazy(()=>__vitePreload(()=>import("./index-CS7Cpww7.js"),__vite__mapDeps([116,41,42,43,44,107,108,117,82,83,84,23,28,29,47,38,6,69,60]),import.meta.url)),NotFoundPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-B2EpuvFX.js"),__vite__mapDeps([118,110]),import.meta.url)),Invite=reactExports.lazy(()=>__vitePreload(()=>import("./index-CEfdMhRs.js"),__vite__mapDeps([119,112,110,96,10,97,113]),import.meta.url)),Console=reactExports.lazy(()=>__vitePreload(()=>import("./index-CeEola33.js"),[],import.meta.url)),AnalyticsPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-w74fQNNd.js"),__vite__mapDeps([120,64,121,122,52,53,123,13,124,125,93,94,9,73,7,8,10,11,12,14,15,16,17,18,19,126,127,77,6,103,25]),import.meta.url)),GenKeyPair=reactExports.lazy(()=>__vitePreload(()=>import("./index-BsMctdy8.js"),__vite__mapDeps([128,110]),import.meta.url));function useSharedContext(){const Be=useNodeContext(),{session:Me}=useSessionContext$1(),{wallet:qe}=d$e(),He=Me.user&&Me.user.did;return reactExports.useEffect(()=>{const Ge=getWsClient();return He?Ge.connect():Ge.isConnected()&&Ge.disconnect(),()=>{Ge.isConnected()&&Ge.disconnect()}},[He]),reactExports.useEffect(()=>{if(qe)return()=>{};const Ge=()=>{document.visibilityState==="visible"&&Me.refresh()};return document.addEventListener("visibilitychange",Ge),()=>{document.removeEventListener("visibilitychange",Ge)}},[]),{node:Be,session:Me}}function ProtectedApp(){const{t:Be}=T$7(),{node:Me,session:qe}=useSharedContext(),He=useLocation();reactExports.useEffect(()=>{window.tracker&&typeof window.tracker.pageView=="function"&&window.tracker.pageView(`${He.pathname}${He.search}`)},[He]),reactExports.useEffect(()=>{qe?.user?.role===constantExports$1.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&qe.logout()},[qe?.user?.role]);const Ge=jsxRuntimeExports.jsx(CircularProgress,{});if(Me.loading||qe.loading)return jsxRuntimeExports.jsx(o$g,{children:Ge});if(!Me.info.initialized)return getAuthMethodExports.getServerAuthMethod(Me.info)==="nft"?jsxRuntimeExports.jsx(NodeVerifyOwner,{action:"verify-owner"}):jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(NodeConnectOwner,{})});if(Me.info.upgradeSessionId)return jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(MaintainProgress,{})});if(!qe.user)return jsxRuntimeExports.jsx(NodeLogin,{loadingEle:Ge});const Je=jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(CircularProgress,{})});return jsxRuntimeExports.jsx(BlockletsProvider,{children:jsxRuntimeExports.jsxs(NotificationProvider,{children:[jsxRuntimeExports.jsx(Health,{}),jsxRuntimeExports.jsx(CheckNodeStatus,{}),jsxRuntimeExports.jsx(GlobalSubscriber,{}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:Je,children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"/dashboard",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:"Dashboard",children:jsxRuntimeExports.jsx(Dashboard,{})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("common.blocklets"),children:jsxRuntimeExports.jsx(BlockletList,{})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets/:did/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:"Blocklets",children:jsxRuntimeExports.jsx(BlockletDetail,{})})}),jsxRuntimeExports.jsx(Route,{path:"/settings/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("common.setting"),children:jsxRuntimeExports.jsx(Settings,{})})}),jsxRuntimeExports.jsx(Route,{path:"/eula",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("setup.steps.eula"),children:jsxRuntimeExports.jsx(EULAPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/store",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("common.store"),children:jsxRuntimeExports.jsx(BlockletStore,{})})}),jsxRuntimeExports.jsx(Route,{path:"/console",element:jsxRuntimeExports.jsx(DashboardRoute,{title:`GraphQL ${Be("common.console")}`,scrollable:!1,fullWidth:!0,children:jsxRuntimeExports.jsx(Console,{})})}),jsxRuntimeExports.jsx(Route,{path:"/notifications",element:jsxRuntimeExports.jsx(DashboardRoute,{title:Be("common.notifications"),children:jsxRuntimeExports.jsx(Notifications,{})})}),jsxRuntimeExports.jsx(Route,{path:"/team/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("common.team"),children:jsxRuntimeExports.jsx(TeamPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/logs/:name?",element:jsxRuntimeExports.jsx(DashboardRoute,{scrollable:!1,fullWidth:!0,title:Be("common.logs"),children:jsxRuntimeExports.jsx(LogPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/analytics/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("common.analytics"),children:jsxRuntimeExports.jsx(AnalyticsPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/",element:jsxRuntimeExports.jsx(Navigate,{to:"/dashboard",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/team",element:jsxRuntimeExports.jsx(Navigate,{to:"/team/members",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/analytics",element:jsxRuntimeExports.jsx(Navigate,{to:"/analytics/traffic",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/router",element:jsxRuntimeExports.jsx(Navigate,{to:"/router/rules",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/settings",element:jsxRuntimeExports.jsx(Navigate,{to:"/settings/basic",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/marketplace",element:jsxRuntimeExports.jsx(Navigate,{to:"/store",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/marketplace/:did",element:jsxRuntimeExports.jsx(Navigate,{to:"/store/:did",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(NotFoundPage,{})})]})})]})})}function UnprotectedWrapper({children:Be}){const{node:Me,session:qe}=useSharedContext();return Me.loading||!qe.initialized&&qe.loading?jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(CircularProgress,{})}):Me.info.upgradeSessionId?jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(MaintainProgress,{})}):Be}function App(){const{changeLocale:Be}=T$7(),Me=useQuery();reactExports.useEffect(()=>{const He=Me.get("locale");He&&["zh","en"].includes(He)&&Be(He)},[]);const qe=jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(CircularProgress,{})});return jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:qe,children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/issue-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(IssuePassport,{})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/lost-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(LostPassport,{})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/exchange-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(ExchangePassport,{})})}),jsxRuntimeExports.jsx(Route,{path:"/accept-server",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(NodeVerifyOwner,{action:"accept-server"})})}),jsxRuntimeExports.jsx(Route,{path:"/gen-key-pair/",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(GenKeyPair,{})})}),jsxRuntimeExports.jsx(Route,{path:"/launch-blocklet/*",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(LaunchBlockletProvider,{children:jsxRuntimeExports.jsx(BlockletLauncher,{})})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets/restore/*",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(BlockletAppProvider,{children:jsxRuntimeExports.jsx(BlockletRestore,{})})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/invite`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(Invite,{})})}),jsxRuntimeExports.jsx(Route,{path:"/*",element:jsxRuntimeExports.jsx(ProtectedApp,{})})]})})}function AppWrapper(){const Be=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";return jsxRuntimeExports.jsx(BrowserRouter,{history:history$1,basename:Be,children:jsxRuntimeExports.jsx(Root,{children:jsxRuntimeExports.jsx(App,{})})})}const root=clientExports.createRoot(document.getElementById("root"));root.render(jsxRuntimeExports.jsx(AppWrapper,{}));const prefix=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";register(`${prefix}/service-worker.js`.replace(/\/+/g,"/"),{registrationOptions:{scope:prefix},registered(){console.info("Service worker has been registered.")},ready(){console.info("Service worker is active.")},cached(){console.info("Content has been cached for offline use.")},updatefound(){console.info("New content is downloading.")},updated(){console.info("New content is available; please refresh.")},offline(){console.info("No internet connection found. App is running in offline mode.")},error(Be){console.error("Error during service worker registration:",Be)}});export{$$4 as $,withQuery as A,useNavigate as B,CircularProgress as C,DialogContentText as D,useSearchParams as E,useMediaQuery as F,Grid$1 as G,H$7 as H,libExports$3 as I,Link$1 as J,BlockletAppAvatar as K,Link as L,Box as M,isEmpty as N,et as O,FormControl as P,InputLabel as Q,MenuItem as R,Select as S,Typography as T,Checkbox as U,Alert as V,WrappedDidAddress as W,formatError as X,o$g as Y,CheckIcon$2 as Z,propTypesExports as _,useSubscription as a,Menu as a$,api as a0,merge as a1,cloneDeep as a2,IconButton as a3,R$3 as a4,ListItemSecondaryAction as a5,List as a6,ListItem as a7,ListItemText as a8,getServerUrl as a9,ErrorBoundary as aA,k$1 as aB,formatRegistryLogoPath as aC,Icon as aD,ListItemIcon as aE,createSvgIcon as aF,ensureDomainAliases as aG,constantExports$1 as aH,getIp as aI,normalizePathPrefix as aJ,sortBy as aK,stringSortHandlerAsc as aL,getAccessUrl as aM,history$1 as aN,semver as aO,useReactive as aP,useAsyncEffect as aQ,InfoOutlinedIcon as aR,sleep as aS,checkInputByType as aT,FormControlLabel as aU,Stack$1 as aV,useAsync as aW,axios as aX,shouldCheckDomainStatus as aY,formatMountPoint as aZ,urlPathFriendly as a_,useBlockletAppContext as aa,getAuthMethodExports as ab,ConfirmDialog as ac,getRestoredAccessUrl as ad,setSessionToken as ae,isEqual as af,isServerlessBlockletInstalled as ag,Debug as ah,getWsClient as ai,useQuery as aj,getPathPrefix as ak,Global as al,Routes as am,Route as an,Navigate as ao,HeaderAddon as ap,SessionContext as aq,css as ar,$$5 as as,formatToDatetime as at,alpha$1 as au,getLaunchAgreementUrl as av,axios$2 as aw,useSessionContext$1 as ax,Tooltip as ay,getBlockletMetaUrl as az,constantExports as b,clsx$1 as b$,checkIsWildcardDomain as b0,Popover as b1,Card as b2,formatToDate as b3,sortDomains as b4,C$a as b5,Collapse as b6,CheckCircle as b7,styled as b8,isUrl as b9,BlockletAdminRoles as bA,isInstalling as bB,Badge as bC,createAppPassportSvg as bD,NavLink as bE,__vitePreload as bF,SetCache as bG,arrayIncludes$1 as bH,arrayIncludesWith as bI,cacheHas as bJ,baseUniq as bK,baseFlatten as bL,baseRest as bM,last as bN,arrayFilter as bO,isArrayLikeObject as bP,t$9 as bQ,isDownloading as bR,getBlockletUrl as bS,getBlockletUrlParams as bT,ButtonBase as bU,memoTheme as bV,emphasize as bW,generateUtilityClasses$1 as bX,generateUtilityClass$1 as bY,useDefaultProps as bZ,useSlotProps as b_,__awaiter as ba,__generator as bb,__spread as bc,getDefaultExportFromCjs$1 as bd,U$3 as be,dayjs$1 as bf,Divider as bg,isCertificateMatch as bh,FormHelperText as bi,FormGroup as bj,o$d as bk,NodeContext as bl,useParams as bm,useNodeContext$1 as bn,uniqBy as bo,l as bp,libExports$1 as bq,B$5 as br,o$a as bs,l$h as bt,BlockletAvatar as bu,ClickAwayListener as bv,f$8 as bw,createPassportSvg as bx,getWalletType as by,useCreation as bz,createCompounder as c,flat as c$,composeClasses as c0,__read as c1,toSlotDomain as c2,omit as c3,fixBlocklet as c4,isProtectedRole as c5,baseOrderBy as c6,isArray$1 as c7,rootShouldForwardProp as c8,useFormControl as c9,isFunction$2 as cA,Container$3 as cB,K$3 as cC,getLauncherBaseURL as cD,SvgIcon as cE,Buffer$1 as cF,parseURL as cG,withHttps as cH,useLaunchBlockletContext as cI,z$3 as cJ,authorize as cK,ArrowForwardIcon as cL,isNewStoreUrl as cM,getAccessibleUrl as cN,getBlockletLogoUrl as cO,t as cP,M$7 as cQ,__spreadArrays as cR,__assign as cS,h$6 as cT,useLocation as cU,l$8 as cV,useMount as cW,s$8 as cX,formatDateTime as cY,getExplorerLink as cZ,patchJsxToLocale as c_,createChainedFunction$1 as ca,useSlot as cb,capitalize$1 as cc,SwitchBase as cd,createSimplePaletteValueFilter as ce,useControlled as cf,useForkRef as cg,useId as ch,getBlockletUrls as ci,defaultCheckAccessible as cj,urlEvaluationExports as ck,memoize as cl,ButtonGroupContext as cm,ButtonGroupButtonContext as cn,useNotificationContext as co,utilExports as cp,NotificationList as cq,useRequest as cr,useMemoizedFn as cs,isNumber$3 as ct,useLatest as cu,dayjs as cv,d$e as cw,Avatar as cx,isFromWallet as cy,usePassportId as cz,useBlockletsContext as d,afterMain as d$,en$2 as d0,Q$3 as d1,getSessionToken as d2,LinearProgress as d3,SvgLogo as d4,isNumber$1 as d5,useEnhancedEffect$1 as d6,debounce$2 as d7,ownerWindow as d8,useRtl as d9,requirePropTypes as dA,requireReactDom as dB,isObject$3 as dC,require$$0$2 as dD,require$$5$1 as dE,requireConstant$1 as dF,$e$1 as dG,noop$1 as dH,Button as dI,Paper as dJ,MenuList as dK,Popper as dL,_inheritsLoose$1 as dM,ReactDOM as dN,_objectWithoutPropertiesLoose$1 as dO,TransitionGroup as dP,ENTERED as dQ,ENTERING as dR,EXITING as dS,TransitionGroupContext as dT,Transition as dU,config$1 as dV,popperGenerator as dW,eventListeners as dX,popperOffsets$1 as dY,computeStyles$1 as dZ,applyStyles$1 as d_,KeyboardArrowLeft as da,KeyboardArrowRight as db,useEventCallback$1 as dc,ownerDocument as dd,l$p as de,getCommonHtmlTitle as df,HelmetExport as dg,requireReact as dh,i$e as di,oe$2 as dj,ne$2 as dk,InfoIcon$2 as dl,upperFirst as dm,camelCase as dn,Skeleton as dp,R$5 as dq,isArrayLike as dr,baseIteratee as ds,keys as dt,toInteger as du,baseFindIndex as dv,commonjsGlobal as dw,getAugmentedNamespace as dx,emotionUtils_browser_esm as dy,requireJsxRuntime as dz,useAsyncRetry as e,toString$2 as e$,afterRead as e0,afterWrite as e1,arrow$1 as e2,auto as e3,basePlacements as e4,beforeMain as e5,beforeRead as e6,beforeWrite as e7,bottom as e8,clippingParents as e9,requireLib$3 as eA,requireLib$4 as eB,requireLib$2 as eC,requireConstant$2 as eD,requireUrlPathFriendly as eE,b$8 as eF,data$s as eG,global$2 as eH,hoistStatics as eI,isEqual$3 as eJ,usePreviousProps as eK,setRef as eL,ClearIcon as eM,ArrowDropDownIcon as eN,Chip as eO,filledInputClasses as eP,inputBaseClasses as eQ,outlinedInputClasses as eR,inputClasses as eS,ListContext as eT,getListItemButtonUtilityClass as eU,listItemButtonClasses as eV,emotionReact_browser_esm as eW,emotionCache_browser_esm as eX,cloneDeep$1 as eY,forceReflow as eZ,_extends$2 as e_,createPopper as ea,createPopper$1 as eb,detectOverflow as ec,end as ed,flip$1 as ee,hide$1 as ef,left as eg,main as eh,modifierPhases as ei,offset$1 as ej,placements as ek,popper as el,preventOverflow$1 as em,read as en,reference as eo,right as ep,start as eq,top as er,variationPlacements as es,viewport as et,write as eu,requireReactIs as ev,emotionStyled_browser_esm as ew,emotionSerialize_esm as ex,emotionSheet_esm as ey,process$1 as ez,useTheme as f,requireSafeBuffer$1 as f$,mergeThemeOptions as f0,StyledEngineProvider as f1,ThemeProvider as f2,ThemeProvider$3 as f3,s$3 as f4,CloseIcon as f5,isString$1 as f6,createTheme as f7,createAxios as f8,pick as f9,slotShouldForwardProp as fA,requireNormalizePathPrefix as fB,debounce as fC,useInterval as fD,formatTime as fE,CloseFullscreenIcon as fF,S$8 as fG,TablePagination as fH,parseAvatar as fI,__rest as fJ,useEffectWithTarget$1 as fK,__values as fL,tmp as fM,useUpdate as fN,Y$3 as fO,I$3 as fP,p$d as fQ,ee as fR,requireUtil$6 as fS,requireObjectKeys$1 as fT,requireShams$1 as fU,requireCallBound as fV,requireEsObjectAtoms as fW,requireDefineDataProperty as fX,requireHasPropertyDescriptors as fY,requireCallBind as fZ,requireCallBound$1 as f_,omitBy as fa,MenuIcon as fb,useDebounceFn as fc,Dialog as fd,OutlinedInput as fe,data as ff,Drawer as fg,parseQuery as fh,parseFilename as fi,stringifyParsedURL as fj,Grow as fk,Wt as fl,InputAdornment as fm,tooltipClasses as fn,e$b as fo,requireEngine as fp,__spreadArray as fq,useEventListener as fr,le$7 as fs,getTargetElement as ft,clamp as fu,extractEventHandlers as fv,isFocusVisible as fw,isHostComponent as fx,lighten as fy,darken as fz,g$f as g,THEME_ID as g$,requireBrowser$f as g0,requireElliptic as g1,requireCryptoBrowserify as g2,requireRipemd160 as g3,requireLib$1 as g4,requireUtil$2 as g5,uniq as g6,useLocalStorageState as g7,InputBase as g8,useSize as g9,arrayMap as gA,baseMap as gB,baseForOwn as gC,isPlainObject$2 as gD,require$$12 as gE,throttle$2 as gF,isUndefined$1 as gG,useTimeout as gH,Fade as gI,FocusTrap as gJ,dialogClasses as gK,localizedFormatPlugin as gL,n$8 as gM,purify as gN,Buffer$1$1 as gO,Q$2 as gP,requireJsonStableStringify as gQ,requireSemver as gR,requireBrowser$5 as gS,require$$0$1 as gT,requireIsAbsoluteUrl as gU,requireDist$1 as gV,requireBrowser$3 as gW,require$$3 as gX,resolveProps as gY,useThemeProps as gZ,defaultTheme$1 as g_,DialogTitle as ga,DialogContent as gb,DialogActions as gc,pickBy as gd,shouldForwardProp as ge,resolveComponentProps as gf,getInviteLink as gg,copy as gh,e$d as gi,getIssuePassportLink as gj,uniqBy$1 as gk,isNodeOwner as gl,isSelf as gm,Q$1 as gn,getBlockletAccessibleUrl as go,A$1 as gp,createPassportSvg$1 as gq,requireMs as gr,E$3 as gs,trim as gt,BlockletSDK as gu,getBlockletSDK as gv,MoreHorizIcon as gw,identity$1 as gx,arrayEach as gy,baseEach as gz,get$1 as h,green as h$,isIndex as h0,useTheme$4 as h1,objectAssign as h2,__extends as h3,isServerless as h4,isFunction$1 as h5,omit$1 as h6,TableContext as h7,Tablelvl2Context as h8,d$f as h9,requireAssertString as hA,isEmail as hB,isURL as hC,createUseStorageState as hD,isBrowser$1 as hE,root$1 as hF,isNil$1 as hG,require$$11 as hH,requireHoistNonReactStatics_cjs as hI,_assertThisInitialized$1 as hJ,reactDomExports as hK,loadIcon as hL,withoutLeadingSlash as hM,fetchSvgAsPng as hN,blobToFile as hO,withoutTrailingSlash as hP,u$2 as hQ,Ce as hR,t$g as hS,i as hT,R$8 as hU,browserExports$1 as hV,highlightExports as hW,funcExports as hX,data$y as hY,useSnackbar as hZ,common$3 as h_,useUnmount as ha,isDidDomainOrIpEchoDomain as hb,ExpandLess as hc,validateDomain as hd,requireDist$2 as he,requireAxios as hf,trim$1 as hg,requirePRetry as hh,TableCell as hi,xe$1 as hj,getSystemDomains as hk,copyArray as hl,baseIndexOf as hm,ke as hn,useAppLogo as ho,getTransferAppLink as hp,requireBn$1 as hq,require$$2 as hr,updateWindowEnv as hs,M$3 as ht,isNil as hu,requireBase32 as hv,Pe as hw,withTrailingSlash as hx,data$B as hy,keyframes as hz,utilExports$1 as i,n$5 as i$,amber as i0,SnackbarContent as i1,d$h as i2,t$1 as i3,useDebounce as i4,Y as i5,g$3 as i6,b as i7,g$a as i8,withErrorBoundary as i9,pWaitFor as iA,hasRequiredSteps as iB,getStoreList as iC,commonjsRequire as iD,require_interface as iE,requireHasown as iF,requireBrowser$1 as iG,require$$4$1 as iH,flatten as iI,trimEnd as iJ,base32Exports as iK,flatExports as iL,qt as iM,AxiosError as iN,I$6 as iO,isNull as iP,orange as iQ,purple as iR,useStore as iS,createStore as iT,create$1 as iU,t$h as iV,clientExports as iW,Ve$2 as iX,retry as iY,isNetworkError as iZ,requirePTimeout as i_,z$2 as ia,M$4 as ib,Fe as ic,G as id,xe as ie,useBlockletLogo as ig,isPlainObject$1 as ih,Toolbar as ii,_setPrototypeOf as ij,isString$3 as ik,FormLabel as il,RelativeTime as im,isIncludeActivity as io,isUserActor as ip,ActorAvatar as iq,SendComponentAvatar as ir,Activity as is,NotificationContent$1 as it,AvatarGroup as iu,requireCjs as iv,useTheme$2 as iw,baseAssignValue as ix,isValidClusterSize as iy,extractStatusUrlFromNextWorkflow as iz,jsxRuntimeExports as j,Modal as j0,GlobalStyles$2 as j1,filesize as k,prettyMs as l,formatLocale as m,T$7 as n,o$i as o,p$3 as p,useSessionContext as q,reactExports as r,styled$3 as s,useSetState as t,useNodeContext as u,TextField as v,n$4 as w,lo as x,getWebWalletUrl as y,joinURL as z};
|
|
2903
|
+
`;function GlobalSubscriber(){const{t:Be}=T$7(),{session:Me}=useSessionContext$1(),{info:qe,refresh:He}=useNodeContext();return useSubscription(constantExports.TeamEvents.userUpdated,({teamDid:Ge,user:Je})=>{Ge===qe.did&&Je&&!Je.approved&&Me&&Me.user&&Me.user.did===Je.did&&(H$7.warning(Be("session.blockAccess"),{autoHideDuration:10*1e3}),Me.logout())}),useSubscription(constantExports$1.EVENTS.NOTIFICATION_CREATE,Ge=>{Ge.entityType==="node"&&He({silent:!0})}),useSubscription(constantExports$1.EVENTS.NODE_UPDATED,()=>{He({silent:!0})}),null}const authorize=({user:Be,launchType:Me,nftId:qe})=>{if(!Be)return!1;if(Me==="serverless"){if(!qe)throw new Error("nftId is required");return Be?.controller?.nftId===qe}return(Be.permissions||[]).includes("mutate_blocklets")},isServerlessBlockletInstalled=Be=>Be.isGetBlocklet&&Be.runtimeBlocklet?.controller?.consumedAt,getRestoredAccessUrl=async Be=>{const Me=getBlockletUrls({blocklet:Be});let qe="";return qe=Me.find(He=>{try{const{hostname:Ge}=new URL(He);return urlEvaluationExports.isSlpDomain(Ge)}catch(Ge){return console.error(Ge),!1}}),qe||(qe=await getAccessibleUrl(Me)),qe},LaunchBlockletContext=reactExports.createContext({}),{Provider:Provider$1,Consumer:Consumer$1}=LaunchBlockletContext;function LaunchBlockletProvider({children:Be}){const{session:Me}=useSessionContext$1(),{t:qe}=T$7(),{api:He,info:Ge}=useNodeContext(),[Je]=useSearchParams(),Ye=Je.get("launchType"),Qe=Je.get("fromLauncher"),Ze=Je.get("blocklet_meta_url")||"",nt=Je.get("nftId")||"",tt=Je.get("from")||"",rt=Je.get("launcherSessionId")||"",at=Je.get("launcherUrl")||"",ot=tt==="url",lt=tt==="empty",ut=ot||lt?"":new URL(Ze).origin,[dt,ct]=reactExports.useState({meta:null,appDid:Je.get("appDid")||null,sessionId:Je.get("sessionId")||null,isFree:!0,isExternal:!1,isInstalling:!1,isInstalled:!1,isRunning:!1,launcherSession:null,registryUrl:""}),ft=(mt,bt)=>ct(Et=>({...Et,appDid:mt,sessionId:bt})),ht=authorize({user:Me.user,launchType:Ye,nftId:nt}),[yt,gt]=reactExports.useState(null),[Ct,St]=reactExports.useState(!0),_t=reactExports.useMemo(()=>Ge?getServerUrl(Ge):"",[Ge]),Bt=async mt=>{if(!mt)throw new Error("appDid should not be empty");const{blocklet:bt}=await He.getBlocklet({input:{did:mt,attachConfig:!1}});if(!bt)return null;const Et=constantExports.BlockletStatus[bt.status],Rt=!!nt,Tt=Et<constantExports.BlockletStatus.installed,At=Et===constantExports.BlockletStatus.installed,kt=Et===constantExports.BlockletStatus.running;return ct(wt=>({...wt,isInstalled:At,isRunning:kt,isExternal:Rt,isInstalling:Tt})),{isInstalled:At,isRunning:kt,isExternal:Rt,isInstalling:Tt}},Dt=async()=>{if(St(!0),lt){ct(mt=>({...mt,meta:{title:Je.get("title")||"",description:Je.get("description")||""}})),St(!1);return}try{if(!Ze&&!lt)throw new Error(qe("common.invalidParam"));const[{meta:mt,isFree:bt,registryUrl:Et},{launcherSession:Rt,error:Tt}]=await Promise.all([He.getBlockletMetaFromUrl({input:{url:Ze,checkPrice:!0}}),rt?He.getLauncherSession({input:{launcherSessionId:rt,launcherUrl:at}}):Promise.resolve({})]);if(rt&&!Rt)throw new Error(`Launch session invalid: ${Tt}`);if(!mt)throw new Error(qe("LaunchBlockletBlocklet.error.loadMetaFailed"));let At={};ht&&dt.appDid&&(At=await Bt(dt.appDid)),ct(kt=>({...kt,...At,meta:mt,isFree:bt,registryUrl:Et,launcherSession:Rt}))}catch(mt){console.error(mt),gt(mt.message)}finally{St(!1)}};reactExports.useEffect(()=>{Me?.user?.role===constantExports$1.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&Me?.user?.controller?.nftId!==nt&&Me.logout(),Dt()},[]),reactExports.useEffect(()=>{Ct||!dt.meta||(ht?dt.appDid&&Bt(dt.appDid).catch(mt=>{H$7.error(mt.message)}):(ct(mt=>({...mt,isInstalled:!1,isRunning:!1,isExternal:!1})),gt(null)))},[ht]);const Ot={meta:dt.meta,isFree:dt.isFree,appDid:dt.appDid,sessionId:dt.sessionId,isInstalling:dt.isInstalling,isInstalled:dt.isInstalled,isExternal:dt.isExternal,isRunning:dt.isRunning,serverUrl:_t,storeUrl:dt.registryUrl||ut,blockletMetaUrl:Ze,fromLauncher:Qe,loading:Ct,error:yt,api:He,getBlocklet:Bt,setAppDid:ft,launcherUrl:at,launcherSession:dt.launcherSession,launcherSessionId:rt,launchType:Ye};return jsxRuntimeExports.jsx(Provider$1,{value:Ot,children:Be})}function useLaunchBlockletContext(){return reactExports.useContext(LaunchBlockletContext)}var useAsyncExports=requireUseAsync();const useAsync=getDefaultExportFromCjs$1(useAsyncExports);function useQuery(){return new URLSearchParams(useLocation().search)}const BlockletAppContext=reactExports.createContext(),{Provider,Consumer}=BlockletAppContext;function BlockletAppProvider({children:Be}){const qe=useQuery().get("blocklet_meta_url"),He=useAsync(async()=>{const{data:Je}=await axios.get(qe);return Je});if(He.loading)return jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(CircularProgress,{})});const Ge={meta:He.value,error:He.error};return jsxRuntimeExports.jsx(Provider,{value:Ge,children:Be})}BlockletAppProvider.propTypes={children:o$i.any.isRequired};function useBlockletAppContext(){return reactExports.useContext(BlockletAppContext)}const Dashboard=reactExports.lazy(()=>__vitePreload(()=>import("./index-WMqkdikj.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),BlockletList=reactExports.lazy(()=>__vitePreload(()=>import("./index-DufKOlby.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,2,31,32,33,34,35,36,37,38]),import.meta.url)),BlockletRestore=reactExports.lazy(()=>__vitePreload(()=>import("./index-DBBnAIQs.js"),__vite__mapDeps([39,40,41,42,43,44,23,6,35,45,46,47,19,15]),import.meta.url)),BlockletStore=reactExports.lazy(()=>__vitePreload(()=>import("./index-CbcxUqJf.js"),__vite__mapDeps([48,6,49,50,51,52,53,17,15,54,31,32,55,56,36,35,57,45,58,4,19,23,24,25,59,60,26,61,62]),import.meta.url)),Settings=reactExports.lazy(()=>__vitePreload(()=>import("./index-C0-id_9j.js"),__vite__mapDeps([63,64,61,65,66,67,26,7,8,9,10,11,12,13,14,15,16,17,18,19,68,22,58,4,2,69,6,70,71,72,73,36,20,74,53,75,76,77]),import.meta.url)),LogPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-DYwPfkqM.js"),__vite__mapDeps([78,79,24,25,6]),import.meta.url)),TeamPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-DRg3WiNb.js"),__vite__mapDeps([80,64,81,15,16,17,18,6,82,83,84,85,86,87,54,22,88,36,89,7,8,9,10,11,12,13,14,19,90,91,37,24,25,65,92,30,31,32,26,4,93,94,73,2,55,45,95,96,97,50,44,98,99,100,101,102,103,104,75,105,106,1,58,107,108]),import.meta.url)),BlockletDetail=reactExports.lazy(()=>__vitePreload(()=>import("./detail-Duk87a8e.js"),__vite__mapDeps([109,64,20,21,6,19,22,23,24,25,26,54,110,87,62]),import.meta.url)),EULAPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-14CzihO_.js"),[],import.meta.url)),Notifications=reactExports.lazy(()=>__vitePreload(()=>import("./index-BnsRewaA.js"),[],import.meta.url)),IssuePassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-iKywF7nl.js"),__vite__mapDeps([111,112,110,96,10,97,113,23]),import.meta.url)),LostPassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-CHCOmcv5.js"),__vite__mapDeps([114,89,57,96,10,113,23,34]),import.meta.url)),ExchangePassport=reactExports.lazy(()=>__vitePreload(()=>import("./index-C-oEFt7E.js"),__vite__mapDeps([115,113,23]),import.meta.url)),BlockletLauncher=reactExports.lazy(()=>__vitePreload(()=>import("./index-OLtm4Vax.js"),__vite__mapDeps([116,41,42,43,44,107,108,117,82,83,84,23,28,29,47,38,6,69,60]),import.meta.url)),NotFoundPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-DvuAChUi.js"),__vite__mapDeps([118,110]),import.meta.url)),Invite=reactExports.lazy(()=>__vitePreload(()=>import("./index-Dt6-hLLE.js"),__vite__mapDeps([119,112,110,96,10,97,113]),import.meta.url)),Console=reactExports.lazy(()=>__vitePreload(()=>import("./index-C6h7Wn7k.js"),[],import.meta.url)),AnalyticsPage=reactExports.lazy(()=>__vitePreload(()=>import("./index-CDcSsFCi.js"),__vite__mapDeps([120,64,121,122,52,53,123,13,124,125,93,94,9,73,7,8,10,11,12,14,15,16,17,18,19,126,127,77,6,103,25]),import.meta.url)),GenKeyPair=reactExports.lazy(()=>__vitePreload(()=>import("./index-D82JKtTS.js"),__vite__mapDeps([128,110]),import.meta.url));function useSharedContext(){const Be=useNodeContext(),{session:Me}=useSessionContext$1(),{wallet:qe}=d$e(),He=Me.user&&Me.user.did;return reactExports.useEffect(()=>{const Ge=getWsClient();return He?Ge.connect():Ge.isConnected()&&Ge.disconnect(),()=>{Ge.isConnected()&&Ge.disconnect()}},[He]),reactExports.useEffect(()=>{if(qe)return()=>{};const Ge=()=>{document.visibilityState==="visible"&&Me.refresh()};return document.addEventListener("visibilitychange",Ge),()=>{document.removeEventListener("visibilitychange",Ge)}},[]),{node:Be,session:Me}}function ProtectedApp(){const{t:Be}=T$7(),{node:Me,session:qe}=useSharedContext(),He=useLocation();reactExports.useEffect(()=>{window.tracker&&typeof window.tracker.pageView=="function"&&window.tracker.pageView(`${He.pathname}${He.search}`)},[He]),reactExports.useEffect(()=>{qe?.user?.role===constantExports$1.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&qe.logout()},[qe?.user?.role]);const Ge=jsxRuntimeExports.jsx(CircularProgress,{});if(Me.loading||qe.loading)return jsxRuntimeExports.jsx(o$g,{children:Ge});if(!Me.info.initialized)return getAuthMethodExports.getServerAuthMethod(Me.info)==="nft"?jsxRuntimeExports.jsx(NodeVerifyOwner,{action:"verify-owner"}):jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(NodeConnectOwner,{})});if(Me.info.upgradeSessionId)return jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(MaintainProgress,{})});if(!qe.user)return jsxRuntimeExports.jsx(NodeLogin,{loadingEle:Ge});const Je=jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(CircularProgress,{})});return jsxRuntimeExports.jsx(BlockletsProvider,{children:jsxRuntimeExports.jsxs(NotificationProvider,{children:[jsxRuntimeExports.jsx(Health,{}),jsxRuntimeExports.jsx(CheckNodeStatus,{}),jsxRuntimeExports.jsx(GlobalSubscriber,{}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:Je,children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"/dashboard",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:"Dashboard",children:jsxRuntimeExports.jsx(Dashboard,{})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("common.blocklets"),children:jsxRuntimeExports.jsx(BlockletList,{})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets/:did/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:"Blocklets",children:jsxRuntimeExports.jsx(BlockletDetail,{})})}),jsxRuntimeExports.jsx(Route,{path:"/settings/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("common.setting"),children:jsxRuntimeExports.jsx(Settings,{})})}),jsxRuntimeExports.jsx(Route,{path:"/eula",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("setup.steps.eula"),children:jsxRuntimeExports.jsx(EULAPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/store",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("common.store"),children:jsxRuntimeExports.jsx(BlockletStore,{})})}),jsxRuntimeExports.jsx(Route,{path:"/console",element:jsxRuntimeExports.jsx(DashboardRoute,{title:`GraphQL ${Be("common.console")}`,scrollable:!1,fullWidth:!0,children:jsxRuntimeExports.jsx(Console,{})})}),jsxRuntimeExports.jsx(Route,{path:"/notifications",element:jsxRuntimeExports.jsx(DashboardRoute,{title:Be("common.notifications"),children:jsxRuntimeExports.jsx(Notifications,{})})}),jsxRuntimeExports.jsx(Route,{path:"/team/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("common.team"),children:jsxRuntimeExports.jsx(TeamPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/logs/:name?",element:jsxRuntimeExports.jsx(DashboardRoute,{scrollable:!1,fullWidth:!0,title:Be("common.logs"),children:jsxRuntimeExports.jsx(LogPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/analytics/:tab",element:jsxRuntimeExports.jsx(DashboardRoute,{fullWidth:!0,title:Be("common.analytics"),children:jsxRuntimeExports.jsx(AnalyticsPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/",element:jsxRuntimeExports.jsx(Navigate,{to:"/dashboard",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/team",element:jsxRuntimeExports.jsx(Navigate,{to:"/team/members",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/analytics",element:jsxRuntimeExports.jsx(Navigate,{to:"/analytics/traffic",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/router",element:jsxRuntimeExports.jsx(Navigate,{to:"/router/rules",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/settings",element:jsxRuntimeExports.jsx(Navigate,{to:"/settings/basic",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/marketplace",element:jsxRuntimeExports.jsx(Navigate,{to:"/store",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"/marketplace/:did",element:jsxRuntimeExports.jsx(Navigate,{to:"/store/:did",replace:!0})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(NotFoundPage,{})})]})})]})})}function UnprotectedWrapper({children:Be}){const{node:Me,session:qe}=useSharedContext();return Me.loading||!qe.initialized&&qe.loading?jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(CircularProgress,{})}):Me.info.upgradeSessionId?jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(MaintainProgress,{})}):Be}function App(){const{changeLocale:Be}=T$7(),Me=useQuery();reactExports.useEffect(()=>{const He=Me.get("locale");He&&["zh","en"].includes(He)&&Be(He)},[]);const qe=jsxRuntimeExports.jsx(o$g,{children:jsxRuntimeExports.jsx(CircularProgress,{})});return jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:qe,children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/issue-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(IssuePassport,{})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/lost-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(LostPassport,{})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/exchange-passport`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(ExchangePassport,{})})}),jsxRuntimeExports.jsx(Route,{path:"/accept-server",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(NodeVerifyOwner,{action:"accept-server"})})}),jsxRuntimeExports.jsx(Route,{path:"/gen-key-pair/",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(GenKeyPair,{})})}),jsxRuntimeExports.jsx(Route,{path:"/launch-blocklet/*",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(LaunchBlockletProvider,{children:jsxRuntimeExports.jsx(BlockletLauncher,{})})})}),jsxRuntimeExports.jsx(Route,{path:"/blocklets/restore/*",element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(BlockletAppProvider,{children:jsxRuntimeExports.jsx(BlockletRestore,{})})})}),jsxRuntimeExports.jsx(Route,{path:`${constantExports$1.WELLKNOWN_SERVICE_PATH_PREFIX}/invite`,element:jsxRuntimeExports.jsx(UnprotectedWrapper,{children:jsxRuntimeExports.jsx(Invite,{})})}),jsxRuntimeExports.jsx(Route,{path:"/*",element:jsxRuntimeExports.jsx(ProtectedApp,{})})]})})}function AppWrapper(){const Be=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";return jsxRuntimeExports.jsx(BrowserRouter,{history:history$1,basename:Be,children:jsxRuntimeExports.jsx(Root,{children:jsxRuntimeExports.jsx(App,{})})})}const root=clientExports.createRoot(document.getElementById("root"));root.render(jsxRuntimeExports.jsx(AppWrapper,{}));const prefix=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";register(`${prefix}/service-worker.js`.replace(/\/+/g,"/"),{registrationOptions:{scope:prefix},registered(){console.info("Service worker has been registered.")},ready(){console.info("Service worker is active.")},cached(){console.info("Content has been cached for offline use.")},updatefound(){console.info("New content is downloading.")},updated(){console.info("New content is available; please refresh.")},offline(){console.info("No internet connection found. App is running in offline mode.")},error(Be){console.error("Error during service worker registration:",Be)}});export{$$4 as $,withQuery as A,useNavigate as B,CircularProgress as C,DialogContentText as D,useSearchParams as E,useMediaQuery as F,Grid$1 as G,H$7 as H,libExports$3 as I,Link$1 as J,BlockletAppAvatar as K,Link as L,Box as M,isEmpty as N,et as O,FormControl as P,InputLabel as Q,MenuItem as R,Select as S,Typography as T,Checkbox as U,Alert as V,WrappedDidAddress as W,formatError as X,o$g as Y,CheckIcon$2 as Z,propTypesExports as _,useSubscription as a,Menu as a$,api as a0,merge as a1,cloneDeep as a2,IconButton as a3,R$3 as a4,ListItemSecondaryAction as a5,List as a6,ListItem as a7,ListItemText as a8,getServerUrl as a9,ErrorBoundary as aA,k$1 as aB,formatRegistryLogoPath as aC,Icon as aD,ListItemIcon as aE,createSvgIcon as aF,ensureDomainAliases as aG,constantExports$1 as aH,getIp as aI,normalizePathPrefix as aJ,sortBy as aK,stringSortHandlerAsc as aL,getAccessUrl as aM,history$1 as aN,semver as aO,useReactive as aP,useAsyncEffect as aQ,InfoOutlinedIcon as aR,sleep as aS,checkInputByType as aT,FormControlLabel as aU,Stack$1 as aV,useAsync as aW,axios as aX,shouldCheckDomainStatus as aY,formatMountPoint as aZ,urlPathFriendly as a_,useBlockletAppContext as aa,getAuthMethodExports as ab,ConfirmDialog as ac,getRestoredAccessUrl as ad,setSessionToken as ae,isEqual as af,isServerlessBlockletInstalled as ag,Debug as ah,getWsClient as ai,useQuery as aj,getPathPrefix as ak,Global as al,Routes as am,Route as an,Navigate as ao,HeaderAddon as ap,SessionContext as aq,css as ar,$$5 as as,formatToDatetime as at,alpha$1 as au,getLaunchAgreementUrl as av,axios$2 as aw,useSessionContext$1 as ax,Tooltip as ay,getBlockletMetaUrl as az,constantExports as b,clsx$1 as b$,checkIsWildcardDomain as b0,Popover as b1,Card as b2,formatToDate as b3,sortDomains as b4,C$a as b5,Collapse as b6,CheckCircle as b7,styled as b8,isUrl as b9,BlockletAdminRoles as bA,isInstalling as bB,Badge as bC,createAppPassportSvg as bD,NavLink as bE,__vitePreload as bF,SetCache as bG,arrayIncludes$1 as bH,arrayIncludesWith as bI,cacheHas as bJ,baseUniq as bK,baseFlatten as bL,baseRest as bM,last as bN,arrayFilter as bO,isArrayLikeObject as bP,t$9 as bQ,isDownloading as bR,getBlockletUrl as bS,getBlockletUrlParams as bT,ButtonBase as bU,memoTheme as bV,emphasize as bW,generateUtilityClasses$1 as bX,generateUtilityClass$1 as bY,useDefaultProps as bZ,useSlotProps as b_,__awaiter as ba,__generator as bb,__spread as bc,getDefaultExportFromCjs$1 as bd,U$3 as be,dayjs$1 as bf,Divider as bg,isCertificateMatch as bh,FormHelperText as bi,FormGroup as bj,o$d as bk,NodeContext as bl,useParams as bm,useNodeContext$1 as bn,uniqBy as bo,l as bp,libExports$1 as bq,B$5 as br,o$a as bs,l$h as bt,BlockletAvatar as bu,ClickAwayListener as bv,f$8 as bw,createPassportSvg as bx,getWalletType as by,useCreation as bz,createCompounder as c,flat as c$,composeClasses as c0,__read as c1,toSlotDomain as c2,omit as c3,fixBlocklet as c4,isProtectedRole as c5,baseOrderBy as c6,isArray$1 as c7,rootShouldForwardProp as c8,useFormControl as c9,isFunction$2 as cA,Container$3 as cB,K$3 as cC,getLauncherBaseURL as cD,SvgIcon as cE,Buffer$1 as cF,parseURL as cG,withHttps as cH,useLaunchBlockletContext as cI,z$3 as cJ,authorize as cK,ArrowForwardIcon as cL,isNewStoreUrl as cM,getAccessibleUrl as cN,getBlockletLogoUrl as cO,t as cP,M$7 as cQ,__spreadArrays as cR,__assign as cS,h$6 as cT,useLocation as cU,l$8 as cV,useMount as cW,s$8 as cX,formatDateTime as cY,getExplorerLink as cZ,patchJsxToLocale as c_,createChainedFunction$1 as ca,useSlot as cb,capitalize$1 as cc,SwitchBase as cd,createSimplePaletteValueFilter as ce,useControlled as cf,useForkRef as cg,useId as ch,getBlockletUrls as ci,defaultCheckAccessible as cj,urlEvaluationExports as ck,memoize as cl,ButtonGroupContext as cm,ButtonGroupButtonContext as cn,useNotificationContext as co,utilExports as cp,NotificationList as cq,useRequest as cr,useMemoizedFn as cs,isNumber$3 as ct,useLatest as cu,dayjs as cv,d$e as cw,Avatar as cx,isFromWallet as cy,usePassportId as cz,useBlockletsContext as d,afterMain as d$,en$2 as d0,Q$3 as d1,getSessionToken as d2,LinearProgress as d3,SvgLogo as d4,isNumber$1 as d5,useEnhancedEffect$1 as d6,debounce$2 as d7,ownerWindow as d8,useRtl as d9,requirePropTypes as dA,requireReactDom as dB,isObject$3 as dC,require$$0$2 as dD,require$$5$1 as dE,requireConstant$1 as dF,$e$1 as dG,noop$1 as dH,Button as dI,Paper as dJ,MenuList as dK,Popper as dL,_inheritsLoose$1 as dM,ReactDOM as dN,_objectWithoutPropertiesLoose$1 as dO,TransitionGroup as dP,ENTERED as dQ,ENTERING as dR,EXITING as dS,TransitionGroupContext as dT,Transition as dU,config$1 as dV,popperGenerator as dW,eventListeners as dX,popperOffsets$1 as dY,computeStyles$1 as dZ,applyStyles$1 as d_,KeyboardArrowLeft as da,KeyboardArrowRight as db,useEventCallback$1 as dc,ownerDocument as dd,l$p as de,getCommonHtmlTitle as df,HelmetExport as dg,requireReact as dh,i$e as di,oe$2 as dj,ne$2 as dk,InfoIcon$2 as dl,upperFirst as dm,camelCase as dn,Skeleton as dp,R$5 as dq,isArrayLike as dr,baseIteratee as ds,keys as dt,toInteger as du,baseFindIndex as dv,commonjsGlobal as dw,getAugmentedNamespace as dx,emotionUtils_browser_esm as dy,requireJsxRuntime as dz,useAsyncRetry as e,toString$2 as e$,afterRead as e0,afterWrite as e1,arrow$1 as e2,auto as e3,basePlacements as e4,beforeMain as e5,beforeRead as e6,beforeWrite as e7,bottom as e8,clippingParents as e9,requireLib$3 as eA,requireLib$4 as eB,requireLib$2 as eC,requireConstant$2 as eD,requireUrlPathFriendly as eE,b$8 as eF,data$s as eG,global$2 as eH,hoistStatics as eI,isEqual$3 as eJ,usePreviousProps as eK,setRef as eL,ClearIcon as eM,ArrowDropDownIcon as eN,Chip as eO,filledInputClasses as eP,inputBaseClasses as eQ,outlinedInputClasses as eR,inputClasses as eS,ListContext as eT,getListItemButtonUtilityClass as eU,listItemButtonClasses as eV,emotionReact_browser_esm as eW,emotionCache_browser_esm as eX,cloneDeep$1 as eY,forceReflow as eZ,_extends$2 as e_,createPopper as ea,createPopper$1 as eb,detectOverflow as ec,end as ed,flip$1 as ee,hide$1 as ef,left as eg,main as eh,modifierPhases as ei,offset$1 as ej,placements as ek,popper as el,preventOverflow$1 as em,read as en,reference as eo,right as ep,start as eq,top as er,variationPlacements as es,viewport as et,write as eu,requireReactIs as ev,emotionStyled_browser_esm as ew,emotionSerialize_esm as ex,emotionSheet_esm as ey,process$1 as ez,useTheme as f,requireSafeBuffer$1 as f$,mergeThemeOptions as f0,StyledEngineProvider as f1,ThemeProvider as f2,ThemeProvider$3 as f3,s$3 as f4,CloseIcon as f5,isString$1 as f6,createTheme as f7,createAxios as f8,pick as f9,slotShouldForwardProp as fA,requireNormalizePathPrefix as fB,debounce as fC,useInterval as fD,formatTime as fE,CloseFullscreenIcon as fF,S$8 as fG,TablePagination as fH,parseAvatar as fI,__rest as fJ,useEffectWithTarget$1 as fK,__values as fL,tmp as fM,useUpdate as fN,Y$3 as fO,I$3 as fP,p$d as fQ,ee as fR,requireUtil$6 as fS,requireObjectKeys$1 as fT,requireShams$1 as fU,requireCallBound as fV,requireEsObjectAtoms as fW,requireDefineDataProperty as fX,requireHasPropertyDescriptors as fY,requireCallBind as fZ,requireCallBound$1 as f_,omitBy as fa,MenuIcon as fb,useDebounceFn as fc,Dialog as fd,OutlinedInput as fe,data as ff,Drawer as fg,parseQuery as fh,parseFilename as fi,stringifyParsedURL as fj,Grow as fk,Wt as fl,InputAdornment as fm,tooltipClasses as fn,e$b as fo,requireEngine as fp,__spreadArray as fq,useEventListener as fr,le$7 as fs,getTargetElement as ft,clamp as fu,extractEventHandlers as fv,isFocusVisible as fw,isHostComponent as fx,lighten as fy,darken as fz,g$f as g,THEME_ID as g$,requireBrowser$f as g0,requireElliptic as g1,requireCryptoBrowserify as g2,requireRipemd160 as g3,requireLib$1 as g4,requireUtil$2 as g5,uniq as g6,useLocalStorageState as g7,InputBase as g8,useSize as g9,arrayMap as gA,baseMap as gB,baseForOwn as gC,isPlainObject$2 as gD,require$$12 as gE,throttle$2 as gF,isUndefined$1 as gG,useTimeout as gH,Fade as gI,FocusTrap as gJ,dialogClasses as gK,localizedFormatPlugin as gL,n$8 as gM,purify as gN,Buffer$1$1 as gO,Q$2 as gP,requireJsonStableStringify as gQ,requireSemver as gR,requireBrowser$5 as gS,require$$0$1 as gT,requireIsAbsoluteUrl as gU,requireDist$1 as gV,requireBrowser$3 as gW,require$$3 as gX,resolveProps as gY,useThemeProps as gZ,defaultTheme$1 as g_,DialogTitle as ga,DialogContent as gb,DialogActions as gc,pickBy as gd,shouldForwardProp as ge,resolveComponentProps as gf,getInviteLink as gg,copy as gh,e$d as gi,getIssuePassportLink as gj,uniqBy$1 as gk,isNodeOwner as gl,isSelf as gm,Q$1 as gn,getBlockletAccessibleUrl as go,A$1 as gp,createPassportSvg$1 as gq,requireMs as gr,E$3 as gs,trim as gt,BlockletSDK as gu,getBlockletSDK as gv,MoreHorizIcon as gw,identity$1 as gx,arrayEach as gy,baseEach as gz,get$1 as h,green as h$,isIndex as h0,useTheme$4 as h1,objectAssign as h2,__extends as h3,isServerless as h4,isFunction$1 as h5,omit$1 as h6,TableContext as h7,Tablelvl2Context as h8,d$f as h9,requireAssertString as hA,isEmail as hB,isURL as hC,createUseStorageState as hD,isBrowser$1 as hE,root$1 as hF,isNil$1 as hG,require$$11 as hH,requireHoistNonReactStatics_cjs as hI,_assertThisInitialized$1 as hJ,reactDomExports as hK,loadIcon as hL,withoutLeadingSlash as hM,fetchSvgAsPng as hN,blobToFile as hO,withoutTrailingSlash as hP,u$2 as hQ,Ce as hR,t$g as hS,i as hT,R$8 as hU,browserExports$1 as hV,highlightExports as hW,funcExports as hX,data$y as hY,useSnackbar as hZ,common$3 as h_,useUnmount as ha,isDidDomainOrIpEchoDomain as hb,ExpandLess as hc,validateDomain as hd,requireDist$2 as he,requireAxios as hf,trim$1 as hg,requirePRetry as hh,TableCell as hi,xe$1 as hj,getSystemDomains as hk,copyArray as hl,baseIndexOf as hm,ke as hn,useAppLogo as ho,getTransferAppLink as hp,requireBn$1 as hq,require$$2 as hr,updateWindowEnv as hs,M$3 as ht,isNil as hu,requireBase32 as hv,Pe as hw,withTrailingSlash as hx,data$B as hy,keyframes as hz,utilExports$1 as i,n$5 as i$,amber as i0,SnackbarContent as i1,d$h as i2,t$1 as i3,useDebounce as i4,Y as i5,g$3 as i6,b as i7,g$a as i8,withErrorBoundary as i9,pWaitFor as iA,hasRequiredSteps as iB,getStoreList as iC,commonjsRequire as iD,require_interface as iE,requireHasown as iF,requireBrowser$1 as iG,require$$4$1 as iH,flatten as iI,trimEnd as iJ,base32Exports as iK,flatExports as iL,qt as iM,AxiosError as iN,I$6 as iO,isNull as iP,orange as iQ,purple as iR,useStore as iS,createStore as iT,create$1 as iU,t$h as iV,clientExports as iW,Ve$2 as iX,retry as iY,isNetworkError as iZ,requirePTimeout as i_,z$2 as ia,M$4 as ib,Fe as ic,G as id,xe as ie,useBlockletLogo as ig,isPlainObject$1 as ih,Toolbar as ii,_setPrototypeOf as ij,isString$3 as ik,FormLabel as il,RelativeTime as im,isIncludeActivity as io,isUserActor as ip,ActorAvatar as iq,SendComponentAvatar as ir,Activity as is,NotificationContent$1 as it,AvatarGroup as iu,requireCjs as iv,useTheme$2 as iw,baseAssignValue as ix,isValidClusterSize as iy,extractStatusUrlFromNextWorkflow as iz,jsxRuntimeExports as j,Modal as j0,GlobalStyles$2 as j1,filesize as k,prettyMs as l,formatLocale as m,T$7 as n,o$i as o,p$3 as p,useSessionContext as q,reactExports as r,styled$3 as s,useSetState as t,useNodeContext as u,TextField as v,n$4 as w,lo as x,getWebWalletUrl as y,joinURL as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{be as v,r as at}from"./index-DJuZ9nhg.js";var he=e=>e.type==="checkbox",ue=e=>e instanceof Date,$=e=>e==null;const _t=e=>typeof e=="object";var P=e=>!$(e)&&!Array.isArray(e)&&_t(e)&&!ue(e),ht=e=>P(e)&&e.target?he(e.target)?e.target.checked:e.target.value:e,Nt=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,mt=(e,r)=>e.has(Nt(r)),Bt=e=>{const r=e.constructor&&e.constructor.prototype;return P(r)&&r.hasOwnProperty("isPrototypeOf")},je=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function T(e){let r;const t=Array.isArray(e),i=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)r=new Date(e);else if(e instanceof Set)r=new Set(e);else if(!(je&&(e instanceof Blob||i))&&(t||P(e)))if(r=t?[]:{},!t&&!Bt(e))r=e;else for(const n in e)e.hasOwnProperty(n)&&(r[n]=T(e[n]));else return e;return r}var Se=e=>/^\w*$/.test(e),U=e=>e===void 0,we=e=>Array.isArray(e)?e.filter(Boolean):[],Ke=e=>we(e.replace(/["|']|\]/g,"").split(/\.|\[/)),c=(e,r,t)=>{if(!r||!P(e))return t;const i=(Se(r)?[r]:Ke(r)).reduce((n,l)=>$(n)?n:n[l],e);return U(i)||i===e?U(e[r])?t:e[r]:i},Q=e=>typeof e=="boolean",E=(e,r,t)=>{let i=-1;const n=Se(r)?[r]:Ke(r),l=n.length,f=l-1;for(;++i<l;){const d=n[i];let b=t;if(i!==f){const x=e[d];b=P(x)||Array.isArray(x)?x:isNaN(+n[i+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=b,e=e[d]}};const Fe={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Z={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ie={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},vt=v.createContext(null);vt.displayName="HookFormContext";const ke=()=>v.useContext(vt);var bt=(e,r,t,i=!0)=>{const n={defaultValues:r._defaultValues};for(const l in e)Object.defineProperty(n,l,{get:()=>{const f=l;return r._proxyFormState[f]!==Z.all&&(r._proxyFormState[f]=!i||Z.all),t&&(t[f]=!0),e[f]}});return n};const De=typeof window<"u"?at.useLayoutEffect:at.useEffect;function Pt(e){const r=ke(),{control:t=r.control,disabled:i,name:n,exact:l}=e||{},[f,d]=v.useState(t._formState),b=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return De(()=>t._subscribe({name:n,formState:b.current,exact:l,callback:x=>{!i&&d({...t._formState,...x})}}),[n,i,l]),v.useEffect(()=>{b.current.isValid&&t._setValid(!0)},[t]),v.useMemo(()=>bt(f,t,b.current,!1),[f,t])}var se=e=>typeof e=="string",Ft=(e,r,t,i,n)=>se(e)?(i&&r.watch.add(e),c(t,e,n)):Array.isArray(e)?e.map(l=>(i&&r.watch.add(l),c(t,l))):(i&&(r.watchAll=!0),t);function Wt(e){const r=ke(),{control:t=r.control,name:i,defaultValue:n,disabled:l,exact:f}=e||{},d=v.useRef(n),[b,x]=v.useState(t._getWatch(i,d.current));return De(()=>t._subscribe({name:i,formState:{values:!0},exact:f,callback:D=>!l&&x(Ft(i,t._names,D.values||t._formValues,!1,d.current))}),[i,t,l,f]),v.useEffect(()=>t._removeUnmounted()),b}function qt(e){const r=ke(),{name:t,disabled:i,control:n=r.control,shouldUnregister:l}=e,f=mt(n._names.array,t),d=Wt({control:n,name:t,defaultValue:c(n._formValues,t,c(n._defaultValues,t,e.defaultValue)),exact:!0}),b=Pt({control:n,name:t,exact:!0}),x=v.useRef(e),D=v.useRef(n.register(t,{...e.rules,value:d,...Q(e.disabled)?{disabled:e.disabled}:{}})),C=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!c(b.errors,t)},isDirty:{enumerable:!0,get:()=>!!c(b.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!c(b.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!c(b.validatingFields,t)},error:{enumerable:!0,get:()=>c(b.errors,t)}}),[b,t]),F=v.useCallback(L=>D.current.onChange({target:{value:ht(L),name:t},type:Fe.CHANGE}),[t]),M=v.useCallback(()=>D.current.onBlur({target:{value:c(n._formValues,t),name:t},type:Fe.BLUR}),[t,n._formValues]),z=v.useCallback(L=>{const ee=c(n._fields,t);ee&&L&&(ee._f.ref={focus:()=>L.focus&&L.focus(),select:()=>L.select&&L.select(),setCustomValidity:V=>L.setCustomValidity(V),reportValidity:()=>L.reportValidity()})},[n._fields,t]),R=v.useMemo(()=>({name:t,value:d,...Q(i)||b.disabled?{disabled:b.disabled||i}:{},onChange:F,onBlur:M,ref:z}),[t,i,b.disabled,F,M,z,d]);return v.useEffect(()=>{const L=n._options.shouldUnregister||l;n.register(t,{...x.current.rules,...Q(x.current.disabled)?{disabled:x.current.disabled}:{}});const ee=(V,G)=>{const W=c(n._fields,V);W&&W._f&&(W._f.mount=G)};if(ee(t,!0),L){const V=T(c(n._options.defaultValues,t));E(n._defaultValues,t,V),U(c(n._formValues,t))&&E(n._formValues,t,V)}return!f&&n.register(t),()=>{(f?L&&!n._state.action:L)?n.unregister(t):ee(t,!1)}},[t,n,f,l]),v.useEffect(()=>{n._setDisabledField({disabled:i,name:t})},[i,t,n]),v.useMemo(()=>({field:R,formState:b,fieldState:C}),[R,b,C])}const ar=e=>e.render(qt(e));var Ht=(e,r,t,i,n)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:n||!0}}:{},K=e=>Array.isArray(e)?e:[e],nt=()=>{let e=[];return{get observers(){return e},next:n=>{for(const l of e)l.next&&l.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(l=>l!==n)}}),unsubscribe:()=>{e=[]}}},qe=e=>$(e)||!_t(e);function le(e,r,t=new WeakSet){if(qe(e)||qe(r))return e===r;if(ue(e)&&ue(r))return e.getTime()===r.getTime();const i=Object.keys(e),n=Object.keys(r);if(i.length!==n.length)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);for(const l of i){const f=e[l];if(!n.includes(l))return!1;if(l!=="ref"){const d=r[l];if(ue(f)&&ue(d)||P(f)&&P(d)||Array.isArray(f)&&Array.isArray(d)?!le(f,d,t):f!==d)return!1}}return!0}var H=e=>P(e)&&!Object.keys(e).length,ze=e=>e.type==="file",te=e=>typeof e=="function",Ve=e=>{if(!je)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Vt=e=>e.type==="select-multiple",Ge=e=>e.type==="radio",$t=e=>Ge(e)||he(e),Me=e=>Ve(e)&&e.isConnected;function jt(e,r){const t=r.slice(0,-1).length;let i=0;for(;i<t;)e=U(e)?i++:e[r[i++]];return e}function Kt(e){for(const r in e)if(e.hasOwnProperty(r)&&!U(e[r]))return!1;return!0}function B(e,r){const t=Array.isArray(r)?r:Se(r)?[r]:Ke(r),i=t.length===1?e:jt(e,t),n=t.length-1,l=t[n];return i&&delete i[l],n!==0&&(P(i)&&H(i)||Array.isArray(i)&&Kt(i))&&B(e,t.slice(0,-1)),e}var At=e=>{for(const r in e)if(te(e[r]))return!0;return!1};function Ae(e,r={}){const t=Array.isArray(e);if(P(e)||t)for(const i in e)Array.isArray(e[i])||P(e[i])&&!At(e[i])?(r[i]=Array.isArray(e[i])?[]:{},Ae(e[i],r[i])):$(e[i])||(r[i]=!0);return r}function xt(e,r,t){const i=Array.isArray(e);if(P(e)||i)for(const n in e)Array.isArray(e[n])||P(e[n])&&!At(e[n])?U(r)||qe(t[n])?t[n]=Array.isArray(e[n])?Ae(e[n],[]):{...Ae(e[n])}:xt(e[n],$(r)?{}:r[n],t[n]):t[n]=!le(e[n],r[n]);return t}var ge=(e,r)=>xt(e,r,Ae(r));const lt={value:!1,isValid:!1},ut={value:!0,isValid:!0};var St=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!U(e[0].attributes.value)?U(e[0].value)||e[0].value===""?ut:{value:e[0].value,isValid:!0}:ut:lt}return lt},wt=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:i})=>U(e)?e:r?e===""?NaN:e&&+e:t&&se(e)?new Date(e):i?i(e):e;const ot={isValid:!1,value:null};var kt=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,ot):ot;function ct(e){const r=e.ref;return ze(r)?r.files:Ge(r)?kt(e.refs).value:Vt(r)?[...r.selectedOptions].map(({value:t})=>t):he(r)?St(e.refs).value:wt(U(r.value)?e.ref.value:r.value,e)}var zt=(e,r,t,i)=>{const n={};for(const l of e){const f=c(r,l);f&&E(n,l,f._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},xe=e=>e instanceof RegExp,_e=e=>U(e)?e:xe(e)?e.source:P(e)?xe(e.value)?e.value.source:e.value:e,de=e=>({isOnSubmit:!e||e===Z.onSubmit,isOnBlur:e===Z.onBlur,isOnChange:e===Z.onChange,isOnAll:e===Z.all,isOnTouch:e===Z.onTouched});const dt="AsyncFunction";var Gt=e=>!!e&&!!e.validate&&!!(te(e.validate)&&e.validate.constructor.name===dt||P(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===dt)),Yt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),He=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const fe=(e,r,t,i)=>{for(const n of t||Object.keys(e)){const l=c(e,n);if(l){const{_f:f,...d}=l;if(f){if(f.refs&&f.refs[0]&&r(f.refs[0],n)&&!i)return!0;if(f.ref&&r(f.ref,f.name)&&!i)return!0;if(fe(d,r))break}else if(P(d)&&fe(d,r))break}}};function ft(e,r,t){const i=c(e,t);if(i||Se(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const l=n.join("."),f=c(r,l),d=c(e,l);if(f&&!Array.isArray(f)&&t!==l)return{name:t};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};n.pop()}return{name:t}}var Jt=(e,r,t,i)=>{t(e);const{name:n,...l}=e;return H(l)||Object.keys(l).length>=Object.keys(r).length||Object.keys(l).find(f=>r[f]===(!i||Z.all))},Qt=(e,r,t)=>!e||!r||e===r||K(e).some(i=>i&&(t?i===r:i.startsWith(r)||r.startsWith(i))),Xt=(e,r,t,i,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(r||e):(t?i.isOnBlur:n.isOnBlur)?!e:(t?i.isOnChange:n.isOnChange)?e:!0,Zt=(e,r)=>!we(c(e,r)).length&&B(e,r),Dt=(e,r,t)=>{const i=K(c(e,t));return E(i,"root",r[t]),E(e,t,i),e},be=e=>se(e);function yt(e,r,t="validate"){if(be(e)||Array.isArray(e)&&e.every(be)||Q(e)&&!e)return{type:t,message:be(e)?e:"",ref:r}}var ce=e=>P(e)&&!xe(e)?e:{value:e,message:""},$e=async(e,r,t,i,n,l)=>{const{ref:f,refs:d,required:b,maxLength:x,minLength:D,min:C,max:F,pattern:M,validate:z,name:R,valueAsNumber:L,mount:ee}=e._f,V=c(t,R);if(!ee||r.has(R))return{};const G=d?d[0]:f,W=w=>{n&&G.reportValidity&&(G.setCustomValidity(Q(w)?"":w||""),G.reportValidity())},I={},m=Ge(f),h=he(f),A=m||h,S=(L||ze(f))&&U(f.value)&&U(V)||Ve(f)&&f.value===""||V===""||Array.isArray(V)&&!V.length,Y=Ht.bind(null,R,i,I),J=(w,p,N,q=ie.maxLength,j=ie.minLength)=>{const re=w?p:N;I[R]={type:w?q:j,message:re,ref:f,...Y(w?q:j,re)}};if(l?!Array.isArray(V)||!V.length:b&&(!A&&(S||$(V))||Q(V)&&!V||h&&!St(d).isValid||m&&!kt(d).isValid)){const{value:w,message:p}=be(b)?{value:!!b,message:b}:ce(b);if(w&&(I[R]={type:ie.required,message:p,ref:G,...Y(ie.required,p)},!i))return W(p),I}if(!S&&(!$(C)||!$(F))){let w,p;const N=ce(F),q=ce(C);if(!$(V)&&!isNaN(V)){const j=f.valueAsNumber||V&&+V;$(N.value)||(w=j>N.value),$(q.value)||(p=j<q.value)}else{const j=f.valueAsDate||new Date(V),re=me=>new Date(new Date().toDateString()+" "+me),ye=f.type=="time",oe=f.type=="week";se(N.value)&&V&&(w=ye?re(V)>re(N.value):oe?V>N.value:j>new Date(N.value)),se(q.value)&&V&&(p=ye?re(V)<re(q.value):oe?V<q.value:j<new Date(q.value))}if((w||p)&&(J(!!w,N.message,q.message,ie.max,ie.min),!i))return W(I[R].message),I}if((x||D)&&!S&&(se(V)||l&&Array.isArray(V))){const w=ce(x),p=ce(D),N=!$(w.value)&&V.length>+w.value,q=!$(p.value)&&V.length<+p.value;if((N||q)&&(J(N,w.message,p.message),!i))return W(I[R].message),I}if(M&&!S&&se(V)){const{value:w,message:p}=ce(M);if(xe(w)&&!V.match(w)&&(I[R]={type:ie.pattern,message:p,ref:f,...Y(ie.pattern,p)},!i))return W(p),I}if(z){if(te(z)){const w=await z(V,t),p=yt(w,G);if(p&&(I[R]={...p,...Y(ie.validate,p.message)},!i))return W(p.message),I}else if(P(z)){let w={};for(const p in z){if(!H(w)&&!i)break;const N=yt(await z[p](V,t),G,p);N&&(w={...N,...Y(p,N.message)},W(N.message),i&&(I[R]=w))}if(!H(w)&&(I[R]={ref:G,...w},!i))return I}}return W(!0),I};const er={mode:Z.onSubmit,reValidateMode:Z.onChange,shouldFocusError:!0};function tr(e={}){let r={...er,...e},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:te(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1};const i={};let n=P(r.defaultValues)||P(r.values)?T(r.defaultValues||r.values)||{}:{},l=r.shouldUnregister?{}:T(n),f={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},b,x=0;const D={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let C={...D};const F={array:nt(),state:nt()},M=r.criteriaMode===Z.all,z=s=>a=>{clearTimeout(x),x=setTimeout(s,a)},R=async s=>{if(!r.disabled&&(D.isValid||C.isValid||s)){const a=r.resolver?H((await h()).errors):await S(i,!0);a!==t.isValid&&F.state.next({isValid:a})}},L=(s,a)=>{!r.disabled&&(D.isValidating||D.validatingFields||C.isValidating||C.validatingFields)&&((s||Array.from(d.mount)).forEach(u=>{u&&(a?E(t.validatingFields,u,a):B(t.validatingFields,u))}),F.state.next({validatingFields:t.validatingFields,isValidating:!H(t.validatingFields)}))},ee=(s,a=[],u,g,y=!0,o=!0)=>{if(g&&u&&!r.disabled){if(f.action=!0,o&&Array.isArray(c(i,s))){const _=u(c(i,s),g.argA,g.argB);y&&E(i,s,_)}if(o&&Array.isArray(c(t.errors,s))){const _=u(c(t.errors,s),g.argA,g.argB);y&&E(t.errors,s,_),Zt(t.errors,s)}if((D.touchedFields||C.touchedFields)&&o&&Array.isArray(c(t.touchedFields,s))){const _=u(c(t.touchedFields,s),g.argA,g.argB);y&&E(t.touchedFields,s,_)}(D.dirtyFields||C.dirtyFields)&&(t.dirtyFields=ge(n,l)),F.state.next({name:s,isDirty:J(s,a),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else E(l,s,a)},V=(s,a)=>{E(t.errors,s,a),F.state.next({errors:t.errors})},G=s=>{t.errors=s,F.state.next({errors:t.errors,isValid:!1})},W=(s,a,u,g)=>{const y=c(i,s);if(y){const o=c(l,s,U(u)?c(n,s):u);U(o)||g&&g.defaultChecked||a?E(l,s,a?o:ct(y._f)):N(s,o),f.mount&&R()}},I=(s,a,u,g,y)=>{let o=!1,_=!1;const k={name:s};if(!r.disabled){if(!u||g){(D.isDirty||C.isDirty)&&(_=t.isDirty,t.isDirty=k.isDirty=J(),o=_!==k.isDirty);const O=le(c(n,s),a);_=!!c(t.dirtyFields,s),O?B(t.dirtyFields,s):E(t.dirtyFields,s,!0),k.dirtyFields=t.dirtyFields,o=o||(D.dirtyFields||C.dirtyFields)&&_!==!O}if(u){const O=c(t.touchedFields,s);O||(E(t.touchedFields,s,u),k.touchedFields=t.touchedFields,o=o||(D.touchedFields||C.touchedFields)&&O!==u)}o&&y&&F.state.next(k)}return o?k:{}},m=(s,a,u,g)=>{const y=c(t.errors,s),o=(D.isValid||C.isValid)&&Q(a)&&t.isValid!==a;if(r.delayError&&u?(b=z(()=>V(s,u)),b(r.delayError)):(clearTimeout(x),b=null,u?E(t.errors,s,u):B(t.errors,s)),(u?!le(y,u):y)||!H(g)||o){const _={...g,...o&&Q(a)?{isValid:a}:{},errors:t.errors,name:s};t={...t,..._},F.state.next(_)}},h=async s=>{L(s,!0);const a=await r.resolver(l,r.context,zt(s||d.mount,i,r.criteriaMode,r.shouldUseNativeValidation));return L(s),a},A=async s=>{const{errors:a}=await h(s);if(s)for(const u of s){const g=c(a,u);g?E(t.errors,u,g):B(t.errors,u)}else t.errors=a;return a},S=async(s,a,u={valid:!0})=>{for(const g in s){const y=s[g];if(y){const{_f:o,..._}=y;if(o){const k=d.array.has(o.name),O=y._f&&Gt(y._f);O&&D.validatingFields&&L([g],!0);const X=await $e(y,d.disabled,l,M,r.shouldUseNativeValidation&&!a,k);if(O&&D.validatingFields&&L([g]),X[o.name]&&(u.valid=!1,a))break;!a&&(c(X,o.name)?k?Dt(t.errors,X,o.name):E(t.errors,o.name,X[o.name]):B(t.errors,o.name))}!H(_)&&await S(_,a,u)}}return u.valid},Y=()=>{for(const s of d.unMount){const a=c(i,s);a&&(a._f.refs?a._f.refs.every(u=>!Me(u)):!Me(a._f.ref))&&Ee(s)}d.unMount=new Set},J=(s,a)=>!r.disabled&&(s&&a&&E(l,s,a),!le(me(),n)),w=(s,a,u)=>Ft(s,d,{...f.mount?l:U(a)?n:se(s)?{[s]:a}:a},u,a),p=s=>we(c(f.mount?l:n,s,r.shouldUnregister?c(n,s,[]):[])),N=(s,a,u={})=>{const g=c(i,s);let y=a;if(g){const o=g._f;o&&(!o.disabled&&E(l,s,wt(a,o)),y=Ve(o.ref)&&$(a)?"":a,Vt(o.ref)?[...o.ref.options].forEach(_=>_.selected=y.includes(_.value)):o.refs?he(o.ref)?o.refs.forEach(_=>{(!_.defaultChecked||!_.disabled)&&(Array.isArray(y)?_.checked=!!y.find(k=>k===_.value):_.checked=y===_.value||!!y)}):o.refs.forEach(_=>_.checked=_.value===y):ze(o.ref)?o.ref.value="":(o.ref.value=y,o.ref.type||F.state.next({name:s,values:T(l)})))}(u.shouldDirty||u.shouldTouch)&&I(s,y,u.shouldTouch,u.shouldDirty,!0),u.shouldValidate&&oe(s)},q=(s,a,u)=>{for(const g in a){if(!a.hasOwnProperty(g))return;const y=a[g],o=s+"."+g,_=c(i,o);(d.array.has(s)||P(y)||_&&!_._f)&&!ue(y)?q(o,y,u):N(o,y,u)}},j=(s,a,u={})=>{const g=c(i,s),y=d.array.has(s),o=T(a);E(l,s,o),y?(F.array.next({name:s,values:T(l)}),(D.isDirty||D.dirtyFields||C.isDirty||C.dirtyFields)&&u.shouldDirty&&F.state.next({name:s,dirtyFields:ge(n,l),isDirty:J(s,o)})):g&&!g._f&&!$(o)?q(s,o,u):N(s,o,u),He(s,d)&&F.state.next({...t}),F.state.next({name:f.mount?s:void 0,values:T(l)})},re=async s=>{f.mount=!0;const a=s.target;let u=a.name,g=!0;const y=c(i,u),o=O=>{g=Number.isNaN(O)||ue(O)&&isNaN(O.getTime())||le(O,c(l,u,O))},_=de(r.mode),k=de(r.reValidateMode);if(y){let O,X;const ve=a.type?ct(y._f):ht(s),ae=s.type===Fe.BLUR||s.type===Fe.FOCUS_OUT,Lt=!Yt(y._f)&&!r.resolver&&!c(t.errors,u)&&!y._f.deps||Xt(ae,c(t.touchedFields,u),t.isSubmitted,k,_),Oe=He(u,d,ae);E(l,u,ve),ae?(y._f.onBlur&&y._f.onBlur(s),b&&b(0)):y._f.onChange&&y._f.onChange(s);const Ue=I(u,ve,ae),Tt=!H(Ue)||Oe;if(!ae&&F.state.next({name:u,type:s.type,values:T(l)}),Lt)return(D.isValid||C.isValid)&&(r.mode==="onBlur"?ae&&R():ae||R()),Tt&&F.state.next({name:u,...Oe?{}:Ue});if(!ae&&Oe&&F.state.next({...t}),r.resolver){const{errors:st}=await h([u]);if(o(ve),g){const It=ft(t.errors,i,u),it=ft(st,i,It.name||u);O=it.error,u=it.name,X=H(st)}}else L([u],!0),O=(await $e(y,d.disabled,l,M,r.shouldUseNativeValidation))[u],L([u]),o(ve),g&&(O?X=!1:(D.isValid||C.isValid)&&(X=await S(i,!0)));g&&(y._f.deps&&oe(y._f.deps),m(u,X,O,Ue))}},ye=(s,a)=>{if(c(t.errors,a)&&s.focus)return s.focus(),1},oe=async(s,a={})=>{let u,g;const y=K(s);if(r.resolver){const o=await A(U(s)?s:y);u=H(o),g=s?!y.some(_=>c(o,_)):u}else s?(g=(await Promise.all(y.map(async o=>{const _=c(i,o);return await S(_&&_._f?{[o]:_}:_)}))).every(Boolean),!(!g&&!t.isValid)&&R()):g=u=await S(i);return F.state.next({...!se(s)||(D.isValid||C.isValid)&&u!==t.isValid?{}:{name:s},...r.resolver||!s?{isValid:u}:{},errors:t.errors}),a.shouldFocus&&!g&&fe(i,ye,s?y:d.mount),g},me=s=>{const a={...f.mount?l:n};return U(s)?a:se(s)?c(a,s):s.map(u=>c(a,u))},Ye=(s,a)=>({invalid:!!c((a||t).errors,s),isDirty:!!c((a||t).dirtyFields,s),error:c((a||t).errors,s),isValidating:!!c(t.validatingFields,s),isTouched:!!c((a||t).touchedFields,s)}),Et=s=>{s&&K(s).forEach(a=>B(t.errors,a)),F.state.next({errors:s?t.errors:{}})},Je=(s,a,u)=>{const g=(c(i,s,{_f:{}})._f||{}).ref,y=c(t.errors,s)||{},{ref:o,message:_,type:k,...O}=y;E(t.errors,s,{...O,...a,ref:g}),F.state.next({name:s,errors:t.errors,isValid:!1}),u&&u.shouldFocus&&g&&g.focus&&g.focus()},pt=(s,a)=>te(s)?F.state.subscribe({next:u=>s(w(void 0,a),u)}):w(s,a,!0),Qe=s=>F.state.subscribe({next:a=>{Qt(s.name,a.name,s.exact)&&Jt(a,s.formState||D,Rt,s.reRenderRoot)&&s.callback({values:{...l},...t,...a})}}).unsubscribe,Ct=s=>(f.mount=!0,C={...C,...s.formState},Qe({...s,formState:C})),Ee=(s,a={})=>{for(const u of s?K(s):d.mount)d.mount.delete(u),d.array.delete(u),a.keepValue||(B(i,u),B(l,u)),!a.keepError&&B(t.errors,u),!a.keepDirty&&B(t.dirtyFields,u),!a.keepTouched&&B(t.touchedFields,u),!a.keepIsValidating&&B(t.validatingFields,u),!r.shouldUnregister&&!a.keepDefaultValue&&B(n,u);F.state.next({values:T(l)}),F.state.next({...t,...a.keepDirty?{isDirty:J()}:{}}),!a.keepIsValid&&R()},Xe=({disabled:s,name:a})=>{(Q(s)&&f.mount||s||d.disabled.has(a))&&(s?d.disabled.add(a):d.disabled.delete(a))},pe=(s,a={})=>{let u=c(i,s);const g=Q(a.disabled)||Q(r.disabled);return E(i,s,{...u||{},_f:{...u&&u._f?u._f:{ref:{name:s}},name:s,mount:!0,...a}}),d.mount.add(s),u?Xe({disabled:Q(a.disabled)?a.disabled:r.disabled,name:s}):W(s,!0,a.value),{...g?{disabled:a.disabled||r.disabled}:{},...r.progressive?{required:!!a.required,min:_e(a.min),max:_e(a.max),minLength:_e(a.minLength),maxLength:_e(a.maxLength),pattern:_e(a.pattern)}:{},name:s,onChange:re,onBlur:re,ref:y=>{if(y){pe(s,a),u=c(i,s);const o=U(y.value)&&y.querySelectorAll&&y.querySelectorAll("input,select,textarea")[0]||y,_=$t(o),k=u._f.refs||[];if(_?k.find(O=>O===o):o===u._f.ref)return;E(i,s,{_f:{...u._f,..._?{refs:[...k.filter(Me),o,...Array.isArray(c(n,s))?[{}]:[]],ref:{type:o.type,name:s}}:{ref:o}}}),W(s,!1,void 0,o)}else u=c(i,s,{}),u._f&&(u._f.mount=!1),(r.shouldUnregister||a.shouldUnregister)&&!(mt(d.array,s)&&f.action)&&d.unMount.add(s)}}},Ce=()=>r.shouldFocusError&&fe(i,ye,d.mount),Ot=s=>{Q(s)&&(F.state.next({disabled:s}),fe(i,(a,u)=>{const g=c(i,u);g&&(a.disabled=g._f.disabled||s,Array.isArray(g._f.refs)&&g._f.refs.forEach(y=>{y.disabled=g._f.disabled||s}))},0,!1))},Ze=(s,a)=>async u=>{let g;u&&(u.preventDefault&&u.preventDefault(),u.persist&&u.persist());let y=T(l);if(F.state.next({isSubmitting:!0}),r.resolver){const{errors:o,values:_}=await h();t.errors=o,y=T(_)}else await S(i);if(d.disabled.size)for(const o of d.disabled)B(y,o);if(B(t.errors,"root"),H(t.errors)){F.state.next({errors:{}});try{await s(y,u)}catch(o){g=o}}else a&&await a({...t.errors},u),Ce(),setTimeout(Ce);if(F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:H(t.errors)&&!g,submitCount:t.submitCount+1,errors:t.errors}),g)throw g},Ut=(s,a={})=>{c(i,s)&&(U(a.defaultValue)?j(s,T(c(n,s))):(j(s,a.defaultValue),E(n,s,T(a.defaultValue))),a.keepTouched||B(t.touchedFields,s),a.keepDirty||(B(t.dirtyFields,s),t.isDirty=a.defaultValue?J(s,T(c(n,s))):J()),a.keepError||(B(t.errors,s),D.isValid&&R()),F.state.next({...t}))},et=(s,a={})=>{const u=s?T(s):n,g=T(u),y=H(s),o=y?n:g;if(a.keepDefaultValues||(n=u),!a.keepValues){if(a.keepDirtyValues){const _=new Set([...d.mount,...Object.keys(ge(n,l))]);for(const k of Array.from(_))c(t.dirtyFields,k)?E(o,k,c(l,k)):j(k,c(o,k))}else{if(je&&U(s))for(const _ of d.mount){const k=c(i,_);if(k&&k._f){const O=Array.isArray(k._f.refs)?k._f.refs[0]:k._f.ref;if(Ve(O)){const X=O.closest("form");if(X){X.reset();break}}}}for(const _ of d.mount){const k=c(o,_,c(n,_));U(k)||(E(o,_,k),j(_,c(o,_)))}}l=T(o),F.array.next({values:{...o}}),F.state.next({values:{...o}})}d={mount:a.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},f.mount=!D.isValid||!!a.keepIsValid||!!a.keepDirtyValues,f.watch=!!r.shouldUnregister,F.state.next({submitCount:a.keepSubmitCount?t.submitCount:0,isDirty:y?!1:a.keepDirty?t.isDirty:!!(a.keepDefaultValues&&!le(s,n)),isSubmitted:a.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:y?{}:a.keepDirtyValues?a.keepDefaultValues&&l?ge(n,l):t.dirtyFields:a.keepDefaultValues&&s?ge(n,s):a.keepDirty?t.dirtyFields:{},touchedFields:a.keepTouched?t.touchedFields:{},errors:a.keepErrors?t.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},tt=(s,a)=>et(te(s)?s(l):s,a),Mt=(s,a={})=>{const u=c(i,s),g=u&&u._f;if(g){const y=g.refs?g.refs[0]:g.ref;y.focus&&(y.focus(),a.shouldSelect&&te(y.select)&&y.select())}},Rt=s=>{t={...t,...s}},rt={control:{register:pe,unregister:Ee,getFieldState:Ye,handleSubmit:Ze,setError:Je,_subscribe:Qe,_runSchema:h,_focusError:Ce,_getWatch:w,_getDirty:J,_setValid:R,_setFieldArray:ee,_setDisabledField:Xe,_setErrors:G,_getFieldArray:p,_reset:et,_resetDefaultValues:()=>te(r.defaultValues)&&r.defaultValues().then(s=>{tt(s,r.resetOptions),F.state.next({isLoading:!1})}),_removeUnmounted:Y,_disableForm:Ot,_subjects:F,_proxyFormState:D,get _fields(){return i},get _formValues(){return l},get _state(){return f},set _state(s){f=s},get _defaultValues(){return n},get _names(){return d},set _names(s){d=s},get _formState(){return t},get _options(){return r},set _options(s){r={...r,...s}}},subscribe:Ct,trigger:oe,register:pe,handleSubmit:Ze,watch:pt,setValue:j,getValues:me,reset:tt,resetField:Ut,clearErrors:Et,unregister:Ee,setError:Je,setFocus:Mt,getFieldState:Ye};return{...rt,formControl:rt}}var ne=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const t=(Math.random()*16+e)%16|0;return(r=="x"?t:t&3|8).toString(16)})},Re=(e,r,t={})=>t.shouldFocus||U(t.shouldFocus)?t.focusName||`${e}.${U(t.focusIndex)?r:t.focusIndex}.`:"",Le=(e,r)=>[...e,...K(r)],Te=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Ie(e,r,t){return[...e.slice(0,r),...K(t),...e.slice(r)]}var Ne=(e,r,t)=>Array.isArray(e)?(U(e[t])&&(e[t]=void 0),e.splice(t,0,e.splice(r,1)[0]),e):[],Be=(e,r)=>[...K(r),...K(e)];function rr(e,r){let t=0;const i=[...e];for(const n of r)i.splice(n-t,1),t++;return we(i).length?i:[]}var Pe=(e,r)=>U(r)?[]:rr(e,K(r).sort((t,i)=>t-i)),We=(e,r,t)=>{[e[r],e[t]]=[e[t],e[r]]},gt=(e,r,t)=>(e[r]=t,e);function nr(e){const r=ke(),{control:t=r.control,name:i,keyName:n="id",shouldUnregister:l,rules:f}=e,[d,b]=v.useState(t._getFieldArray(i)),x=v.useRef(t._getFieldArray(i).map(ne)),D=v.useRef(d),C=v.useRef(i),F=v.useRef(!1);C.current=i,D.current=d,t._names.array.add(i),f&&t.register(i,f),De(()=>t._subjects.array.subscribe({next:({values:m,name:h})=>{if(h===C.current||!h){const A=c(m,C.current);Array.isArray(A)&&(b(A),x.current=A.map(ne))}}}).unsubscribe,[t]);const M=v.useCallback(m=>{F.current=!0,t._setFieldArray(i,m)},[t,i]),z=(m,h)=>{const A=K(T(m)),S=Le(t._getFieldArray(i),A);t._names.focus=Re(i,S.length-1,h),x.current=Le(x.current,A.map(ne)),M(S),b(S),t._setFieldArray(i,S,Le,{argA:Te(m)})},R=(m,h)=>{const A=K(T(m)),S=Be(t._getFieldArray(i),A);t._names.focus=Re(i,0,h),x.current=Be(x.current,A.map(ne)),M(S),b(S),t._setFieldArray(i,S,Be,{argA:Te(m)})},L=m=>{const h=Pe(t._getFieldArray(i),m);x.current=Pe(x.current,m),M(h),b(h),!Array.isArray(c(t._fields,i))&&E(t._fields,i,void 0),t._setFieldArray(i,h,Pe,{argA:m})},ee=(m,h,A)=>{const S=K(T(h)),Y=Ie(t._getFieldArray(i),m,S);t._names.focus=Re(i,m,A),x.current=Ie(x.current,m,S.map(ne)),M(Y),b(Y),t._setFieldArray(i,Y,Ie,{argA:m,argB:Te(h)})},V=(m,h)=>{const A=t._getFieldArray(i);We(A,m,h),We(x.current,m,h),M(A),b(A),t._setFieldArray(i,A,We,{argA:m,argB:h},!1)},G=(m,h)=>{const A=t._getFieldArray(i);Ne(A,m,h),Ne(x.current,m,h),M(A),b(A),t._setFieldArray(i,A,Ne,{argA:m,argB:h},!1)},W=(m,h)=>{const A=T(h),S=gt(t._getFieldArray(i),m,A);x.current=[...S].map((Y,J)=>!Y||J===m?ne():x.current[J]),M(S),b([...S]),t._setFieldArray(i,S,gt,{argA:m,argB:A},!0,!1)},I=m=>{const h=K(T(m));x.current=h.map(ne),M([...h]),b([...h]),t._setFieldArray(i,[...h],A=>A,{},!0,!1)};return v.useEffect(()=>{if(t._state.action=!1,He(i,t._names)&&t._subjects.state.next({...t._formState}),F.current&&(!de(t._options.mode).isOnSubmit||t._formState.isSubmitted)&&!de(t._options.reValidateMode).isOnSubmit)if(t._options.resolver)t._runSchema([i]).then(m=>{const h=c(m.errors,i),A=c(t._formState.errors,i);(A?!h&&A.type||h&&(A.type!==h.type||A.message!==h.message):h&&h.type)&&(h?E(t._formState.errors,i,h):B(t._formState.errors,i),t._subjects.state.next({errors:t._formState.errors}))});else{const m=c(t._fields,i);m&&m._f&&!(de(t._options.reValidateMode).isOnSubmit&&de(t._options.mode).isOnSubmit)&&$e(m,t._names.disabled,t._formValues,t._options.criteriaMode===Z.all,t._options.shouldUseNativeValidation,!0).then(h=>!H(h)&&t._subjects.state.next({errors:Dt(t._formState.errors,h,i)}))}t._subjects.state.next({name:i,values:T(t._formValues)}),t._names.focus&&fe(t._fields,(m,h)=>{if(t._names.focus&&h.startsWith(t._names.focus)&&m.focus)return m.focus(),1}),t._names.focus="",t._setValid(),F.current=!1},[d,i,t]),v.useEffect(()=>(!c(t._formValues,i)&&t._setFieldArray(i),()=>{const m=(h,A)=>{const S=c(t._fields,h);S&&S._f&&(S._f.mount=A)};t._options.shouldUnregister||l?t.unregister(i):m(i,!1)}),[i,t,n,l]),{swap:v.useCallback(V,[M,i,t]),move:v.useCallback(G,[M,i,t]),prepend:v.useCallback(R,[M,i,t]),append:v.useCallback(z,[M,i,t]),remove:v.useCallback(L,[M,i,t]),insert:v.useCallback(ee,[M,i,t]),update:v.useCallback(W,[M,i,t]),replace:v.useCallback(I,[M,i,t]),fields:v.useMemo(()=>d.map((m,h)=>({...m,[n]:x.current[h]||ne()})),[d,n])}}function lr(e={}){const r=v.useRef(void 0),t=v.useRef(void 0),[i,n]=v.useState({isDirty:!1,isValidating:!1,isLoading:te(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:te(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:i},e.defaultValues&&!te(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:f,...d}=tr(e);r.current={...d,formState:i}}const l=r.current.control;return l._options=e,De(()=>{const f=l._subscribe({formState:l._proxyFormState,callback:()=>n({...l._formState}),reRenderRoot:!0});return n(d=>({...d,isReady:!0})),l._formState.isReady=!0,f},[l]),v.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),v.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),v.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),v.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),v.useEffect(()=>{if(l._proxyFormState.isDirty){const f=l._getDirty();f!==i.isDirty&&l._subjects.state.next({isDirty:f})}},[l,i.isDirty]),v.useEffect(()=>{e.values&&!le(e.values,t.current)?(l._reset(e.values,l._options.resetOptions),t.current=e.values,n(f=>({...f}))):l._resetDefaultValues()},[l,e.values]),v.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),r.current.formState=bt(i,l),r.current}export{ar as C,Wt as a,nr as b,lr as u};
|
|
1
|
+
import{be as v,r as at}from"./index-z2Pq7re4.js";var he=e=>e.type==="checkbox",ue=e=>e instanceof Date,$=e=>e==null;const _t=e=>typeof e=="object";var P=e=>!$(e)&&!Array.isArray(e)&&_t(e)&&!ue(e),ht=e=>P(e)&&e.target?he(e.target)?e.target.checked:e.target.value:e,Nt=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,mt=(e,r)=>e.has(Nt(r)),Bt=e=>{const r=e.constructor&&e.constructor.prototype;return P(r)&&r.hasOwnProperty("isPrototypeOf")},je=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function T(e){let r;const t=Array.isArray(e),i=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)r=new Date(e);else if(e instanceof Set)r=new Set(e);else if(!(je&&(e instanceof Blob||i))&&(t||P(e)))if(r=t?[]:{},!t&&!Bt(e))r=e;else for(const n in e)e.hasOwnProperty(n)&&(r[n]=T(e[n]));else return e;return r}var Se=e=>/^\w*$/.test(e),U=e=>e===void 0,we=e=>Array.isArray(e)?e.filter(Boolean):[],Ke=e=>we(e.replace(/["|']|\]/g,"").split(/\.|\[/)),c=(e,r,t)=>{if(!r||!P(e))return t;const i=(Se(r)?[r]:Ke(r)).reduce((n,l)=>$(n)?n:n[l],e);return U(i)||i===e?U(e[r])?t:e[r]:i},Q=e=>typeof e=="boolean",E=(e,r,t)=>{let i=-1;const n=Se(r)?[r]:Ke(r),l=n.length,f=l-1;for(;++i<l;){const d=n[i];let b=t;if(i!==f){const x=e[d];b=P(x)||Array.isArray(x)?x:isNaN(+n[i+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=b,e=e[d]}};const Fe={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Z={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ie={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},vt=v.createContext(null);vt.displayName="HookFormContext";const ke=()=>v.useContext(vt);var bt=(e,r,t,i=!0)=>{const n={defaultValues:r._defaultValues};for(const l in e)Object.defineProperty(n,l,{get:()=>{const f=l;return r._proxyFormState[f]!==Z.all&&(r._proxyFormState[f]=!i||Z.all),t&&(t[f]=!0),e[f]}});return n};const De=typeof window<"u"?at.useLayoutEffect:at.useEffect;function Pt(e){const r=ke(),{control:t=r.control,disabled:i,name:n,exact:l}=e||{},[f,d]=v.useState(t._formState),b=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return De(()=>t._subscribe({name:n,formState:b.current,exact:l,callback:x=>{!i&&d({...t._formState,...x})}}),[n,i,l]),v.useEffect(()=>{b.current.isValid&&t._setValid(!0)},[t]),v.useMemo(()=>bt(f,t,b.current,!1),[f,t])}var se=e=>typeof e=="string",Ft=(e,r,t,i,n)=>se(e)?(i&&r.watch.add(e),c(t,e,n)):Array.isArray(e)?e.map(l=>(i&&r.watch.add(l),c(t,l))):(i&&(r.watchAll=!0),t);function Wt(e){const r=ke(),{control:t=r.control,name:i,defaultValue:n,disabled:l,exact:f}=e||{},d=v.useRef(n),[b,x]=v.useState(t._getWatch(i,d.current));return De(()=>t._subscribe({name:i,formState:{values:!0},exact:f,callback:D=>!l&&x(Ft(i,t._names,D.values||t._formValues,!1,d.current))}),[i,t,l,f]),v.useEffect(()=>t._removeUnmounted()),b}function qt(e){const r=ke(),{name:t,disabled:i,control:n=r.control,shouldUnregister:l}=e,f=mt(n._names.array,t),d=Wt({control:n,name:t,defaultValue:c(n._formValues,t,c(n._defaultValues,t,e.defaultValue)),exact:!0}),b=Pt({control:n,name:t,exact:!0}),x=v.useRef(e),D=v.useRef(n.register(t,{...e.rules,value:d,...Q(e.disabled)?{disabled:e.disabled}:{}})),C=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!c(b.errors,t)},isDirty:{enumerable:!0,get:()=>!!c(b.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!c(b.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!c(b.validatingFields,t)},error:{enumerable:!0,get:()=>c(b.errors,t)}}),[b,t]),F=v.useCallback(L=>D.current.onChange({target:{value:ht(L),name:t},type:Fe.CHANGE}),[t]),M=v.useCallback(()=>D.current.onBlur({target:{value:c(n._formValues,t),name:t},type:Fe.BLUR}),[t,n._formValues]),z=v.useCallback(L=>{const ee=c(n._fields,t);ee&&L&&(ee._f.ref={focus:()=>L.focus&&L.focus(),select:()=>L.select&&L.select(),setCustomValidity:V=>L.setCustomValidity(V),reportValidity:()=>L.reportValidity()})},[n._fields,t]),R=v.useMemo(()=>({name:t,value:d,...Q(i)||b.disabled?{disabled:b.disabled||i}:{},onChange:F,onBlur:M,ref:z}),[t,i,b.disabled,F,M,z,d]);return v.useEffect(()=>{const L=n._options.shouldUnregister||l;n.register(t,{...x.current.rules,...Q(x.current.disabled)?{disabled:x.current.disabled}:{}});const ee=(V,G)=>{const W=c(n._fields,V);W&&W._f&&(W._f.mount=G)};if(ee(t,!0),L){const V=T(c(n._options.defaultValues,t));E(n._defaultValues,t,V),U(c(n._formValues,t))&&E(n._formValues,t,V)}return!f&&n.register(t),()=>{(f?L&&!n._state.action:L)?n.unregister(t):ee(t,!1)}},[t,n,f,l]),v.useEffect(()=>{n._setDisabledField({disabled:i,name:t})},[i,t,n]),v.useMemo(()=>({field:R,formState:b,fieldState:C}),[R,b,C])}const ar=e=>e.render(qt(e));var Ht=(e,r,t,i,n)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:n||!0}}:{},K=e=>Array.isArray(e)?e:[e],nt=()=>{let e=[];return{get observers(){return e},next:n=>{for(const l of e)l.next&&l.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(l=>l!==n)}}),unsubscribe:()=>{e=[]}}},qe=e=>$(e)||!_t(e);function le(e,r,t=new WeakSet){if(qe(e)||qe(r))return e===r;if(ue(e)&&ue(r))return e.getTime()===r.getTime();const i=Object.keys(e),n=Object.keys(r);if(i.length!==n.length)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);for(const l of i){const f=e[l];if(!n.includes(l))return!1;if(l!=="ref"){const d=r[l];if(ue(f)&&ue(d)||P(f)&&P(d)||Array.isArray(f)&&Array.isArray(d)?!le(f,d,t):f!==d)return!1}}return!0}var H=e=>P(e)&&!Object.keys(e).length,ze=e=>e.type==="file",te=e=>typeof e=="function",Ve=e=>{if(!je)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Vt=e=>e.type==="select-multiple",Ge=e=>e.type==="radio",$t=e=>Ge(e)||he(e),Me=e=>Ve(e)&&e.isConnected;function jt(e,r){const t=r.slice(0,-1).length;let i=0;for(;i<t;)e=U(e)?i++:e[r[i++]];return e}function Kt(e){for(const r in e)if(e.hasOwnProperty(r)&&!U(e[r]))return!1;return!0}function B(e,r){const t=Array.isArray(r)?r:Se(r)?[r]:Ke(r),i=t.length===1?e:jt(e,t),n=t.length-1,l=t[n];return i&&delete i[l],n!==0&&(P(i)&&H(i)||Array.isArray(i)&&Kt(i))&&B(e,t.slice(0,-1)),e}var At=e=>{for(const r in e)if(te(e[r]))return!0;return!1};function Ae(e,r={}){const t=Array.isArray(e);if(P(e)||t)for(const i in e)Array.isArray(e[i])||P(e[i])&&!At(e[i])?(r[i]=Array.isArray(e[i])?[]:{},Ae(e[i],r[i])):$(e[i])||(r[i]=!0);return r}function xt(e,r,t){const i=Array.isArray(e);if(P(e)||i)for(const n in e)Array.isArray(e[n])||P(e[n])&&!At(e[n])?U(r)||qe(t[n])?t[n]=Array.isArray(e[n])?Ae(e[n],[]):{...Ae(e[n])}:xt(e[n],$(r)?{}:r[n],t[n]):t[n]=!le(e[n],r[n]);return t}var ge=(e,r)=>xt(e,r,Ae(r));const lt={value:!1,isValid:!1},ut={value:!0,isValid:!0};var St=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!U(e[0].attributes.value)?U(e[0].value)||e[0].value===""?ut:{value:e[0].value,isValid:!0}:ut:lt}return lt},wt=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:i})=>U(e)?e:r?e===""?NaN:e&&+e:t&&se(e)?new Date(e):i?i(e):e;const ot={isValid:!1,value:null};var kt=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,ot):ot;function ct(e){const r=e.ref;return ze(r)?r.files:Ge(r)?kt(e.refs).value:Vt(r)?[...r.selectedOptions].map(({value:t})=>t):he(r)?St(e.refs).value:wt(U(r.value)?e.ref.value:r.value,e)}var zt=(e,r,t,i)=>{const n={};for(const l of e){const f=c(r,l);f&&E(n,l,f._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},xe=e=>e instanceof RegExp,_e=e=>U(e)?e:xe(e)?e.source:P(e)?xe(e.value)?e.value.source:e.value:e,de=e=>({isOnSubmit:!e||e===Z.onSubmit,isOnBlur:e===Z.onBlur,isOnChange:e===Z.onChange,isOnAll:e===Z.all,isOnTouch:e===Z.onTouched});const dt="AsyncFunction";var Gt=e=>!!e&&!!e.validate&&!!(te(e.validate)&&e.validate.constructor.name===dt||P(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===dt)),Yt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),He=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const fe=(e,r,t,i)=>{for(const n of t||Object.keys(e)){const l=c(e,n);if(l){const{_f:f,...d}=l;if(f){if(f.refs&&f.refs[0]&&r(f.refs[0],n)&&!i)return!0;if(f.ref&&r(f.ref,f.name)&&!i)return!0;if(fe(d,r))break}else if(P(d)&&fe(d,r))break}}};function ft(e,r,t){const i=c(e,t);if(i||Se(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const l=n.join("."),f=c(r,l),d=c(e,l);if(f&&!Array.isArray(f)&&t!==l)return{name:t};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};n.pop()}return{name:t}}var Jt=(e,r,t,i)=>{t(e);const{name:n,...l}=e;return H(l)||Object.keys(l).length>=Object.keys(r).length||Object.keys(l).find(f=>r[f]===(!i||Z.all))},Qt=(e,r,t)=>!e||!r||e===r||K(e).some(i=>i&&(t?i===r:i.startsWith(r)||r.startsWith(i))),Xt=(e,r,t,i,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(r||e):(t?i.isOnBlur:n.isOnBlur)?!e:(t?i.isOnChange:n.isOnChange)?e:!0,Zt=(e,r)=>!we(c(e,r)).length&&B(e,r),Dt=(e,r,t)=>{const i=K(c(e,t));return E(i,"root",r[t]),E(e,t,i),e},be=e=>se(e);function yt(e,r,t="validate"){if(be(e)||Array.isArray(e)&&e.every(be)||Q(e)&&!e)return{type:t,message:be(e)?e:"",ref:r}}var ce=e=>P(e)&&!xe(e)?e:{value:e,message:""},$e=async(e,r,t,i,n,l)=>{const{ref:f,refs:d,required:b,maxLength:x,minLength:D,min:C,max:F,pattern:M,validate:z,name:R,valueAsNumber:L,mount:ee}=e._f,V=c(t,R);if(!ee||r.has(R))return{};const G=d?d[0]:f,W=w=>{n&&G.reportValidity&&(G.setCustomValidity(Q(w)?"":w||""),G.reportValidity())},I={},m=Ge(f),h=he(f),A=m||h,S=(L||ze(f))&&U(f.value)&&U(V)||Ve(f)&&f.value===""||V===""||Array.isArray(V)&&!V.length,Y=Ht.bind(null,R,i,I),J=(w,p,N,q=ie.maxLength,j=ie.minLength)=>{const re=w?p:N;I[R]={type:w?q:j,message:re,ref:f,...Y(w?q:j,re)}};if(l?!Array.isArray(V)||!V.length:b&&(!A&&(S||$(V))||Q(V)&&!V||h&&!St(d).isValid||m&&!kt(d).isValid)){const{value:w,message:p}=be(b)?{value:!!b,message:b}:ce(b);if(w&&(I[R]={type:ie.required,message:p,ref:G,...Y(ie.required,p)},!i))return W(p),I}if(!S&&(!$(C)||!$(F))){let w,p;const N=ce(F),q=ce(C);if(!$(V)&&!isNaN(V)){const j=f.valueAsNumber||V&&+V;$(N.value)||(w=j>N.value),$(q.value)||(p=j<q.value)}else{const j=f.valueAsDate||new Date(V),re=me=>new Date(new Date().toDateString()+" "+me),ye=f.type=="time",oe=f.type=="week";se(N.value)&&V&&(w=ye?re(V)>re(N.value):oe?V>N.value:j>new Date(N.value)),se(q.value)&&V&&(p=ye?re(V)<re(q.value):oe?V<q.value:j<new Date(q.value))}if((w||p)&&(J(!!w,N.message,q.message,ie.max,ie.min),!i))return W(I[R].message),I}if((x||D)&&!S&&(se(V)||l&&Array.isArray(V))){const w=ce(x),p=ce(D),N=!$(w.value)&&V.length>+w.value,q=!$(p.value)&&V.length<+p.value;if((N||q)&&(J(N,w.message,p.message),!i))return W(I[R].message),I}if(M&&!S&&se(V)){const{value:w,message:p}=ce(M);if(xe(w)&&!V.match(w)&&(I[R]={type:ie.pattern,message:p,ref:f,...Y(ie.pattern,p)},!i))return W(p),I}if(z){if(te(z)){const w=await z(V,t),p=yt(w,G);if(p&&(I[R]={...p,...Y(ie.validate,p.message)},!i))return W(p.message),I}else if(P(z)){let w={};for(const p in z){if(!H(w)&&!i)break;const N=yt(await z[p](V,t),G,p);N&&(w={...N,...Y(p,N.message)},W(N.message),i&&(I[R]=w))}if(!H(w)&&(I[R]={ref:G,...w},!i))return I}}return W(!0),I};const er={mode:Z.onSubmit,reValidateMode:Z.onChange,shouldFocusError:!0};function tr(e={}){let r={...er,...e},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:te(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1};const i={};let n=P(r.defaultValues)||P(r.values)?T(r.defaultValues||r.values)||{}:{},l=r.shouldUnregister?{}:T(n),f={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},b,x=0;const D={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let C={...D};const F={array:nt(),state:nt()},M=r.criteriaMode===Z.all,z=s=>a=>{clearTimeout(x),x=setTimeout(s,a)},R=async s=>{if(!r.disabled&&(D.isValid||C.isValid||s)){const a=r.resolver?H((await h()).errors):await S(i,!0);a!==t.isValid&&F.state.next({isValid:a})}},L=(s,a)=>{!r.disabled&&(D.isValidating||D.validatingFields||C.isValidating||C.validatingFields)&&((s||Array.from(d.mount)).forEach(u=>{u&&(a?E(t.validatingFields,u,a):B(t.validatingFields,u))}),F.state.next({validatingFields:t.validatingFields,isValidating:!H(t.validatingFields)}))},ee=(s,a=[],u,g,y=!0,o=!0)=>{if(g&&u&&!r.disabled){if(f.action=!0,o&&Array.isArray(c(i,s))){const _=u(c(i,s),g.argA,g.argB);y&&E(i,s,_)}if(o&&Array.isArray(c(t.errors,s))){const _=u(c(t.errors,s),g.argA,g.argB);y&&E(t.errors,s,_),Zt(t.errors,s)}if((D.touchedFields||C.touchedFields)&&o&&Array.isArray(c(t.touchedFields,s))){const _=u(c(t.touchedFields,s),g.argA,g.argB);y&&E(t.touchedFields,s,_)}(D.dirtyFields||C.dirtyFields)&&(t.dirtyFields=ge(n,l)),F.state.next({name:s,isDirty:J(s,a),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else E(l,s,a)},V=(s,a)=>{E(t.errors,s,a),F.state.next({errors:t.errors})},G=s=>{t.errors=s,F.state.next({errors:t.errors,isValid:!1})},W=(s,a,u,g)=>{const y=c(i,s);if(y){const o=c(l,s,U(u)?c(n,s):u);U(o)||g&&g.defaultChecked||a?E(l,s,a?o:ct(y._f)):N(s,o),f.mount&&R()}},I=(s,a,u,g,y)=>{let o=!1,_=!1;const k={name:s};if(!r.disabled){if(!u||g){(D.isDirty||C.isDirty)&&(_=t.isDirty,t.isDirty=k.isDirty=J(),o=_!==k.isDirty);const O=le(c(n,s),a);_=!!c(t.dirtyFields,s),O?B(t.dirtyFields,s):E(t.dirtyFields,s,!0),k.dirtyFields=t.dirtyFields,o=o||(D.dirtyFields||C.dirtyFields)&&_!==!O}if(u){const O=c(t.touchedFields,s);O||(E(t.touchedFields,s,u),k.touchedFields=t.touchedFields,o=o||(D.touchedFields||C.touchedFields)&&O!==u)}o&&y&&F.state.next(k)}return o?k:{}},m=(s,a,u,g)=>{const y=c(t.errors,s),o=(D.isValid||C.isValid)&&Q(a)&&t.isValid!==a;if(r.delayError&&u?(b=z(()=>V(s,u)),b(r.delayError)):(clearTimeout(x),b=null,u?E(t.errors,s,u):B(t.errors,s)),(u?!le(y,u):y)||!H(g)||o){const _={...g,...o&&Q(a)?{isValid:a}:{},errors:t.errors,name:s};t={...t,..._},F.state.next(_)}},h=async s=>{L(s,!0);const a=await r.resolver(l,r.context,zt(s||d.mount,i,r.criteriaMode,r.shouldUseNativeValidation));return L(s),a},A=async s=>{const{errors:a}=await h(s);if(s)for(const u of s){const g=c(a,u);g?E(t.errors,u,g):B(t.errors,u)}else t.errors=a;return a},S=async(s,a,u={valid:!0})=>{for(const g in s){const y=s[g];if(y){const{_f:o,..._}=y;if(o){const k=d.array.has(o.name),O=y._f&&Gt(y._f);O&&D.validatingFields&&L([g],!0);const X=await $e(y,d.disabled,l,M,r.shouldUseNativeValidation&&!a,k);if(O&&D.validatingFields&&L([g]),X[o.name]&&(u.valid=!1,a))break;!a&&(c(X,o.name)?k?Dt(t.errors,X,o.name):E(t.errors,o.name,X[o.name]):B(t.errors,o.name))}!H(_)&&await S(_,a,u)}}return u.valid},Y=()=>{for(const s of d.unMount){const a=c(i,s);a&&(a._f.refs?a._f.refs.every(u=>!Me(u)):!Me(a._f.ref))&&Ee(s)}d.unMount=new Set},J=(s,a)=>!r.disabled&&(s&&a&&E(l,s,a),!le(me(),n)),w=(s,a,u)=>Ft(s,d,{...f.mount?l:U(a)?n:se(s)?{[s]:a}:a},u,a),p=s=>we(c(f.mount?l:n,s,r.shouldUnregister?c(n,s,[]):[])),N=(s,a,u={})=>{const g=c(i,s);let y=a;if(g){const o=g._f;o&&(!o.disabled&&E(l,s,wt(a,o)),y=Ve(o.ref)&&$(a)?"":a,Vt(o.ref)?[...o.ref.options].forEach(_=>_.selected=y.includes(_.value)):o.refs?he(o.ref)?o.refs.forEach(_=>{(!_.defaultChecked||!_.disabled)&&(Array.isArray(y)?_.checked=!!y.find(k=>k===_.value):_.checked=y===_.value||!!y)}):o.refs.forEach(_=>_.checked=_.value===y):ze(o.ref)?o.ref.value="":(o.ref.value=y,o.ref.type||F.state.next({name:s,values:T(l)})))}(u.shouldDirty||u.shouldTouch)&&I(s,y,u.shouldTouch,u.shouldDirty,!0),u.shouldValidate&&oe(s)},q=(s,a,u)=>{for(const g in a){if(!a.hasOwnProperty(g))return;const y=a[g],o=s+"."+g,_=c(i,o);(d.array.has(s)||P(y)||_&&!_._f)&&!ue(y)?q(o,y,u):N(o,y,u)}},j=(s,a,u={})=>{const g=c(i,s),y=d.array.has(s),o=T(a);E(l,s,o),y?(F.array.next({name:s,values:T(l)}),(D.isDirty||D.dirtyFields||C.isDirty||C.dirtyFields)&&u.shouldDirty&&F.state.next({name:s,dirtyFields:ge(n,l),isDirty:J(s,o)})):g&&!g._f&&!$(o)?q(s,o,u):N(s,o,u),He(s,d)&&F.state.next({...t}),F.state.next({name:f.mount?s:void 0,values:T(l)})},re=async s=>{f.mount=!0;const a=s.target;let u=a.name,g=!0;const y=c(i,u),o=O=>{g=Number.isNaN(O)||ue(O)&&isNaN(O.getTime())||le(O,c(l,u,O))},_=de(r.mode),k=de(r.reValidateMode);if(y){let O,X;const ve=a.type?ct(y._f):ht(s),ae=s.type===Fe.BLUR||s.type===Fe.FOCUS_OUT,Lt=!Yt(y._f)&&!r.resolver&&!c(t.errors,u)&&!y._f.deps||Xt(ae,c(t.touchedFields,u),t.isSubmitted,k,_),Oe=He(u,d,ae);E(l,u,ve),ae?(y._f.onBlur&&y._f.onBlur(s),b&&b(0)):y._f.onChange&&y._f.onChange(s);const Ue=I(u,ve,ae),Tt=!H(Ue)||Oe;if(!ae&&F.state.next({name:u,type:s.type,values:T(l)}),Lt)return(D.isValid||C.isValid)&&(r.mode==="onBlur"?ae&&R():ae||R()),Tt&&F.state.next({name:u,...Oe?{}:Ue});if(!ae&&Oe&&F.state.next({...t}),r.resolver){const{errors:st}=await h([u]);if(o(ve),g){const It=ft(t.errors,i,u),it=ft(st,i,It.name||u);O=it.error,u=it.name,X=H(st)}}else L([u],!0),O=(await $e(y,d.disabled,l,M,r.shouldUseNativeValidation))[u],L([u]),o(ve),g&&(O?X=!1:(D.isValid||C.isValid)&&(X=await S(i,!0)));g&&(y._f.deps&&oe(y._f.deps),m(u,X,O,Ue))}},ye=(s,a)=>{if(c(t.errors,a)&&s.focus)return s.focus(),1},oe=async(s,a={})=>{let u,g;const y=K(s);if(r.resolver){const o=await A(U(s)?s:y);u=H(o),g=s?!y.some(_=>c(o,_)):u}else s?(g=(await Promise.all(y.map(async o=>{const _=c(i,o);return await S(_&&_._f?{[o]:_}:_)}))).every(Boolean),!(!g&&!t.isValid)&&R()):g=u=await S(i);return F.state.next({...!se(s)||(D.isValid||C.isValid)&&u!==t.isValid?{}:{name:s},...r.resolver||!s?{isValid:u}:{},errors:t.errors}),a.shouldFocus&&!g&&fe(i,ye,s?y:d.mount),g},me=s=>{const a={...f.mount?l:n};return U(s)?a:se(s)?c(a,s):s.map(u=>c(a,u))},Ye=(s,a)=>({invalid:!!c((a||t).errors,s),isDirty:!!c((a||t).dirtyFields,s),error:c((a||t).errors,s),isValidating:!!c(t.validatingFields,s),isTouched:!!c((a||t).touchedFields,s)}),Et=s=>{s&&K(s).forEach(a=>B(t.errors,a)),F.state.next({errors:s?t.errors:{}})},Je=(s,a,u)=>{const g=(c(i,s,{_f:{}})._f||{}).ref,y=c(t.errors,s)||{},{ref:o,message:_,type:k,...O}=y;E(t.errors,s,{...O,...a,ref:g}),F.state.next({name:s,errors:t.errors,isValid:!1}),u&&u.shouldFocus&&g&&g.focus&&g.focus()},pt=(s,a)=>te(s)?F.state.subscribe({next:u=>s(w(void 0,a),u)}):w(s,a,!0),Qe=s=>F.state.subscribe({next:a=>{Qt(s.name,a.name,s.exact)&&Jt(a,s.formState||D,Rt,s.reRenderRoot)&&s.callback({values:{...l},...t,...a})}}).unsubscribe,Ct=s=>(f.mount=!0,C={...C,...s.formState},Qe({...s,formState:C})),Ee=(s,a={})=>{for(const u of s?K(s):d.mount)d.mount.delete(u),d.array.delete(u),a.keepValue||(B(i,u),B(l,u)),!a.keepError&&B(t.errors,u),!a.keepDirty&&B(t.dirtyFields,u),!a.keepTouched&&B(t.touchedFields,u),!a.keepIsValidating&&B(t.validatingFields,u),!r.shouldUnregister&&!a.keepDefaultValue&&B(n,u);F.state.next({values:T(l)}),F.state.next({...t,...a.keepDirty?{isDirty:J()}:{}}),!a.keepIsValid&&R()},Xe=({disabled:s,name:a})=>{(Q(s)&&f.mount||s||d.disabled.has(a))&&(s?d.disabled.add(a):d.disabled.delete(a))},pe=(s,a={})=>{let u=c(i,s);const g=Q(a.disabled)||Q(r.disabled);return E(i,s,{...u||{},_f:{...u&&u._f?u._f:{ref:{name:s}},name:s,mount:!0,...a}}),d.mount.add(s),u?Xe({disabled:Q(a.disabled)?a.disabled:r.disabled,name:s}):W(s,!0,a.value),{...g?{disabled:a.disabled||r.disabled}:{},...r.progressive?{required:!!a.required,min:_e(a.min),max:_e(a.max),minLength:_e(a.minLength),maxLength:_e(a.maxLength),pattern:_e(a.pattern)}:{},name:s,onChange:re,onBlur:re,ref:y=>{if(y){pe(s,a),u=c(i,s);const o=U(y.value)&&y.querySelectorAll&&y.querySelectorAll("input,select,textarea")[0]||y,_=$t(o),k=u._f.refs||[];if(_?k.find(O=>O===o):o===u._f.ref)return;E(i,s,{_f:{...u._f,..._?{refs:[...k.filter(Me),o,...Array.isArray(c(n,s))?[{}]:[]],ref:{type:o.type,name:s}}:{ref:o}}}),W(s,!1,void 0,o)}else u=c(i,s,{}),u._f&&(u._f.mount=!1),(r.shouldUnregister||a.shouldUnregister)&&!(mt(d.array,s)&&f.action)&&d.unMount.add(s)}}},Ce=()=>r.shouldFocusError&&fe(i,ye,d.mount),Ot=s=>{Q(s)&&(F.state.next({disabled:s}),fe(i,(a,u)=>{const g=c(i,u);g&&(a.disabled=g._f.disabled||s,Array.isArray(g._f.refs)&&g._f.refs.forEach(y=>{y.disabled=g._f.disabled||s}))},0,!1))},Ze=(s,a)=>async u=>{let g;u&&(u.preventDefault&&u.preventDefault(),u.persist&&u.persist());let y=T(l);if(F.state.next({isSubmitting:!0}),r.resolver){const{errors:o,values:_}=await h();t.errors=o,y=T(_)}else await S(i);if(d.disabled.size)for(const o of d.disabled)B(y,o);if(B(t.errors,"root"),H(t.errors)){F.state.next({errors:{}});try{await s(y,u)}catch(o){g=o}}else a&&await a({...t.errors},u),Ce(),setTimeout(Ce);if(F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:H(t.errors)&&!g,submitCount:t.submitCount+1,errors:t.errors}),g)throw g},Ut=(s,a={})=>{c(i,s)&&(U(a.defaultValue)?j(s,T(c(n,s))):(j(s,a.defaultValue),E(n,s,T(a.defaultValue))),a.keepTouched||B(t.touchedFields,s),a.keepDirty||(B(t.dirtyFields,s),t.isDirty=a.defaultValue?J(s,T(c(n,s))):J()),a.keepError||(B(t.errors,s),D.isValid&&R()),F.state.next({...t}))},et=(s,a={})=>{const u=s?T(s):n,g=T(u),y=H(s),o=y?n:g;if(a.keepDefaultValues||(n=u),!a.keepValues){if(a.keepDirtyValues){const _=new Set([...d.mount,...Object.keys(ge(n,l))]);for(const k of Array.from(_))c(t.dirtyFields,k)?E(o,k,c(l,k)):j(k,c(o,k))}else{if(je&&U(s))for(const _ of d.mount){const k=c(i,_);if(k&&k._f){const O=Array.isArray(k._f.refs)?k._f.refs[0]:k._f.ref;if(Ve(O)){const X=O.closest("form");if(X){X.reset();break}}}}for(const _ of d.mount){const k=c(o,_,c(n,_));U(k)||(E(o,_,k),j(_,c(o,_)))}}l=T(o),F.array.next({values:{...o}}),F.state.next({values:{...o}})}d={mount:a.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},f.mount=!D.isValid||!!a.keepIsValid||!!a.keepDirtyValues,f.watch=!!r.shouldUnregister,F.state.next({submitCount:a.keepSubmitCount?t.submitCount:0,isDirty:y?!1:a.keepDirty?t.isDirty:!!(a.keepDefaultValues&&!le(s,n)),isSubmitted:a.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:y?{}:a.keepDirtyValues?a.keepDefaultValues&&l?ge(n,l):t.dirtyFields:a.keepDefaultValues&&s?ge(n,s):a.keepDirty?t.dirtyFields:{},touchedFields:a.keepTouched?t.touchedFields:{},errors:a.keepErrors?t.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},tt=(s,a)=>et(te(s)?s(l):s,a),Mt=(s,a={})=>{const u=c(i,s),g=u&&u._f;if(g){const y=g.refs?g.refs[0]:g.ref;y.focus&&(y.focus(),a.shouldSelect&&te(y.select)&&y.select())}},Rt=s=>{t={...t,...s}},rt={control:{register:pe,unregister:Ee,getFieldState:Ye,handleSubmit:Ze,setError:Je,_subscribe:Qe,_runSchema:h,_focusError:Ce,_getWatch:w,_getDirty:J,_setValid:R,_setFieldArray:ee,_setDisabledField:Xe,_setErrors:G,_getFieldArray:p,_reset:et,_resetDefaultValues:()=>te(r.defaultValues)&&r.defaultValues().then(s=>{tt(s,r.resetOptions),F.state.next({isLoading:!1})}),_removeUnmounted:Y,_disableForm:Ot,_subjects:F,_proxyFormState:D,get _fields(){return i},get _formValues(){return l},get _state(){return f},set _state(s){f=s},get _defaultValues(){return n},get _names(){return d},set _names(s){d=s},get _formState(){return t},get _options(){return r},set _options(s){r={...r,...s}}},subscribe:Ct,trigger:oe,register:pe,handleSubmit:Ze,watch:pt,setValue:j,getValues:me,reset:tt,resetField:Ut,clearErrors:Et,unregister:Ee,setError:Je,setFocus:Mt,getFieldState:Ye};return{...rt,formControl:rt}}var ne=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const t=(Math.random()*16+e)%16|0;return(r=="x"?t:t&3|8).toString(16)})},Re=(e,r,t={})=>t.shouldFocus||U(t.shouldFocus)?t.focusName||`${e}.${U(t.focusIndex)?r:t.focusIndex}.`:"",Le=(e,r)=>[...e,...K(r)],Te=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Ie(e,r,t){return[...e.slice(0,r),...K(t),...e.slice(r)]}var Ne=(e,r,t)=>Array.isArray(e)?(U(e[t])&&(e[t]=void 0),e.splice(t,0,e.splice(r,1)[0]),e):[],Be=(e,r)=>[...K(r),...K(e)];function rr(e,r){let t=0;const i=[...e];for(const n of r)i.splice(n-t,1),t++;return we(i).length?i:[]}var Pe=(e,r)=>U(r)?[]:rr(e,K(r).sort((t,i)=>t-i)),We=(e,r,t)=>{[e[r],e[t]]=[e[t],e[r]]},gt=(e,r,t)=>(e[r]=t,e);function nr(e){const r=ke(),{control:t=r.control,name:i,keyName:n="id",shouldUnregister:l,rules:f}=e,[d,b]=v.useState(t._getFieldArray(i)),x=v.useRef(t._getFieldArray(i).map(ne)),D=v.useRef(d),C=v.useRef(i),F=v.useRef(!1);C.current=i,D.current=d,t._names.array.add(i),f&&t.register(i,f),De(()=>t._subjects.array.subscribe({next:({values:m,name:h})=>{if(h===C.current||!h){const A=c(m,C.current);Array.isArray(A)&&(b(A),x.current=A.map(ne))}}}).unsubscribe,[t]);const M=v.useCallback(m=>{F.current=!0,t._setFieldArray(i,m)},[t,i]),z=(m,h)=>{const A=K(T(m)),S=Le(t._getFieldArray(i),A);t._names.focus=Re(i,S.length-1,h),x.current=Le(x.current,A.map(ne)),M(S),b(S),t._setFieldArray(i,S,Le,{argA:Te(m)})},R=(m,h)=>{const A=K(T(m)),S=Be(t._getFieldArray(i),A);t._names.focus=Re(i,0,h),x.current=Be(x.current,A.map(ne)),M(S),b(S),t._setFieldArray(i,S,Be,{argA:Te(m)})},L=m=>{const h=Pe(t._getFieldArray(i),m);x.current=Pe(x.current,m),M(h),b(h),!Array.isArray(c(t._fields,i))&&E(t._fields,i,void 0),t._setFieldArray(i,h,Pe,{argA:m})},ee=(m,h,A)=>{const S=K(T(h)),Y=Ie(t._getFieldArray(i),m,S);t._names.focus=Re(i,m,A),x.current=Ie(x.current,m,S.map(ne)),M(Y),b(Y),t._setFieldArray(i,Y,Ie,{argA:m,argB:Te(h)})},V=(m,h)=>{const A=t._getFieldArray(i);We(A,m,h),We(x.current,m,h),M(A),b(A),t._setFieldArray(i,A,We,{argA:m,argB:h},!1)},G=(m,h)=>{const A=t._getFieldArray(i);Ne(A,m,h),Ne(x.current,m,h),M(A),b(A),t._setFieldArray(i,A,Ne,{argA:m,argB:h},!1)},W=(m,h)=>{const A=T(h),S=gt(t._getFieldArray(i),m,A);x.current=[...S].map((Y,J)=>!Y||J===m?ne():x.current[J]),M(S),b([...S]),t._setFieldArray(i,S,gt,{argA:m,argB:A},!0,!1)},I=m=>{const h=K(T(m));x.current=h.map(ne),M([...h]),b([...h]),t._setFieldArray(i,[...h],A=>A,{},!0,!1)};return v.useEffect(()=>{if(t._state.action=!1,He(i,t._names)&&t._subjects.state.next({...t._formState}),F.current&&(!de(t._options.mode).isOnSubmit||t._formState.isSubmitted)&&!de(t._options.reValidateMode).isOnSubmit)if(t._options.resolver)t._runSchema([i]).then(m=>{const h=c(m.errors,i),A=c(t._formState.errors,i);(A?!h&&A.type||h&&(A.type!==h.type||A.message!==h.message):h&&h.type)&&(h?E(t._formState.errors,i,h):B(t._formState.errors,i),t._subjects.state.next({errors:t._formState.errors}))});else{const m=c(t._fields,i);m&&m._f&&!(de(t._options.reValidateMode).isOnSubmit&&de(t._options.mode).isOnSubmit)&&$e(m,t._names.disabled,t._formValues,t._options.criteriaMode===Z.all,t._options.shouldUseNativeValidation,!0).then(h=>!H(h)&&t._subjects.state.next({errors:Dt(t._formState.errors,h,i)}))}t._subjects.state.next({name:i,values:T(t._formValues)}),t._names.focus&&fe(t._fields,(m,h)=>{if(t._names.focus&&h.startsWith(t._names.focus)&&m.focus)return m.focus(),1}),t._names.focus="",t._setValid(),F.current=!1},[d,i,t]),v.useEffect(()=>(!c(t._formValues,i)&&t._setFieldArray(i),()=>{const m=(h,A)=>{const S=c(t._fields,h);S&&S._f&&(S._f.mount=A)};t._options.shouldUnregister||l?t.unregister(i):m(i,!1)}),[i,t,n,l]),{swap:v.useCallback(V,[M,i,t]),move:v.useCallback(G,[M,i,t]),prepend:v.useCallback(R,[M,i,t]),append:v.useCallback(z,[M,i,t]),remove:v.useCallback(L,[M,i,t]),insert:v.useCallback(ee,[M,i,t]),update:v.useCallback(W,[M,i,t]),replace:v.useCallback(I,[M,i,t]),fields:v.useMemo(()=>d.map((m,h)=>({...m,[n]:x.current[h]||ne()})),[d,n])}}function lr(e={}){const r=v.useRef(void 0),t=v.useRef(void 0),[i,n]=v.useState({isDirty:!1,isValidating:!1,isLoading:te(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:te(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:i},e.defaultValues&&!te(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:f,...d}=tr(e);r.current={...d,formState:i}}const l=r.current.control;return l._options=e,De(()=>{const f=l._subscribe({formState:l._proxyFormState,callback:()=>n({...l._formState}),reRenderRoot:!0});return n(d=>({...d,isReady:!0})),l._formState.isReady=!0,f},[l]),v.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),v.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),v.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),v.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),v.useEffect(()=>{if(l._proxyFormState.isDirty){const f=l._getDirty();f!==i.isDirty&&l._subjects.state.next({isDirty:f})}},[l,i.isDirty]),v.useEffect(()=>{e.values&&!le(e.values,t.current)?(l._reset(e.values,l._options.resetOptions),t.current=e.values,n(f=>({...f}))):l._resetDefaultValues()},[l,e.values]),v.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),r.current.formState=bt(i,l),r.current}export{ar as C,Wt as a,nr as b,lr as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j,o as L,dD as Ot,dE as Pt,dF as Lt,M as dt,dG as Tt,r as I,be as Dt,a7 as Nt,a3 as qt,a8 as Mt,bi as Wt,bn as $t,q as Bt,n as Ft,cJ as Gt,b as Ht,by as Vt,z as et,i as Kt,W as zt,cs as Jt,H as Yt,X as rt,T as Xt,v as Qt,$ as Zt,D as kt,V as te,w as it,C as nt,x as ee,A as re}from"./index-DJuZ9nhg.js";import{W as ie}from"./status-DD9VFS3g.js";import{r as gt,a as ne,W as se}from"./without-wallet-Cifhravr.js";import{r as oe}from"./cloneDeep-LYTwa-JV.js";import{u as vt}from"./useLocalStorage-rIF260NZ.js";import{v as st}from"./index-CLPR7ihj.js";import{D as ae}from"./url-evaluation-PoqA_faF.js";import{A as le}from"./Autocomplete-BQrCutXD.js";import{L as ce}from"./ListItemButton-ClnowAwh.js";import{S as ue,a as he,b as fe}from"./Stepper-CTMouRdp.js";function pe({mode:o,...p}){return o==="development"?j.jsx(ie,{type:"primary",...p,children:"DEV"}):null}pe.propTypes={mode:L.string.isRequired};var T={},F={exports:{}},K={exports:{}},ot;function yt(){if(ot)return K.exports;ot=1;var o=K.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(u){return"file-"+m(u)}}},p={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:m};Object.keys(o).forEach(function(u){Object.keys(p).forEach(function(h){o[u][h]||(o[u][h]=p[h])}),o[u].protocols_re=RegExp("^("+o[u].protocols.map(function(h){return h.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function m(u){return u.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}return K.exports}var z,at;function me(){if(at)return z;at=1;var o=yt(),p=Object.assign||function(h,t){if(t===null||typeof t!="object")return h;const r=Object.keys(t);let i=r.length;for(;i--;)h[r[i]]=t[r[i]];return h};z=m;function m(u,h,t,r,i,n,a){var x=this;x.type=u,Object.keys(o[u]).forEach(function(C){x[C]=o[u][C]}),x.user=h,x.auth=t,x.project=r,x.committish=i,x.default=n,x.opts=a||{}}return m.prototype.hash=function(){return this.committish?"#"+this.committish:""},m.prototype._fill=function(u,h){if(u){var t=p({},h);t.path=t.path?t.path.replace(/^[/]+/g,""):"",h=p(p({},this.opts),h);var r=this;Object.keys(this).forEach(function(c){r[c]!=null&&t[c]==null&&(t[c]=r[c])});var i=t.auth,n=t.committish,a=t.fragment,x=t.path,C=t.project;Object.keys(t).forEach(function(c){var E=t[c];(c==="path"||c==="project")&&typeof E=="string"?t[c]=E.split("/").map(function(S){return encodeURIComponent(S)}).join("/"):c!=="domain"&&(t[c]=encodeURIComponent(E))}),t["auth@"]=i?i+"@":"",t["#fragment"]=a?"#"+this.hashformat(a):"",t.fragment=t.fragment?t.fragment:"",t["#path"]=x?"#"+this.hashformat(x):"",t["/path"]=t.path?"/"+t.path:"",t.projectPath=C.split("/").map(encodeURIComponent).join("/"),h.noCommittish?(t["#committish"]="",t["/tree/committish"]="",t["/committish"]="",t.committish=""):(t["#committish"]=n?"#"+n:"",t["/tree/committish"]=t.committish?"/"+t.treepath+"/"+t.committish:"",t["/committish"]=t.committish?"/"+t.committish:"",t.committish=t.committish||"master");var g=u;return Object.keys(t).forEach(function(c){g=g.replace(new RegExp("[{]"+c+"[}]","g"),t[c])}),h.noGitPlus?g.replace(/^git[+]/,""):g}},m.prototype.ssh=function(u){return this._fill(this.sshtemplate,u)},m.prototype.sshurl=function(u){return this._fill(this.sshurltemplate,u)},m.prototype.browse=function(u,h,t){return typeof u=="string"?(typeof h!="string"&&(t=h,h=null),this._fill(this.browsefiletemplate,p({fragment:h,path:u},t))):this._fill(this.browsetemplate,u)},m.prototype.docs=function(u){return this._fill(this.docstemplate,u)},m.prototype.bugs=function(u){return this._fill(this.bugstemplate,u)},m.prototype.https=function(u){return this._fill(this.httpstemplate,u)},m.prototype.git=function(u){return this._fill(this.gittemplate,u)},m.prototype.shortcut=function(u){return this._fill(this.shortcuttemplate,u)},m.prototype.path=function(u){return this._fill(this.pathtemplate,u)},m.prototype.tarball=function(u){var h=p({},u,{noCommittish:!1});return this._fill(this.tarballtemplate,h)},m.prototype.file=function(u,h){return this._fill(this.filetemplate,p({path:u},h))},m.prototype.getDefaultRepresentation=function(){return this.default},m.prototype.toString=function(u){return this.default&&typeof this[this.default]=="function"?this[this.default](u):this.sshurl(u)},z}var J,lt;function de(){return lt||(lt=1,J=function(o){o.prototype[Symbol.iterator]=function*(){for(let p=this.head;p;p=p.next)yield p.value}}),J}var Y,ct;function ge(){if(ct)return Y;ct=1,Y=o,o.Node=h,o.create=o;function o(t){var r=this;if(r instanceof o||(r=new o),r.tail=null,r.head=null,r.length=0,t&&typeof t.forEach=="function")t.forEach(function(a){r.push(a)});else if(arguments.length>0)for(var i=0,n=arguments.length;i<n;i++)r.push(arguments[i]);return r}o.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var r=t.next,i=t.prev;return r&&(r.prev=i),i&&(i.next=r),t===this.head&&(this.head=r),t===this.tail&&(this.tail=i),t.list.length--,t.next=null,t.prev=null,t.list=null,r},o.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var r=this.head;t.list=this,t.next=r,r&&(r.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},o.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var r=this.tail;t.list=this,t.prev=r,r&&(r.next=t),this.tail=t,this.head||(this.head=t),this.length++}},o.prototype.push=function(){for(var t=0,r=arguments.length;t<r;t++)m(this,arguments[t]);return this.length},o.prototype.unshift=function(){for(var t=0,r=arguments.length;t<r;t++)u(this,arguments[t]);return this.length},o.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},o.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},o.prototype.forEach=function(t,r){r=r||this;for(var i=this.head,n=0;i!==null;n++)t.call(r,i.value,n,this),i=i.next},o.prototype.forEachReverse=function(t,r){r=r||this;for(var i=this.tail,n=this.length-1;i!==null;n--)t.call(r,i.value,n,this),i=i.prev},o.prototype.get=function(t){for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;if(r===t&&i!==null)return i.value},o.prototype.getReverse=function(t){for(var r=0,i=this.tail;i!==null&&r<t;r++)i=i.prev;if(r===t&&i!==null)return i.value},o.prototype.map=function(t,r){r=r||this;for(var i=new o,n=this.head;n!==null;)i.push(t.call(r,n.value,this)),n=n.next;return i},o.prototype.mapReverse=function(t,r){r=r||this;for(var i=new o,n=this.tail;n!==null;)i.push(t.call(r,n.value,this)),n=n.prev;return i},o.prototype.reduce=function(t,r){var i,n=this.head;if(arguments.length>1)i=r;else if(this.head)n=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var a=0;n!==null;a++)i=t(i,n.value,a),n=n.next;return i},o.prototype.reduceReverse=function(t,r){var i,n=this.tail;if(arguments.length>1)i=r;else if(this.tail)n=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var a=this.length-1;n!==null;a--)i=t(i,n.value,a),n=n.prev;return i},o.prototype.toArray=function(){for(var t=new Array(this.length),r=0,i=this.head;i!==null;r++)t[r]=i.value,i=i.next;return t},o.prototype.toArrayReverse=function(){for(var t=new Array(this.length),r=0,i=this.tail;i!==null;r++)t[r]=i.value,i=i.prev;return t},o.prototype.slice=function(t,r){r=r||this.length,r<0&&(r+=this.length),t=t||0,t<0&&(t+=this.length);var i=new o;if(r<t||r<0)return i;t<0&&(t=0),r>this.length&&(r=this.length);for(var n=0,a=this.head;a!==null&&n<t;n++)a=a.next;for(;a!==null&&n<r;n++,a=a.next)i.push(a.value);return i},o.prototype.sliceReverse=function(t,r){r=r||this.length,r<0&&(r+=this.length),t=t||0,t<0&&(t+=this.length);var i=new o;if(r<t||r<0)return i;t<0&&(t=0),r>this.length&&(r=this.length);for(var n=this.length,a=this.tail;a!==null&&n>r;n--)a=a.prev;for(;a!==null&&n>t;n--,a=a.prev)i.push(a.value);return i},o.prototype.splice=function(t,r,...i){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,a=this.head;a!==null&&n<t;n++)a=a.next;for(var x=[],n=0;a&&n<r;n++)x.push(a.value),a=this.removeNode(a);a===null&&(a=this.tail),a!==this.head&&a!==this.tail&&(a=a.prev);for(var n=0;n<i.length;n++)a=p(this,a,i[n]);return x},o.prototype.reverse=function(){for(var t=this.head,r=this.tail,i=t;i!==null;i=i.prev){var n=i.prev;i.prev=i.next,i.next=n}return this.head=r,this.tail=t,this};function p(t,r,i){var n=r===t.head?new h(i,null,r,t):new h(i,r,r.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}function m(t,r){t.tail=new h(r,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function u(t,r){t.head=new h(r,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function h(t,r,i,n){if(!(this instanceof h))return new h(t,r,i,n);this.list=n,this.value=t,r?(r.next=this,this.prev=r):this.prev=null,i?(i.prev=this,this.next=i):this.next=null}try{de()(o)}catch{}return Y}var X,ut;function ve(){if(ut)return X;ut=1;const o=ge(),p=Symbol("max"),m=Symbol("length"),u=Symbol("lengthCalculator"),h=Symbol("allowStale"),t=Symbol("maxAge"),r=Symbol("dispose"),i=Symbol("noDisposeOnSet"),n=Symbol("lruList"),a=Symbol("cache"),x=Symbol("updateAgeOnGet"),C=()=>1;class g{constructor(s){if(typeof s=="number"&&(s={max:s}),s||(s={}),s.max&&(typeof s.max!="number"||s.max<0))throw new TypeError("max must be a non-negative number");this[p]=s.max||1/0;const e=s.length||C;if(this[u]=typeof e!="function"?C:e,this[h]=s.stale||!1,s.maxAge&&typeof s.maxAge!="number")throw new TypeError("maxAge must be a number");this[t]=s.maxAge||0,this[r]=s.dispose,this[i]=s.noDisposeOnSet||!1,this[x]=s.updateAgeOnGet||!1,this.reset()}set max(s){if(typeof s!="number"||s<0)throw new TypeError("max must be a non-negative number");this[p]=s||1/0,S(this)}get max(){return this[p]}set allowStale(s){this[h]=!!s}get allowStale(){return this[h]}set maxAge(s){if(typeof s!="number")throw new TypeError("maxAge must be a non-negative number");this[t]=s,S(this)}get maxAge(){return this[t]}set lengthCalculator(s){typeof s!="function"&&(s=C),s!==this[u]&&(this[u]=s,this[m]=0,this[n].forEach(e=>{e.length=this[u](e.value,e.key),this[m]+=e.length})),S(this)}get lengthCalculator(){return this[u]}get length(){return this[m]}get itemCount(){return this[n].length}rforEach(s,e){e=e||this;for(let l=this[n].tail;l!==null;){const f=l.prev;U(this,s,l,e),l=f}}forEach(s,e){e=e||this;for(let l=this[n].head;l!==null;){const f=l.next;U(this,s,l,e),l=f}}keys(){return this[n].toArray().map(s=>s.key)}values(){return this[n].toArray().map(s=>s.value)}reset(){this[r]&&this[n]&&this[n].length&&this[n].forEach(s=>this[r](s.key,s.value)),this[a]=new Map,this[n]=new o,this[m]=0}dump(){return this[n].map(s=>E(this,s)?!1:{k:s.key,v:s.value,e:s.now+(s.maxAge||0)}).toArray().filter(s=>s)}dumpLru(){return this[n]}set(s,e,l){if(l=l||this[t],l&&typeof l!="number")throw new TypeError("maxAge must be a number");const f=l?Date.now():0,y=this[u](e,s);if(this[a].has(s)){if(y>this[p])return w(this,this[a].get(s)),!1;const A=this[a].get(s).value;return this[r]&&(this[i]||this[r](s,A.value)),A.now=f,A.maxAge=l,A.value=e,this[m]+=y-A.length,A.length=y,this.get(s),S(this),!0}const b=new R(s,e,y,f,l);return b.length>this[p]?(this[r]&&this[r](s,e),!1):(this[m]+=b.length,this[n].unshift(b),this[a].set(s,this[n].head),S(this),!0)}has(s){if(!this[a].has(s))return!1;const e=this[a].get(s).value;return!E(this,e)}get(s){return c(this,s,!0)}peek(s){return c(this,s,!1)}pop(){const s=this[n].tail;return s?(w(this,s),s.value):null}del(s){w(this,this[a].get(s))}load(s){this.reset();const e=Date.now();for(let l=s.length-1;l>=0;l--){const f=s[l],y=f.e||0;if(y===0)this.set(f.k,f.v);else{const b=y-e;b>0&&this.set(f.k,f.v,b)}}}prune(){this[a].forEach((s,e)=>c(this,e,!1))}}const c=(v,s,e)=>{const l=v[a].get(s);if(l){const f=l.value;if(E(v,f)){if(w(v,l),!v[h])return}else e&&(v[x]&&(l.value.now=Date.now()),v[n].unshiftNode(l));return f.value}},E=(v,s)=>{if(!s||!s.maxAge&&!v[t])return!1;const e=Date.now()-s.now;return s.maxAge?e>s.maxAge:v[t]&&e>v[t]},S=v=>{if(v[m]>v[p])for(let s=v[n].tail;v[m]>v[p]&&s!==null;){const e=s.prev;w(v,s),s=e}},w=(v,s)=>{if(s){const e=s.value;v[r]&&v[r](e.key,e.value),v[m]-=e.length,v[a].delete(e.key),v[n].removeNode(s)}};class R{constructor(s,e,l,f,y){this.key=s,this.value=e,this.length=l,this.now=f,this.maxAge=y||0}}const U=(v,s,e,l)=>{let f=e.value;E(v,f)&&(w(v,e),v[h]||(f=void 0)),f&&s.call(l,f.value,f.key,v)};return X=g,X}var ht;function ye(){if(ht)return F.exports;ht=1;var o=Ot,p=yt(),m=F.exports=me(),u=ve(),h=new u({max:1e3}),t={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function r(g){return t[g]||g.slice(0,-1)}var i={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};F.exports.fromUrl=function(g,c){if(typeof g=="string"){var E=g+JSON.stringify(c||{});return h.has(E)||h.set(E,n(g,c)),h.get(E)}};function n(g,c){if(!(g==null||g==="")){var E=x(a(g)?"github:"+g:g),S=C(E),w=E.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),R=Object.keys(p).map(function(U){try{var v=p[U],s=null;S.auth&&i[S.protocol]&&(s=S.auth);var e=S.hash?decodeURIComponent(S.hash.substr(1)):null,l=null,f=null,y=null;if(w&&w[1]===U)l=w[2]&&decodeURIComponent(w[2]),f=decodeURIComponent(w[3].replace(/\.git$/,"")),y="shortcut";else{if(S.host&&S.host!==v.domain&&S.host.replace(/^www[.]/,"")!==v.domain||!v.protocols_re.test(S.protocol)||!S.path)return;var b=v.pathmatch,_=S.path.match(b);if(!_)return;_[1]!==null&&_[1]!==void 0&&(l=decodeURIComponent(_[1].replace(/^:/,""))),f=decodeURIComponent(_[2]),y=r(S.protocol)}return new m(U,l,s,f,e,y,c)}catch(A){if(!(A instanceof URIError))throw A}}).filter(function(U){return U});if(R.length===1)return R[0]}}function a(g){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(g)}function x(g){var c=o.parse(g);return c.protocol==="gist:"&&c.host&&!c.path?c.protocol+"/"+c.host:g}function C(g){var c=g.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!c){var E=o.parse(g);if(E.auth){const w=g.match(/[^@]+@[^:/]+/);if(w){var S=new o.URL(w[0]);E.auth=S.username||"",S.password&&(E.auth+=":"+S.password)}}return E}return{protocol:"git+ssh:",slashes:!0,auth:c[1],host:c[2],port:null,hostname:c[2],hash:c[4],search:null,query:null,pathname:"/"+c[3],path:"/"+c[3],href:"git+ssh://"+c[1]+"@"+c[2]+"/"+c[3]+(c[4]||"")}}return F.exports}var N={},P={},ft;function xe(){if(ft)return P;ft=1;var o=P&&P.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(P,"__esModule",{value:!0}),P.setService=P.findService=P.getDefaultServiceConfig=P.getServiceConfig=void 0;const p=o(oe),m=gt(),u={},h=a=>{u[a.name]={validate:a.schema.validate.bind(a.schema),defaultConfig:a.default}};P.setService=h,h({name:"auth",schema:m.authConfigSchema,default:{}});const t=a=>{if(!a)throw new Error("service name should not be empty");const x=u[a];if(!x)throw new Error(`service ${a} does not exist`);return x},r=(a,x,{validate:C}={})=>{const g=t(a),c=(0,p.default)(x||{}),{value:E,error:S}=g.validate(c);if(C&&S)throw new Error(`Invalid blocklet service config: ${S.details.map(w=>w.message).join(", ")}`);return E};P.getServiceConfig=r;const i=a=>{const{defaultConfig:x}=t(a);return x};P.getDefaultServiceConfig=i;const n=(a,x)=>{const C=[x];return(a||[]).find(g=>C.includes(g.name))};return P.findService=n,P.default={getServiceConfig:r,getDefaultServiceConfig:i,findService:n,setService:h},P}var pt;function be(){if(pt)return N;pt=1,Object.defineProperty(N,"__esModule",{value:!0}),N.fixAndValidateService=N.validateMeta=void 0;const o=gt(),p=xe(),m=h=>(!h.interfaces||!h.interfaces.length||h.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(r=>{r.config=(0,p.getServiceConfig)(r.name,r.config,{validate:!0})})}),h);N.fixAndValidateService=m;const u=(h,{ensureFiles:t=!1,ensureDist:r=!1,ensureComponentStore:i=!0,ensureName:n=!1,skipValidateDidName:a=!1,schemaOptions:x={}}={})=>{const C=(0,o.createBlockletSchema)(null,{ensureFiles:t,ensureDist:r,ensureComponentStore:i,ensureName:n,skipValidateDidName:a,...x}),{value:g,error:c}=C.validate(h);if(c)throw new Error(`Invalid blocklet meta: ${c.details.map(E=>E.message).join(", ")}`);return g};return N.validateMeta=u,N.default=u,N}var mt;function je(){return mt||(mt=1,function(o){var p=T&&T.__createBinding||(Object.create?function(e,l,f,y){y===void 0&&(y=f);var b=Object.getOwnPropertyDescriptor(l,f);(!b||("get"in b?!l.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return l[f]}}),Object.defineProperty(e,y,b)}:function(e,l,f,y){y===void 0&&(y=f),e[y]=l[f]}),m=T&&T.__setModuleDefault||(Object.create?function(e,l){Object.defineProperty(e,"default",{enumerable:!0,value:l})}:function(e,l){e.default=l}),u=T&&T.__importStar||function(){var e=function(l){return e=Object.getOwnPropertyNames||function(f){var y=[];for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(y[y.length]=b);return y},e(l)};return function(l){if(l&&l.__esModule)return l;var f={};if(l!=null)for(var y=e(l),b=0;b<y.length;b++)y[b]!=="default"&&p(f,l,y[b]);return m(f,l),f}}(),h=T&&T.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.fixService=o.fixInterfaces=o.parsePerson=o.formatPerson=o.fixName=o.fixTags=o.fixPerson=o.fixKeywords=o.fixFiles=o.fixRepository=o.fixRequired=void 0;const t=h(Pt),r=u(ye()),i=Lt(),n=be();Object.defineProperty(o,"fixService",{enumerable:!0,get:function(){return n.fixAndValidateService}});const a=ne(),x=(e,l)=>{e.description||(e.description=`Blocklet from ${l}`),e.version||(e.version=i.BLOCKLET_DEFAULT_VERSION)};o.fixRequired=x;const C=e=>{if(e.repository&&(typeof e.repository=="string"&&(e.repository={type:"git",url:e.repository}),e.repository.url)){const l=r.fromUrl(e.repository.url);l&&(e.repository.url=l.getDefaultRepresentation()==="shortcut"?l.https():l.toString())}};o.fixRepository=C;const g=e=>{Array.isArray(e.files)?e.files&&(e.files=e.files.filter(l=>!(!l||typeof l!="string"))):delete e.files};o.fixFiles=g;const c=e=>{typeof e.keywords=="string"&&(e.keywords=e.keywords.split(/,\s+/)),e.keywords&&!Array.isArray(e.keywords)?delete e.keywords:e.keywords&&(e.keywords=e.keywords.filter(l=>!(typeof l!="string"||!l)))};o.fixKeywords=c;const E=e=>{typeof e.tags=="string"&&(e.tags=e.tags.split(/,\s+/)),e.tags&&!Array.isArray(e.tags)?delete e.tags:e.tags&&(e.tags=e.tags.filter(l=>!(typeof l!="string"||!l)))};o.fixTags=E;const S=(e,l)=>(e.author&&(e.author=l(e.author)),["maintainers","contributors"].forEach(f=>{Array.isArray(e[f])&&(e[f]=e[f].map(l))}),e),w=e=>{if(!e)return"";if(typeof e=="string")return e;const l=e.name||"",f=e.url||e.web,y=f?` (${f})`:"",b=e.email||e.mail,_=b?` <${b}>`:"";return l+_+y};o.formatPerson=w;const R=e=>{if(typeof e!="string")return e;const l=e.match(/^([^(<]+)/),f=e.match(/\(([^)]+)\)/),y=e.match(/<([^>]+)>/),b={};return l&&l[0].trim()&&(b.name=l[0].trim()),y&&([,b.email]=y),f&&([,b.url]=f),b};o.parsePerson=R;const U=e=>(S(e,w),S(e,R),e);o.fixPerson=U;const v=(e,l=!0)=>{if(Array.isArray(e.interfaces)||(e.interfaces=[]),e.interfaces.length)return e.interfaces.forEach(_=>{_.type===i.BLOCKLET_INTERFACE_TYPE_WEB&&(_.protocol="http")}),e;const y=(0,t.default)(e,"capabilities.dynamicPathPrefix",!0)?i.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",b=({type:_="web",name:A,path:W="/",protocol:G="http",port:B=i.BLOCKLET_DEFAULT_PORT_NAME})=>{e.interfaces.push({type:_,name:A,path:W,prefix:y,port:B,protocol:G})};return[i.BLOCKLET_INTERFACE_PUBLIC].forEach(_=>{e[_]&&b({name:_,path:e[_]})}),Array.isArray(e.exposeServices)&&e.exposeServices.forEach(_=>{b({type:"service",name:_.protocol,protocol:_.protocol,port:{internal:`BLOCKLET_${_.protocol}_PORT`.toUpperCase(),external:_.port}})}),l&&(delete e.publicUrl,delete e.adminUrl,delete e.configUrl,delete e.docUrl,delete e.exposeServices,e.capabilities&&delete e.capabilities.dynamicPathPrefix),e};o.fixInterfaces=v;const s=e=>{const{did:l}=e;try{(0,a.validateNewDid)(l),e.name=l}catch{}return e};o.fixName=s,o.default={fixRequired:x,fixRepository:C,fixFiles:g,fixKeywords:c,fixPerson:U,fixTags:E,fixName:s,formatPerson:w,parsePerson:R,fixInterfaces:v,fixService:n.fixAndValidateService}}(T)),T}var Se=je();function xt({owner:o,locale:p}){return j.jsxs(dt,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.fullName,o.did?j.jsx(Tt,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:o.did,compact:!0,size:14,locale:p}):null]})}xt.propTypes={owner:L.object.isRequired,locale:L.string.isRequired};const Ee="install-blocklet-from-URL",bt=()=>{const[o,p]=vt(Ee,"[]",{raw:!0}),m=h=>{const t=h.trim(),r=JSON.parse(o),i=r.findIndex(n=>n===t);i!==0&&(i>0&&r.splice(i,1),r.length>=10&&r.splice(9),r.unshift(t),p(JSON.stringify(r)))},u=h=>{if(!h)return;const t=JSON.parse(o),r=h.trim(),i=t.findIndex(n=>n===r);i>-1&&(t.splice(i,1),p(JSON.stringify(t)))};return{urls:o?JSON.parse(o):[],addUrlRecord:m,removeUrlRecord:u}};function jt({value:o="",onValueChange:p=()=>{},children:m=null,helperText:u=""}){const{urls:h,removeUrlRecord:t}=bt(),r=(i,n)=>{i.preventDefault(),i.stopPropagation(),t(n)};return j.jsxs(dt,{children:[j.jsx(le,{freeSolo:!0,options:h,inputValue:o,onInputChange:(i,n)=>{p(n)},disableClearable:!0,popupIcon:null,renderInput:i=>Dt.cloneElement(m,{...i}),renderOption:(i,n)=>I.createElement(Nt,{...i,key:n,secondaryAction:j.jsx(qt,{edge:"end","aria-label":"delete",onClick:a=>r(a,n),children:j.jsx(ae,{})})},j.jsx(ce,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:j.jsx(Mt,{primary:n,sx:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})})),slotProps:{listbox:{sx:{maxHeight:300,overflow:"auto"}}}}),j.jsx(Wt,{style:{margin:0},children:u})]})}jt.propTypes={onValueChange:L.func,children:L.node,value:L.string,helperText:L.string};function _e({defaultUrl:o="",onCancel:p,onSuccess:m,onError:u=()=>{},mode:h="install",handleText:t={}}){const{api:r}=$t(),{api:i,session:n}=Bt(),[a,x]=I.useState(!1),[C,g]=I.useState(""),{t:c,locale:E}=Ft(),S={dist:{}},{encryptKey:w}=Gt(),[R,U]=I.useState(o),[v,s]=I.useState(o?1:0),[e,l]=I.useState(S),[f,y]=I.useState(!1),[b,_]=I.useState(""),[A]=vt("instant-blocklet-install",!1),[W,G]=I.useState({}),B=h==="component",H=B?!0:!o,{addUrlRecord:St}=bt(),$=I.useMemo(()=>(n.user?.connectedAccounts||[]).some(D=>D.provider===Ht.LOGIN_PROVIDER.WALLET),[n.user]),Q=I.useMemo(()=>{let d=R.trim();return!d.startsWith("https://")&&!d.startsWith("http://")&&!d.startsWith("file://")&&(d=`file://${d}`),d},[R]),V=async()=>{l(S),g(null),x(!0);const d=Q;try{const O=decodeURIComponent(d);try{new URL(O)}catch{throw new Error("Invalid URL")}const{meta:D,inStore:It,registryUrl:Ut}=await r.getBlockletMetaFromUrl({input:{url:O}});l(D),G({inStore:It,registryUrl:Ut,inputUrl:d}),St(d)}catch(O){console.error(O);const D=`Blocklet Install failed: ${rt(O)}`;g(D),u(O)}finally{x(!1)}},Et=()=>{if(B){m({meta:e,...W}),p();return}if(A){x(!0),y(!0);return}const d=et(window?.env?.apiPrefix??"/","/launch-blocklet/install");window.location.href=re(d,{blocklet_meta_url:decodeURIComponent(Q.trim()),from:"url"})},Z=()=>{x(!1),y(!1),m({meta:e,...W}),p()},_t=()=>{x(!1),y(!1)};I.useEffect(()=>{o&&V()},[o]);const M=I.useMemo(()=>({title:e.title,wt:Vt(e),blockletMetaUrl:decodeURIComponent(R.trim())}),[e,R]),k=I.useCallback(async()=>{if($||A){_("");return}const d=new URL(window.location.href);d.pathname=et(window?.env?.apiPrefix??"/","/api/did/launch-free-blocklet-by-session/token"),d.searchParams.set("_ek_",w),Object.keys(M).forEach(D=>{d.searchParams.set(D,M[D])});const{data:O}=await i.get(d.href);O.url?_(O.url):_("")},[$,M,i,w,A]);I.useEffect(()=>{k()},[k]);const wt=I.useMemo(()=>$&&b?{...M,nw:b,skipMigrateAccount:!0}:M,[M,b,$]),Ct=[{name:c("common.name"),value:Kt.getDisplayName({meta:e},!0)},{name:c("common.version"),value:e.version},{name:c("common.did"),value:e.did?j.jsx(zt,{did:e.did}):null},{name:c("common.author"),value:e.owner?j.jsx(xt,{owner:e.owner,locale:E}):Se.formatPerson(e.author)},{name:c("blocklet.dist.downloadLink"),value:e.dist.tarball}],Rt=()=>a?j.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:j.jsx(nt,{})}):e.did?j.jsx("div",{style:{paddingLeft:"10%"},children:Ct.map(d=>d.name===c("common.did")?j.jsx(st,{valueComponent:"div",nameWidth:120,name:d.name,nameFormatter:()=>c("common.did"),children:d.value},d.name):j.jsx(st,{valueComponent:"div",nameWidth:120,name:d.name,children:d.value},d.name))}):null,At=Jt(async()=>{let d=e.title;n.user&&(d=`${n.user.fullName}'s ${e.title}`);try{Z(),await r.launchBlockletWithoutWallet({input:{title:d,blockletMetaUrl:decodeURIComponent(R.trim()),type:"store",storeUrl:W.registryUrl,onlyRequired:!0}})}catch(O){console.error("launchBlockletWithoutWallet error:",O),Yt.error(rt(O),{autoHideDuration:3e3})}}),tt=[{label:c("blocklet.fromUrl.step0"),body:j.jsx(Xt,{component:"div",children:j.jsx(jt,{style:{marginBottom:32},value:R,helperText:c("blocklet.fromUrl.description"),onValueChange:d=>{g(null),U(d)},children:j.jsx(Qt,{label:c("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:R,onChange:d=>{g(null),U(d.target.value)},disabled:a,onKeyPress:d=>{d.key==="Enter"&&(d.preventDefault(),V(),s(1))}})})}),cancel:c("common.cancel"),confirm:c("common.next"),onCancel:p,onConfirm:()=>{V(),s(1)}},{label:c("blocklet.fromUrl.step1"),body:Rt(),cancel:c(H?"common.pre":"common.cancel"),confirm:t?.confirm||c("blocklet.fromUrl.confirm"),onCancel:()=>{H?s(d=>d-1):p()},onConfirm:()=>{Et()}}],q=tt[v];return j.jsxs(j.Fragment,{children:[j.jsxs(Zt,{title:t?.title||c("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>q.onCancel(),showCloseButton:v===0,disableEscapeKeyDown:!0,open:!0,actions:j.jsxs(j.Fragment,{children:[q.cancel&&j.jsx(it,{onClick:d=>{d.stopPropagation(),g(null),q.onCancel()},color:"inherit",children:q.cancel||c("common.cancel")}),j.jsxs(it,{onClick:d=>{d.stopPropagation(),q.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a||!R||C,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[a&&v===0&&j.jsx(nt,{size:16}),q.confirm]})]}),children:[H&&j.jsx(ue,{alternativeLabel:!0,activeStep:v,children:tt.map(({label:d})=>j.jsx(he,{children:j.jsx(fe,{children:d})},d))}),j.jsx(kt,{component:"div",style:{marginTop:24},children:q.body}),!!C&&j.jsx(te,{severity:"error",style:{width:"100%",marginTop:8},children:C})]}),e&&f&&j.jsx(ee,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:!$&&!A?"bind-wallet":"launch-free-blocklet-by-session",checkFn:i.get,checkTimeout:5*60*1e3,onSuccess:Z,extraParams:wt,messages:{title:c("setup.keyPair.title"),scan:c("setup.keyPair.scan"),confirm:c("setup.keyPair.confirm"),success:c("setup.keyPair.success")},onClose:_t,customItems:A?[]:[j.jsx(se,{onClick:At})]})]})}_e.propTypes={defaultUrl:L.string,onCancel:L.func.isRequired,onSuccess:L.func.isRequired,onError:L.func,mode:L.oneOf(["install","component"]),handleText:L.object};export{pe as B,_e as I,xt as a,Se as f};
|
|
1
|
+
import{j,o as L,dD as Ot,dE as Pt,dF as Lt,M as dt,dG as Tt,r as I,be as Dt,a7 as Nt,a3 as qt,a8 as Mt,bi as Wt,bn as $t,q as Bt,n as Ft,cJ as Gt,b as Ht,by as Vt,z as et,i as Kt,W as zt,cs as Jt,H as Yt,X as rt,T as Xt,v as Qt,$ as Zt,D as kt,V as te,w as it,C as nt,x as ee,A as re}from"./index-z2Pq7re4.js";import{W as ie}from"./status-BpSJKdrt.js";import{r as gt,a as ne,W as se}from"./without-wallet-Bpmf04-L.js";import{r as oe}from"./cloneDeep-Djkce8fU.js";import{u as vt}from"./useLocalStorage-CFg3RYoG.js";import{v as st}from"./index-0z8Wehkl.js";import{D as ae}from"./url-evaluation-CeV7iBRh.js";import{A as le}from"./Autocomplete-rgPa6avl.js";import{L as ce}from"./ListItemButton-B2QtbVrs.js";import{S as ue,a as he,b as fe}from"./Stepper-JC9uh-tv.js";function pe({mode:o,...p}){return o==="development"?j.jsx(ie,{type:"primary",...p,children:"DEV"}):null}pe.propTypes={mode:L.string.isRequired};var T={},F={exports:{}},K={exports:{}},ot;function yt(){if(ot)return K.exports;ot=1;var o=K.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(u){return"file-"+m(u)}}},p={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:m};Object.keys(o).forEach(function(u){Object.keys(p).forEach(function(h){o[u][h]||(o[u][h]=p[h])}),o[u].protocols_re=RegExp("^("+o[u].protocols.map(function(h){return h.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function m(u){return u.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}return K.exports}var z,at;function me(){if(at)return z;at=1;var o=yt(),p=Object.assign||function(h,t){if(t===null||typeof t!="object")return h;const r=Object.keys(t);let i=r.length;for(;i--;)h[r[i]]=t[r[i]];return h};z=m;function m(u,h,t,r,i,n,a){var x=this;x.type=u,Object.keys(o[u]).forEach(function(C){x[C]=o[u][C]}),x.user=h,x.auth=t,x.project=r,x.committish=i,x.default=n,x.opts=a||{}}return m.prototype.hash=function(){return this.committish?"#"+this.committish:""},m.prototype._fill=function(u,h){if(u){var t=p({},h);t.path=t.path?t.path.replace(/^[/]+/g,""):"",h=p(p({},this.opts),h);var r=this;Object.keys(this).forEach(function(c){r[c]!=null&&t[c]==null&&(t[c]=r[c])});var i=t.auth,n=t.committish,a=t.fragment,x=t.path,C=t.project;Object.keys(t).forEach(function(c){var E=t[c];(c==="path"||c==="project")&&typeof E=="string"?t[c]=E.split("/").map(function(S){return encodeURIComponent(S)}).join("/"):c!=="domain"&&(t[c]=encodeURIComponent(E))}),t["auth@"]=i?i+"@":"",t["#fragment"]=a?"#"+this.hashformat(a):"",t.fragment=t.fragment?t.fragment:"",t["#path"]=x?"#"+this.hashformat(x):"",t["/path"]=t.path?"/"+t.path:"",t.projectPath=C.split("/").map(encodeURIComponent).join("/"),h.noCommittish?(t["#committish"]="",t["/tree/committish"]="",t["/committish"]="",t.committish=""):(t["#committish"]=n?"#"+n:"",t["/tree/committish"]=t.committish?"/"+t.treepath+"/"+t.committish:"",t["/committish"]=t.committish?"/"+t.committish:"",t.committish=t.committish||"master");var g=u;return Object.keys(t).forEach(function(c){g=g.replace(new RegExp("[{]"+c+"[}]","g"),t[c])}),h.noGitPlus?g.replace(/^git[+]/,""):g}},m.prototype.ssh=function(u){return this._fill(this.sshtemplate,u)},m.prototype.sshurl=function(u){return this._fill(this.sshurltemplate,u)},m.prototype.browse=function(u,h,t){return typeof u=="string"?(typeof h!="string"&&(t=h,h=null),this._fill(this.browsefiletemplate,p({fragment:h,path:u},t))):this._fill(this.browsetemplate,u)},m.prototype.docs=function(u){return this._fill(this.docstemplate,u)},m.prototype.bugs=function(u){return this._fill(this.bugstemplate,u)},m.prototype.https=function(u){return this._fill(this.httpstemplate,u)},m.prototype.git=function(u){return this._fill(this.gittemplate,u)},m.prototype.shortcut=function(u){return this._fill(this.shortcuttemplate,u)},m.prototype.path=function(u){return this._fill(this.pathtemplate,u)},m.prototype.tarball=function(u){var h=p({},u,{noCommittish:!1});return this._fill(this.tarballtemplate,h)},m.prototype.file=function(u,h){return this._fill(this.filetemplate,p({path:u},h))},m.prototype.getDefaultRepresentation=function(){return this.default},m.prototype.toString=function(u){return this.default&&typeof this[this.default]=="function"?this[this.default](u):this.sshurl(u)},z}var J,lt;function de(){return lt||(lt=1,J=function(o){o.prototype[Symbol.iterator]=function*(){for(let p=this.head;p;p=p.next)yield p.value}}),J}var Y,ct;function ge(){if(ct)return Y;ct=1,Y=o,o.Node=h,o.create=o;function o(t){var r=this;if(r instanceof o||(r=new o),r.tail=null,r.head=null,r.length=0,t&&typeof t.forEach=="function")t.forEach(function(a){r.push(a)});else if(arguments.length>0)for(var i=0,n=arguments.length;i<n;i++)r.push(arguments[i]);return r}o.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var r=t.next,i=t.prev;return r&&(r.prev=i),i&&(i.next=r),t===this.head&&(this.head=r),t===this.tail&&(this.tail=i),t.list.length--,t.next=null,t.prev=null,t.list=null,r},o.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var r=this.head;t.list=this,t.next=r,r&&(r.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},o.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var r=this.tail;t.list=this,t.prev=r,r&&(r.next=t),this.tail=t,this.head||(this.head=t),this.length++}},o.prototype.push=function(){for(var t=0,r=arguments.length;t<r;t++)m(this,arguments[t]);return this.length},o.prototype.unshift=function(){for(var t=0,r=arguments.length;t<r;t++)u(this,arguments[t]);return this.length},o.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},o.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},o.prototype.forEach=function(t,r){r=r||this;for(var i=this.head,n=0;i!==null;n++)t.call(r,i.value,n,this),i=i.next},o.prototype.forEachReverse=function(t,r){r=r||this;for(var i=this.tail,n=this.length-1;i!==null;n--)t.call(r,i.value,n,this),i=i.prev},o.prototype.get=function(t){for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;if(r===t&&i!==null)return i.value},o.prototype.getReverse=function(t){for(var r=0,i=this.tail;i!==null&&r<t;r++)i=i.prev;if(r===t&&i!==null)return i.value},o.prototype.map=function(t,r){r=r||this;for(var i=new o,n=this.head;n!==null;)i.push(t.call(r,n.value,this)),n=n.next;return i},o.prototype.mapReverse=function(t,r){r=r||this;for(var i=new o,n=this.tail;n!==null;)i.push(t.call(r,n.value,this)),n=n.prev;return i},o.prototype.reduce=function(t,r){var i,n=this.head;if(arguments.length>1)i=r;else if(this.head)n=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var a=0;n!==null;a++)i=t(i,n.value,a),n=n.next;return i},o.prototype.reduceReverse=function(t,r){var i,n=this.tail;if(arguments.length>1)i=r;else if(this.tail)n=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var a=this.length-1;n!==null;a--)i=t(i,n.value,a),n=n.prev;return i},o.prototype.toArray=function(){for(var t=new Array(this.length),r=0,i=this.head;i!==null;r++)t[r]=i.value,i=i.next;return t},o.prototype.toArrayReverse=function(){for(var t=new Array(this.length),r=0,i=this.tail;i!==null;r++)t[r]=i.value,i=i.prev;return t},o.prototype.slice=function(t,r){r=r||this.length,r<0&&(r+=this.length),t=t||0,t<0&&(t+=this.length);var i=new o;if(r<t||r<0)return i;t<0&&(t=0),r>this.length&&(r=this.length);for(var n=0,a=this.head;a!==null&&n<t;n++)a=a.next;for(;a!==null&&n<r;n++,a=a.next)i.push(a.value);return i},o.prototype.sliceReverse=function(t,r){r=r||this.length,r<0&&(r+=this.length),t=t||0,t<0&&(t+=this.length);var i=new o;if(r<t||r<0)return i;t<0&&(t=0),r>this.length&&(r=this.length);for(var n=this.length,a=this.tail;a!==null&&n>r;n--)a=a.prev;for(;a!==null&&n>t;n--,a=a.prev)i.push(a.value);return i},o.prototype.splice=function(t,r,...i){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,a=this.head;a!==null&&n<t;n++)a=a.next;for(var x=[],n=0;a&&n<r;n++)x.push(a.value),a=this.removeNode(a);a===null&&(a=this.tail),a!==this.head&&a!==this.tail&&(a=a.prev);for(var n=0;n<i.length;n++)a=p(this,a,i[n]);return x},o.prototype.reverse=function(){for(var t=this.head,r=this.tail,i=t;i!==null;i=i.prev){var n=i.prev;i.prev=i.next,i.next=n}return this.head=r,this.tail=t,this};function p(t,r,i){var n=r===t.head?new h(i,null,r,t):new h(i,r,r.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}function m(t,r){t.tail=new h(r,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function u(t,r){t.head=new h(r,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function h(t,r,i,n){if(!(this instanceof h))return new h(t,r,i,n);this.list=n,this.value=t,r?(r.next=this,this.prev=r):this.prev=null,i?(i.prev=this,this.next=i):this.next=null}try{de()(o)}catch{}return Y}var X,ut;function ve(){if(ut)return X;ut=1;const o=ge(),p=Symbol("max"),m=Symbol("length"),u=Symbol("lengthCalculator"),h=Symbol("allowStale"),t=Symbol("maxAge"),r=Symbol("dispose"),i=Symbol("noDisposeOnSet"),n=Symbol("lruList"),a=Symbol("cache"),x=Symbol("updateAgeOnGet"),C=()=>1;class g{constructor(s){if(typeof s=="number"&&(s={max:s}),s||(s={}),s.max&&(typeof s.max!="number"||s.max<0))throw new TypeError("max must be a non-negative number");this[p]=s.max||1/0;const e=s.length||C;if(this[u]=typeof e!="function"?C:e,this[h]=s.stale||!1,s.maxAge&&typeof s.maxAge!="number")throw new TypeError("maxAge must be a number");this[t]=s.maxAge||0,this[r]=s.dispose,this[i]=s.noDisposeOnSet||!1,this[x]=s.updateAgeOnGet||!1,this.reset()}set max(s){if(typeof s!="number"||s<0)throw new TypeError("max must be a non-negative number");this[p]=s||1/0,S(this)}get max(){return this[p]}set allowStale(s){this[h]=!!s}get allowStale(){return this[h]}set maxAge(s){if(typeof s!="number")throw new TypeError("maxAge must be a non-negative number");this[t]=s,S(this)}get maxAge(){return this[t]}set lengthCalculator(s){typeof s!="function"&&(s=C),s!==this[u]&&(this[u]=s,this[m]=0,this[n].forEach(e=>{e.length=this[u](e.value,e.key),this[m]+=e.length})),S(this)}get lengthCalculator(){return this[u]}get length(){return this[m]}get itemCount(){return this[n].length}rforEach(s,e){e=e||this;for(let l=this[n].tail;l!==null;){const f=l.prev;U(this,s,l,e),l=f}}forEach(s,e){e=e||this;for(let l=this[n].head;l!==null;){const f=l.next;U(this,s,l,e),l=f}}keys(){return this[n].toArray().map(s=>s.key)}values(){return this[n].toArray().map(s=>s.value)}reset(){this[r]&&this[n]&&this[n].length&&this[n].forEach(s=>this[r](s.key,s.value)),this[a]=new Map,this[n]=new o,this[m]=0}dump(){return this[n].map(s=>E(this,s)?!1:{k:s.key,v:s.value,e:s.now+(s.maxAge||0)}).toArray().filter(s=>s)}dumpLru(){return this[n]}set(s,e,l){if(l=l||this[t],l&&typeof l!="number")throw new TypeError("maxAge must be a number");const f=l?Date.now():0,y=this[u](e,s);if(this[a].has(s)){if(y>this[p])return w(this,this[a].get(s)),!1;const A=this[a].get(s).value;return this[r]&&(this[i]||this[r](s,A.value)),A.now=f,A.maxAge=l,A.value=e,this[m]+=y-A.length,A.length=y,this.get(s),S(this),!0}const b=new R(s,e,y,f,l);return b.length>this[p]?(this[r]&&this[r](s,e),!1):(this[m]+=b.length,this[n].unshift(b),this[a].set(s,this[n].head),S(this),!0)}has(s){if(!this[a].has(s))return!1;const e=this[a].get(s).value;return!E(this,e)}get(s){return c(this,s,!0)}peek(s){return c(this,s,!1)}pop(){const s=this[n].tail;return s?(w(this,s),s.value):null}del(s){w(this,this[a].get(s))}load(s){this.reset();const e=Date.now();for(let l=s.length-1;l>=0;l--){const f=s[l],y=f.e||0;if(y===0)this.set(f.k,f.v);else{const b=y-e;b>0&&this.set(f.k,f.v,b)}}}prune(){this[a].forEach((s,e)=>c(this,e,!1))}}const c=(v,s,e)=>{const l=v[a].get(s);if(l){const f=l.value;if(E(v,f)){if(w(v,l),!v[h])return}else e&&(v[x]&&(l.value.now=Date.now()),v[n].unshiftNode(l));return f.value}},E=(v,s)=>{if(!s||!s.maxAge&&!v[t])return!1;const e=Date.now()-s.now;return s.maxAge?e>s.maxAge:v[t]&&e>v[t]},S=v=>{if(v[m]>v[p])for(let s=v[n].tail;v[m]>v[p]&&s!==null;){const e=s.prev;w(v,s),s=e}},w=(v,s)=>{if(s){const e=s.value;v[r]&&v[r](e.key,e.value),v[m]-=e.length,v[a].delete(e.key),v[n].removeNode(s)}};class R{constructor(s,e,l,f,y){this.key=s,this.value=e,this.length=l,this.now=f,this.maxAge=y||0}}const U=(v,s,e,l)=>{let f=e.value;E(v,f)&&(w(v,e),v[h]||(f=void 0)),f&&s.call(l,f.value,f.key,v)};return X=g,X}var ht;function ye(){if(ht)return F.exports;ht=1;var o=Ot,p=yt(),m=F.exports=me(),u=ve(),h=new u({max:1e3}),t={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function r(g){return t[g]||g.slice(0,-1)}var i={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};F.exports.fromUrl=function(g,c){if(typeof g=="string"){var E=g+JSON.stringify(c||{});return h.has(E)||h.set(E,n(g,c)),h.get(E)}};function n(g,c){if(!(g==null||g==="")){var E=x(a(g)?"github:"+g:g),S=C(E),w=E.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),R=Object.keys(p).map(function(U){try{var v=p[U],s=null;S.auth&&i[S.protocol]&&(s=S.auth);var e=S.hash?decodeURIComponent(S.hash.substr(1)):null,l=null,f=null,y=null;if(w&&w[1]===U)l=w[2]&&decodeURIComponent(w[2]),f=decodeURIComponent(w[3].replace(/\.git$/,"")),y="shortcut";else{if(S.host&&S.host!==v.domain&&S.host.replace(/^www[.]/,"")!==v.domain||!v.protocols_re.test(S.protocol)||!S.path)return;var b=v.pathmatch,_=S.path.match(b);if(!_)return;_[1]!==null&&_[1]!==void 0&&(l=decodeURIComponent(_[1].replace(/^:/,""))),f=decodeURIComponent(_[2]),y=r(S.protocol)}return new m(U,l,s,f,e,y,c)}catch(A){if(!(A instanceof URIError))throw A}}).filter(function(U){return U});if(R.length===1)return R[0]}}function a(g){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(g)}function x(g){var c=o.parse(g);return c.protocol==="gist:"&&c.host&&!c.path?c.protocol+"/"+c.host:g}function C(g){var c=g.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!c){var E=o.parse(g);if(E.auth){const w=g.match(/[^@]+@[^:/]+/);if(w){var S=new o.URL(w[0]);E.auth=S.username||"",S.password&&(E.auth+=":"+S.password)}}return E}return{protocol:"git+ssh:",slashes:!0,auth:c[1],host:c[2],port:null,hostname:c[2],hash:c[4],search:null,query:null,pathname:"/"+c[3],path:"/"+c[3],href:"git+ssh://"+c[1]+"@"+c[2]+"/"+c[3]+(c[4]||"")}}return F.exports}var N={},P={},ft;function xe(){if(ft)return P;ft=1;var o=P&&P.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(P,"__esModule",{value:!0}),P.setService=P.findService=P.getDefaultServiceConfig=P.getServiceConfig=void 0;const p=o(oe),m=gt(),u={},h=a=>{u[a.name]={validate:a.schema.validate.bind(a.schema),defaultConfig:a.default}};P.setService=h,h({name:"auth",schema:m.authConfigSchema,default:{}});const t=a=>{if(!a)throw new Error("service name should not be empty");const x=u[a];if(!x)throw new Error(`service ${a} does not exist`);return x},r=(a,x,{validate:C}={})=>{const g=t(a),c=(0,p.default)(x||{}),{value:E,error:S}=g.validate(c);if(C&&S)throw new Error(`Invalid blocklet service config: ${S.details.map(w=>w.message).join(", ")}`);return E};P.getServiceConfig=r;const i=a=>{const{defaultConfig:x}=t(a);return x};P.getDefaultServiceConfig=i;const n=(a,x)=>{const C=[x];return(a||[]).find(g=>C.includes(g.name))};return P.findService=n,P.default={getServiceConfig:r,getDefaultServiceConfig:i,findService:n,setService:h},P}var pt;function be(){if(pt)return N;pt=1,Object.defineProperty(N,"__esModule",{value:!0}),N.fixAndValidateService=N.validateMeta=void 0;const o=gt(),p=xe(),m=h=>(!h.interfaces||!h.interfaces.length||h.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(r=>{r.config=(0,p.getServiceConfig)(r.name,r.config,{validate:!0})})}),h);N.fixAndValidateService=m;const u=(h,{ensureFiles:t=!1,ensureDist:r=!1,ensureComponentStore:i=!0,ensureName:n=!1,skipValidateDidName:a=!1,schemaOptions:x={}}={})=>{const C=(0,o.createBlockletSchema)(null,{ensureFiles:t,ensureDist:r,ensureComponentStore:i,ensureName:n,skipValidateDidName:a,...x}),{value:g,error:c}=C.validate(h);if(c)throw new Error(`Invalid blocklet meta: ${c.details.map(E=>E.message).join(", ")}`);return g};return N.validateMeta=u,N.default=u,N}var mt;function je(){return mt||(mt=1,function(o){var p=T&&T.__createBinding||(Object.create?function(e,l,f,y){y===void 0&&(y=f);var b=Object.getOwnPropertyDescriptor(l,f);(!b||("get"in b?!l.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return l[f]}}),Object.defineProperty(e,y,b)}:function(e,l,f,y){y===void 0&&(y=f),e[y]=l[f]}),m=T&&T.__setModuleDefault||(Object.create?function(e,l){Object.defineProperty(e,"default",{enumerable:!0,value:l})}:function(e,l){e.default=l}),u=T&&T.__importStar||function(){var e=function(l){return e=Object.getOwnPropertyNames||function(f){var y=[];for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(y[y.length]=b);return y},e(l)};return function(l){if(l&&l.__esModule)return l;var f={};if(l!=null)for(var y=e(l),b=0;b<y.length;b++)y[b]!=="default"&&p(f,l,y[b]);return m(f,l),f}}(),h=T&&T.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.fixService=o.fixInterfaces=o.parsePerson=o.formatPerson=o.fixName=o.fixTags=o.fixPerson=o.fixKeywords=o.fixFiles=o.fixRepository=o.fixRequired=void 0;const t=h(Pt),r=u(ye()),i=Lt(),n=be();Object.defineProperty(o,"fixService",{enumerable:!0,get:function(){return n.fixAndValidateService}});const a=ne(),x=(e,l)=>{e.description||(e.description=`Blocklet from ${l}`),e.version||(e.version=i.BLOCKLET_DEFAULT_VERSION)};o.fixRequired=x;const C=e=>{if(e.repository&&(typeof e.repository=="string"&&(e.repository={type:"git",url:e.repository}),e.repository.url)){const l=r.fromUrl(e.repository.url);l&&(e.repository.url=l.getDefaultRepresentation()==="shortcut"?l.https():l.toString())}};o.fixRepository=C;const g=e=>{Array.isArray(e.files)?e.files&&(e.files=e.files.filter(l=>!(!l||typeof l!="string"))):delete e.files};o.fixFiles=g;const c=e=>{typeof e.keywords=="string"&&(e.keywords=e.keywords.split(/,\s+/)),e.keywords&&!Array.isArray(e.keywords)?delete e.keywords:e.keywords&&(e.keywords=e.keywords.filter(l=>!(typeof l!="string"||!l)))};o.fixKeywords=c;const E=e=>{typeof e.tags=="string"&&(e.tags=e.tags.split(/,\s+/)),e.tags&&!Array.isArray(e.tags)?delete e.tags:e.tags&&(e.tags=e.tags.filter(l=>!(typeof l!="string"||!l)))};o.fixTags=E;const S=(e,l)=>(e.author&&(e.author=l(e.author)),["maintainers","contributors"].forEach(f=>{Array.isArray(e[f])&&(e[f]=e[f].map(l))}),e),w=e=>{if(!e)return"";if(typeof e=="string")return e;const l=e.name||"",f=e.url||e.web,y=f?` (${f})`:"",b=e.email||e.mail,_=b?` <${b}>`:"";return l+_+y};o.formatPerson=w;const R=e=>{if(typeof e!="string")return e;const l=e.match(/^([^(<]+)/),f=e.match(/\(([^)]+)\)/),y=e.match(/<([^>]+)>/),b={};return l&&l[0].trim()&&(b.name=l[0].trim()),y&&([,b.email]=y),f&&([,b.url]=f),b};o.parsePerson=R;const U=e=>(S(e,w),S(e,R),e);o.fixPerson=U;const v=(e,l=!0)=>{if(Array.isArray(e.interfaces)||(e.interfaces=[]),e.interfaces.length)return e.interfaces.forEach(_=>{_.type===i.BLOCKLET_INTERFACE_TYPE_WEB&&(_.protocol="http")}),e;const y=(0,t.default)(e,"capabilities.dynamicPathPrefix",!0)?i.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",b=({type:_="web",name:A,path:W="/",protocol:G="http",port:B=i.BLOCKLET_DEFAULT_PORT_NAME})=>{e.interfaces.push({type:_,name:A,path:W,prefix:y,port:B,protocol:G})};return[i.BLOCKLET_INTERFACE_PUBLIC].forEach(_=>{e[_]&&b({name:_,path:e[_]})}),Array.isArray(e.exposeServices)&&e.exposeServices.forEach(_=>{b({type:"service",name:_.protocol,protocol:_.protocol,port:{internal:`BLOCKLET_${_.protocol}_PORT`.toUpperCase(),external:_.port}})}),l&&(delete e.publicUrl,delete e.adminUrl,delete e.configUrl,delete e.docUrl,delete e.exposeServices,e.capabilities&&delete e.capabilities.dynamicPathPrefix),e};o.fixInterfaces=v;const s=e=>{const{did:l}=e;try{(0,a.validateNewDid)(l),e.name=l}catch{}return e};o.fixName=s,o.default={fixRequired:x,fixRepository:C,fixFiles:g,fixKeywords:c,fixPerson:U,fixTags:E,fixName:s,formatPerson:w,parsePerson:R,fixInterfaces:v,fixService:n.fixAndValidateService}}(T)),T}var Se=je();function xt({owner:o,locale:p}){return j.jsxs(dt,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.fullName,o.did?j.jsx(Tt,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:o.did,compact:!0,size:14,locale:p}):null]})}xt.propTypes={owner:L.object.isRequired,locale:L.string.isRequired};const Ee="install-blocklet-from-URL",bt=()=>{const[o,p]=vt(Ee,"[]",{raw:!0}),m=h=>{const t=h.trim(),r=JSON.parse(o),i=r.findIndex(n=>n===t);i!==0&&(i>0&&r.splice(i,1),r.length>=10&&r.splice(9),r.unshift(t),p(JSON.stringify(r)))},u=h=>{if(!h)return;const t=JSON.parse(o),r=h.trim(),i=t.findIndex(n=>n===r);i>-1&&(t.splice(i,1),p(JSON.stringify(t)))};return{urls:o?JSON.parse(o):[],addUrlRecord:m,removeUrlRecord:u}};function jt({value:o="",onValueChange:p=()=>{},children:m=null,helperText:u=""}){const{urls:h,removeUrlRecord:t}=bt(),r=(i,n)=>{i.preventDefault(),i.stopPropagation(),t(n)};return j.jsxs(dt,{children:[j.jsx(le,{freeSolo:!0,options:h,inputValue:o,onInputChange:(i,n)=>{p(n)},disableClearable:!0,popupIcon:null,renderInput:i=>Dt.cloneElement(m,{...i}),renderOption:(i,n)=>I.createElement(Nt,{...i,key:n,secondaryAction:j.jsx(qt,{edge:"end","aria-label":"delete",onClick:a=>r(a,n),children:j.jsx(ae,{})})},j.jsx(ce,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:j.jsx(Mt,{primary:n,sx:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})})),slotProps:{listbox:{sx:{maxHeight:300,overflow:"auto"}}}}),j.jsx(Wt,{style:{margin:0},children:u})]})}jt.propTypes={onValueChange:L.func,children:L.node,value:L.string,helperText:L.string};function _e({defaultUrl:o="",onCancel:p,onSuccess:m,onError:u=()=>{},mode:h="install",handleText:t={}}){const{api:r}=$t(),{api:i,session:n}=Bt(),[a,x]=I.useState(!1),[C,g]=I.useState(""),{t:c,locale:E}=Ft(),S={dist:{}},{encryptKey:w}=Gt(),[R,U]=I.useState(o),[v,s]=I.useState(o?1:0),[e,l]=I.useState(S),[f,y]=I.useState(!1),[b,_]=I.useState(""),[A]=vt("instant-blocklet-install",!1),[W,G]=I.useState({}),B=h==="component",H=B?!0:!o,{addUrlRecord:St}=bt(),$=I.useMemo(()=>(n.user?.connectedAccounts||[]).some(D=>D.provider===Ht.LOGIN_PROVIDER.WALLET),[n.user]),Q=I.useMemo(()=>{let d=R.trim();return!d.startsWith("https://")&&!d.startsWith("http://")&&!d.startsWith("file://")&&(d=`file://${d}`),d},[R]),V=async()=>{l(S),g(null),x(!0);const d=Q;try{const O=decodeURIComponent(d);try{new URL(O)}catch{throw new Error("Invalid URL")}const{meta:D,inStore:It,registryUrl:Ut}=await r.getBlockletMetaFromUrl({input:{url:O}});l(D),G({inStore:It,registryUrl:Ut,inputUrl:d}),St(d)}catch(O){console.error(O);const D=`Blocklet Install failed: ${rt(O)}`;g(D),u(O)}finally{x(!1)}},Et=()=>{if(B){m({meta:e,...W}),p();return}if(A){x(!0),y(!0);return}const d=et(window?.env?.apiPrefix??"/","/launch-blocklet/install");window.location.href=re(d,{blocklet_meta_url:decodeURIComponent(Q.trim()),from:"url"})},Z=()=>{x(!1),y(!1),m({meta:e,...W}),p()},_t=()=>{x(!1),y(!1)};I.useEffect(()=>{o&&V()},[o]);const M=I.useMemo(()=>({title:e.title,wt:Vt(e),blockletMetaUrl:decodeURIComponent(R.trim())}),[e,R]),k=I.useCallback(async()=>{if($||A){_("");return}const d=new URL(window.location.href);d.pathname=et(window?.env?.apiPrefix??"/","/api/did/launch-free-blocklet-by-session/token"),d.searchParams.set("_ek_",w),Object.keys(M).forEach(D=>{d.searchParams.set(D,M[D])});const{data:O}=await i.get(d.href);O.url?_(O.url):_("")},[$,M,i,w,A]);I.useEffect(()=>{k()},[k]);const wt=I.useMemo(()=>$&&b?{...M,nw:b,skipMigrateAccount:!0}:M,[M,b,$]),Ct=[{name:c("common.name"),value:Kt.getDisplayName({meta:e},!0)},{name:c("common.version"),value:e.version},{name:c("common.did"),value:e.did?j.jsx(zt,{did:e.did}):null},{name:c("common.author"),value:e.owner?j.jsx(xt,{owner:e.owner,locale:E}):Se.formatPerson(e.author)},{name:c("blocklet.dist.downloadLink"),value:e.dist.tarball}],Rt=()=>a?j.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:j.jsx(nt,{})}):e.did?j.jsx("div",{style:{paddingLeft:"10%"},children:Ct.map(d=>d.name===c("common.did")?j.jsx(st,{valueComponent:"div",nameWidth:120,name:d.name,nameFormatter:()=>c("common.did"),children:d.value},d.name):j.jsx(st,{valueComponent:"div",nameWidth:120,name:d.name,children:d.value},d.name))}):null,At=Jt(async()=>{let d=e.title;n.user&&(d=`${n.user.fullName}'s ${e.title}`);try{Z(),await r.launchBlockletWithoutWallet({input:{title:d,blockletMetaUrl:decodeURIComponent(R.trim()),type:"store",storeUrl:W.registryUrl,onlyRequired:!0}})}catch(O){console.error("launchBlockletWithoutWallet error:",O),Yt.error(rt(O),{autoHideDuration:3e3})}}),tt=[{label:c("blocklet.fromUrl.step0"),body:j.jsx(Xt,{component:"div",children:j.jsx(jt,{style:{marginBottom:32},value:R,helperText:c("blocklet.fromUrl.description"),onValueChange:d=>{g(null),U(d)},children:j.jsx(Qt,{label:c("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:R,onChange:d=>{g(null),U(d.target.value)},disabled:a,onKeyPress:d=>{d.key==="Enter"&&(d.preventDefault(),V(),s(1))}})})}),cancel:c("common.cancel"),confirm:c("common.next"),onCancel:p,onConfirm:()=>{V(),s(1)}},{label:c("blocklet.fromUrl.step1"),body:Rt(),cancel:c(H?"common.pre":"common.cancel"),confirm:t?.confirm||c("blocklet.fromUrl.confirm"),onCancel:()=>{H?s(d=>d-1):p()},onConfirm:()=>{Et()}}],q=tt[v];return j.jsxs(j.Fragment,{children:[j.jsxs(Zt,{title:t?.title||c("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>q.onCancel(),showCloseButton:v===0,disableEscapeKeyDown:!0,open:!0,actions:j.jsxs(j.Fragment,{children:[q.cancel&&j.jsx(it,{onClick:d=>{d.stopPropagation(),g(null),q.onCancel()},color:"inherit",children:q.cancel||c("common.cancel")}),j.jsxs(it,{onClick:d=>{d.stopPropagation(),q.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a||!R||C,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[a&&v===0&&j.jsx(nt,{size:16}),q.confirm]})]}),children:[H&&j.jsx(ue,{alternativeLabel:!0,activeStep:v,children:tt.map(({label:d})=>j.jsx(he,{children:j.jsx(fe,{children:d})},d))}),j.jsx(kt,{component:"div",style:{marginTop:24},children:q.body}),!!C&&j.jsx(te,{severity:"error",style:{width:"100%",marginTop:8},children:C})]}),e&&f&&j.jsx(ee,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:!$&&!A?"bind-wallet":"launch-free-blocklet-by-session",checkFn:i.get,checkTimeout:5*60*1e3,onSuccess:Z,extraParams:wt,messages:{title:c("setup.keyPair.title"),scan:c("setup.keyPair.scan"),confirm:c("setup.keyPair.confirm"),success:c("setup.keyPair.success")},onClose:_t,customItems:A?[]:[j.jsx(se,{onClick:At})]})]})}_e.propTypes={defaultUrl:L.string,onCancel:L.func.isRequired,onSuccess:L.func.isRequired,onError:L.func,mode:L.oneOf(["install","component"]),handleText:L.object};export{pe as B,_e as I,xt as a,Se as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as $,j as i,r as u,g as T,bf as H,$ as M,s as v,o as s,w as E,M as y,cV as q,n as w,q as A,aP as D,cW as U,cz as F,cs as j,z as O,cX as W,aH as Y,cY as V,cZ as k,c_ as I,as as B,b7 as X,cr as J,C as K,b8 as Z}from"./index-
|
|
1
|
+
import{aF as $,j as i,r as u,g as T,bf as H,$ as M,s as v,o as s,w as E,M as y,cV as q,n as w,q as A,aP as D,cW as U,cz as F,cs as j,z as O,cX as W,aH as Y,cY as V,cZ as k,c_ as I,as as B,b7 as X,cr as J,C as K,b8 as Z}from"./index-z2Pq7re4.js";import{p as G}from"./index-djmnhckV.js";import{N as Q}from"./index-a5z0oLm0.js";import{b as ee}from"./sdk-Z_sZEcD1.js";import{w as ie}from"./wrap-locale-C7tS6amm.js";const se=$(i.jsx("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2m0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19z"}));function P({invitation:e,createPassportSvg:n,passportColor:c="auto"}){const[p,r]=u.useState(!1),{t:l}=u.useContext(T),t=u.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),d=u.useMemo(()=>n({title:t,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c,extra:e.passportExpireTime?{key:"Exp",value:H(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,t]),m=u.useCallback(()=>{r(!0)},[]),o=u.useCallback(()=>{r(!1)},[]);return i.jsxs(i.Fragment,{children:[i.jsx(te,{children:i.jsxs("div",{className:"invite-passport__card",onClick:m,children:[!!e.display&&i.jsx(Q,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&i.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:d}})]})}),i.jsx(M,{open:p,title:l("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:o,children:e.role.permissions&&e.role.permissions.length>0?i.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(x=>i.jsx("li",{style:{listStyle:"circle"},children:x.description},x.name))}):i.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[i.jsx(se,{style:{width:"30px",height:"30px"}}),i.jsx("div",{children:l("invite.emptyPermission")})]})})]})}P.propTypes={invitation:s.object.isRequired,createPassportSvg:s.func.isRequired,passportColor:s.string};const te=v.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
max-width: 350px;
|
|
4
4
|
margin: 30px auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fB as P,bd as s}from"./index-
|
|
1
|
+
import{fB as P,bd as s}from"./index-z2Pq7re4.js";var r,e;function f(){if(e)return r;e=1;const a=P();return r=(i,t)=>a(i)===a(t),r}var u=f();const x=s(u);export{x as i};
|