@abtnode/webapp 1.16.44-beta-20250523-232943-369d21c5 → 1.16.44-beta-20250526-130644-5e05dc90
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-BLiJpepT.js → AdapterDayjs-bsD4OAFM.js} +1 -1
- package/dist/assets/{Add-B6SubMna.js → Add-BYFWsyUF.js} +1 -1
- package/dist/assets/{ArrowDropDown-xGKcJlzT.js → ArrowDropDown-b23Ws4Dh.js} +1 -1
- package/dist/assets/{Autocomplete-DcWkc_vX.js → Autocomplete-Cbi7HzEa.js} +1 -1
- package/dist/assets/{Breadcrumbs-CpID4vgW.js → Breadcrumbs-C_csYT5C.js} +1 -1
- package/dist/assets/{ButtonGroup-BwF8mqMo.js → ButtonGroup-BbvSuEoF.js} +1 -1
- package/dist/assets/{CSSTransition-DwNIlRBk.js → CSSTransition-CJ-9QKlG.js} +1 -1
- package/dist/assets/{CallMerge-Dx0ABV96.js → CallMerge-SZDzfJgb.js} +1 -1
- package/dist/assets/{CardContent-B7pLobRd.js → CardContent-BCodnoZu.js} +1 -1
- package/dist/assets/{ChevronLeft-BFPYYAY4.js → ChevronLeft-BCWTA2ES.js} +1 -1
- package/dist/assets/{ChevronRight-AScR76u1.js → ChevronRight-B8F_ru7A.js} +1 -1
- package/dist/assets/{Clear-CgFuQS8E.js → Clear-n1FkleT7.js} +1 -1
- package/dist/assets/{Close-DMagDs34.js → Close-Cem8y-ph.js} +1 -1
- package/dist/assets/{Community-Cnc3hgQ2.js → Community-stiBX7J2.js} +1 -1
- package/dist/assets/{Delete-DBAS8mVY.js → Delete-CwKOurFN.js} +1 -1
- package/dist/assets/{Delete-CT7C6Kie.js → Delete-D0GFkYtH.js} +1 -1
- package/dist/assets/{DeleteOutline-3nz1tDzg.js → DeleteOutline-CSi3y8ZI.js} +1 -1
- package/dist/assets/{Done-CX1gjQiO.js → Done-D3hzYYUk.js} +1 -1
- package/dist/assets/{Edit-CBtokBzw.js → Edit-DUZ7gP_b.js} +1 -1
- package/dist/assets/{ErrorOutline-vNCs_MWh.js → ErrorOutline-zzYP4d-G.js} +1 -1
- package/dist/assets/{HelpOutline-C3TbxHgu.js → HelpOutline-BtTkcIQl.js} +1 -1
- package/dist/assets/{Holiday-BW8-5cu1.js → Holiday-CFhQLlq2.js} +1 -1
- package/dist/assets/{Launch-Gzp4KZV3.js → Launch-C-pZPEtf.js} +1 -1
- package/dist/assets/{Link-C1-DzkbR.js → Link-DoRwHSx9.js} +1 -1
- package/dist/assets/{ListItemButton-WitFXLXy.js → ListItemButton-C4nle7Vw.js} +1 -1
- package/dist/assets/{ListSubheader-BPukSiYH.js → ListSubheader-CN5kB_3v.js} +1 -1
- package/dist/assets/{LoadingButton-D1yBseaf.js → LoadingButton-DzOnJ8zq.js} +1 -1
- package/dist/assets/{LockIcon-C0-sdX_W.js → LockIcon-DzCd9ccj.js} +1 -1
- package/dist/assets/{Meeting-Cni7k1GA.js → Meeting-1bsu0vcq.js} +1 -1
- package/dist/assets/{MoreHoriz-BwjT-Th3.js → MoreHoriz-DC7IikA2.js} +1 -1
- package/dist/assets/{MoreVert-LcWQtq9o.js → MoreVert-CrQ5BD1O.js} +1 -1
- package/dist/assets/{OffSick-G3qdzC0H.js → OffSick-xV6w5rWa.js} +1 -1
- package/dist/assets/{OpenInNew-WY83GLbI.js → OpenInNew-DeXzob2p.js} +1 -1
- package/dist/assets/{Public-BVtXGGU3.js → Public-B575ztUz.js} +1 -1
- package/dist/assets/{Refresh-B52Zvr1H.js → Refresh-2rMRmiq8.js} +1 -1
- package/dist/assets/{SchemaReference.es-DgPLsBl7.js → SchemaReference.es-Dde3PXx0.js} +1 -1
- package/dist/assets/{Search-BVjKyf6X.js → Search-DlTi3_X0.js} +1 -1
- package/dist/assets/{Slider-DJkYLVcS.js → Slider-DVwffPl5.js} +1 -1
- package/dist/assets/{Stepper-DpIVkIVF.js → Stepper-DBIHjo83.js} +1 -1
- package/dist/assets/{Switch-BEuyXxAj.js → Switch-Qp41_PVH.js} +1 -1
- package/dist/assets/{TableRow-De6rTaLH.js → TableRow-CDB9WIef.js} +1 -1
- package/dist/assets/{TableSearch-C-ei22_d.js → TableSearch-C_ybT7kk.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-Cn-eBR9-.js → ToggleButtonGroup-C-CIJkUk.js} +1 -1
- package/dist/assets/{Verified-CuZqBCQf.js → Verified-CLm0sUb6.js} +1 -1
- package/dist/assets/{VerifiedUser-1sSxKHO8.js → VerifiedUser-Cz-5rgpe.js} +1 -1
- package/dist/assets/{ViewColumn-Z9CzTkc6.js → ViewColumn-Db8V4QN9.js} +1 -1
- package/dist/assets/{ViewList-CMZhtdms.js → ViewList-BaTy1Ph1.js} +1 -1
- package/dist/assets/{WorkingRemotely-Bs2JhSor.js → WorkingRemotely-C_qc4360.js} +1 -1
- package/dist/assets/{_createAggregator-B8uLgymt.js → _createAggregator-CEr_MPC5.js} +1 -1
- package/dist/assets/{actions-C-FzNJrL.js → actions-DQy4Y2na.js} +1 -1
- package/dist/assets/{actions-CpNtRMjL.js → actions-DveJjfxt.js} +1 -1
- package/dist/assets/{agreement-DiJIrinp.js → agreement-DeYzUIM7.js} +1 -1
- package/dist/assets/api-sNy9Buh2.js +1 -0
- package/dist/assets/{appearance-DFXmNgG9.js → appearance-DbHWwKo-.js} +1 -1
- package/dist/assets/{audit-logs-7jpmSelT.js → audit-logs-DWljSpy4.js} +1 -1
- package/dist/assets/{base-chart-SdbqVXfX.js → base-chart-CneSkRrp.js} +1 -1
- package/dist/assets/{blocklet-B7Zji5DT.js → blocklet-BNsbNDuf.js} +1 -1
- package/dist/assets/{brace-fold.es-CM_B0aiu.js → brace-fold.es-CHQJKmOH.js} +1 -1
- package/dist/assets/{chain-DBedh8bm.js → chain-DZftcLJ3.js} +1 -1
- package/dist/assets/{click-to-copy-BsvcMemr.js → click-to-copy-ADdBawgq.js} +1 -1
- package/dist/assets/cloneDeep-JEYtEd7F.js +1 -0
- package/dist/assets/{closebrackets.es-BT2tUB9N.js → closebrackets.es-DDKcuj7l.js} +1 -1
- package/dist/assets/{codemirror.es-RSOcc6GZ.js → codemirror.es-CDd3nIcD.js} +1 -1
- package/dist/assets/{collapse-CxLV5r0z.js → collapse-S-vTWAhi.js} +1 -1
- package/dist/assets/{comment.es-HeBeZZGe.js → comment.es-BCYde1B6.js} +1 -1
- package/dist/assets/config-navigation-CNRkvto9.js +86 -0
- package/dist/assets/{connect-to-BrVjRNZt.js → connect-to-Dr4HhNJU.js} +1 -1
- package/dist/assets/{delete-confirm-CjqJdSpd.js → delete-confirm-DoYSwIFx.js} +1 -1
- package/dist/assets/{detail-DvWKfPF5.js → detail-B9ggyBgZ.js} +3 -3
- package/dist/assets/{dialog.es-CdoDmecR.js → dialog.es-MsWV9Nfp.js} +1 -1
- package/dist/assets/{domains-HOzCVRIr.js → domains-B3WgGegI.js} +1 -1
- package/dist/assets/{download-B2lNfZpo.js → download-CCFD10FS.js} +1 -1
- package/dist/assets/emotion-react.browser.esm-BsFIkhYD.js +1 -0
- package/dist/assets/{foldgutter.es-BU8vz30T.js → foldgutter.es-Dlj2we2Y.js} +1 -1
- package/dist/assets/{get-safe-url-CA8_5OeR.js → get-safe-url-DWTB-tRE.js} +1 -1
- package/dist/assets/{get-safe-url-CgXktKsm.js → get-safe-url-h3P_Qh4v.js} +1 -1
- package/dist/assets/getValidReactChildren-DTJlyDSN.js +1 -0
- package/dist/assets/{hint.es-D6ygv-Ud.js → hint.es-Dy1C7k3I.js} +1 -1
- package/dist/assets/{hint.es2-DeMP8e9y.js → hint.es2-NY7C4sAJ.js} +1 -1
- package/dist/assets/{iframe-Bhr8GDCE.js → iframe-Cs_wGN9V.js} +1 -1
- package/dist/assets/{index-BHcs0slQ.js → index-0U-vrSlK.js} +1 -1
- package/dist/assets/{index-Cxtz33Uv.js → index-1REZAjOu.js} +1 -1
- package/dist/assets/{index-D_F7-gyj.js → index-1k7DvKxH.js} +1 -1
- package/dist/assets/{index-Ul7VaxKJ.js → index-1l3rmmE5.js} +1 -1
- package/dist/assets/{index-Dd8yxjG4.js → index-7iYq2V4L.js} +1 -1
- package/dist/assets/{index-DXkrxNwp.js → index-B4oRLjo7.js} +1 -1
- package/dist/assets/{index-Bh782xzD.js → index-BA0q44b7.js} +1 -1
- package/dist/assets/{index-MT0i2iOl.js → index-BI9Br-d5.js} +1 -1
- package/dist/assets/{index-CRiyLOjk.js → index-BIr1sHAt.js} +1 -1
- package/dist/assets/index-BKivhg3S.js +6 -0
- package/dist/assets/{index-CNaJckFK.js → index-BPpMhVpd.js} +3 -3
- package/dist/assets/{index-CGd5LtOY.js → index-BTVRLsIg.js} +1 -1
- package/dist/assets/{index-BwIYMrsC.js → index-BeEM_0q3.js} +1 -1
- package/dist/assets/{index-DUeIl46T.js → index-Bm4jeiDa.js} +1 -1
- package/dist/assets/{index-D6XCWvDm.js → index-Bnl28jeD.js} +1 -1
- package/dist/assets/{index-jEjcw4up.js → index-BoDwKZkr.js} +1 -1
- package/dist/assets/{index-B6mALCYH.js → index-Bt1dFWNc.js} +1 -1
- package/dist/assets/{index-ccWoyWFx.js → index-Btu-tCxx.js} +7 -7
- package/dist/assets/{index-DtqeRbTN.js → index-BuuM5jo8.js} +1 -1
- package/dist/assets/{index-DxWeQQqZ.js → index-CIH-dF5H.js} +1 -1
- package/dist/assets/{index-jLzUI2_x.js → index-CNOx9gM8.js} +1 -1
- package/dist/assets/{index-yz00dDKs.js → index-CSOOaDVw.js} +3 -3
- package/dist/assets/index-CcKekV6p.js +1 -0
- package/dist/assets/{index-BILnzeuZ.js → index-Cjt_N1wY.js} +1 -1
- package/dist/assets/{index-C7XZPy3K.js → index-Co9nkuve.js} +1 -1
- package/dist/assets/{index-AxNvb4Iw.js → index-CuFXa0mJ.js} +1 -1
- package/dist/assets/{index-BjDWYhhh.js → index-Cvhm7Tb9.js} +1 -1
- package/dist/assets/{index-CsJ1SLdq.js → index-D5xjISzz.js} +1 -1
- package/dist/assets/{index-bajfduTV.js → index-DM-X6w1C.js} +1 -1
- package/dist/assets/{index-BFotr4ae.js → index-DhUL5M2s.js} +1 -1
- package/dist/assets/{index-CkvAmFX4.js → index-DjMNpYZS.js} +1 -1
- package/dist/assets/{index-otCXU1uz.js → index-DjfLAu4m.js} +1 -1
- package/dist/assets/{index-C4_lviTb.js → index-DuQ11Re2.js} +1 -1
- package/dist/assets/{index-BSmu-hBe.js → index-DuTpAxAe.js} +3 -3
- package/dist/assets/{index-DqFUEzLa.js → index-Dx0P0x6J.js} +1 -1
- package/dist/assets/{index-CRwIMkPp.js → index-EWwtp8EM.js} +1 -1
- package/dist/assets/{index-DMZMNjTk.js → index-IViEbtE5.js} +1 -1
- package/dist/assets/{index-sIpE29lb.js → index-JsgthZUN.js} +1 -1
- package/dist/assets/{index-B8_LPRJ9.js → index-MgaM83zd.js} +1 -1
- package/dist/assets/{index-K1bGg3g2.js → index-PRwzODZo.js} +1 -1
- package/dist/assets/{index-D1AXuR6p.js → index-RNqR3FXM.js} +5 -5
- package/dist/assets/{index-D2rnKn07.js → index-Vn3yqa3y.js} +1 -1
- package/dist/assets/{index-BOPDHYJq.js → index-_Y4g7Ki7.js} +1 -1
- package/dist/assets/{index-DV6EQKFf.js → index-bbeMAhGa.js} +1 -1
- package/dist/assets/{index-C1T4p2CL.js → index-c-0gMptp.js} +1 -1
- package/dist/assets/{index-hsXwdita.js → index-e66xJJ-x.js} +130 -130
- package/dist/assets/{index-Cd_2D3Sl.js → index-f9QTV2yS.js} +1 -1
- package/dist/assets/{index-CR4B_UPh.js → index-gkWEdVLt.js} +1 -1
- package/dist/assets/{index-DmndvspS.js → index-rsJnFyyL.js} +1 -1
- package/dist/assets/{index.esm-CiAi8rZc.js → index.esm-BiZwp2sI.js} +1 -1
- package/dist/assets/{info-addon.es-BSeCJ9m1.js → info-addon.es-ipFCgBgs.js} +1 -1
- package/dist/assets/{info.es-B00gqIVn.js → info.es-CXZgqePH.js} +1 -1
- package/dist/assets/{install-from-url-CeY10_5r.js → install-from-url-CSiK3Yao.js} +1 -1
- package/dist/assets/{invitation-C-a_EKGE.js → invitation-D6ia_iSD.js} +1 -1
- package/dist/assets/is-path-prefix-equal-CF4M2MVl.js +1 -0
- package/dist/assets/{item-ChksU4uH.js → item-11xHJrBQ.js} +1 -1
- package/dist/assets/{javascript.es-Nrg3dwD2.js → javascript.es-BOFqQkgH.js} +1 -1
- package/dist/assets/{jump-to-line.es-DytSz8B4.js → jump-to-line.es-Cx_iKetf.js} +1 -1
- package/dist/assets/{jump.es-qNIPcsKh.js → jump.es-UmQ5eqNY.js} +1 -1
- package/dist/assets/{lint.es-CM5l-pk5.js → lint.es-CkuzJ0c7.js} +1 -1
- package/dist/assets/{lint.es2-CdyZVqYu.js → lint.es2-CPQEeICW.js} +1 -1
- package/dist/assets/{lint.es3--4lw23-T.js → lint.es3-B2trihuW.js} +1 -1
- package/dist/assets/{list-header-CY82YyA-.js → list-header-ovy1bk-e.js} +1 -1
- package/dist/assets/{log-WrdeB8oi.js → log--8P_TkIi.js} +1 -1
- package/dist/assets/{lottie-react.esm-kgcpgzdv.js → lottie-react.esm-BWBFsFNg.js} +1 -1
- package/dist/assets/{matchbrackets.es-CTK-n4WV.js → matchbrackets.es-DnV41gw8.js} +1 -1
- package/dist/assets/{memory-COTxwn8h.js → memory-CLu87brV.js} +1 -1
- package/dist/assets/{metric-pxFNJXub.js → metric-CgjE4Yze.js} +1 -1
- package/dist/assets/{mode.es-BOrUao3h.js → mode.es-CikDBGfg.js} +1 -1
- package/dist/assets/{mode.es2-DSNTJt4C.js → mode.es2-C1ydBzoH.js} +1 -1
- package/dist/assets/{mode.es3-DVFLZO9P.js → mode.es3-dTgcRvSz.js} +1 -1
- package/dist/assets/omit-zgah02wK.js +1 -0
- package/dist/assets/{onlineParser.es-DXqaDUWT.js → onlineParser.es-CWgvKSNI.js} +1 -1
- package/dist/assets/{overview-CQH3sl8k.js → overview-APoIqy5P.js} +1 -1
- package/dist/assets/{permission-BcsRTq-z.js → permission-CtZli8Hf.js} +1 -1
- package/dist/assets/{preference-D6gVeL13.js → preference-0MD46HXq.js} +3 -3
- package/dist/assets/{raf-schd.esm-4rNe_vqV.js → raf-schd.esm-CjWurqZc.js} +1 -1
- package/dist/assets/refType-CrQ6NnaY.js +1 -0
- package/dist/assets/{resource-dialog-ChJDsQlO.js → resource-dialog-DtmI53Zf.js} +19 -19
- package/dist/assets/{runtime-CxUATjE0.js → runtime-BjHuHXy7.js} +1 -1
- package/dist/assets/{schema-QrpPKg0u.js → schema-DG7Gb1Zp.js} +2 -2
- package/dist/assets/sdk-CGbU2sfF.js +1 -0
- package/dist/assets/{search.es-C7IRtXJD.js → search.es-sAbvHQqG.js} +1 -1
- package/dist/assets/{searchcursor.es-DtM5l0hm.js → searchcursor.es-BiTKqSTz.js} +1 -1
- package/dist/assets/{service-BKkazWLo.js → service-yH9ZzgNY.js} +1 -1
- package/dist/assets/{shorten-label-DIFv6Qd6.js → shorten-label-w_L-1NYs.js} +1 -1
- package/dist/assets/{show-hint.es-XOudcdA5.js → show-hint.es-nq7hJT2o.js} +1 -1
- package/dist/assets/{simple-select-Cay1Q_fh.js → simple-select-N7r4TYd1.js} +1 -1
- package/dist/assets/{spaces-nJAMiLX6.js → spaces-BTe9w9go.js} +1 -1
- package/dist/assets/{status-DmJZiE7J.js → status-DRBez5Qf.js} +1 -1
- package/dist/assets/{status-kUWkWAv4.js → status-DTf_MR_m.js} +1 -1
- package/dist/assets/{sublime.es-CeCR_B9o.js → sublime.es-DZ-Kt_RU.js} +1 -1
- package/dist/assets/{switch-control-DQnqNSWg.js → switch-control-Cohshryy.js} +1 -1
- package/dist/assets/{table-icons-OCqVUqzX.js → table-icons-Bs7Hkb6l.js} +1 -1
- package/dist/assets/{table-tips-CKrQ79sg.js → table-tips-BLg1K8Th.js} +1 -1
- package/dist/assets/{team-C07jDfHF.js → team-BczhIV16.js} +1 -1
- package/dist/assets/{toLower-DkxjP5Df.js → toLower-PXiIHwDf.js} +1 -1
- package/dist/assets/toUpper-Cv02sfIb.js +1 -0
- package/dist/assets/{traffic-Cf_YvLXi.js → traffic-CoY4yr_p.js} +1 -1
- package/dist/assets/{url-evaluation-CTRSa9ZC.js → url-evaluation-DRKjUU7g.js} +1 -1
- package/dist/assets/{url-join-ChZrV7Xa.js → url-join-CM2acrDe.js} +1 -1
- package/dist/assets/{use-mobile-Btxuy2XK.js → use-mobile-B7_S05ne.js} +1 -1
- package/dist/assets/{use-mobile-CecRxviL.js → use-mobile-D02_HykR.js} +1 -1
- package/dist/assets/{useAsync-D_akrj3d.js → useAsync-D-2V_lHb.js} +1 -1
- package/dist/assets/{useAsyncRetry-CWTbJjuS.js → useAsyncRetry-DYNhhV2W.js} +1 -1
- package/dist/assets/{useLocalStorage-Cq7sRYfb.js → useLocalStorage-ChdS5XVQ.js} +1 -1
- package/dist/assets/{useThemeProps-B56eXTgo.js → useThemeProps-Dk-4jx1U.js} +1 -1
- package/dist/assets/{util-BMW_0_6P.js → util-wc6KkzlL.js} +1 -1
- package/dist/assets/{wait-container-CuKeuwrf.js → wait-container-BIM4llf9.js} +1 -1
- package/dist/assets/{withStyles-Y8PX3nVz.js → withStyles-Dcw4_09o.js} +1 -1
- package/dist/assets/{wrap-locale-DifWX99q.js → wrap-locale-B6I84qwC.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/api-D8wCBLkG.js +0 -1
- package/dist/assets/cloneDeep-CZ9xagkL.js +0 -1
- package/dist/assets/config-navigation-xuqRoE1o.js +0 -86
- package/dist/assets/emotion-react.browser.esm-CRPrOqTl.js +0 -1
- package/dist/assets/getValidReactChildren-BTgp7BID.js +0 -1
- package/dist/assets/index-BlCna4p9.js +0 -1
- package/dist/assets/index-X7qxXYI4.js +0 -6
- package/dist/assets/is-path-prefix-equal-Cb4XUN1S.js +0 -1
- package/dist/assets/omit-BQN0r_Sl.js +0 -1
- package/dist/assets/refType-wo8smHzx.js +0 -1
- package/dist/assets/sdk-B6Epvrj4.js +0 -1
- package/dist/assets/toUpper-DIQ1Y_cr.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,dq as c,K as l,P as n}from"./index-
|
|
1
|
+
import{j as e,dq as c,K as l,P as n}from"./index-e66xJJ-x.js";var i=function(t){return e.jsx("svg",{...t,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.36096 2.3999C7.04725 2.3999 6.76249 2.58326 6.63267 2.86886L0.872671 15.5409C0.825415 15.6448 0.800964 15.7577 0.800964 15.8719V15.9999V27.3919C0.800964 27.8337 1.15914 28.1919 1.60096 28.1919H30.401C30.8428 28.1919 31.201 27.8337 31.201 27.3919V15.8719C31.201 15.7577 31.1765 15.6448 31.1293 15.5409L25.3693 2.86886C25.2394 2.58326 24.9547 2.3999 24.641 2.3999H7.36096ZM2.40096 16.7999V26.5919H29.601V16.7932C29.5669 16.7976 29.5321 16.7999 29.4968 16.7999H22.3993L20.3328 19.8997C20.1845 20.1222 19.9347 20.2559 19.6672 20.2559H11.6032C11.3357 20.2559 11.0859 20.1222 10.9375 19.8997L8.87104 16.7999H2.40096ZM29.2167 15.1999H21.9712C21.7037 15.1999 21.4539 15.3336 21.3056 15.5561L19.239 18.6559H12.0313L9.96483 15.5561C9.81645 15.3336 9.56667 15.1999 9.29919 15.1999H2.78519L7.8761 3.9999H24.1258L29.2167 15.1999Z",fill:"currentColor"})})};i.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};i.displayName="empty";const a=c(l)`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as g,bp as v,u as y,j as r,N as f,S as x,Q as h}from"./index-
|
|
1
|
+
import{x as g,bp as v,u as y,j as r,N as f,S as x,Q as h}from"./index-e66xJJ-x.js";import{L as j,D as S}from"./download-CCFD10FS.js";import{_ as b}from"./useLocalStorage-ChdS5XVQ.js";import"./ButtonGroup-BbvSuEoF.js";import"./getValidReactChildren-DTJlyDSN.js";function F(){const c=g(),[s,i]=b("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(j,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(S,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{F as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as P,K as b,Z as X,j as e,$ as ve,r as f,P as E,m as O,a0 as We,a1 as Se,a2 as j,a3 as Ge,a4 as re,a5 as He,y as I,X as Z,a6 as qe,k as F,T as Ve,a7 as Ye,B as U,D as Ke,C as je,s as Qe,t as Xe,V as Ce,a8 as Ze,a9 as Je,aa as et,u as M,e as tt,ab as W,o as oe,z as st,ac as ne,x as Pe,q as ae,ad as ot,W as ie,g as J,v as Re,w as ee,ae as rt,af as nt,ag as Te,ah as at,b as B,ai as xe,aj as it,I as lt,ak as ct,M as dt,al as pt,am as mt,an as Ee,ao as De,ap as Be,aq as Ue,ar as Oe,as as N,at as _e,au as $e,av as Ae,aw as ht,ax as ge}from"./index-
|
|
1
|
+
import{n as P,K as b,Z as X,j as e,$ as ve,r as f,P as E,m as O,a0 as We,a1 as Se,a2 as j,a3 as Ge,a4 as re,a5 as He,y as I,X as Z,a6 as qe,k as F,T as Ve,a7 as Ye,B as U,D as Ke,C as je,s as Qe,t as Xe,V as Ce,a8 as Ze,a9 as Je,aa as et,u as M,e as tt,ab as W,o as oe,z as st,ac as ne,x as Pe,q as ae,ad as ot,W as ie,g as J,v as Re,w as ee,ae as rt,af as nt,ag as Te,ah as at,b as B,ai as xe,aj as it,I as lt,ak as ct,M as dt,al as pt,am as mt,an as Ee,ao as De,ap as Be,aq as Ue,ar as Oe,as as N,at as _e,au as $e,av as Ae,aw as ht,ax as ge}from"./index-e66xJJ-x.js";import{t as ut}from"./toLower-PXiIHwDf.js";import{P as H,L as ft,A as xt,S as Fe,a as Le}from"./index-BoDwKZkr.js";import{A as gt,D as le,u as yt,W as wt,P as kt,a as Ne,L as Ie}from"./wait-container-BIM4llf9.js";import{g as te}from"./get-safe-url-DWTB-tRE.js";import{_ as ye}from"./useLocalStorage-ChdS5XVQ.js";import{d as bt}from"./Launch-C-pZPEtf.js";import{d as vt}from"./DeleteOutline-CSi3y8ZI.js";import{g as St,i as jt}from"./spaces-BTe9w9go.js";import{d as Ct}from"./MoreVert-CrQ5BD1O.js";import{E as Pt}from"./index-f9QTV2yS.js";import"./url-join-CM2acrDe.js";import"./Close-Cem8y-ph.js";import"./use-mobile-B7_S05ne.js";import"./api-sNy9Buh2.js";function ce({children:t,selected:i}){return e.jsxs(Rt,{children:[t,e.jsx(b,{className:`selected-container ${i?"selected":""}`,children:e.jsx(ve,{className:"selected-icon"})})]})}const Rt=P(b)`
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
.selected-container {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bh as b}from"./index-hsXwdita.js";var _e=e=>e.type==="checkbox",ue=e=>e instanceof Date,j=e=>e==null;const dt=e=>typeof e=="object";var U=e=>!j(e)&&!Array.isArray(e)&&dt(e)&&!ue(e),yt=e=>U(e)&&e.target?_e(e.target)?e.target.checked:e.target.value:e,Ut=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,gt=(e,s)=>e.has(Ut(s)),Mt=e=>{const s=e.constructor&&e.constructor.prototype;return U(s)&&s.hasOwnProperty("isPrototypeOf")},We=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function T(e){let s;const t=Array.isArray(e),i=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(We&&(e instanceof Blob||i))&&(t||U(e)))if(s=t?[]:{},!t&&!Mt(e))s=e;else for(const n in e)e.hasOwnProperty(n)&&(s[n]=T(e[n]));else return e;return s}var he=e=>Array.isArray(e)?e.filter(Boolean):[],O=e=>e===void 0,c=(e,s,t)=>{if(!s||!U(e))return t;const i=he(s.split(/[,[\].]+?/)).reduce((n,u)=>j(n)?n:n[u],e);return O(i)||i===e?O(e[s])?t:e[s]:i},Q=e=>typeof e=="boolean",qe=e=>/^\w*$/.test(e),_t=e=>he(e.replace(/["|']|\]/g,"").split(/\.|\[/)),C=(e,s,t)=>{let i=-1;const n=qe(s)?[s]:_t(s),u=n.length,d=u-1;for(;++i<u;){const y=n[i];let A=t;if(i!==d){const x=e[y];A=U(x)||Array.isArray(x)?x:isNaN(+n[i+1])?{}:[]}if(y==="__proto__"||y==="constructor"||y==="prototype")return;e[y]=A,e=e[y]}};const me={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ee={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"},Nt=b.createContext(null),xe=()=>b.useContext(Nt);var ht=(e,s,t,i=!0)=>{const n={defaultValues:s._defaultValues};for(const u in e)Object.defineProperty(n,u,{get:()=>{const d=u;return s._proxyFormState[d]!==ee.all&&(s._proxyFormState[d]=!i||ee.all),t&&(t[d]=!0),e[d]}});return n};function Bt(e){const s=xe(),{control:t=s.control,disabled:i,name:n,exact:u}=e||{},[d,y]=b.useState(t._formState),A=b.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),x=b.useRef(n);return x.current=n,b.useEffect(()=>t._subscribe({name:x.current,formState:A.current,exact:u,callback:w=>{!i&&y({...t._formState,...w})}}),[t,i,u]),b.useEffect(()=>{A.current.isValid&&t._setValid(!0)},[t]),b.useMemo(()=>ht(d,t,A.current,!1),[d,t])}var se=e=>typeof e=="string",vt=(e,s,t,i,n)=>se(e)?(i&&s.watch.add(e),c(t,e,n)):Array.isArray(e)?e.map(u=>(i&&s.watch.add(u),c(t,u))):(i&&(s.watchAll=!0),t);function It(e){const s=xe(),{control:t=s.control,name:i,defaultValue:n,disabled:u,exact:d}=e||{},y=b.useRef(i),A=b.useRef(n);y.current=i,b.useEffect(()=>t._subscribe({name:y.current,formState:{values:!0},exact:d,callback:E=>!u&&w(vt(y.current,t._names,E.values||t._formValues,!1,A.current))}),[t,u,d]);const[x,w]=b.useState(t._getWatch(i,n));return b.useEffect(()=>t._removeUnmounted()),x}function Pt(e){const s=xe(),{name:t,disabled:i,control:n=s.control,shouldUnregister:u}=e,d=gt(n._names.array,t),y=It({control:n,name:t,defaultValue:c(n._formValues,t,c(n._defaultValues,t,e.defaultValue)),exact:!0}),A=Bt({control:n,name:t,exact:!0}),x=b.useRef(e),w=b.useRef(n.register(t,{...e.rules,value:y,...Q(e.disabled)?{disabled:e.disabled}:{}})),E=b.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!c(A.errors,t)},isDirty:{enumerable:!0,get:()=>!!c(A.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!c(A.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!c(A.validatingFields,t)},error:{enumerable:!0,get:()=>c(A.errors,t)}}),[A,t]),F=b.useCallback(P=>w.current.onChange({target:{value:yt(P),name:t},type:me.CHANGE}),[t]),R=b.useCallback(()=>w.current.onBlur({target:{value:c(n._formValues,t),name:t},type:me.BLUR}),[t,n._formValues]),G=b.useCallback(P=>{const W=c(n._fields,t);W&&P&&(W._f.ref={focus:()=>P.focus(),select:()=>P.select(),setCustomValidity:m=>P.setCustomValidity(m),reportValidity:()=>P.reportValidity()})},[n._fields,t]),I=b.useMemo(()=>({name:t,value:y,...Q(i)||A.disabled?{disabled:A.disabled||i}:{},onChange:F,onBlur:R,ref:G}),[t,i,A.disabled,F,R,G,y]);return b.useEffect(()=>{const P=n._options.shouldUnregister||u;n.register(t,{...x.current.rules,...Q(x.current.disabled)?{disabled:x.current.disabled}:{}});const W=(m,Y)=>{const $=c(n._fields,m);$&&$._f&&($._f.mount=Y)};if(W(t,!0),P){const m=T(c(n._options.defaultValues,t));C(n._defaultValues,t,m),O(c(n._formValues,t))&&C(n._formValues,t,m)}return!d&&n.register(t),()=>{(d?P&&!n._state.action:P)?n.unregister(t):W(t,!1)}},[t,n,d,u]),b.useEffect(()=>{n._setDisabledField({disabled:i,name:t})},[i,t,n]),b.useMemo(()=>({field:I,formState:A,fieldState:E}),[I,A,E])}const sr=e=>e.render(Pt(e));var Wt=(e,s,t,i,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:n||!0}}:{},z=e=>Array.isArray(e)?e:[e],st=()=>{let e=[];return{get observers(){return e},next:n=>{for(const u of e)u.next&&u.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(u=>u!==n)}}),unsubscribe:()=>{e=[]}}},Be=e=>j(e)||!dt(e);function le(e,s){if(Be(e)||Be(s))return e===s;if(ue(e)&&ue(s))return e.getTime()===s.getTime();const t=Object.keys(e),i=Object.keys(s);if(t.length!==i.length)return!1;for(const n of t){const u=e[n];if(!i.includes(n))return!1;if(n!=="ref"){const d=s[n];if(ue(u)&&ue(d)||U(u)&&U(d)||Array.isArray(u)&&Array.isArray(d)?!le(u,d):u!==d)return!1}}return!0}var H=e=>U(e)&&!Object.keys(e).length,He=e=>e.type==="file",te=e=>typeof e=="function",Ae=e=>{if(!We)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},bt=e=>e.type==="select-multiple",$e=e=>e.type==="radio",qt=e=>$e(e)||_e(e),Ee=e=>Ae(e)&&e.isConnected;function Ht(e,s){const t=s.slice(0,-1).length;let i=0;for(;i<t;)e=O(e)?i++:e[s[i++]];return e}function $t(e){for(const s in e)if(e.hasOwnProperty(s)&&!O(e[s]))return!1;return!0}function B(e,s){const t=Array.isArray(s)?s:qe(s)?[s]:_t(s),i=t.length===1?e:Ht(e,t),n=t.length-1,u=t[n];return i&&delete i[u],n!==0&&(U(i)&&H(i)||Array.isArray(i)&&$t(i))&&B(e,t.slice(0,-1)),e}var mt=e=>{for(const s in e)if(te(e[s]))return!0;return!1};function Fe(e,s={}){const t=Array.isArray(e);if(U(e)||t)for(const i in e)Array.isArray(e[i])||U(e[i])&&!mt(e[i])?(s[i]=Array.isArray(e[i])?[]:{},Fe(e[i],s[i])):j(e[i])||(s[i]=!0);return s}function At(e,s,t){const i=Array.isArray(e);if(U(e)||i)for(const n in e)Array.isArray(e[n])||U(e[n])&&!mt(e[n])?O(s)||Be(t[n])?t[n]=Array.isArray(e[n])?Fe(e[n],[]):{...Fe(e[n])}:At(e[n],j(s)?{}:s[n],t[n]):t[n]=!le(e[n],s[n]);return t}var ye=(e,s)=>At(e,s,Fe(s));const it={value:!1,isValid:!1},at={value:!0,isValid:!0};var Ft=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!O(e[0].attributes.value)?O(e[0].value)||e[0].value===""?at:{value:e[0].value,isValid:!0}:at:it}return it},Vt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:i})=>O(e)?e:s?e===""?NaN:e&&+e:t&&se(e)?new Date(e):i?i(e):e;const nt={isValid:!1,value:null};var xt=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,nt):nt;function lt(e){const s=e.ref;return He(s)?s.files:$e(s)?xt(e.refs).value:bt(s)?[...s.selectedOptions].map(({value:t})=>t):_e(s)?Ft(e.refs).value:Vt(O(s.value)?e.ref.value:s.value,e)}var jt=(e,s,t,i)=>{const n={};for(const u of e){const d=c(s,u);d&&C(n,u,d._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},Ve=e=>e instanceof RegExp,ge=e=>O(e)?e:Ve(e)?e.source:U(e)?Ve(e.value)?e.value.source:e.value:e,ce=e=>({isOnSubmit:!e||e===ee.onSubmit,isOnBlur:e===ee.onBlur,isOnChange:e===ee.onChange,isOnAll:e===ee.all,isOnTouch:e===ee.onTouched});const ut="AsyncFunction";var Kt=e=>!!e&&!!e.validate&&!!(te(e.validate)&&e.validate.constructor.name===ut||U(e.validate)&&Object.values(e.validate).find(s=>s.constructor.name===ut)),zt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Ie=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const fe=(e,s,t,i)=>{for(const n of t||Object.keys(e)){const u=c(e,n);if(u){const{_f:d,...y}=u;if(d){if(d.refs&&d.refs[0]&&s(d.refs[0],n)&&!i)return!0;if(d.ref&&s(d.ref,d.name)&&!i)return!0;if(fe(y,s))break}else if(U(y)&&fe(y,s))break}}};function ot(e,s,t){const i=c(e,t);if(i||qe(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const u=n.join("."),d=c(s,u),y=c(e,u);if(d&&!Array.isArray(d)&&t!==u)return{name:t};if(y&&y.type)return{name:u,error:y};n.pop()}return{name:t}}var Gt=(e,s,t,i)=>{t(e);const{name:n,...u}=e;return H(u)||Object.keys(u).length>=Object.keys(s).length||Object.keys(u).find(d=>s[d]===(!i||ee.all))},Yt=(e,s,t)=>!e||!s||e===s||z(e).some(i=>i&&(t?i===s:i.startsWith(s)||s.startsWith(i))),Jt=(e,s,t,i,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?i.isOnBlur:n.isOnBlur)?!e:(t?i.isOnChange:n.isOnChange)?e:!0,Qt=(e,s)=>!he(c(e,s)).length&&B(e,s),St=(e,s,t)=>{const i=z(c(e,t));return C(i,"root",s[t]),C(e,t,i),e},be=e=>se(e);function ct(e,s,t="validate"){if(be(e)||Array.isArray(e)&&e.every(be)||Q(e)&&!e)return{type:t,message:be(e)?e:"",ref:s}}var oe=e=>U(e)&&!Ve(e)?e:{value:e,message:""},Pe=async(e,s,t,i,n,u)=>{const{ref:d,refs:y,required:A,maxLength:x,minLength:w,min:E,max:F,pattern:R,validate:G,name:I,valueAsNumber:P,mount:W}=e._f,m=c(t,I);if(!W||s.has(I))return{};const Y=y?y[0]:d,$=p=>{n&&Y.reportValidity&&(Y.setCustomValidity(Q(p)?"":p||""),Y.reportValidity())},M={},v=$e(d),h=_e(d),V=v||h,D=(P||He(d))&&O(d.value)&&O(m)||Ae(d)&&d.value===""||m===""||Array.isArray(m)&&!m.length,J=Wt.bind(null,I,i,M),X=(p,S,L,K=ie.maxLength,Z=ie.minLength)=>{const re=p?S:L;M[I]={type:p?K:Z,message:re,ref:d,...J(p?K:Z,re)}};if(u?!Array.isArray(m)||!m.length:A&&(!V&&(D||j(m))||Q(m)&&!m||h&&!Ft(y).isValid||v&&!xt(y).isValid)){const{value:p,message:S}=be(A)?{value:!!A,message:A}:oe(A);if(p&&(M[I]={type:ie.required,message:S,ref:Y,...J(ie.required,S)},!i))return $(S),M}if(!D&&(!j(E)||!j(F))){let p,S;const L=oe(F),K=oe(E);if(!j(m)&&!isNaN(m)){const Z=d.valueAsNumber||m&&+m;j(L.value)||(p=Z>L.value),j(K.value)||(S=Z<K.value)}else{const Z=d.valueAsDate||new Date(m),re=ve=>new Date(new Date().toDateString()+" "+ve),ae=d.type=="time",de=d.type=="week";se(L.value)&&m&&(p=ae?re(m)>re(L.value):de?m>L.value:Z>new Date(L.value)),se(K.value)&&m&&(S=ae?re(m)<re(K.value):de?m<K.value:Z<new Date(K.value))}if((p||S)&&(X(!!p,L.message,K.message,ie.max,ie.min),!i))return $(M[I].message),M}if((x||w)&&!D&&(se(m)||u&&Array.isArray(m))){const p=oe(x),S=oe(w),L=!j(p.value)&&m.length>+p.value,K=!j(S.value)&&m.length<+S.value;if((L||K)&&(X(L,p.message,S.message),!i))return $(M[I].message),M}if(R&&!D&&se(m)){const{value:p,message:S}=oe(R);if(Ve(p)&&!m.match(p)&&(M[I]={type:ie.pattern,message:S,ref:d,...J(ie.pattern,S)},!i))return $(S),M}if(G){if(te(G)){const p=await G(m,t),S=ct(p,Y);if(S&&(M[I]={...S,...J(ie.validate,S.message)},!i))return $(S.message),M}else if(U(G)){let p={};for(const S in G){if(!H(p)&&!i)break;const L=ct(await G[S](m,t),Y,S);L&&(p={...L,...J(S,L.message)},$(L.message),i&&(M[I]=p))}if(!H(p)&&(M[I]={ref:Y,...p},!i))return M}}return $(!0),M};const Xt={mode:ee.onSubmit,reValidateMode:ee.onChange,shouldFocusError:!0};function Zt(e={}){let s={...Xt,...e},t={submitCount:0,isDirty:!1,isLoading:te(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1};const i={};let n=U(s.defaultValues)||U(s.values)?T(s.values||s.defaultValues)||{}:{},u=s.shouldUnregister?{}:T(n),d={action:!1,mount:!1,watch:!1},y={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},A,x=0;const w={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let E={...w};const F={array:st(),state:st()},R=ce(s.mode),G=ce(s.reValidateMode),I=s.criteriaMode===ee.all,P=r=>a=>{clearTimeout(x),x=setTimeout(r,a)},W=async r=>{if(!s.disabled&&(w.isValid||E.isValid||r)){const a=s.resolver?H((await D()).errors):await X(i,!0);a!==t.isValid&&F.state.next({isValid:a})}},m=(r,a)=>{!s.disabled&&(w.isValidating||w.validatingFields||E.isValidating||E.validatingFields)&&((r||Array.from(y.mount)).forEach(l=>{l&&(a?C(t.validatingFields,l,a):B(t.validatingFields,l))}),F.state.next({validatingFields:t.validatingFields,isValidating:!H(t.validatingFields)}))},Y=(r,a=[],l,g,f=!0,o=!0)=>{if(g&&l&&!s.disabled){if(d.action=!0,o&&Array.isArray(c(i,r))){const _=l(c(i,r),g.argA,g.argB);f&&C(i,r,_)}if(o&&Array.isArray(c(t.errors,r))){const _=l(c(t.errors,r),g.argA,g.argB);f&&C(t.errors,r,_),Qt(t.errors,r)}if((w.touchedFields||E.touchedFields)&&o&&Array.isArray(c(t.touchedFields,r))){const _=l(c(t.touchedFields,r),g.argA,g.argB);f&&C(t.touchedFields,r,_)}(w.dirtyFields||E.dirtyFields)&&(t.dirtyFields=ye(n,u)),F.state.next({name:r,isDirty:S(r,a),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else C(u,r,a)},$=(r,a)=>{C(t.errors,r,a),F.state.next({errors:t.errors})},M=r=>{t.errors=r,F.state.next({errors:t.errors,isValid:!1})},v=(r,a,l,g)=>{const f=c(i,r);if(f){const o=c(u,r,O(l)?c(n,r):l);O(o)||g&&g.defaultChecked||a?C(u,r,a?o:lt(f._f)):Z(r,o),d.mount&&W()}},h=(r,a,l,g,f)=>{let o=!1,_=!1;const k={name:r};if(!s.disabled){if(!l||g){(w.isDirty||E.isDirty)&&(_=t.isDirty,t.isDirty=k.isDirty=S(),o=_!==k.isDirty);const N=le(c(n,r),a);_=!!c(t.dirtyFields,r),N?B(t.dirtyFields,r):C(t.dirtyFields,r,!0),k.dirtyFields=t.dirtyFields,o=o||(w.dirtyFields||E.dirtyFields)&&_!==!N}if(l){const N=c(t.touchedFields,r);N||(C(t.touchedFields,r,l),k.touchedFields=t.touchedFields,o=o||(w.touchedFields||E.touchedFields)&&N!==l)}o&&f&&F.state.next(k)}return o?k:{}},V=(r,a,l,g)=>{const f=c(t.errors,r),o=(w.isValid||E.isValid)&&Q(a)&&t.isValid!==a;if(s.delayError&&l?(A=P(()=>$(r,l)),A(s.delayError)):(clearTimeout(x),A=null,l?C(t.errors,r,l):B(t.errors,r)),(l?!le(f,l):f)||!H(g)||o){const _={...g,...o&&Q(a)?{isValid:a}:{},errors:t.errors,name:r};t={...t,..._},F.state.next(_)}},D=async r=>{m(r,!0);const a=await s.resolver(u,s.context,jt(r||y.mount,i,s.criteriaMode,s.shouldUseNativeValidation));return m(r),a},J=async r=>{const{errors:a}=await D(r);if(r)for(const l of r){const g=c(a,l);g?C(t.errors,l,g):B(t.errors,l)}else t.errors=a;return a},X=async(r,a,l={valid:!0})=>{for(const g in r){const f=r[g];if(f){const{_f:o,..._}=f;if(o){const k=y.array.has(o.name),N=f._f&&Kt(f._f);N&&w.validatingFields&&m([g],!0);const q=await Pe(f,y.disabled,u,I,s.shouldUseNativeValidation&&!a,k);if(N&&w.validatingFields&&m([g]),q[o.name]&&(l.valid=!1,a))break;!a&&(c(q,o.name)?k?St(t.errors,q,o.name):C(t.errors,o.name,q[o.name]):B(t.errors,o.name))}!H(_)&&await X(_,a,l)}}return l.valid},p=()=>{for(const r of y.unMount){const a=c(i,r);a&&(a._f.refs?a._f.refs.every(l=>!Ee(l)):!Ee(a._f.ref))&&we(r)}y.unMount=new Set},S=(r,a)=>!s.disabled&&(r&&a&&C(u,r,a),!le(je(),n)),L=(r,a,l)=>vt(r,y,{...d.mount?u:O(a)?n:se(r)?{[r]:a}:a},l,a),K=r=>he(c(d.mount?u:n,r,s.shouldUnregister?c(n,r,[]):[])),Z=(r,a,l={})=>{const g=c(i,r);let f=a;if(g){const o=g._f;o&&(!o.disabled&&C(u,r,Vt(a,o)),f=Ae(o.ref)&&j(a)?"":a,bt(o.ref)?[...o.ref.options].forEach(_=>_.selected=f.includes(_.value)):o.refs?_e(o.ref)?o.refs.length>1?o.refs.forEach(_=>(!_.defaultChecked||!_.disabled)&&(_.checked=Array.isArray(f)?!!f.find(k=>k===_.value):f===_.value)):o.refs[0]&&(o.refs[0].checked=!!f):o.refs.forEach(_=>_.checked=_.value===f):He(o.ref)?o.ref.value="":(o.ref.value=f,o.ref.type||F.state.next({name:r,values:T(u)})))}(l.shouldDirty||l.shouldTouch)&&h(r,f,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&Se(r)},re=(r,a,l)=>{for(const g in a){const f=a[g],o=`${r}.${g}`,_=c(i,o);(y.array.has(r)||U(f)||_&&!_._f)&&!ue(f)?re(o,f,l):Z(o,f,l)}},ae=(r,a,l={})=>{const g=c(i,r),f=y.array.has(r),o=T(a);C(u,r,o),f?(F.array.next({name:r,values:T(u)}),(w.isDirty||w.dirtyFields||E.isDirty||E.dirtyFields)&&l.shouldDirty&&F.state.next({name:r,dirtyFields:ye(n,u),isDirty:S(r,o)})):g&&!g._f&&!j(o)?re(r,o,l):Z(r,o,l),Ie(r,y)&&F.state.next({...t}),F.state.next({name:d.mount?r:void 0,values:T(u)})},de=async r=>{d.mount=!0;const a=r.target;let l=a.name,g=!0;const f=c(i,l),o=_=>{g=Number.isNaN(_)||ue(_)&&isNaN(_.getTime())||le(_,c(u,l,_))};if(f){let _,k;const N=a.type?lt(f._f):yt(r),q=r.type===me.BLUR||r.type===me.FOCUS_OUT,Rt=!zt(f._f)&&!s.resolver&&!c(t.errors,l)&&!f._f.deps||Jt(q,c(t.touchedFields,l),t.isSubmitted,G,R),De=Ie(l,y,q);C(u,l,N),q?(f._f.onBlur&&f._f.onBlur(r),A&&A(0)):f._f.onChange&&f._f.onChange(r);const pe=h(l,N,q),Tt=!H(pe)||De;if(!q&&F.state.next({name:l,type:r.type,values:T(u)}),Rt)return(w.isValid||E.isValid)&&(s.mode==="onBlur"?q&&W():q||W()),Tt&&F.state.next({name:l,...De?{}:pe});if(!q&&De&&F.state.next({...t}),s.resolver){const{errors:tt}=await D([l]);if(o(N),g){const Lt=ot(t.errors,i,l),rt=ot(tt,i,Lt.name||l);_=rt.error,l=rt.name,k=H(tt)}}else m([l],!0),_=(await Pe(f,y.disabled,u,I,s.shouldUseNativeValidation))[l],m([l]),o(N),g&&(_?k=!1:(w.isValid||E.isValid)&&(k=await X(i,!0)));g&&(f._f.deps&&Se(f._f.deps),V(l,k,_,pe))}},ve=(r,a)=>{if(c(t.errors,a)&&r.focus)return r.focus(),1},Se=async(r,a={})=>{let l,g;const f=z(r);if(s.resolver){const o=await J(O(r)?r:f);l=H(o),g=r?!f.some(_=>c(o,_)):l}else r?(g=(await Promise.all(f.map(async o=>{const _=c(i,o);return await X(_&&_._f?{[o]:_}:_)}))).every(Boolean),!(!g&&!t.isValid)&&W()):g=l=await X(i);return F.state.next({...!se(r)||(w.isValid||E.isValid)&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),a.shouldFocus&&!g&&fe(i,ve,r?f:y.mount),g},je=r=>{const a={...d.mount?u:n};return O(r)?a:se(r)?c(a,r):r.map(l=>c(a,l))},Ke=(r,a)=>({invalid:!!c((a||t).errors,r),isDirty:!!c((a||t).dirtyFields,r),error:c((a||t).errors,r),isValidating:!!c(t.validatingFields,r),isTouched:!!c((a||t).touchedFields,r)}),wt=r=>{r&&z(r).forEach(a=>B(t.errors,a)),F.state.next({errors:r?t.errors:{}})},ze=(r,a,l)=>{const g=(c(i,r,{_f:{}})._f||{}).ref,f=c(t.errors,r)||{},{ref:o,message:_,type:k,...N}=f;C(t.errors,r,{...N,...a,ref:g}),F.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&g&&g.focus&&g.focus()},kt=(r,a)=>te(r)?F.state.subscribe({next:l=>r(L(void 0,a),l)}):L(r,a,!0),Ge=r=>F.state.subscribe({next:a=>{Yt(r.name,a.name,r.exact)&&Gt(a,r.formState||w,Ot,r.reRenderRoot)&&r.callback({values:{...u},...t,...a})}}).unsubscribe,Dt=r=>(d.mount=!0,E={...E,...r.formState},Ge({...r,formState:E})),we=(r,a={})=>{for(const l of r?z(r):y.mount)y.mount.delete(l),y.array.delete(l),a.keepValue||(B(i,l),B(u,l)),!a.keepError&&B(t.errors,l),!a.keepDirty&&B(t.dirtyFields,l),!a.keepTouched&&B(t.touchedFields,l),!a.keepIsValidating&&B(t.validatingFields,l),!s.shouldUnregister&&!a.keepDefaultValue&&B(n,l);F.state.next({values:T(u)}),F.state.next({...t,...a.keepDirty?{isDirty:S()}:{}}),!a.keepIsValid&&W()},Ye=({disabled:r,name:a})=>{(Q(r)&&d.mount||r||y.disabled.has(a))&&(r?y.disabled.add(a):y.disabled.delete(a))},ke=(r,a={})=>{let l=c(i,r);const g=Q(a.disabled)||Q(s.disabled);return C(i,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...a}}),y.mount.add(r),l?Ye({disabled:Q(a.disabled)?a.disabled:s.disabled,name:r}):v(r,!0,a.value),{...g?{disabled:a.disabled||s.disabled}:{},...s.progressive?{required:!!a.required,min:ge(a.min),max:ge(a.max),minLength:ge(a.minLength),maxLength:ge(a.maxLength),pattern:ge(a.pattern)}:{},name:r,onChange:de,onBlur:de,ref:f=>{if(f){ke(r,a),l=c(i,r);const o=O(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,_=qt(o),k=l._f.refs||[];if(_?k.find(N=>N===o):o===l._f.ref)return;C(i,r,{_f:{...l._f,..._?{refs:[...k.filter(Ee),o,...Array.isArray(c(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),v(r,!1,void 0,o)}else l=c(i,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||a.shouldUnregister)&&!(gt(y.array,r)&&d.action)&&y.unMount.add(r)}}},Je=()=>s.shouldFocusError&&fe(i,ve,y.mount),pt=r=>{Q(r)&&(F.state.next({disabled:r}),fe(i,(a,l)=>{const g=c(i,l);g&&(a.disabled=g._f.disabled||r,Array.isArray(g._f.refs)&&g._f.refs.forEach(f=>{f.disabled=g._f.disabled||r}))},0,!1))},Qe=(r,a)=>async l=>{let g;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let f=T(u);if(F.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:_}=await D();t.errors=o,f=_}else await X(i);if(y.disabled.size)for(const o of y.disabled)C(f,o,void 0);if(B(t.errors,"root"),H(t.errors)){F.state.next({errors:{}});try{await r(f,l)}catch(o){g=o}}else a&&await a({...t.errors},l),Je(),setTimeout(Je);if(F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:H(t.errors)&&!g,submitCount:t.submitCount+1,errors:t.errors}),g)throw g},Et=(r,a={})=>{c(i,r)&&(O(a.defaultValue)?ae(r,T(c(n,r))):(ae(r,a.defaultValue),C(n,r,T(a.defaultValue))),a.keepTouched||B(t.touchedFields,r),a.keepDirty||(B(t.dirtyFields,r),t.isDirty=a.defaultValue?S(r,T(c(n,r))):S()),a.keepError||(B(t.errors,r),w.isValid&&W()),F.state.next({...t}))},Xe=(r,a={})=>{const l=r?T(r):n,g=T(l),f=H(r),o=f?n:g;if(a.keepDefaultValues||(n=l),!a.keepValues){if(a.keepDirtyValues){const _=new Set([...y.mount,...Object.keys(ye(n,u))]);for(const k of Array.from(_))c(t.dirtyFields,k)?C(o,k,c(u,k)):ae(k,c(o,k))}else{if(We&&O(r))for(const _ of y.mount){const k=c(i,_);if(k&&k._f){const N=Array.isArray(k._f.refs)?k._f.refs[0]:k._f.ref;if(Ae(N)){const q=N.closest("form");if(q){q.reset();break}}}}for(const _ of y.mount)ae(_,c(o,_))}u=T(o),F.array.next({values:{...o}}),F.state.next({values:{...o}})}y={mount:a.keepDirtyValues?y.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!w.isValid||!!a.keepIsValid||!!a.keepDirtyValues,d.watch=!!s.shouldUnregister,F.state.next({submitCount:a.keepSubmitCount?t.submitCount:0,isDirty:f?!1:a.keepDirty?t.isDirty:!!(a.keepDefaultValues&&!le(r,n)),isSubmitted:a.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:f?{}:a.keepDirtyValues?a.keepDefaultValues&&u?ye(n,u):t.dirtyFields:a.keepDefaultValues&&r?ye(n,r):a.keepDirty?t.dirtyFields:{},touchedFields:a.keepTouched?t.touchedFields:{},errors:a.keepErrors?t.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},Ze=(r,a)=>Xe(te(r)?r(u):r,a),Ct=(r,a={})=>{const l=c(i,r),g=l&&l._f;if(g){const f=g.refs?g.refs[0]:g.ref;f.focus&&(f.focus(),a.shouldSelect&&te(f.select)&&f.select())}},Ot=r=>{t={...t,...r}},et={control:{register:ke,unregister:we,getFieldState:Ke,handleSubmit:Qe,setError:ze,_subscribe:Ge,_runSchema:D,_getWatch:L,_getDirty:S,_setValid:W,_setFieldArray:Y,_setDisabledField:Ye,_setErrors:M,_getFieldArray:K,_reset:Xe,_resetDefaultValues:()=>te(s.defaultValues)&&s.defaultValues().then(r=>{Ze(r,s.resetOptions),F.state.next({isLoading:!1})}),_removeUnmounted:p,_disableForm:pt,_subjects:F,_proxyFormState:w,get _fields(){return i},get _formValues(){return u},get _state(){return d},set _state(r){d=r},get _defaultValues(){return n},get _names(){return y},set _names(r){y=r},get _formState(){return t},get _options(){return s},set _options(r){s={...s,...r}}},subscribe:Dt,trigger:Se,register:ke,handleSubmit:Qe,watch:kt,setValue:ae,getValues:je,reset:Ze,resetField:Et,clearErrors:wt,unregister:we,setError:ze,setFocus:Ct,getFieldState:Ke};return{...et,formControl:et}}var ne=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const t=(Math.random()*16+e)%16|0;return(s=="x"?t:t&3|8).toString(16)})},Ce=(e,s,t={})=>t.shouldFocus||O(t.shouldFocus)?t.focusName||`${e}.${O(t.focusIndex)?s:t.focusIndex}.`:"",Oe=(e,s)=>[...e,...z(s)],Re=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Te(e,s,t){return[...e.slice(0,s),...z(t),...e.slice(s)]}var Le=(e,s,t)=>Array.isArray(e)?(O(e[t])&&(e[t]=void 0),e.splice(t,0,e.splice(s,1)[0]),e):[],Ue=(e,s)=>[...z(s),...z(e)];function er(e,s){let t=0;const i=[...e];for(const n of s)i.splice(n-t,1),t++;return he(i).length?i:[]}var Me=(e,s)=>O(s)?[]:er(e,z(s).sort((t,i)=>t-i)),Ne=(e,s,t)=>{[e[s],e[t]]=[e[t],e[s]]},ft=(e,s,t)=>(e[s]=t,e);function ir(e){const s=xe(),{control:t=s.control,name:i,keyName:n="id",shouldUnregister:u,rules:d}=e,[y,A]=b.useState(t._getFieldArray(i)),x=b.useRef(t._getFieldArray(i).map(ne)),w=b.useRef(y),E=b.useRef(i),F=b.useRef(!1);E.current=i,w.current=y,t._names.array.add(i),d&&t.register(i,d),b.useEffect(()=>t._subjects.array.subscribe({next:({values:v,name:h})=>{if(h===E.current||!h){const V=c(v,E.current);Array.isArray(V)&&(A(V),x.current=V.map(ne))}}}).unsubscribe,[t]);const R=b.useCallback(v=>{F.current=!0,t._setFieldArray(i,v)},[t,i]),G=(v,h)=>{const V=z(T(v)),D=Oe(t._getFieldArray(i),V);t._names.focus=Ce(i,D.length-1,h),x.current=Oe(x.current,V.map(ne)),R(D),A(D),t._setFieldArray(i,D,Oe,{argA:Re(v)})},I=(v,h)=>{const V=z(T(v)),D=Ue(t._getFieldArray(i),V);t._names.focus=Ce(i,0,h),x.current=Ue(x.current,V.map(ne)),R(D),A(D),t._setFieldArray(i,D,Ue,{argA:Re(v)})},P=v=>{const h=Me(t._getFieldArray(i),v);x.current=Me(x.current,v),R(h),A(h),!Array.isArray(c(t._fields,i))&&C(t._fields,i,void 0),t._setFieldArray(i,h,Me,{argA:v})},W=(v,h,V)=>{const D=z(T(h)),J=Te(t._getFieldArray(i),v,D);t._names.focus=Ce(i,v,V),x.current=Te(x.current,v,D.map(ne)),R(J),A(J),t._setFieldArray(i,J,Te,{argA:v,argB:Re(h)})},m=(v,h)=>{const V=t._getFieldArray(i);Ne(V,v,h),Ne(x.current,v,h),R(V),A(V),t._setFieldArray(i,V,Ne,{argA:v,argB:h},!1)},Y=(v,h)=>{const V=t._getFieldArray(i);Le(V,v,h),Le(x.current,v,h),R(V),A(V),t._setFieldArray(i,V,Le,{argA:v,argB:h},!1)},$=(v,h)=>{const V=T(h),D=ft(t._getFieldArray(i),v,V);x.current=[...D].map((J,X)=>!J||X===v?ne():x.current[X]),R(D),A([...D]),t._setFieldArray(i,D,ft,{argA:v,argB:V},!0,!1)},M=v=>{const h=z(T(v));x.current=h.map(ne),R([...h]),A([...h]),t._setFieldArray(i,[...h],V=>V,{},!0,!1)};return b.useEffect(()=>{if(t._state.action=!1,Ie(i,t._names)&&t._subjects.state.next({...t._formState}),F.current&&(!ce(t._options.mode).isOnSubmit||t._formState.isSubmitted)&&!ce(t._options.reValidateMode).isOnSubmit)if(t._options.resolver)t._runSchema([i]).then(v=>{const h=c(v.errors,i),V=c(t._formState.errors,i);(V?!h&&V.type||h&&(V.type!==h.type||V.message!==h.message):h&&h.type)&&(h?C(t._formState.errors,i,h):B(t._formState.errors,i),t._subjects.state.next({errors:t._formState.errors}))});else{const v=c(t._fields,i);v&&v._f&&!(ce(t._options.reValidateMode).isOnSubmit&&ce(t._options.mode).isOnSubmit)&&Pe(v,t._names.disabled,t._formValues,t._options.criteriaMode===ee.all,t._options.shouldUseNativeValidation,!0).then(h=>!H(h)&&t._subjects.state.next({errors:St(t._formState.errors,h,i)}))}t._subjects.state.next({name:i,values:T(t._formValues)}),t._names.focus&&fe(t._fields,(v,h)=>{if(t._names.focus&&h.startsWith(t._names.focus)&&v.focus)return v.focus(),1}),t._names.focus="",t._setValid(),F.current=!1},[y,i,t]),b.useEffect(()=>(!c(t._formValues,i)&&t._setFieldArray(i),()=>{const v=(h,V)=>{const D=c(t._fields,h);D&&D._f&&(D._f.mount=V)};t._options.shouldUnregister||u?t.unregister(i):v(i,!1)}),[i,t,n,u]),{swap:b.useCallback(m,[R,i,t]),move:b.useCallback(Y,[R,i,t]),prepend:b.useCallback(I,[R,i,t]),append:b.useCallback(G,[R,i,t]),remove:b.useCallback(P,[R,i,t]),insert:b.useCallback(W,[R,i,t]),update:b.useCallback($,[R,i,t]),replace:b.useCallback(M,[R,i,t]),fields:b.useMemo(()=>y.map((v,h)=>({...v,[n]:x.current[h]||ne()})),[y,n])}}function ar(e={}){const s=b.useRef(void 0),t=b.useRef(void 0),[i,n]=b.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,defaultValues:te(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...e.formControl?e.formControl:Zt(e),formState:i},e.formControl&&e.defaultValues&&!te(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const u=s.current.control;return u._options=e,b.useLayoutEffect(()=>u._subscribe({formState:u._proxyFormState,callback:()=>n({...u._formState}),reRenderRoot:!0}),[u]),b.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),b.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==i.isDirty&&u._subjects.state.next({isDirty:d})}},[u,i.isDirty]),b.useEffect(()=>{e.values&&!le(e.values,t.current)?(u._reset(e.values,u._options.resetOptions),t.current=e.values,n(d=>({...d}))):u._resetDefaultValues()},[e.values,u]),b.useEffect(()=>{e.errors&&!H(e.errors)&&u._setErrors(e.errors)},[e.errors,u]),b.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),b.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[e.shouldUnregister,u]),s.current.formState=ht(i,u),s.current}export{sr as C,It as a,ir as b,ar as u};
|
|
1
|
+
import{bh as b}from"./index-e66xJJ-x.js";var _e=e=>e.type==="checkbox",ue=e=>e instanceof Date,j=e=>e==null;const dt=e=>typeof e=="object";var U=e=>!j(e)&&!Array.isArray(e)&&dt(e)&&!ue(e),yt=e=>U(e)&&e.target?_e(e.target)?e.target.checked:e.target.value:e,Ut=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,gt=(e,s)=>e.has(Ut(s)),Mt=e=>{const s=e.constructor&&e.constructor.prototype;return U(s)&&s.hasOwnProperty("isPrototypeOf")},We=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function T(e){let s;const t=Array.isArray(e),i=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(We&&(e instanceof Blob||i))&&(t||U(e)))if(s=t?[]:{},!t&&!Mt(e))s=e;else for(const n in e)e.hasOwnProperty(n)&&(s[n]=T(e[n]));else return e;return s}var he=e=>Array.isArray(e)?e.filter(Boolean):[],O=e=>e===void 0,c=(e,s,t)=>{if(!s||!U(e))return t;const i=he(s.split(/[,[\].]+?/)).reduce((n,u)=>j(n)?n:n[u],e);return O(i)||i===e?O(e[s])?t:e[s]:i},Q=e=>typeof e=="boolean",qe=e=>/^\w*$/.test(e),_t=e=>he(e.replace(/["|']|\]/g,"").split(/\.|\[/)),C=(e,s,t)=>{let i=-1;const n=qe(s)?[s]:_t(s),u=n.length,d=u-1;for(;++i<u;){const y=n[i];let A=t;if(i!==d){const x=e[y];A=U(x)||Array.isArray(x)?x:isNaN(+n[i+1])?{}:[]}if(y==="__proto__"||y==="constructor"||y==="prototype")return;e[y]=A,e=e[y]}};const me={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ee={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"},Nt=b.createContext(null),xe=()=>b.useContext(Nt);var ht=(e,s,t,i=!0)=>{const n={defaultValues:s._defaultValues};for(const u in e)Object.defineProperty(n,u,{get:()=>{const d=u;return s._proxyFormState[d]!==ee.all&&(s._proxyFormState[d]=!i||ee.all),t&&(t[d]=!0),e[d]}});return n};function Bt(e){const s=xe(),{control:t=s.control,disabled:i,name:n,exact:u}=e||{},[d,y]=b.useState(t._formState),A=b.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),x=b.useRef(n);return x.current=n,b.useEffect(()=>t._subscribe({name:x.current,formState:A.current,exact:u,callback:w=>{!i&&y({...t._formState,...w})}}),[t,i,u]),b.useEffect(()=>{A.current.isValid&&t._setValid(!0)},[t]),b.useMemo(()=>ht(d,t,A.current,!1),[d,t])}var se=e=>typeof e=="string",vt=(e,s,t,i,n)=>se(e)?(i&&s.watch.add(e),c(t,e,n)):Array.isArray(e)?e.map(u=>(i&&s.watch.add(u),c(t,u))):(i&&(s.watchAll=!0),t);function It(e){const s=xe(),{control:t=s.control,name:i,defaultValue:n,disabled:u,exact:d}=e||{},y=b.useRef(i),A=b.useRef(n);y.current=i,b.useEffect(()=>t._subscribe({name:y.current,formState:{values:!0},exact:d,callback:E=>!u&&w(vt(y.current,t._names,E.values||t._formValues,!1,A.current))}),[t,u,d]);const[x,w]=b.useState(t._getWatch(i,n));return b.useEffect(()=>t._removeUnmounted()),x}function Pt(e){const s=xe(),{name:t,disabled:i,control:n=s.control,shouldUnregister:u}=e,d=gt(n._names.array,t),y=It({control:n,name:t,defaultValue:c(n._formValues,t,c(n._defaultValues,t,e.defaultValue)),exact:!0}),A=Bt({control:n,name:t,exact:!0}),x=b.useRef(e),w=b.useRef(n.register(t,{...e.rules,value:y,...Q(e.disabled)?{disabled:e.disabled}:{}})),E=b.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!c(A.errors,t)},isDirty:{enumerable:!0,get:()=>!!c(A.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!c(A.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!c(A.validatingFields,t)},error:{enumerable:!0,get:()=>c(A.errors,t)}}),[A,t]),F=b.useCallback(P=>w.current.onChange({target:{value:yt(P),name:t},type:me.CHANGE}),[t]),R=b.useCallback(()=>w.current.onBlur({target:{value:c(n._formValues,t),name:t},type:me.BLUR}),[t,n._formValues]),G=b.useCallback(P=>{const W=c(n._fields,t);W&&P&&(W._f.ref={focus:()=>P.focus(),select:()=>P.select(),setCustomValidity:m=>P.setCustomValidity(m),reportValidity:()=>P.reportValidity()})},[n._fields,t]),I=b.useMemo(()=>({name:t,value:y,...Q(i)||A.disabled?{disabled:A.disabled||i}:{},onChange:F,onBlur:R,ref:G}),[t,i,A.disabled,F,R,G,y]);return b.useEffect(()=>{const P=n._options.shouldUnregister||u;n.register(t,{...x.current.rules,...Q(x.current.disabled)?{disabled:x.current.disabled}:{}});const W=(m,Y)=>{const $=c(n._fields,m);$&&$._f&&($._f.mount=Y)};if(W(t,!0),P){const m=T(c(n._options.defaultValues,t));C(n._defaultValues,t,m),O(c(n._formValues,t))&&C(n._formValues,t,m)}return!d&&n.register(t),()=>{(d?P&&!n._state.action:P)?n.unregister(t):W(t,!1)}},[t,n,d,u]),b.useEffect(()=>{n._setDisabledField({disabled:i,name:t})},[i,t,n]),b.useMemo(()=>({field:I,formState:A,fieldState:E}),[I,A,E])}const sr=e=>e.render(Pt(e));var Wt=(e,s,t,i,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:n||!0}}:{},z=e=>Array.isArray(e)?e:[e],st=()=>{let e=[];return{get observers(){return e},next:n=>{for(const u of e)u.next&&u.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(u=>u!==n)}}),unsubscribe:()=>{e=[]}}},Be=e=>j(e)||!dt(e);function le(e,s){if(Be(e)||Be(s))return e===s;if(ue(e)&&ue(s))return e.getTime()===s.getTime();const t=Object.keys(e),i=Object.keys(s);if(t.length!==i.length)return!1;for(const n of t){const u=e[n];if(!i.includes(n))return!1;if(n!=="ref"){const d=s[n];if(ue(u)&&ue(d)||U(u)&&U(d)||Array.isArray(u)&&Array.isArray(d)?!le(u,d):u!==d)return!1}}return!0}var H=e=>U(e)&&!Object.keys(e).length,He=e=>e.type==="file",te=e=>typeof e=="function",Ae=e=>{if(!We)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},bt=e=>e.type==="select-multiple",$e=e=>e.type==="radio",qt=e=>$e(e)||_e(e),Ee=e=>Ae(e)&&e.isConnected;function Ht(e,s){const t=s.slice(0,-1).length;let i=0;for(;i<t;)e=O(e)?i++:e[s[i++]];return e}function $t(e){for(const s in e)if(e.hasOwnProperty(s)&&!O(e[s]))return!1;return!0}function B(e,s){const t=Array.isArray(s)?s:qe(s)?[s]:_t(s),i=t.length===1?e:Ht(e,t),n=t.length-1,u=t[n];return i&&delete i[u],n!==0&&(U(i)&&H(i)||Array.isArray(i)&&$t(i))&&B(e,t.slice(0,-1)),e}var mt=e=>{for(const s in e)if(te(e[s]))return!0;return!1};function Fe(e,s={}){const t=Array.isArray(e);if(U(e)||t)for(const i in e)Array.isArray(e[i])||U(e[i])&&!mt(e[i])?(s[i]=Array.isArray(e[i])?[]:{},Fe(e[i],s[i])):j(e[i])||(s[i]=!0);return s}function At(e,s,t){const i=Array.isArray(e);if(U(e)||i)for(const n in e)Array.isArray(e[n])||U(e[n])&&!mt(e[n])?O(s)||Be(t[n])?t[n]=Array.isArray(e[n])?Fe(e[n],[]):{...Fe(e[n])}:At(e[n],j(s)?{}:s[n],t[n]):t[n]=!le(e[n],s[n]);return t}var ye=(e,s)=>At(e,s,Fe(s));const it={value:!1,isValid:!1},at={value:!0,isValid:!0};var Ft=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!O(e[0].attributes.value)?O(e[0].value)||e[0].value===""?at:{value:e[0].value,isValid:!0}:at:it}return it},Vt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:i})=>O(e)?e:s?e===""?NaN:e&&+e:t&&se(e)?new Date(e):i?i(e):e;const nt={isValid:!1,value:null};var xt=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,nt):nt;function lt(e){const s=e.ref;return He(s)?s.files:$e(s)?xt(e.refs).value:bt(s)?[...s.selectedOptions].map(({value:t})=>t):_e(s)?Ft(e.refs).value:Vt(O(s.value)?e.ref.value:s.value,e)}var jt=(e,s,t,i)=>{const n={};for(const u of e){const d=c(s,u);d&&C(n,u,d._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},Ve=e=>e instanceof RegExp,ge=e=>O(e)?e:Ve(e)?e.source:U(e)?Ve(e.value)?e.value.source:e.value:e,ce=e=>({isOnSubmit:!e||e===ee.onSubmit,isOnBlur:e===ee.onBlur,isOnChange:e===ee.onChange,isOnAll:e===ee.all,isOnTouch:e===ee.onTouched});const ut="AsyncFunction";var Kt=e=>!!e&&!!e.validate&&!!(te(e.validate)&&e.validate.constructor.name===ut||U(e.validate)&&Object.values(e.validate).find(s=>s.constructor.name===ut)),zt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Ie=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const fe=(e,s,t,i)=>{for(const n of t||Object.keys(e)){const u=c(e,n);if(u){const{_f:d,...y}=u;if(d){if(d.refs&&d.refs[0]&&s(d.refs[0],n)&&!i)return!0;if(d.ref&&s(d.ref,d.name)&&!i)return!0;if(fe(y,s))break}else if(U(y)&&fe(y,s))break}}};function ot(e,s,t){const i=c(e,t);if(i||qe(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const u=n.join("."),d=c(s,u),y=c(e,u);if(d&&!Array.isArray(d)&&t!==u)return{name:t};if(y&&y.type)return{name:u,error:y};n.pop()}return{name:t}}var Gt=(e,s,t,i)=>{t(e);const{name:n,...u}=e;return H(u)||Object.keys(u).length>=Object.keys(s).length||Object.keys(u).find(d=>s[d]===(!i||ee.all))},Yt=(e,s,t)=>!e||!s||e===s||z(e).some(i=>i&&(t?i===s:i.startsWith(s)||s.startsWith(i))),Jt=(e,s,t,i,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?i.isOnBlur:n.isOnBlur)?!e:(t?i.isOnChange:n.isOnChange)?e:!0,Qt=(e,s)=>!he(c(e,s)).length&&B(e,s),St=(e,s,t)=>{const i=z(c(e,t));return C(i,"root",s[t]),C(e,t,i),e},be=e=>se(e);function ct(e,s,t="validate"){if(be(e)||Array.isArray(e)&&e.every(be)||Q(e)&&!e)return{type:t,message:be(e)?e:"",ref:s}}var oe=e=>U(e)&&!Ve(e)?e:{value:e,message:""},Pe=async(e,s,t,i,n,u)=>{const{ref:d,refs:y,required:A,maxLength:x,minLength:w,min:E,max:F,pattern:R,validate:G,name:I,valueAsNumber:P,mount:W}=e._f,m=c(t,I);if(!W||s.has(I))return{};const Y=y?y[0]:d,$=p=>{n&&Y.reportValidity&&(Y.setCustomValidity(Q(p)?"":p||""),Y.reportValidity())},M={},v=$e(d),h=_e(d),V=v||h,D=(P||He(d))&&O(d.value)&&O(m)||Ae(d)&&d.value===""||m===""||Array.isArray(m)&&!m.length,J=Wt.bind(null,I,i,M),X=(p,S,L,K=ie.maxLength,Z=ie.minLength)=>{const re=p?S:L;M[I]={type:p?K:Z,message:re,ref:d,...J(p?K:Z,re)}};if(u?!Array.isArray(m)||!m.length:A&&(!V&&(D||j(m))||Q(m)&&!m||h&&!Ft(y).isValid||v&&!xt(y).isValid)){const{value:p,message:S}=be(A)?{value:!!A,message:A}:oe(A);if(p&&(M[I]={type:ie.required,message:S,ref:Y,...J(ie.required,S)},!i))return $(S),M}if(!D&&(!j(E)||!j(F))){let p,S;const L=oe(F),K=oe(E);if(!j(m)&&!isNaN(m)){const Z=d.valueAsNumber||m&&+m;j(L.value)||(p=Z>L.value),j(K.value)||(S=Z<K.value)}else{const Z=d.valueAsDate||new Date(m),re=ve=>new Date(new Date().toDateString()+" "+ve),ae=d.type=="time",de=d.type=="week";se(L.value)&&m&&(p=ae?re(m)>re(L.value):de?m>L.value:Z>new Date(L.value)),se(K.value)&&m&&(S=ae?re(m)<re(K.value):de?m<K.value:Z<new Date(K.value))}if((p||S)&&(X(!!p,L.message,K.message,ie.max,ie.min),!i))return $(M[I].message),M}if((x||w)&&!D&&(se(m)||u&&Array.isArray(m))){const p=oe(x),S=oe(w),L=!j(p.value)&&m.length>+p.value,K=!j(S.value)&&m.length<+S.value;if((L||K)&&(X(L,p.message,S.message),!i))return $(M[I].message),M}if(R&&!D&&se(m)){const{value:p,message:S}=oe(R);if(Ve(p)&&!m.match(p)&&(M[I]={type:ie.pattern,message:S,ref:d,...J(ie.pattern,S)},!i))return $(S),M}if(G){if(te(G)){const p=await G(m,t),S=ct(p,Y);if(S&&(M[I]={...S,...J(ie.validate,S.message)},!i))return $(S.message),M}else if(U(G)){let p={};for(const S in G){if(!H(p)&&!i)break;const L=ct(await G[S](m,t),Y,S);L&&(p={...L,...J(S,L.message)},$(L.message),i&&(M[I]=p))}if(!H(p)&&(M[I]={ref:Y,...p},!i))return M}}return $(!0),M};const Xt={mode:ee.onSubmit,reValidateMode:ee.onChange,shouldFocusError:!0};function Zt(e={}){let s={...Xt,...e},t={submitCount:0,isDirty:!1,isLoading:te(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1};const i={};let n=U(s.defaultValues)||U(s.values)?T(s.values||s.defaultValues)||{}:{},u=s.shouldUnregister?{}:T(n),d={action:!1,mount:!1,watch:!1},y={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},A,x=0;const w={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let E={...w};const F={array:st(),state:st()},R=ce(s.mode),G=ce(s.reValidateMode),I=s.criteriaMode===ee.all,P=r=>a=>{clearTimeout(x),x=setTimeout(r,a)},W=async r=>{if(!s.disabled&&(w.isValid||E.isValid||r)){const a=s.resolver?H((await D()).errors):await X(i,!0);a!==t.isValid&&F.state.next({isValid:a})}},m=(r,a)=>{!s.disabled&&(w.isValidating||w.validatingFields||E.isValidating||E.validatingFields)&&((r||Array.from(y.mount)).forEach(l=>{l&&(a?C(t.validatingFields,l,a):B(t.validatingFields,l))}),F.state.next({validatingFields:t.validatingFields,isValidating:!H(t.validatingFields)}))},Y=(r,a=[],l,g,f=!0,o=!0)=>{if(g&&l&&!s.disabled){if(d.action=!0,o&&Array.isArray(c(i,r))){const _=l(c(i,r),g.argA,g.argB);f&&C(i,r,_)}if(o&&Array.isArray(c(t.errors,r))){const _=l(c(t.errors,r),g.argA,g.argB);f&&C(t.errors,r,_),Qt(t.errors,r)}if((w.touchedFields||E.touchedFields)&&o&&Array.isArray(c(t.touchedFields,r))){const _=l(c(t.touchedFields,r),g.argA,g.argB);f&&C(t.touchedFields,r,_)}(w.dirtyFields||E.dirtyFields)&&(t.dirtyFields=ye(n,u)),F.state.next({name:r,isDirty:S(r,a),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else C(u,r,a)},$=(r,a)=>{C(t.errors,r,a),F.state.next({errors:t.errors})},M=r=>{t.errors=r,F.state.next({errors:t.errors,isValid:!1})},v=(r,a,l,g)=>{const f=c(i,r);if(f){const o=c(u,r,O(l)?c(n,r):l);O(o)||g&&g.defaultChecked||a?C(u,r,a?o:lt(f._f)):Z(r,o),d.mount&&W()}},h=(r,a,l,g,f)=>{let o=!1,_=!1;const k={name:r};if(!s.disabled){if(!l||g){(w.isDirty||E.isDirty)&&(_=t.isDirty,t.isDirty=k.isDirty=S(),o=_!==k.isDirty);const N=le(c(n,r),a);_=!!c(t.dirtyFields,r),N?B(t.dirtyFields,r):C(t.dirtyFields,r,!0),k.dirtyFields=t.dirtyFields,o=o||(w.dirtyFields||E.dirtyFields)&&_!==!N}if(l){const N=c(t.touchedFields,r);N||(C(t.touchedFields,r,l),k.touchedFields=t.touchedFields,o=o||(w.touchedFields||E.touchedFields)&&N!==l)}o&&f&&F.state.next(k)}return o?k:{}},V=(r,a,l,g)=>{const f=c(t.errors,r),o=(w.isValid||E.isValid)&&Q(a)&&t.isValid!==a;if(s.delayError&&l?(A=P(()=>$(r,l)),A(s.delayError)):(clearTimeout(x),A=null,l?C(t.errors,r,l):B(t.errors,r)),(l?!le(f,l):f)||!H(g)||o){const _={...g,...o&&Q(a)?{isValid:a}:{},errors:t.errors,name:r};t={...t,..._},F.state.next(_)}},D=async r=>{m(r,!0);const a=await s.resolver(u,s.context,jt(r||y.mount,i,s.criteriaMode,s.shouldUseNativeValidation));return m(r),a},J=async r=>{const{errors:a}=await D(r);if(r)for(const l of r){const g=c(a,l);g?C(t.errors,l,g):B(t.errors,l)}else t.errors=a;return a},X=async(r,a,l={valid:!0})=>{for(const g in r){const f=r[g];if(f){const{_f:o,..._}=f;if(o){const k=y.array.has(o.name),N=f._f&&Kt(f._f);N&&w.validatingFields&&m([g],!0);const q=await Pe(f,y.disabled,u,I,s.shouldUseNativeValidation&&!a,k);if(N&&w.validatingFields&&m([g]),q[o.name]&&(l.valid=!1,a))break;!a&&(c(q,o.name)?k?St(t.errors,q,o.name):C(t.errors,o.name,q[o.name]):B(t.errors,o.name))}!H(_)&&await X(_,a,l)}}return l.valid},p=()=>{for(const r of y.unMount){const a=c(i,r);a&&(a._f.refs?a._f.refs.every(l=>!Ee(l)):!Ee(a._f.ref))&&we(r)}y.unMount=new Set},S=(r,a)=>!s.disabled&&(r&&a&&C(u,r,a),!le(je(),n)),L=(r,a,l)=>vt(r,y,{...d.mount?u:O(a)?n:se(r)?{[r]:a}:a},l,a),K=r=>he(c(d.mount?u:n,r,s.shouldUnregister?c(n,r,[]):[])),Z=(r,a,l={})=>{const g=c(i,r);let f=a;if(g){const o=g._f;o&&(!o.disabled&&C(u,r,Vt(a,o)),f=Ae(o.ref)&&j(a)?"":a,bt(o.ref)?[...o.ref.options].forEach(_=>_.selected=f.includes(_.value)):o.refs?_e(o.ref)?o.refs.length>1?o.refs.forEach(_=>(!_.defaultChecked||!_.disabled)&&(_.checked=Array.isArray(f)?!!f.find(k=>k===_.value):f===_.value)):o.refs[0]&&(o.refs[0].checked=!!f):o.refs.forEach(_=>_.checked=_.value===f):He(o.ref)?o.ref.value="":(o.ref.value=f,o.ref.type||F.state.next({name:r,values:T(u)})))}(l.shouldDirty||l.shouldTouch)&&h(r,f,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&Se(r)},re=(r,a,l)=>{for(const g in a){const f=a[g],o=`${r}.${g}`,_=c(i,o);(y.array.has(r)||U(f)||_&&!_._f)&&!ue(f)?re(o,f,l):Z(o,f,l)}},ae=(r,a,l={})=>{const g=c(i,r),f=y.array.has(r),o=T(a);C(u,r,o),f?(F.array.next({name:r,values:T(u)}),(w.isDirty||w.dirtyFields||E.isDirty||E.dirtyFields)&&l.shouldDirty&&F.state.next({name:r,dirtyFields:ye(n,u),isDirty:S(r,o)})):g&&!g._f&&!j(o)?re(r,o,l):Z(r,o,l),Ie(r,y)&&F.state.next({...t}),F.state.next({name:d.mount?r:void 0,values:T(u)})},de=async r=>{d.mount=!0;const a=r.target;let l=a.name,g=!0;const f=c(i,l),o=_=>{g=Number.isNaN(_)||ue(_)&&isNaN(_.getTime())||le(_,c(u,l,_))};if(f){let _,k;const N=a.type?lt(f._f):yt(r),q=r.type===me.BLUR||r.type===me.FOCUS_OUT,Rt=!zt(f._f)&&!s.resolver&&!c(t.errors,l)&&!f._f.deps||Jt(q,c(t.touchedFields,l),t.isSubmitted,G,R),De=Ie(l,y,q);C(u,l,N),q?(f._f.onBlur&&f._f.onBlur(r),A&&A(0)):f._f.onChange&&f._f.onChange(r);const pe=h(l,N,q),Tt=!H(pe)||De;if(!q&&F.state.next({name:l,type:r.type,values:T(u)}),Rt)return(w.isValid||E.isValid)&&(s.mode==="onBlur"?q&&W():q||W()),Tt&&F.state.next({name:l,...De?{}:pe});if(!q&&De&&F.state.next({...t}),s.resolver){const{errors:tt}=await D([l]);if(o(N),g){const Lt=ot(t.errors,i,l),rt=ot(tt,i,Lt.name||l);_=rt.error,l=rt.name,k=H(tt)}}else m([l],!0),_=(await Pe(f,y.disabled,u,I,s.shouldUseNativeValidation))[l],m([l]),o(N),g&&(_?k=!1:(w.isValid||E.isValid)&&(k=await X(i,!0)));g&&(f._f.deps&&Se(f._f.deps),V(l,k,_,pe))}},ve=(r,a)=>{if(c(t.errors,a)&&r.focus)return r.focus(),1},Se=async(r,a={})=>{let l,g;const f=z(r);if(s.resolver){const o=await J(O(r)?r:f);l=H(o),g=r?!f.some(_=>c(o,_)):l}else r?(g=(await Promise.all(f.map(async o=>{const _=c(i,o);return await X(_&&_._f?{[o]:_}:_)}))).every(Boolean),!(!g&&!t.isValid)&&W()):g=l=await X(i);return F.state.next({...!se(r)||(w.isValid||E.isValid)&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),a.shouldFocus&&!g&&fe(i,ve,r?f:y.mount),g},je=r=>{const a={...d.mount?u:n};return O(r)?a:se(r)?c(a,r):r.map(l=>c(a,l))},Ke=(r,a)=>({invalid:!!c((a||t).errors,r),isDirty:!!c((a||t).dirtyFields,r),error:c((a||t).errors,r),isValidating:!!c(t.validatingFields,r),isTouched:!!c((a||t).touchedFields,r)}),wt=r=>{r&&z(r).forEach(a=>B(t.errors,a)),F.state.next({errors:r?t.errors:{}})},ze=(r,a,l)=>{const g=(c(i,r,{_f:{}})._f||{}).ref,f=c(t.errors,r)||{},{ref:o,message:_,type:k,...N}=f;C(t.errors,r,{...N,...a,ref:g}),F.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&g&&g.focus&&g.focus()},kt=(r,a)=>te(r)?F.state.subscribe({next:l=>r(L(void 0,a),l)}):L(r,a,!0),Ge=r=>F.state.subscribe({next:a=>{Yt(r.name,a.name,r.exact)&&Gt(a,r.formState||w,Ot,r.reRenderRoot)&&r.callback({values:{...u},...t,...a})}}).unsubscribe,Dt=r=>(d.mount=!0,E={...E,...r.formState},Ge({...r,formState:E})),we=(r,a={})=>{for(const l of r?z(r):y.mount)y.mount.delete(l),y.array.delete(l),a.keepValue||(B(i,l),B(u,l)),!a.keepError&&B(t.errors,l),!a.keepDirty&&B(t.dirtyFields,l),!a.keepTouched&&B(t.touchedFields,l),!a.keepIsValidating&&B(t.validatingFields,l),!s.shouldUnregister&&!a.keepDefaultValue&&B(n,l);F.state.next({values:T(u)}),F.state.next({...t,...a.keepDirty?{isDirty:S()}:{}}),!a.keepIsValid&&W()},Ye=({disabled:r,name:a})=>{(Q(r)&&d.mount||r||y.disabled.has(a))&&(r?y.disabled.add(a):y.disabled.delete(a))},ke=(r,a={})=>{let l=c(i,r);const g=Q(a.disabled)||Q(s.disabled);return C(i,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...a}}),y.mount.add(r),l?Ye({disabled:Q(a.disabled)?a.disabled:s.disabled,name:r}):v(r,!0,a.value),{...g?{disabled:a.disabled||s.disabled}:{},...s.progressive?{required:!!a.required,min:ge(a.min),max:ge(a.max),minLength:ge(a.minLength),maxLength:ge(a.maxLength),pattern:ge(a.pattern)}:{},name:r,onChange:de,onBlur:de,ref:f=>{if(f){ke(r,a),l=c(i,r);const o=O(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,_=qt(o),k=l._f.refs||[];if(_?k.find(N=>N===o):o===l._f.ref)return;C(i,r,{_f:{...l._f,..._?{refs:[...k.filter(Ee),o,...Array.isArray(c(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),v(r,!1,void 0,o)}else l=c(i,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||a.shouldUnregister)&&!(gt(y.array,r)&&d.action)&&y.unMount.add(r)}}},Je=()=>s.shouldFocusError&&fe(i,ve,y.mount),pt=r=>{Q(r)&&(F.state.next({disabled:r}),fe(i,(a,l)=>{const g=c(i,l);g&&(a.disabled=g._f.disabled||r,Array.isArray(g._f.refs)&&g._f.refs.forEach(f=>{f.disabled=g._f.disabled||r}))},0,!1))},Qe=(r,a)=>async l=>{let g;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let f=T(u);if(F.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:_}=await D();t.errors=o,f=_}else await X(i);if(y.disabled.size)for(const o of y.disabled)C(f,o,void 0);if(B(t.errors,"root"),H(t.errors)){F.state.next({errors:{}});try{await r(f,l)}catch(o){g=o}}else a&&await a({...t.errors},l),Je(),setTimeout(Je);if(F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:H(t.errors)&&!g,submitCount:t.submitCount+1,errors:t.errors}),g)throw g},Et=(r,a={})=>{c(i,r)&&(O(a.defaultValue)?ae(r,T(c(n,r))):(ae(r,a.defaultValue),C(n,r,T(a.defaultValue))),a.keepTouched||B(t.touchedFields,r),a.keepDirty||(B(t.dirtyFields,r),t.isDirty=a.defaultValue?S(r,T(c(n,r))):S()),a.keepError||(B(t.errors,r),w.isValid&&W()),F.state.next({...t}))},Xe=(r,a={})=>{const l=r?T(r):n,g=T(l),f=H(r),o=f?n:g;if(a.keepDefaultValues||(n=l),!a.keepValues){if(a.keepDirtyValues){const _=new Set([...y.mount,...Object.keys(ye(n,u))]);for(const k of Array.from(_))c(t.dirtyFields,k)?C(o,k,c(u,k)):ae(k,c(o,k))}else{if(We&&O(r))for(const _ of y.mount){const k=c(i,_);if(k&&k._f){const N=Array.isArray(k._f.refs)?k._f.refs[0]:k._f.ref;if(Ae(N)){const q=N.closest("form");if(q){q.reset();break}}}}for(const _ of y.mount)ae(_,c(o,_))}u=T(o),F.array.next({values:{...o}}),F.state.next({values:{...o}})}y={mount:a.keepDirtyValues?y.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!w.isValid||!!a.keepIsValid||!!a.keepDirtyValues,d.watch=!!s.shouldUnregister,F.state.next({submitCount:a.keepSubmitCount?t.submitCount:0,isDirty:f?!1:a.keepDirty?t.isDirty:!!(a.keepDefaultValues&&!le(r,n)),isSubmitted:a.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:f?{}:a.keepDirtyValues?a.keepDefaultValues&&u?ye(n,u):t.dirtyFields:a.keepDefaultValues&&r?ye(n,r):a.keepDirty?t.dirtyFields:{},touchedFields:a.keepTouched?t.touchedFields:{},errors:a.keepErrors?t.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},Ze=(r,a)=>Xe(te(r)?r(u):r,a),Ct=(r,a={})=>{const l=c(i,r),g=l&&l._f;if(g){const f=g.refs?g.refs[0]:g.ref;f.focus&&(f.focus(),a.shouldSelect&&te(f.select)&&f.select())}},Ot=r=>{t={...t,...r}},et={control:{register:ke,unregister:we,getFieldState:Ke,handleSubmit:Qe,setError:ze,_subscribe:Ge,_runSchema:D,_getWatch:L,_getDirty:S,_setValid:W,_setFieldArray:Y,_setDisabledField:Ye,_setErrors:M,_getFieldArray:K,_reset:Xe,_resetDefaultValues:()=>te(s.defaultValues)&&s.defaultValues().then(r=>{Ze(r,s.resetOptions),F.state.next({isLoading:!1})}),_removeUnmounted:p,_disableForm:pt,_subjects:F,_proxyFormState:w,get _fields(){return i},get _formValues(){return u},get _state(){return d},set _state(r){d=r},get _defaultValues(){return n},get _names(){return y},set _names(r){y=r},get _formState(){return t},get _options(){return s},set _options(r){s={...s,...r}}},subscribe:Dt,trigger:Se,register:ke,handleSubmit:Qe,watch:kt,setValue:ae,getValues:je,reset:Ze,resetField:Et,clearErrors:wt,unregister:we,setError:ze,setFocus:Ct,getFieldState:Ke};return{...et,formControl:et}}var ne=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const t=(Math.random()*16+e)%16|0;return(s=="x"?t:t&3|8).toString(16)})},Ce=(e,s,t={})=>t.shouldFocus||O(t.shouldFocus)?t.focusName||`${e}.${O(t.focusIndex)?s:t.focusIndex}.`:"",Oe=(e,s)=>[...e,...z(s)],Re=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Te(e,s,t){return[...e.slice(0,s),...z(t),...e.slice(s)]}var Le=(e,s,t)=>Array.isArray(e)?(O(e[t])&&(e[t]=void 0),e.splice(t,0,e.splice(s,1)[0]),e):[],Ue=(e,s)=>[...z(s),...z(e)];function er(e,s){let t=0;const i=[...e];for(const n of s)i.splice(n-t,1),t++;return he(i).length?i:[]}var Me=(e,s)=>O(s)?[]:er(e,z(s).sort((t,i)=>t-i)),Ne=(e,s,t)=>{[e[s],e[t]]=[e[t],e[s]]},ft=(e,s,t)=>(e[s]=t,e);function ir(e){const s=xe(),{control:t=s.control,name:i,keyName:n="id",shouldUnregister:u,rules:d}=e,[y,A]=b.useState(t._getFieldArray(i)),x=b.useRef(t._getFieldArray(i).map(ne)),w=b.useRef(y),E=b.useRef(i),F=b.useRef(!1);E.current=i,w.current=y,t._names.array.add(i),d&&t.register(i,d),b.useEffect(()=>t._subjects.array.subscribe({next:({values:v,name:h})=>{if(h===E.current||!h){const V=c(v,E.current);Array.isArray(V)&&(A(V),x.current=V.map(ne))}}}).unsubscribe,[t]);const R=b.useCallback(v=>{F.current=!0,t._setFieldArray(i,v)},[t,i]),G=(v,h)=>{const V=z(T(v)),D=Oe(t._getFieldArray(i),V);t._names.focus=Ce(i,D.length-1,h),x.current=Oe(x.current,V.map(ne)),R(D),A(D),t._setFieldArray(i,D,Oe,{argA:Re(v)})},I=(v,h)=>{const V=z(T(v)),D=Ue(t._getFieldArray(i),V);t._names.focus=Ce(i,0,h),x.current=Ue(x.current,V.map(ne)),R(D),A(D),t._setFieldArray(i,D,Ue,{argA:Re(v)})},P=v=>{const h=Me(t._getFieldArray(i),v);x.current=Me(x.current,v),R(h),A(h),!Array.isArray(c(t._fields,i))&&C(t._fields,i,void 0),t._setFieldArray(i,h,Me,{argA:v})},W=(v,h,V)=>{const D=z(T(h)),J=Te(t._getFieldArray(i),v,D);t._names.focus=Ce(i,v,V),x.current=Te(x.current,v,D.map(ne)),R(J),A(J),t._setFieldArray(i,J,Te,{argA:v,argB:Re(h)})},m=(v,h)=>{const V=t._getFieldArray(i);Ne(V,v,h),Ne(x.current,v,h),R(V),A(V),t._setFieldArray(i,V,Ne,{argA:v,argB:h},!1)},Y=(v,h)=>{const V=t._getFieldArray(i);Le(V,v,h),Le(x.current,v,h),R(V),A(V),t._setFieldArray(i,V,Le,{argA:v,argB:h},!1)},$=(v,h)=>{const V=T(h),D=ft(t._getFieldArray(i),v,V);x.current=[...D].map((J,X)=>!J||X===v?ne():x.current[X]),R(D),A([...D]),t._setFieldArray(i,D,ft,{argA:v,argB:V},!0,!1)},M=v=>{const h=z(T(v));x.current=h.map(ne),R([...h]),A([...h]),t._setFieldArray(i,[...h],V=>V,{},!0,!1)};return b.useEffect(()=>{if(t._state.action=!1,Ie(i,t._names)&&t._subjects.state.next({...t._formState}),F.current&&(!ce(t._options.mode).isOnSubmit||t._formState.isSubmitted)&&!ce(t._options.reValidateMode).isOnSubmit)if(t._options.resolver)t._runSchema([i]).then(v=>{const h=c(v.errors,i),V=c(t._formState.errors,i);(V?!h&&V.type||h&&(V.type!==h.type||V.message!==h.message):h&&h.type)&&(h?C(t._formState.errors,i,h):B(t._formState.errors,i),t._subjects.state.next({errors:t._formState.errors}))});else{const v=c(t._fields,i);v&&v._f&&!(ce(t._options.reValidateMode).isOnSubmit&&ce(t._options.mode).isOnSubmit)&&Pe(v,t._names.disabled,t._formValues,t._options.criteriaMode===ee.all,t._options.shouldUseNativeValidation,!0).then(h=>!H(h)&&t._subjects.state.next({errors:St(t._formState.errors,h,i)}))}t._subjects.state.next({name:i,values:T(t._formValues)}),t._names.focus&&fe(t._fields,(v,h)=>{if(t._names.focus&&h.startsWith(t._names.focus)&&v.focus)return v.focus(),1}),t._names.focus="",t._setValid(),F.current=!1},[y,i,t]),b.useEffect(()=>(!c(t._formValues,i)&&t._setFieldArray(i),()=>{const v=(h,V)=>{const D=c(t._fields,h);D&&D._f&&(D._f.mount=V)};t._options.shouldUnregister||u?t.unregister(i):v(i,!1)}),[i,t,n,u]),{swap:b.useCallback(m,[R,i,t]),move:b.useCallback(Y,[R,i,t]),prepend:b.useCallback(I,[R,i,t]),append:b.useCallback(G,[R,i,t]),remove:b.useCallback(P,[R,i,t]),insert:b.useCallback(W,[R,i,t]),update:b.useCallback($,[R,i,t]),replace:b.useCallback(M,[R,i,t]),fields:b.useMemo(()=>y.map((v,h)=>({...v,[n]:x.current[h]||ne()})),[y,n])}}function ar(e={}){const s=b.useRef(void 0),t=b.useRef(void 0),[i,n]=b.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,defaultValues:te(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...e.formControl?e.formControl:Zt(e),formState:i},e.formControl&&e.defaultValues&&!te(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const u=s.current.control;return u._options=e,b.useLayoutEffect(()=>u._subscribe({formState:u._proxyFormState,callback:()=>n({...u._formState}),reRenderRoot:!0}),[u]),b.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),b.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==i.isDirty&&u._subjects.state.next({isDirty:d})}},[u,i.isDirty]),b.useEffect(()=>{e.values&&!le(e.values,t.current)?(u._reset(e.values,u._options.resetOptions),t.current=e.values,n(d=>({...d}))):u._resetDefaultValues()},[e.values,u]),b.useEffect(()=>{e.errors&&!H(e.errors)&&u._setErrors(e.errors)},[e.errors,u]),b.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),b.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[e.shouldUnregister,u]),s.current.formState=ht(i,u),s.current}export{sr as C,It as a,ir as b,ar as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as i}from"./codemirror.es-
|
|
1
|
+
import{C as i}from"./codemirror.es-CDd3nIcD.js";import"./index-RNqR3FXM.js";import"./index-e66xJJ-x.js";var y=Object.defineProperty,u=(e,t)=>y(e,"name",{value:t,configurable:!0});i.defineOption("info",!1,(e,t,n)=>{if(n&&n!==i.Init){const o=e.state.info.onMouseOver;i.off(e.getWrapperElement(),"mouseover",o),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(t){const o=e.state.info=v(t);o.onMouseOver=h.bind(null,e),i.on(e.getWrapperElement(),"mouseover",o.onMouseOver)}});function v(e){return{options:e instanceof Function?{render:e}:e===!0?{}:e}}u(v,"createState");function g(e){const t=e.state.info.options;return(t==null?void 0:t.hoverTime)||500}u(g,"getHoverTime");function h(e,t){const n=e.state.info,o=t.target||t.srcElement;if(!(o instanceof HTMLElement)||o.nodeName!=="SPAN"||n.hoverTimeout!==void 0)return;const s=o.getBoundingClientRect(),r=u(function(){clearTimeout(n.hoverTimeout),n.hoverTimeout=setTimeout(f,a)},"onMouseMove"),p=u(function(){i.off(document,"mousemove",r),i.off(e.getWrapperElement(),"mouseout",p),clearTimeout(n.hoverTimeout),n.hoverTimeout=void 0},"onMouseOut"),f=u(function(){i.off(document,"mousemove",r),i.off(e.getWrapperElement(),"mouseout",p),n.hoverTimeout=void 0,T(e,s)},"onHover"),a=g(e);n.hoverTimeout=setTimeout(f,a),i.on(document,"mousemove",r),i.on(e.getWrapperElement(),"mouseout",p)}u(h,"onMouseOver");function T(e,t){const n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}),s=e.state.info.options,r=s.render||e.getHelper(n,"info");if(r){const p=e.getTokenAt(n,!0);if(p){const f=r(p,s,e,n);f&&M(e,t,f)}}}u(T,"onMouseHover");function M(e,t,n){const o=document.createElement("div");o.className="CodeMirror-info",o.appendChild(n),document.body.appendChild(o);const s=o.getBoundingClientRect(),r=window.getComputedStyle(o),p=s.right-s.left+parseFloat(r.marginLeft)+parseFloat(r.marginRight),f=s.bottom-s.top+parseFloat(r.marginTop)+parseFloat(r.marginBottom);let a=t.bottom;f>window.innerHeight-t.bottom-15&&t.top>window.innerHeight-t.bottom&&(a=t.top-f),a<0&&(a=t.bottom);let l=Math.max(0,window.innerWidth-p-15);l>t.left&&(l=t.left),o.style.opacity="1",o.style.top=a+"px",o.style.left=l+"px";let d;const c=u(function(){clearTimeout(d)},"onMouseOverPopup"),m=u(function(){clearTimeout(d),d=setTimeout(O,200)},"onMouseOut"),O=u(function(){i.off(o,"mouseover",c),i.off(o,"mouseout",m),i.off(e.getWrapperElement(),"mouseout",m),o.style.opacity?(o.style.opacity="0",setTimeout(()=>{o.parentNode&&o.parentNode.removeChild(o)},600)):o.parentNode&&o.parentNode.removeChild(o)},"hidePopup");i.on(o,"mouseover",c),i.on(o,"mouseout",m),i.on(e.getWrapperElement(),"mouseout",m)}u(M,"showPopup");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as h}from"./codemirror.es-
|
|
1
|
+
import{C as h}from"./codemirror.es-CDd3nIcD.js";import{g as E,a as C,b as N,c as _,d as V,e as x}from"./SchemaReference.es-Dde3PXx0.js";import"./info-addon.es-ipFCgBgs.js";import{Y as A,r as F}from"./index-RNqR3FXM.js";import"./index-e66xJJ-x.js";import"./introspection.es-CPJcz6nz.js";import"./forEachState.es-D8bf0zSr.js";var L=Object.defineProperty,l=(r,e)=>L(r,"name",{value:e,configurable:!0});h.registerHelper("info","graphql",(r,e)=>{if(!e.schema||!r.state)return;const i=r.state,n=i.kind,d=i.step,c=E(e.schema,r.state);if(n==="Field"&&d===0&&c.fieldDef||n==="AliasedField"&&d===2&&c.fieldDef){const a=document.createElement("div");return o(a,c,e),u(a,e,c.fieldDef),a}else if(n==="Directive"&&d===1&&c.directiveDef){const a=document.createElement("div");return f(a,c,e),u(a,e,c.directiveDef),a}else if(n==="Argument"&&d===0&&c.argDef){const a=document.createElement("div");return p(a,c,e),u(a,e,c.argDef),a}else if(n==="EnumValue"&&c.enumValue&&c.enumValue.description){const a=document.createElement("div");return D(a,c,e),u(a,e,c.enumValue),a}else if(n==="NamedType"&&c.type&&c.type.description){const a=document.createElement("div");return m(a,c,e,c.type),u(a,e,c.type),a}});function o(r,e,i){s(r,e,i),v(r,e,i,e.type)}l(o,"renderField");function s(r,e,i){var n;const d=((n=e.fieldDef)===null||n===void 0?void 0:n.name)||"";d.slice(0,2)!=="__"&&(m(r,e,i,e.parentType),t(r,".")),t(r,d,"field-name",i,C(e))}l(s,"renderQualifiedField");function f(r,e,i){var n;const d="@"+(((n=e.directiveDef)===null||n===void 0?void 0:n.name)||"");t(r,d,"directive-name",i,N(e))}l(f,"renderDirective");function p(r,e,i){var n;e.directiveDef?f(r,e,i):e.fieldDef&&s(r,e,i);const d=((n=e.argDef)===null||n===void 0?void 0:n.name)||"";t(r,"("),t(r,d,"arg-name",i,_(e)),v(r,e,i,e.inputType),t(r,")")}l(p,"renderArg");function v(r,e,i,n){t(r,": "),m(r,e,i,n)}l(v,"renderTypeAnnotation");function D(r,e,i){var n;const d=((n=e.enumValue)===null||n===void 0?void 0:n.name)||"";m(r,e,i,e.inputType),t(r,"."),t(r,d,"enum-value",i,V(e))}l(D,"renderEnumValue");function m(r,e,i,n){n instanceof A?(m(r,e,i,n.ofType),t(r,"!")):n instanceof F?(t(r,"["),m(r,e,i,n.ofType),t(r,"]")):t(r,(n==null?void 0:n.name)||"","type-name",i,x(e,n))}l(m,"renderType");function u(r,e,i){const n=i.description;if(n){const d=document.createElement("div");d.className="info-description",e.renderDescription?d.innerHTML=e.renderDescription(n):d.appendChild(document.createTextNode(n)),r.appendChild(d)}T(r,e,i)}l(u,"renderDescription");function T(r,e,i){const n=i.deprecationReason;if(n){const d=document.createElement("div");d.className="info-deprecation",e.renderDescription?d.innerHTML=e.renderDescription(n):d.appendChild(document.createTextNode(n));const c=document.createElement("span");c.className="info-deprecation-label",c.appendChild(document.createTextNode("Deprecated: ")),d.insertBefore(c,d.firstChild),r.appendChild(d)}}l(T,"renderDeprecation");function t(r,e,i="",n={onClick:null},d=null){if(i){const c=n.onClick;let a;c?(a=document.createElement("a"),a.href="javascript:void 0",a.addEventListener("click",g=>{c(d,g)})):a=document.createElement("span"),a.className=i,a.appendChild(document.createTextNode(e)),r.appendChild(a)}else r.appendChild(document.createTextNode(e))}l(t,"text");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as C,j as u,ff as Gt,d8 as O,fg as qt,b as Ht,K as jt,fh as Kt,a6 as Vt,bh as zt,r as P,a9 as Jt,a4 as Yt,aa as Xt,bm as Qt,bq as Zt,o as kt,m as te,H as ee,W as re,k as ie,t as ne,D as se,B as ft,C as pt,s as oe,V as ae,v as le,bB as ce,X as he}from"./index-hsXwdita.js";import{W as ue}from"./url-evaluation-CTRSa9ZC.js";import{s as St,n as fe}from"./schema-QrpPKg0u.js";import{r as pe}from"./cloneDeep-CZ9xagkL.js";import{I as mt}from"./index-sIpE29lb.js";import{d as me}from"./Delete-CT7C6Kie.js";import{_ as de}from"./useLocalStorage-Cq7sRYfb.js";import{A as ge}from"./Autocomplete-DcWkc_vX.js";import{L as ve}from"./ListItemButton-WitFXLXy.js";import{S as ye,a as be,b as xe}from"./Stepper-DpIVkIVF.js";function je({mode:t,...e}){return t==="development"?u.jsx(ue,{type:"primary",...e,children:"DEV"}):null}je.propTypes={mode:C.string.isRequired};var _t={},lt={exports:{}},Et={exports:{}},Y=Et.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(t){return"file-"+Ct(t)}}},dt={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:Ct};Object.keys(Y).forEach(function(t){Object.keys(dt).forEach(function(e){Y[t][e]||(Y[t][e]=dt[e])}),Y[t].protocols_re=RegExp("^("+Y[t].protocols.map(function(e){return e.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function Ct(t){return t.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var wt=Et.exports,gt=wt,K=Object.assign||function(e,r){if(r===null||typeof r!="object")return e;const i=Object.keys(r);let s=i.length;for(;s--;)e[i[s]]=r[i[s]];return e},Se=E;function E(t,e,r,i,s,a,c){var l=this;l.type=t,Object.keys(gt[t]).forEach(function(d){l[d]=gt[t][d]}),l.user=e,l.auth=r,l.project=i,l.committish=s,l.default=a,l.opts=c||{}}E.prototype.hash=function(){return this.committish?"#"+this.committish:""};E.prototype._fill=function(t,e){if(t){var r=K({},e);r.path=r.path?r.path.replace(/^[/]+/g,""):"",e=K(K({},this.opts),e);var i=this;Object.keys(this).forEach(function(h){i[h]!=null&&r[h]==null&&(r[h]=i[h])});var s=r.auth,a=r.committish,c=r.fragment,l=r.path,d=r.project;Object.keys(r).forEach(function(h){var j=r[h];(h==="path"||h==="project")&&typeof j=="string"?r[h]=j.split("/").map(function(m){return encodeURIComponent(m)}).join("/"):h!=="domain"&&(r[h]=encodeURIComponent(j))}),r["auth@"]=s?s+"@":"",r["#fragment"]=c?"#"+this.hashformat(c):"",r.fragment=r.fragment?r.fragment:"",r["#path"]=l?"#"+this.hashformat(l):"",r["/path"]=r.path?"/"+r.path:"",r.projectPath=d.split("/").map(encodeURIComponent).join("/"),e.noCommittish?(r["#committish"]="",r["/tree/committish"]="",r["/committish"]="",r.committish=""):(r["#committish"]=a?"#"+a:"",r["/tree/committish"]=r.committish?"/"+r.treepath+"/"+r.committish:"",r["/committish"]=r.committish?"/"+r.committish:"",r.committish=r.committish||"master");var y=t;return Object.keys(r).forEach(function(h){y=y.replace(new RegExp("[{]"+h+"[}]","g"),r[h])}),e.noGitPlus?y.replace(/^git[+]/,""):y}};E.prototype.ssh=function(t){return this._fill(this.sshtemplate,t)};E.prototype.sshurl=function(t){return this._fill(this.sshurltemplate,t)};E.prototype.browse=function(t,e,r){return typeof t=="string"?(typeof e!="string"&&(r=e,e=null),this._fill(this.browsefiletemplate,K({fragment:e,path:t},r))):this._fill(this.browsetemplate,t)};E.prototype.docs=function(t){return this._fill(this.docstemplate,t)};E.prototype.bugs=function(t){return this._fill(this.bugstemplate,t)};E.prototype.https=function(t){return this._fill(this.httpstemplate,t)};E.prototype.git=function(t){return this._fill(this.gittemplate,t)};E.prototype.shortcut=function(t){return this._fill(this.shortcuttemplate,t)};E.prototype.path=function(t){return this._fill(this.pathtemplate,t)};E.prototype.tarball=function(t){var e=K({},t,{noCommittish:!1});return this._fill(this.tarballtemplate,e)};E.prototype.file=function(t,e){return this._fill(this.filetemplate,K({path:t},e))};E.prototype.getDefaultRepresentation=function(){return this.default};E.prototype.toString=function(t){return this.default&&typeof this[this.default]=="function"?this[this.default](t):this.sshurl(t)};var it,vt;function _e(){return vt||(vt=1,it=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),it}var Ee=p;p.Node=$;p.create=p;function p(t){var e=this;if(e instanceof p||(e=new p),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)e.push(arguments[r]);return e}p.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};p.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};p.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};p.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)we(this,arguments[t]);return this.length};p.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)Ie(this,arguments[t]);return this.length};p.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}};p.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}};p.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,i=0;r!==null;i++)t.call(e,r.value,i,this),r=r.next};p.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,i=this.length-1;r!==null;i--)t.call(e,r.value,i,this),r=r.prev};p.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};p.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};p.prototype.map=function(t,e){e=e||this;for(var r=new p,i=this.head;i!==null;)r.push(t.call(e,i.value,this)),i=i.next;return r};p.prototype.mapReverse=function(t,e){e=e||this;for(var r=new p,i=this.tail;i!==null;)r.push(t.call(e,i.value,this)),i=i.prev;return r};p.prototype.reduce=function(t,e){var r,i=this.head;if(arguments.length>1)r=e;else if(this.head)i=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;i!==null;s++)r=t(r,i.value,s),i=i.next;return r};p.prototype.reduceReverse=function(t,e){var r,i=this.tail;if(arguments.length>1)r=e;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;i!==null;s--)r=t(r,i.value,s),i=i.prev;return r};p.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};p.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};p.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new p;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,s=this.head;s!==null&&i<t;i++)s=s.next;for(;s!==null&&i<e;i++,s=s.next)r.push(s.value);return r};p.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new p;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,s=this.tail;s!==null&&i>e;i--)s=s.prev;for(;s!==null&&i>t;i--,s=s.prev)r.push(s.value);return r};p.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,s=this.head;s!==null&&i<t;i++)s=s.next;for(var a=[],i=0;s&&i<e;i++)a.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var i=0;i<r.length;i++)s=Ce(this,s,r[i]);return a};p.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=e,this.tail=t,this};function Ce(t,e,r){var i=e===t.head?new $(r,null,e,t):new $(r,e,e.next,t);return i.next===null&&(t.tail=i),i.prev===null&&(t.head=i),t.length++,i}function we(t,e){t.tail=new $(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function Ie(t,e){t.head=new $(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function $(t,e,r,i){if(!(this instanceof $))return new $(t,e,r,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{_e()(p)}catch{}const Re=Ee,N=Symbol("max"),L=Symbol("length"),H=Symbol("lengthCalculator"),Q=Symbol("allowStale"),B=Symbol("maxAge"),U=Symbol("dispose"),yt=Symbol("noDisposeOnSet"),S=Symbol("lruList"),R=Symbol("cache"),It=Symbol("updateAgeOnGet"),nt=()=>1;class Ae{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[N]=e.max||1/0;const r=e.length||nt;if(this[H]=typeof r!="function"?nt:r,this[Q]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[B]=e.maxAge||0,this[U]=e.dispose,this[yt]=e.noDisposeOnSet||!1,this[It]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[N]=e||1/0,X(this)}get max(){return this[N]}set allowStale(e){this[Q]=!!e}get allowStale(){return this[Q]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[B]=e,X(this)}get maxAge(){return this[B]}set lengthCalculator(e){typeof e!="function"&&(e=nt),e!==this[H]&&(this[H]=e,this[L]=0,this[S].forEach(r=>{r.length=this[H](r.value,r.key),this[L]+=r.length})),X(this)}get lengthCalculator(){return this[H]}get length(){return this[L]}get itemCount(){return this[S].length}rforEach(e,r){r=r||this;for(let i=this[S].tail;i!==null;){const s=i.prev;bt(this,e,i,r),i=s}}forEach(e,r){r=r||this;for(let i=this[S].head;i!==null;){const s=i.next;bt(this,e,i,r),i=s}}keys(){return this[S].toArray().map(e=>e.key)}values(){return this[S].toArray().map(e=>e.value)}reset(){this[U]&&this[S]&&this[S].length&&this[S].forEach(e=>this[U](e.key,e.value)),this[R]=new Map,this[S]=new Re,this[L]=0}dump(){return this[S].map(e=>Z(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[S]}set(e,r,i){if(i=i||this[B],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const s=i?Date.now():0,a=this[H](r,e);if(this[R].has(e)){if(a>this[N])return V(this,this[R].get(e)),!1;const d=this[R].get(e).value;return this[U]&&(this[yt]||this[U](e,d.value)),d.now=s,d.maxAge=i,d.value=r,this[L]+=a-d.length,d.length=a,this.get(e),X(this),!0}const c=new Oe(e,r,a,s,i);return c.length>this[N]?(this[U]&&this[U](e,r),!1):(this[L]+=c.length,this[S].unshift(c),this[R].set(e,this[S].head),X(this),!0)}has(e){if(!this[R].has(e))return!1;const r=this[R].get(e).value;return!Z(this,r)}get(e){return st(this,e,!0)}peek(e){return st(this,e,!1)}pop(){const e=this[S].tail;return e?(V(this,e),e.value):null}del(e){V(this,this[R].get(e))}load(e){this.reset();const r=Date.now();for(let i=e.length-1;i>=0;i--){const s=e[i],a=s.e||0;if(a===0)this.set(s.k,s.v);else{const c=a-r;c>0&&this.set(s.k,s.v,c)}}}prune(){this[R].forEach((e,r)=>st(this,r,!1))}}const st=(t,e,r)=>{const i=t[R].get(e);if(i){const s=i.value;if(Z(t,s)){if(V(t,i),!t[Q])return}else r&&(t[It]&&(i.value.now=Date.now()),t[S].unshiftNode(i));return s.value}},Z=(t,e)=>{if(!e||!e.maxAge&&!t[B])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[B]&&r>t[B]},X=t=>{if(t[L]>t[N])for(let e=t[S].tail;t[L]>t[N]&&e!==null;){const r=e.prev;V(t,e),e=r}},V=(t,e)=>{if(e){const r=e.value;t[U]&&t[U](r.key,r.value),t[L]-=r.length,t[R].delete(r.key),t[S].removeNode(e)}};class Oe{constructor(e,r,i,s,a){this.key=e,this.value=r,this.length=i,this.now=s,this.maxAge=a||0}}const bt=(t,e,r,i)=>{let s=r.value;Z(t,s)&&(V(t,r),t[Q]||(s=void 0)),s&&e.call(i,s.value,s.key,t)};var Pe=Ae,at=Gt,xt=wt,Ue=lt.exports=Se,Le=Pe,ot=new Le({max:1e3}),Te={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function De(t){return Te[t]||t.slice(0,-1)}var Ne={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};lt.exports.fromUrl=function(t,e){if(typeof t=="string"){var r=t+JSON.stringify(e||{});return ot.has(r)||ot.set(r,Be(t,e)),ot.get(r)}};function Be(t,e){if(!(t==null||t==="")){var r=Me($e(t)?"github:"+t:t),i=Fe(r),s=r.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),a=Object.keys(xt).map(function(c){try{var l=xt[c],d=null;i.auth&&Ne[i.protocol]&&(d=i.auth);var y=i.hash?decodeURIComponent(i.hash.substr(1)):null,h=null,j=null,m=null;if(s&&s[1]===c)h=s[2]&&decodeURIComponent(s[2]),j=decodeURIComponent(s[3].replace(/\.git$/,"")),m="shortcut";else{if(i.host&&i.host!==l.domain&&i.host.replace(/^www[.]/,"")!==l.domain||!l.protocols_re.test(i.protocol)||!i.path)return;var F=l.pathmatch,w=i.path.match(F);if(!w)return;w[1]!==null&&w[1]!==void 0&&(h=decodeURIComponent(w[1].replace(/^:/,""))),j=decodeURIComponent(w[2]),m=De(i.protocol)}return new Ue(c,h,d,j,y,m,e)}catch(I){if(!(I instanceof URIError))throw I}}).filter(function(c){return c});if(a.length===1)return a[0]}}function $e(t){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(t)}function Me(t){var e=at.parse(t);return e.protocol==="gist:"&&e.host&&!e.path?e.protocol+"/"+e.host:t}function Fe(t){var e=t.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!e){var r=at.parse(t);if(r.auth){const s=t.match(/[^@]+@[^:/]+/);if(s){var i=new at.URL(s[0]);r.auth=i.username||"",i.password&&(r.auth+=":"+i.password)}}return r}return{protocol:"git+ssh:",slashes:!0,auth:e[1],host:e[2],port:null,hostname:e[2],hash:e[4],search:null,query:null,pathname:"/"+e[3],path:"/"+e[3],href:"git+ssh://"+e[1]+"@"+e[2]+"/"+e[3]+(e[4]||"")}}var We=lt.exports,M={},A={},Ge=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(A,"__esModule",{value:!0});A.setService=A.findService=A.getDefaultServiceConfig=A.getServiceConfig=void 0;const qe=Ge(pe),He=St,Rt={},ct=t=>{Rt[t.name]={validate:t.schema.validate.bind(t.schema),defaultConfig:t.default}};A.setService=ct;ct({name:"auth",schema:He.authConfigSchema,default:{}});const At=t=>{if(!t)throw new Error("service name should not be empty");const e=Rt[t];if(!e)throw new Error(`service ${t} does not exist`);return e},Ot=(t,e,{validate:r}={})=>{const i=At(t),s=(0,qe.default)(e||{}),{value:a,error:c}=i.validate(s);if(r&&c)throw new Error(`Invalid blocklet service config: ${c.details.map(l=>l.message).join(", ")}`);return a};A.getServiceConfig=Ot;const Pt=t=>{const{defaultConfig:e}=At(t);return e};A.getDefaultServiceConfig=Pt;const Ut=(t,e)=>{const r=[e];return(t||[]).find(i=>r.includes(i.name))};A.findService=Ut;A.default={getServiceConfig:Ot,getDefaultServiceConfig:Pt,findService:Ut,setService:ct};Object.defineProperty(M,"__esModule",{value:!0});M.fixAndValidateService=M.validateMeta=void 0;const Ke=St,Ve=A,ze=t=>(!t.interfaces||!t.interfaces.length||t.interfaces.forEach(e=>{e.services&&e.services.length&&e.services.forEach(r=>{r.config=(0,Ve.getServiceConfig)(r.name,r.config,{validate:!0})})}),t);M.fixAndValidateService=ze;const Lt=(t,{ensureFiles:e=!1,ensureDist:r=!1,ensureComponentStore:i=!0,ensureName:s=!1,skipValidateDidName:a=!1,schemaOptions:c={}}={})=>{const l=(0,Ke.createBlockletSchema)(null,{ensureFiles:e,ensureDist:r,ensureComponentStore:i,ensureName:s,skipValidateDidName:a,...c}),{value:d,error:y}=l.validate(t);if(y)throw new Error(`Invalid blocklet meta: ${y.details.map(h=>h.message).join(", ")}`);return d};M.validateMeta=Lt;M.default=Lt;(function(t){var e=O&&O.__createBinding||(Object.create?function(n,o,v,b){b===void 0&&(b=v);var g=Object.getOwnPropertyDescriptor(o,v);(!g||("get"in g?!o.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return o[v]}}),Object.defineProperty(n,b,g)}:function(n,o,v,b){b===void 0&&(b=v),n[b]=o[v]}),r=O&&O.__setModuleDefault||(Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o}),i=O&&O.__importStar||function(){var n=function(o){return n=Object.getOwnPropertyNames||function(v){var b=[];for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(b[b.length]=g);return b},n(o)};return function(o){if(o&&o.__esModule)return o;var v={};if(o!=null)for(var b=n(o),g=0;g<b.length;g++)b[g]!=="default"&&e(v,o,b[g]);return r(v,o),v}}(),s=O&&O.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.fixService=t.fixInterfaces=t.parsePerson=t.formatPerson=t.fixName=t.fixTags=t.fixPerson=t.fixKeywords=t.fixFiles=t.fixRepository=t.fixRequired=void 0;const a=s(qt),c=i(We),l=Ht,d=M;Object.defineProperty(t,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const y=fe,h=(n,o)=>{n.description||(n.description=`Blocklet from ${o}`),n.version||(n.version=l.BLOCKLET_DEFAULT_VERSION)};t.fixRequired=h;const j=n=>{if(n.repository&&(typeof n.repository=="string"&&(n.repository={type:"git",url:n.repository}),n.repository.url)){const o=c.fromUrl(n.repository.url);o&&(n.repository.url=o.getDefaultRepresentation()==="shortcut"?o.https():o.toString())}};t.fixRepository=j;const m=n=>{Array.isArray(n.files)?n.files&&(n.files=n.files.filter(o=>!(!o||typeof o!="string"))):delete n.files};t.fixFiles=m;const F=n=>{typeof n.keywords=="string"&&(n.keywords=n.keywords.split(/,\s+/)),n.keywords&&!Array.isArray(n.keywords)?delete n.keywords:n.keywords&&(n.keywords=n.keywords.filter(o=>!(typeof o!="string"||!o)))};t.fixKeywords=F;const w=n=>{typeof n.tags=="string"&&(n.tags=n.tags.split(/,\s+/)),n.tags&&!Array.isArray(n.tags)?delete n.tags:n.tags&&(n.tags=n.tags.filter(o=>!(typeof o!="string"||!o)))};t.fixTags=w;const I=(n,o)=>(n.author&&(n.author=o(n.author)),["maintainers","contributors"].forEach(v=>{Array.isArray(n[v])&&(n[v]=n[v].map(o))}),n),W=n=>{if(!n)return"";if(typeof n=="string")return n;const o=n.name||"",v=n.url||n.web,b=v?` (${v})`:"",g=n.email||n.mail,x=g?` <${g}>`:"";return o+x+b};t.formatPerson=W;const T=n=>{if(typeof n!="string")return n;const o=n.match(/^([^(<]+)/),v=n.match(/\(([^)]+)\)/),b=n.match(/<([^>]+)>/),g={};return o&&o[0].trim()&&(g.name=o[0].trim()),b&&([,g.email]=b),v&&([,g.url]=v),g};t.parsePerson=T;const G=n=>(I(n,W),I(n,T),n);t.fixPerson=G;const _=(n,o=!0)=>{if(Array.isArray(n.interfaces)||(n.interfaces=[]),n.interfaces.length)return n.interfaces.forEach(x=>{x.type===l.BLOCKLET_INTERFACE_TYPE_WEB&&(x.protocol="http")}),n;const b=(0,a.default)(n,"capabilities.dynamicPathPrefix",!0)?l.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",g=({type:x="web",name:k,path:J="/",protocol:tt="http",port:et=l.BLOCKLET_DEFAULT_PORT_NAME})=>{n.interfaces.push({type:x,name:k,path:J,prefix:b,port:et,protocol:tt})};return[l.BLOCKLET_INTERFACE_PUBLIC].forEach(x=>{n[x]&&g({name:x,path:n[x]})}),Array.isArray(n.exposeServices)&&n.exposeServices.forEach(x=>{g({type:"service",name:x.protocol,protocol:x.protocol,port:{internal:`BLOCKLET_${x.protocol}_PORT`.toUpperCase(),external:x.port}})}),o&&(delete n.publicUrl,delete n.adminUrl,delete n.configUrl,delete n.docUrl,delete n.exposeServices,n.capabilities&&delete n.capabilities.dynamicPathPrefix),n};t.fixInterfaces=_;const z=n=>{const{did:o}=n;try{(0,y.validateNewDid)(o),n.name=o}catch{}return n};t.fixName=z,t.default={fixRequired:h,fixRepository:j,fixFiles:m,fixKeywords:F,fixPerson:G,fixTags:w,fixName:z,formatPerson:W,parsePerson:T,fixInterfaces:_,fixService:d.fixAndValidateService}})(_t);function Tt({owner:t,locale:e}){return u.jsxs(jt,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.fullName,t.did?u.jsx(Kt,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:t.did,compact:!0,size:14,locale:e}):null]})}Tt.propTypes={owner:C.object.isRequired,locale:C.string.isRequired};const Je="install-blocklet-from-URL",Dt=()=>{const[t,e]=de(Je,"[]",{raw:!0}),r=s=>{const a=s.trim(),c=JSON.parse(t),l=c.findIndex(d=>d===a);l!==0&&(l>0&&c.splice(l,1),c.length>=10&&c.splice(9),c.unshift(a),e(JSON.stringify(c)))},i=s=>{if(!s)return;const a=JSON.parse(t),c=s.trim(),l=a.findIndex(d=>d===c);l>-1&&(a.splice(l,1),e(JSON.stringify(a)))};return{urls:t?JSON.parse(t):[],addUrlRecord:r,removeUrlRecord:i}},Ye=Vt(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function ht(t){const{value:e,onValueChange:r,children:i,helperText:s}=t,{urls:a,removeUrlRecord:c}=Dt(),l=(y,h)=>{y.preventDefault(),y.stopPropagation(),c(h)},d=Ye();return u.jsxs(jt,{children:[u.jsx(ge,{freeSolo:!0,options:a,inputValue:e,onInputChange:(y,h)=>{r(h)},disableClearable:!0,popupIcon:null,renderInput:y=>zt.cloneElement(i,{...y}),renderOption:(y,h)=>P.createElement(Jt,{...y,key:h,secondaryAction:u.jsx(Yt,{edge:"end","aria-label":"delete",onClick:j=>l(j,h),children:u.jsx(me,{})})},u.jsx(ve,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:u.jsx(Xt,{primary:h,className:d.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),u.jsx(Qt,{style:{margin:0},children:s})]})}ht.propTypes={onValueChange:C.func,children:C.node,value:C.string,helperText:C.string};ht.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function Nt({defaultUrl:t,onCancel:e,onSuccess:r,onError:i,mode:s,handleText:a}){const{api:c}=Zt(),{api:l}=kt(),[d,y]=P.useState(!1),[h,j]=P.useState(""),{t:m,locale:F}=te(),w={dist:{}},[I,W]=P.useState(t),[T,G]=P.useState(t?1:0),[_,z]=P.useState(w),[n,o]=P.useState(!1),[v,b]=P.useState({}),g=s==="component",x=g?!0:!t,{addUrlRecord:k}=Dt(),J=async()=>{z(w),j(null),y(!0);let f=I.trim();!f.startsWith("https://")&&!f.startsWith("http://")&&!f.startsWith("file://")&&(f=`file://${f}`);try{const q=decodeURIComponent(f);try{new URL(q)}catch{throw new Error("Invalid URL")}const{meta:rt,inStore:Ft,registryUrl:Wt}=await c.getBlockletMetaFromUrl({input:{url:q}});z(rt),b({inStore:Ft,registryUrl:Wt,inputUrl:f}),k(f)}catch(q){console.error(q);const rt=`Blocklet Install failed: ${he(q)}`;j(rt),i(q)}finally{y(!1)}},tt=()=>{if(g){r({meta:_,...v}),e();return}y(!0),o(!0)},et=()=>{y(!1),o(!1),r({meta:_,...v}),e()},Bt=()=>{y(!1),o(!1)};P.useEffect(()=>{t&&J()},[t]);const $t=[{name:m("common.name"),value:ee.getDisplayName({meta:_},!0)},{name:m("common.version"),value:_.version},{name:m("common.did"),value:_.did?u.jsx(re,{did:_.did}):null},{name:m("common.author"),value:_.owner?u.jsx(Tt,{owner:_.owner,locale:F}):_t.formatPerson(_.author)},{name:m("blocklet.dist.downloadLink"),value:_.dist.tarball}],Mt=()=>d?u.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:u.jsx(pt,{})}):_.did?u.jsx("div",{style:{paddingLeft:"10%"},children:$t.map(f=>f.name===m("common.did")?u.jsx(mt,{valueComponent:"div",nameWidth:120,name:f.name,nameFormatter:()=>m("common.did"),children:f.value},f.name):u.jsx(mt,{valueComponent:"div",nameWidth:120,name:f.name,children:f.value},f.name))}):null,ut=[{label:m("blocklet.fromUrl.step0"),body:u.jsx(ie,{component:"div",children:u.jsx(ht,{style:{marginBottom:32},value:I,helperText:m("blocklet.fromUrl.description"),onValueChange:f=>{j(null),W(f)},children:u.jsx(ne,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:I,onChange:f=>{j(null),W(f.target.value)},disabled:d,onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),J(),G(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:e,onConfirm:()=>{J(),G(1)}},{label:m("blocklet.fromUrl.step1"),body:Mt(),cancel:m(x?"common.pre":"common.cancel"),confirm:(a==null?void 0:a.confirm)||m("blocklet.fromUrl.confirm"),onCancel:()=>{x?G(f=>f-1):e()},onConfirm:()=>{tt()}}],D=ut[T];return u.jsxs(u.Fragment,{children:[u.jsxs(se,{title:(a==null?void 0:a.title)||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>D.onCancel(),showCloseButton:T===0,disableEscapeKeyDown:!0,open:!0,actions:u.jsxs(u.Fragment,{children:[D.cancel&&u.jsx(ft,{onClick:f=>{f.stopPropagation(),j(null),D.onCancel()},color:"inherit",children:D.cancel||m("common.cancel")}),u.jsxs(ft,{onClick:f=>{f.stopPropagation(),D.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:d||!I||h,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[d&&T===0&&u.jsx(pt,{size:16}),D.confirm]})]}),children:[x&&u.jsx(ye,{alternativeLabel:!0,activeStep:T,children:ut.map(({label:f})=>u.jsx(be,{children:u.jsx(xe,{children:f})},f))}),u.jsx(oe,{component:"div",style:{marginTop:24},children:D.body}),!!h&&u.jsx(ae,{severity:"error",style:{width:"100%",marginTop:8},children:h})]}),_&&n&&u.jsx(le,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:l.get,checkTimeout:5*60*1e3,onSuccess:et,extraParams:{title:_.title,wt:ce(_),blockletMetaUrl:decodeURIComponent(I.trim())},messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:Bt})]})}Nt.propTypes={defaultUrl:C.string,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onError:C.func,mode:C.oneOf(["install","component"]),handleText:C.object};Nt.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};export{je as B,Nt as I,Tt as a,_t as f};
|
|
1
|
+
import{P as C,j as u,ff as Gt,d8 as O,fg as qt,b as Ht,K as jt,fh as Kt,a6 as Vt,bh as zt,r as P,a9 as Jt,a4 as Yt,aa as Xt,bm as Qt,bq as Zt,o as kt,m as te,H as ee,W as re,k as ie,t as ne,D as se,B as ft,C as pt,s as oe,V as ae,v as le,bB as ce,X as he}from"./index-e66xJJ-x.js";import{W as ue}from"./url-evaluation-DRKjUU7g.js";import{s as St,n as fe}from"./schema-DG7Gb1Zp.js";import{r as pe}from"./cloneDeep-JEYtEd7F.js";import{I as mt}from"./index-JsgthZUN.js";import{d as me}from"./Delete-D0GFkYtH.js";import{_ as de}from"./useLocalStorage-ChdS5XVQ.js";import{A as ge}from"./Autocomplete-Cbi7HzEa.js";import{L as ve}from"./ListItemButton-C4nle7Vw.js";import{S as ye,a as be,b as xe}from"./Stepper-DBIHjo83.js";function je({mode:t,...e}){return t==="development"?u.jsx(ue,{type:"primary",...e,children:"DEV"}):null}je.propTypes={mode:C.string.isRequired};var _t={},lt={exports:{}},Et={exports:{}},Y=Et.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(t){return"file-"+Ct(t)}}},dt={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:Ct};Object.keys(Y).forEach(function(t){Object.keys(dt).forEach(function(e){Y[t][e]||(Y[t][e]=dt[e])}),Y[t].protocols_re=RegExp("^("+Y[t].protocols.map(function(e){return e.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function Ct(t){return t.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var wt=Et.exports,gt=wt,K=Object.assign||function(e,r){if(r===null||typeof r!="object")return e;const i=Object.keys(r);let s=i.length;for(;s--;)e[i[s]]=r[i[s]];return e},Se=E;function E(t,e,r,i,s,a,c){var l=this;l.type=t,Object.keys(gt[t]).forEach(function(d){l[d]=gt[t][d]}),l.user=e,l.auth=r,l.project=i,l.committish=s,l.default=a,l.opts=c||{}}E.prototype.hash=function(){return this.committish?"#"+this.committish:""};E.prototype._fill=function(t,e){if(t){var r=K({},e);r.path=r.path?r.path.replace(/^[/]+/g,""):"",e=K(K({},this.opts),e);var i=this;Object.keys(this).forEach(function(h){i[h]!=null&&r[h]==null&&(r[h]=i[h])});var s=r.auth,a=r.committish,c=r.fragment,l=r.path,d=r.project;Object.keys(r).forEach(function(h){var j=r[h];(h==="path"||h==="project")&&typeof j=="string"?r[h]=j.split("/").map(function(m){return encodeURIComponent(m)}).join("/"):h!=="domain"&&(r[h]=encodeURIComponent(j))}),r["auth@"]=s?s+"@":"",r["#fragment"]=c?"#"+this.hashformat(c):"",r.fragment=r.fragment?r.fragment:"",r["#path"]=l?"#"+this.hashformat(l):"",r["/path"]=r.path?"/"+r.path:"",r.projectPath=d.split("/").map(encodeURIComponent).join("/"),e.noCommittish?(r["#committish"]="",r["/tree/committish"]="",r["/committish"]="",r.committish=""):(r["#committish"]=a?"#"+a:"",r["/tree/committish"]=r.committish?"/"+r.treepath+"/"+r.committish:"",r["/committish"]=r.committish?"/"+r.committish:"",r.committish=r.committish||"master");var y=t;return Object.keys(r).forEach(function(h){y=y.replace(new RegExp("[{]"+h+"[}]","g"),r[h])}),e.noGitPlus?y.replace(/^git[+]/,""):y}};E.prototype.ssh=function(t){return this._fill(this.sshtemplate,t)};E.prototype.sshurl=function(t){return this._fill(this.sshurltemplate,t)};E.prototype.browse=function(t,e,r){return typeof t=="string"?(typeof e!="string"&&(r=e,e=null),this._fill(this.browsefiletemplate,K({fragment:e,path:t},r))):this._fill(this.browsetemplate,t)};E.prototype.docs=function(t){return this._fill(this.docstemplate,t)};E.prototype.bugs=function(t){return this._fill(this.bugstemplate,t)};E.prototype.https=function(t){return this._fill(this.httpstemplate,t)};E.prototype.git=function(t){return this._fill(this.gittemplate,t)};E.prototype.shortcut=function(t){return this._fill(this.shortcuttemplate,t)};E.prototype.path=function(t){return this._fill(this.pathtemplate,t)};E.prototype.tarball=function(t){var e=K({},t,{noCommittish:!1});return this._fill(this.tarballtemplate,e)};E.prototype.file=function(t,e){return this._fill(this.filetemplate,K({path:t},e))};E.prototype.getDefaultRepresentation=function(){return this.default};E.prototype.toString=function(t){return this.default&&typeof this[this.default]=="function"?this[this.default](t):this.sshurl(t)};var it,vt;function _e(){return vt||(vt=1,it=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),it}var Ee=p;p.Node=$;p.create=p;function p(t){var e=this;if(e instanceof p||(e=new p),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)e.push(arguments[r]);return e}p.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};p.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};p.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};p.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)we(this,arguments[t]);return this.length};p.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)Ie(this,arguments[t]);return this.length};p.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}};p.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}};p.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,i=0;r!==null;i++)t.call(e,r.value,i,this),r=r.next};p.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,i=this.length-1;r!==null;i--)t.call(e,r.value,i,this),r=r.prev};p.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};p.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};p.prototype.map=function(t,e){e=e||this;for(var r=new p,i=this.head;i!==null;)r.push(t.call(e,i.value,this)),i=i.next;return r};p.prototype.mapReverse=function(t,e){e=e||this;for(var r=new p,i=this.tail;i!==null;)r.push(t.call(e,i.value,this)),i=i.prev;return r};p.prototype.reduce=function(t,e){var r,i=this.head;if(arguments.length>1)r=e;else if(this.head)i=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;i!==null;s++)r=t(r,i.value,s),i=i.next;return r};p.prototype.reduceReverse=function(t,e){var r,i=this.tail;if(arguments.length>1)r=e;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;i!==null;s--)r=t(r,i.value,s),i=i.prev;return r};p.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};p.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};p.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new p;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,s=this.head;s!==null&&i<t;i++)s=s.next;for(;s!==null&&i<e;i++,s=s.next)r.push(s.value);return r};p.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new p;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,s=this.tail;s!==null&&i>e;i--)s=s.prev;for(;s!==null&&i>t;i--,s=s.prev)r.push(s.value);return r};p.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,s=this.head;s!==null&&i<t;i++)s=s.next;for(var a=[],i=0;s&&i<e;i++)a.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var i=0;i<r.length;i++)s=Ce(this,s,r[i]);return a};p.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=e,this.tail=t,this};function Ce(t,e,r){var i=e===t.head?new $(r,null,e,t):new $(r,e,e.next,t);return i.next===null&&(t.tail=i),i.prev===null&&(t.head=i),t.length++,i}function we(t,e){t.tail=new $(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function Ie(t,e){t.head=new $(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function $(t,e,r,i){if(!(this instanceof $))return new $(t,e,r,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{_e()(p)}catch{}const Re=Ee,N=Symbol("max"),L=Symbol("length"),H=Symbol("lengthCalculator"),Q=Symbol("allowStale"),B=Symbol("maxAge"),U=Symbol("dispose"),yt=Symbol("noDisposeOnSet"),S=Symbol("lruList"),R=Symbol("cache"),It=Symbol("updateAgeOnGet"),nt=()=>1;class Ae{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[N]=e.max||1/0;const r=e.length||nt;if(this[H]=typeof r!="function"?nt:r,this[Q]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[B]=e.maxAge||0,this[U]=e.dispose,this[yt]=e.noDisposeOnSet||!1,this[It]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[N]=e||1/0,X(this)}get max(){return this[N]}set allowStale(e){this[Q]=!!e}get allowStale(){return this[Q]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[B]=e,X(this)}get maxAge(){return this[B]}set lengthCalculator(e){typeof e!="function"&&(e=nt),e!==this[H]&&(this[H]=e,this[L]=0,this[S].forEach(r=>{r.length=this[H](r.value,r.key),this[L]+=r.length})),X(this)}get lengthCalculator(){return this[H]}get length(){return this[L]}get itemCount(){return this[S].length}rforEach(e,r){r=r||this;for(let i=this[S].tail;i!==null;){const s=i.prev;bt(this,e,i,r),i=s}}forEach(e,r){r=r||this;for(let i=this[S].head;i!==null;){const s=i.next;bt(this,e,i,r),i=s}}keys(){return this[S].toArray().map(e=>e.key)}values(){return this[S].toArray().map(e=>e.value)}reset(){this[U]&&this[S]&&this[S].length&&this[S].forEach(e=>this[U](e.key,e.value)),this[R]=new Map,this[S]=new Re,this[L]=0}dump(){return this[S].map(e=>Z(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[S]}set(e,r,i){if(i=i||this[B],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const s=i?Date.now():0,a=this[H](r,e);if(this[R].has(e)){if(a>this[N])return V(this,this[R].get(e)),!1;const d=this[R].get(e).value;return this[U]&&(this[yt]||this[U](e,d.value)),d.now=s,d.maxAge=i,d.value=r,this[L]+=a-d.length,d.length=a,this.get(e),X(this),!0}const c=new Oe(e,r,a,s,i);return c.length>this[N]?(this[U]&&this[U](e,r),!1):(this[L]+=c.length,this[S].unshift(c),this[R].set(e,this[S].head),X(this),!0)}has(e){if(!this[R].has(e))return!1;const r=this[R].get(e).value;return!Z(this,r)}get(e){return st(this,e,!0)}peek(e){return st(this,e,!1)}pop(){const e=this[S].tail;return e?(V(this,e),e.value):null}del(e){V(this,this[R].get(e))}load(e){this.reset();const r=Date.now();for(let i=e.length-1;i>=0;i--){const s=e[i],a=s.e||0;if(a===0)this.set(s.k,s.v);else{const c=a-r;c>0&&this.set(s.k,s.v,c)}}}prune(){this[R].forEach((e,r)=>st(this,r,!1))}}const st=(t,e,r)=>{const i=t[R].get(e);if(i){const s=i.value;if(Z(t,s)){if(V(t,i),!t[Q])return}else r&&(t[It]&&(i.value.now=Date.now()),t[S].unshiftNode(i));return s.value}},Z=(t,e)=>{if(!e||!e.maxAge&&!t[B])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[B]&&r>t[B]},X=t=>{if(t[L]>t[N])for(let e=t[S].tail;t[L]>t[N]&&e!==null;){const r=e.prev;V(t,e),e=r}},V=(t,e)=>{if(e){const r=e.value;t[U]&&t[U](r.key,r.value),t[L]-=r.length,t[R].delete(r.key),t[S].removeNode(e)}};class Oe{constructor(e,r,i,s,a){this.key=e,this.value=r,this.length=i,this.now=s,this.maxAge=a||0}}const bt=(t,e,r,i)=>{let s=r.value;Z(t,s)&&(V(t,r),t[Q]||(s=void 0)),s&&e.call(i,s.value,s.key,t)};var Pe=Ae,at=Gt,xt=wt,Ue=lt.exports=Se,Le=Pe,ot=new Le({max:1e3}),Te={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function De(t){return Te[t]||t.slice(0,-1)}var Ne={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};lt.exports.fromUrl=function(t,e){if(typeof t=="string"){var r=t+JSON.stringify(e||{});return ot.has(r)||ot.set(r,Be(t,e)),ot.get(r)}};function Be(t,e){if(!(t==null||t==="")){var r=Me($e(t)?"github:"+t:t),i=Fe(r),s=r.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),a=Object.keys(xt).map(function(c){try{var l=xt[c],d=null;i.auth&&Ne[i.protocol]&&(d=i.auth);var y=i.hash?decodeURIComponent(i.hash.substr(1)):null,h=null,j=null,m=null;if(s&&s[1]===c)h=s[2]&&decodeURIComponent(s[2]),j=decodeURIComponent(s[3].replace(/\.git$/,"")),m="shortcut";else{if(i.host&&i.host!==l.domain&&i.host.replace(/^www[.]/,"")!==l.domain||!l.protocols_re.test(i.protocol)||!i.path)return;var F=l.pathmatch,w=i.path.match(F);if(!w)return;w[1]!==null&&w[1]!==void 0&&(h=decodeURIComponent(w[1].replace(/^:/,""))),j=decodeURIComponent(w[2]),m=De(i.protocol)}return new Ue(c,h,d,j,y,m,e)}catch(I){if(!(I instanceof URIError))throw I}}).filter(function(c){return c});if(a.length===1)return a[0]}}function $e(t){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(t)}function Me(t){var e=at.parse(t);return e.protocol==="gist:"&&e.host&&!e.path?e.protocol+"/"+e.host:t}function Fe(t){var e=t.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!e){var r=at.parse(t);if(r.auth){const s=t.match(/[^@]+@[^:/]+/);if(s){var i=new at.URL(s[0]);r.auth=i.username||"",i.password&&(r.auth+=":"+i.password)}}return r}return{protocol:"git+ssh:",slashes:!0,auth:e[1],host:e[2],port:null,hostname:e[2],hash:e[4],search:null,query:null,pathname:"/"+e[3],path:"/"+e[3],href:"git+ssh://"+e[1]+"@"+e[2]+"/"+e[3]+(e[4]||"")}}var We=lt.exports,M={},A={},Ge=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(A,"__esModule",{value:!0});A.setService=A.findService=A.getDefaultServiceConfig=A.getServiceConfig=void 0;const qe=Ge(pe),He=St,Rt={},ct=t=>{Rt[t.name]={validate:t.schema.validate.bind(t.schema),defaultConfig:t.default}};A.setService=ct;ct({name:"auth",schema:He.authConfigSchema,default:{}});const At=t=>{if(!t)throw new Error("service name should not be empty");const e=Rt[t];if(!e)throw new Error(`service ${t} does not exist`);return e},Ot=(t,e,{validate:r}={})=>{const i=At(t),s=(0,qe.default)(e||{}),{value:a,error:c}=i.validate(s);if(r&&c)throw new Error(`Invalid blocklet service config: ${c.details.map(l=>l.message).join(", ")}`);return a};A.getServiceConfig=Ot;const Pt=t=>{const{defaultConfig:e}=At(t);return e};A.getDefaultServiceConfig=Pt;const Ut=(t,e)=>{const r=[e];return(t||[]).find(i=>r.includes(i.name))};A.findService=Ut;A.default={getServiceConfig:Ot,getDefaultServiceConfig:Pt,findService:Ut,setService:ct};Object.defineProperty(M,"__esModule",{value:!0});M.fixAndValidateService=M.validateMeta=void 0;const Ke=St,Ve=A,ze=t=>(!t.interfaces||!t.interfaces.length||t.interfaces.forEach(e=>{e.services&&e.services.length&&e.services.forEach(r=>{r.config=(0,Ve.getServiceConfig)(r.name,r.config,{validate:!0})})}),t);M.fixAndValidateService=ze;const Lt=(t,{ensureFiles:e=!1,ensureDist:r=!1,ensureComponentStore:i=!0,ensureName:s=!1,skipValidateDidName:a=!1,schemaOptions:c={}}={})=>{const l=(0,Ke.createBlockletSchema)(null,{ensureFiles:e,ensureDist:r,ensureComponentStore:i,ensureName:s,skipValidateDidName:a,...c}),{value:d,error:y}=l.validate(t);if(y)throw new Error(`Invalid blocklet meta: ${y.details.map(h=>h.message).join(", ")}`);return d};M.validateMeta=Lt;M.default=Lt;(function(t){var e=O&&O.__createBinding||(Object.create?function(n,o,v,b){b===void 0&&(b=v);var g=Object.getOwnPropertyDescriptor(o,v);(!g||("get"in g?!o.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return o[v]}}),Object.defineProperty(n,b,g)}:function(n,o,v,b){b===void 0&&(b=v),n[b]=o[v]}),r=O&&O.__setModuleDefault||(Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o}),i=O&&O.__importStar||function(){var n=function(o){return n=Object.getOwnPropertyNames||function(v){var b=[];for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(b[b.length]=g);return b},n(o)};return function(o){if(o&&o.__esModule)return o;var v={};if(o!=null)for(var b=n(o),g=0;g<b.length;g++)b[g]!=="default"&&e(v,o,b[g]);return r(v,o),v}}(),s=O&&O.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.fixService=t.fixInterfaces=t.parsePerson=t.formatPerson=t.fixName=t.fixTags=t.fixPerson=t.fixKeywords=t.fixFiles=t.fixRepository=t.fixRequired=void 0;const a=s(qt),c=i(We),l=Ht,d=M;Object.defineProperty(t,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const y=fe,h=(n,o)=>{n.description||(n.description=`Blocklet from ${o}`),n.version||(n.version=l.BLOCKLET_DEFAULT_VERSION)};t.fixRequired=h;const j=n=>{if(n.repository&&(typeof n.repository=="string"&&(n.repository={type:"git",url:n.repository}),n.repository.url)){const o=c.fromUrl(n.repository.url);o&&(n.repository.url=o.getDefaultRepresentation()==="shortcut"?o.https():o.toString())}};t.fixRepository=j;const m=n=>{Array.isArray(n.files)?n.files&&(n.files=n.files.filter(o=>!(!o||typeof o!="string"))):delete n.files};t.fixFiles=m;const F=n=>{typeof n.keywords=="string"&&(n.keywords=n.keywords.split(/,\s+/)),n.keywords&&!Array.isArray(n.keywords)?delete n.keywords:n.keywords&&(n.keywords=n.keywords.filter(o=>!(typeof o!="string"||!o)))};t.fixKeywords=F;const w=n=>{typeof n.tags=="string"&&(n.tags=n.tags.split(/,\s+/)),n.tags&&!Array.isArray(n.tags)?delete n.tags:n.tags&&(n.tags=n.tags.filter(o=>!(typeof o!="string"||!o)))};t.fixTags=w;const I=(n,o)=>(n.author&&(n.author=o(n.author)),["maintainers","contributors"].forEach(v=>{Array.isArray(n[v])&&(n[v]=n[v].map(o))}),n),W=n=>{if(!n)return"";if(typeof n=="string")return n;const o=n.name||"",v=n.url||n.web,b=v?` (${v})`:"",g=n.email||n.mail,x=g?` <${g}>`:"";return o+x+b};t.formatPerson=W;const T=n=>{if(typeof n!="string")return n;const o=n.match(/^([^(<]+)/),v=n.match(/\(([^)]+)\)/),b=n.match(/<([^>]+)>/),g={};return o&&o[0].trim()&&(g.name=o[0].trim()),b&&([,g.email]=b),v&&([,g.url]=v),g};t.parsePerson=T;const G=n=>(I(n,W),I(n,T),n);t.fixPerson=G;const _=(n,o=!0)=>{if(Array.isArray(n.interfaces)||(n.interfaces=[]),n.interfaces.length)return n.interfaces.forEach(x=>{x.type===l.BLOCKLET_INTERFACE_TYPE_WEB&&(x.protocol="http")}),n;const b=(0,a.default)(n,"capabilities.dynamicPathPrefix",!0)?l.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",g=({type:x="web",name:k,path:J="/",protocol:tt="http",port:et=l.BLOCKLET_DEFAULT_PORT_NAME})=>{n.interfaces.push({type:x,name:k,path:J,prefix:b,port:et,protocol:tt})};return[l.BLOCKLET_INTERFACE_PUBLIC].forEach(x=>{n[x]&&g({name:x,path:n[x]})}),Array.isArray(n.exposeServices)&&n.exposeServices.forEach(x=>{g({type:"service",name:x.protocol,protocol:x.protocol,port:{internal:`BLOCKLET_${x.protocol}_PORT`.toUpperCase(),external:x.port}})}),o&&(delete n.publicUrl,delete n.adminUrl,delete n.configUrl,delete n.docUrl,delete n.exposeServices,n.capabilities&&delete n.capabilities.dynamicPathPrefix),n};t.fixInterfaces=_;const z=n=>{const{did:o}=n;try{(0,y.validateNewDid)(o),n.name=o}catch{}return n};t.fixName=z,t.default={fixRequired:h,fixRepository:j,fixFiles:m,fixKeywords:F,fixPerson:G,fixTags:w,fixName:z,formatPerson:W,parsePerson:T,fixInterfaces:_,fixService:d.fixAndValidateService}})(_t);function Tt({owner:t,locale:e}){return u.jsxs(jt,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.fullName,t.did?u.jsx(Kt,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:t.did,compact:!0,size:14,locale:e}):null]})}Tt.propTypes={owner:C.object.isRequired,locale:C.string.isRequired};const Je="install-blocklet-from-URL",Dt=()=>{const[t,e]=de(Je,"[]",{raw:!0}),r=s=>{const a=s.trim(),c=JSON.parse(t),l=c.findIndex(d=>d===a);l!==0&&(l>0&&c.splice(l,1),c.length>=10&&c.splice(9),c.unshift(a),e(JSON.stringify(c)))},i=s=>{if(!s)return;const a=JSON.parse(t),c=s.trim(),l=a.findIndex(d=>d===c);l>-1&&(a.splice(l,1),e(JSON.stringify(a)))};return{urls:t?JSON.parse(t):[],addUrlRecord:r,removeUrlRecord:i}},Ye=Vt(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function ht(t){const{value:e,onValueChange:r,children:i,helperText:s}=t,{urls:a,removeUrlRecord:c}=Dt(),l=(y,h)=>{y.preventDefault(),y.stopPropagation(),c(h)},d=Ye();return u.jsxs(jt,{children:[u.jsx(ge,{freeSolo:!0,options:a,inputValue:e,onInputChange:(y,h)=>{r(h)},disableClearable:!0,popupIcon:null,renderInput:y=>zt.cloneElement(i,{...y}),renderOption:(y,h)=>P.createElement(Jt,{...y,key:h,secondaryAction:u.jsx(Yt,{edge:"end","aria-label":"delete",onClick:j=>l(j,h),children:u.jsx(me,{})})},u.jsx(ve,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:u.jsx(Xt,{primary:h,className:d.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),u.jsx(Qt,{style:{margin:0},children:s})]})}ht.propTypes={onValueChange:C.func,children:C.node,value:C.string,helperText:C.string};ht.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function Nt({defaultUrl:t,onCancel:e,onSuccess:r,onError:i,mode:s,handleText:a}){const{api:c}=Zt(),{api:l}=kt(),[d,y]=P.useState(!1),[h,j]=P.useState(""),{t:m,locale:F}=te(),w={dist:{}},[I,W]=P.useState(t),[T,G]=P.useState(t?1:0),[_,z]=P.useState(w),[n,o]=P.useState(!1),[v,b]=P.useState({}),g=s==="component",x=g?!0:!t,{addUrlRecord:k}=Dt(),J=async()=>{z(w),j(null),y(!0);let f=I.trim();!f.startsWith("https://")&&!f.startsWith("http://")&&!f.startsWith("file://")&&(f=`file://${f}`);try{const q=decodeURIComponent(f);try{new URL(q)}catch{throw new Error("Invalid URL")}const{meta:rt,inStore:Ft,registryUrl:Wt}=await c.getBlockletMetaFromUrl({input:{url:q}});z(rt),b({inStore:Ft,registryUrl:Wt,inputUrl:f}),k(f)}catch(q){console.error(q);const rt=`Blocklet Install failed: ${he(q)}`;j(rt),i(q)}finally{y(!1)}},tt=()=>{if(g){r({meta:_,...v}),e();return}y(!0),o(!0)},et=()=>{y(!1),o(!1),r({meta:_,...v}),e()},Bt=()=>{y(!1),o(!1)};P.useEffect(()=>{t&&J()},[t]);const $t=[{name:m("common.name"),value:ee.getDisplayName({meta:_},!0)},{name:m("common.version"),value:_.version},{name:m("common.did"),value:_.did?u.jsx(re,{did:_.did}):null},{name:m("common.author"),value:_.owner?u.jsx(Tt,{owner:_.owner,locale:F}):_t.formatPerson(_.author)},{name:m("blocklet.dist.downloadLink"),value:_.dist.tarball}],Mt=()=>d?u.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:u.jsx(pt,{})}):_.did?u.jsx("div",{style:{paddingLeft:"10%"},children:$t.map(f=>f.name===m("common.did")?u.jsx(mt,{valueComponent:"div",nameWidth:120,name:f.name,nameFormatter:()=>m("common.did"),children:f.value},f.name):u.jsx(mt,{valueComponent:"div",nameWidth:120,name:f.name,children:f.value},f.name))}):null,ut=[{label:m("blocklet.fromUrl.step0"),body:u.jsx(ie,{component:"div",children:u.jsx(ht,{style:{marginBottom:32},value:I,helperText:m("blocklet.fromUrl.description"),onValueChange:f=>{j(null),W(f)},children:u.jsx(ne,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:I,onChange:f=>{j(null),W(f.target.value)},disabled:d,onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),J(),G(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:e,onConfirm:()=>{J(),G(1)}},{label:m("blocklet.fromUrl.step1"),body:Mt(),cancel:m(x?"common.pre":"common.cancel"),confirm:(a==null?void 0:a.confirm)||m("blocklet.fromUrl.confirm"),onCancel:()=>{x?G(f=>f-1):e()},onConfirm:()=>{tt()}}],D=ut[T];return u.jsxs(u.Fragment,{children:[u.jsxs(se,{title:(a==null?void 0:a.title)||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>D.onCancel(),showCloseButton:T===0,disableEscapeKeyDown:!0,open:!0,actions:u.jsxs(u.Fragment,{children:[D.cancel&&u.jsx(ft,{onClick:f=>{f.stopPropagation(),j(null),D.onCancel()},color:"inherit",children:D.cancel||m("common.cancel")}),u.jsxs(ft,{onClick:f=>{f.stopPropagation(),D.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:d||!I||h,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[d&&T===0&&u.jsx(pt,{size:16}),D.confirm]})]}),children:[x&&u.jsx(ye,{alternativeLabel:!0,activeStep:T,children:ut.map(({label:f})=>u.jsx(be,{children:u.jsx(xe,{children:f})},f))}),u.jsx(oe,{component:"div",style:{marginTop:24},children:D.body}),!!h&&u.jsx(ae,{severity:"error",style:{width:"100%",marginTop:8},children:h})]}),_&&n&&u.jsx(le,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:l.get,checkTimeout:5*60*1e3,onSuccess:et,extraParams:{title:_.title,wt:ce(_),blockletMetaUrl:decodeURIComponent(I.trim())},messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:Bt})]})}Nt.propTypes={defaultUrl:C.string,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onError:C.func,mode:C.oneOf(["install","component"]),handleText:C.object};Nt.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};export{je as B,Nt as I,Tt as a,_t as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bX as T,j as s,P as r,n as v,r as m,e as A,bi as $,D as E,m as j,o as H,aT as M,cX as q,cu as b,a2 as F,cY as U,A as B,cZ as O,cD as Y,c_ as N,c$ as S,av as V,K as L,bc as W,b8 as X,bs as K,C as J}from"./index-
|
|
1
|
+
import{bX as T,j as s,P as r,n as v,r as m,e as A,bi as $,D as E,m as j,o as H,aT as M,cX as q,cu as b,a2 as F,cY as U,A as B,cZ as O,cD as Y,c_ as N,c$ as S,av as V,K as L,bc as W,b8 as X,bs as K,C as J}from"./index-e66xJJ-x.js";import{R as Z}from"./index-D5xjISzz.js";import{N as G}from"./index-BTVRLsIg.js";import{C as z}from"./index-IViEbtE5.js";import{b as Q}from"./sdk-CGbU2sfF.js";import{w as ee}from"./wrap-locale-B6I84qwC.js";const se=T(s.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"}),"Inbox");function P({invitation:e,createPassportSvg:a,passportColor:c}){const[p,o]=m.useState(!1),{t}=m.useContext(A),l=m.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),u=m.useMemo(()=>a({title:l,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:$(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,l]),x=m.useCallback(()=>{o(!0)},[]),i=m.useCallback(()=>{o(!1)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(ie,{children:s.jsxs("div",{className:"invite-passport__card",onClick:x,children:[!!e.display&&s.jsx(G,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&s.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:u}})]})}),s.jsx(E,{open:p,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:i,children:e.role.permissions&&e.role.permissions.length>0?s.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(n=>s.jsx("li",{style:{listStyle:"circle"},children:n.description},n.name))}):s.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[s.jsx(se,{style:{width:"30px",height:"30px"}}),s.jsx("div",{children:t("invite.emptyPermission")})]})})]})}P.propTypes={invitation:r.object.isRequired,createPassportSvg:r.func.isRequired,passportColor:r.string};P.defaultProps={passportColor:"auto"};const ie=v.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
max-width: 350px;
|
|
4
4
|
margin: 30px auto;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bl as i,ga as e}from"./index-e66xJJ-x.js";const a=e;var o=(r,t)=>a(r)===a(t);const P=i(o);export{P as i};
|