@abtnode/webapp 1.16.43-beta-20250419-231352-c78ac93d → 1.16.43-beta-20250420-132156-d732158a
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-Cvpvococ.js → AdapterDayjs-CvCGckYL.js} +1 -1
- package/dist/assets/{Add-Do4PUh5X.js → Add-Cj1GwkKW.js} +1 -1
- package/dist/assets/{ArrowDropDown-DlLoBd5O.js → ArrowDropDown-D5mGNR03.js} +1 -1
- package/dist/assets/{Autocomplete-8l10UH26.js → Autocomplete-DuiLMv1o.js} +1 -1
- package/dist/assets/{Breadcrumbs-CTxrM3iq.js → Breadcrumbs-C2dg7iJH.js} +1 -1
- package/dist/assets/{ButtonGroup-jq75babd.js → ButtonGroup-CcLHnhC4.js} +1 -1
- package/dist/assets/{CSSTransition-Be2lCFWj.js → CSSTransition-D-xj_lEW.js} +1 -1
- package/dist/assets/{CallMerge-Dn1-C0m8.js → CallMerge-XaiMaWvF.js} +1 -1
- package/dist/assets/{CardContent-p0HerB2M.js → CardContent-DFEMxexG.js} +1 -1
- package/dist/assets/{ChevronLeft-JMgoqv1P.js → ChevronLeft-DHpx84Q3.js} +1 -1
- package/dist/assets/{ChevronRight-BRJpeXvU.js → ChevronRight-BsKgMnVp.js} +1 -1
- package/dist/assets/{Clear-Dee15ZKB.js → Clear-CBus3YPN.js} +1 -1
- package/dist/assets/{Close-fYv6NWB2.js → Close-Ce-e8gYh.js} +1 -1
- package/dist/assets/{Community-DwyvjRoN.js → Community-CzdvPZbq.js} +1 -1
- package/dist/assets/{Delete-DL_etOWb.js → Delete-DfBIMsYZ.js} +1 -1
- package/dist/assets/{Delete-BBkD2GAm.js → Delete-E4y6t1JP.js} +1 -1
- package/dist/assets/{DeleteOutline-CJur6DNk.js → DeleteOutline-BZ3_z3iH.js} +1 -1
- package/dist/assets/{Done-vYGWNHHy.js → Done-CKe-FMOo.js} +1 -1
- package/dist/assets/{Edit-CRnqnhH9.js → Edit-K2_xM3YP.js} +1 -1
- package/dist/assets/{ErrorOutline-D22L4UmC.js → ErrorOutline-NhUNtUrq.js} +1 -1
- package/dist/assets/{HelpOutline-Crn0Z0sH.js → HelpOutline-BIx91aby.js} +1 -1
- package/dist/assets/{Holiday--m700UUV.js → Holiday-CsAx5a3y.js} +1 -1
- package/dist/assets/{Launch-B959IsxA.js → Launch-DbAaLLdn.js} +1 -1
- package/dist/assets/{Link-C0pm3nZZ.js → Link-BQNrDjfd.js} +1 -1
- package/dist/assets/{ListItemButton-Bu0_R2ca.js → ListItemButton-Cd6Uq-Ac.js} +1 -1
- package/dist/assets/{ListSubheader-C0FJk3-H.js → ListSubheader-eUJyCt4T.js} +1 -1
- package/dist/assets/{LoadingButton-BcryG2ki.js → LoadingButton-DVPu322x.js} +1 -1
- package/dist/assets/{LockIcon-DtDbYwWX.js → LockIcon-CiguMpNN.js} +1 -1
- package/dist/assets/{Meeting-C2-3UeAP.js → Meeting-C3v58tIT.js} +1 -1
- package/dist/assets/{MoreHoriz-BNH4KEQj.js → MoreHoriz-Cly_ulfn.js} +1 -1
- package/dist/assets/{MoreVert-BnLtQQPi.js → MoreVert-61JL59bH.js} +1 -1
- package/dist/assets/{OffSick-D-LYxvJG.js → OffSick-CToGGhIx.js} +1 -1
- package/dist/assets/{Phone-C69yIwZa.js → Phone-50QuQeWu.js} +1 -1
- package/dist/assets/{Public-R75NJcSG.js → Public-EAyGtHHi.js} +1 -1
- package/dist/assets/{Refresh-BFb6at9W.js → Refresh-2FBzb_uQ.js} +1 -1
- package/dist/assets/{SchemaReference.es-nI9BrrE3.js → SchemaReference.es-CYEXItFR.js} +1 -1
- package/dist/assets/{Search-CfIrlArL.js → Search-DQ4Y1c5N.js} +1 -1
- package/dist/assets/{Slider-Ce4-AA62.js → Slider-BQJhsQiK.js} +1 -1
- package/dist/assets/{Stepper-B9jFEqOQ.js → Stepper-zGEKMQJb.js} +1 -1
- package/dist/assets/{TableSearch-B7b60mjO.js → TableSearch-CvOwepTo.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-BBCf3swR.js → ToggleButtonGroup-ClJp8lmK.js} +1 -1
- package/dist/assets/{Verified-BeU4A60V.js → Verified-tGi6fe3F.js} +1 -1
- package/dist/assets/{VerifiedUser-B5iWLUpk.js → VerifiedUser-CCkZHpu5.js} +1 -1
- package/dist/assets/{ViewColumn-DOT0Os2K.js → ViewColumn-Dug72V0B.js} +1 -1
- package/dist/assets/{ViewList-CFuBhPy5.js → ViewList-BG98kh5u.js} +1 -1
- package/dist/assets/{WorkingRemotely-CxfU4UCt.js → WorkingRemotely-BzsyqruY.js} +1 -1
- package/dist/assets/{_createAggregator-CjZtATK4.js → _createAggregator-Z9y-nGZg.js} +1 -1
- package/dist/assets/{actions-DjJDvvNb.js → actions-D7wsLSGA.js} +1 -1
- package/dist/assets/{actions-CQYnMEfY.js → actions-sMg6nWfa.js} +1 -1
- package/dist/assets/{agreement-DlIVHnRs.js → agreement-D_pxcKSB.js} +1 -1
- package/dist/assets/api-BV0Wx2uO.js +1 -0
- package/dist/assets/appearance-BKpK01va.js +1 -0
- package/dist/assets/{audit-logs-DvPq3DKg.js → audit-logs-DaG555bS.js} +1 -1
- package/dist/assets/{blocklet-DJeYf4PW.js → blocklet-Dj2klNma.js} +1 -1
- package/dist/assets/{brace-fold.es-wBUs6RJn.js → brace-fold.es-BSiUbwCn.js} +1 -1
- package/dist/assets/{chain-DoJ5uumw.js → chain-z6EbQN66.js} +1 -1
- package/dist/assets/{click-to-copy-CGbpKHCv.js → click-to-copy-Bd1pbmjJ.js} +1 -1
- package/dist/assets/cloneDeep-B3IuXkH6.js +1 -0
- package/dist/assets/{closebrackets.es-BvXetdd_.js → closebrackets.es-Dgw0-_DW.js} +1 -1
- package/dist/assets/{codemirror.es-BXES79gX.js → codemirror.es-s2Rr8TMK.js} +1 -1
- package/dist/assets/{comment.es-CTD0f_fP.js → comment.es-DuYAsmJq.js} +1 -1
- package/dist/assets/{config-navigation-D7AslSv5.js → config-navigation-BRr3prTj.js} +3 -3
- package/dist/assets/{connect-to-KDT0hSpV.js → connect-to-Cs0EUT4S.js} +1 -1
- package/dist/assets/{delete-confirm-BxVrliVv.js → delete-confirm-BNoGa68c.js} +1 -1
- package/dist/assets/{detail-BuIG8mZH.js → detail-DBcw2MaX.js} +3 -3
- package/dist/assets/{dialog.es-B8HLFpZr.js → dialog.es-BgtfhF68.js} +1 -1
- package/dist/assets/{domains-B3cNb2Aw.js → domains-CM3lyOs-.js} +1 -1
- package/dist/assets/{download-B0OUhY0B.js → download-DSqZegJ2.js} +1 -1
- package/dist/assets/emotion-react.browser.esm-BDvH2bbh.js +1 -0
- package/dist/assets/{foldgutter.es-BY73pCtu.js → foldgutter.es-61oGOeH5.js} +1 -1
- package/dist/assets/{get-safe-url-BfHsII0C.js → get-safe-url-CadEaGnF.js} +1 -1
- package/dist/assets/{get-safe-url-D9ml_fvy.js → get-safe-url-GbVPhyM0.js} +1 -1
- package/dist/assets/getValidReactChildren-4Syslwwk.js +1 -0
- package/dist/assets/{hint.es--cULfPXx.js → hint.es-DFa1vaHD.js} +1 -1
- package/dist/assets/{hint.es2-COHxokUc.js → hint.es2-Ytgf8cwU.js} +1 -1
- package/dist/assets/{iframe-BVfyrfbA.js → iframe-BpVmcJc3.js} +1 -1
- package/dist/assets/{index-B-XvEBt5.js → index-9mb4i7nG.js} +1 -1
- package/dist/assets/index-B-8BgkIX.js +1 -0
- package/dist/assets/{index-BqBaspNQ.js → index-B0AqZtHc.js} +1 -1
- package/dist/assets/{index-jn2mgjU9.js → index-B8nUQyU8.js} +1 -1
- package/dist/assets/{index-55NJHWFF.js → index-BG6hT912.js} +1 -1
- package/dist/assets/{index-L8tJ4G2a.js → index-BGfher7X.js} +1 -1
- package/dist/assets/{index-B7UfL6V6.js → index-BScCZen8.js} +8 -8
- package/dist/assets/{index-BWKhFNY-.js → index-BWheHxyB.js} +1 -1
- package/dist/assets/{index-B6e7M9AU.js → index-BX4S2ZnM.js} +1 -1
- package/dist/assets/{index-BzuvZxfP.js → index-BXx8CiDa.js} +1 -1
- package/dist/assets/{index-Bl4yS0n4.js → index-BYIEHzl8.js} +3 -3
- package/dist/assets/{index-DXxOMksl.js → index-BbjbAT2O.js} +1 -1
- package/dist/assets/{index-CAvhJF2K.js → index-BcUKk-lE.js} +1 -1
- package/dist/assets/{index-CtQ2LyfY.js → index-BfuK1c3U.js} +1 -1
- package/dist/assets/{index-BhFXgjJL.js → index-BlbHoShU.js} +1 -1
- package/dist/assets/{index-H1Gi2Jnl.js → index-BnuJug5D.js} +1 -1
- package/dist/assets/{index-vvJGfld4.js → index-Bp2gRuoi.js} +1 -1
- package/dist/assets/{index-DzrZDra1.js → index-C-czX6v8.js} +1 -1
- package/dist/assets/{index-ChLseMHx.js → index-C6PFgd4s.js} +3 -3
- package/dist/assets/{index-CpRTEk5Y.js → index-CAMnhpz_.js} +1 -1
- package/dist/assets/{index-Cr-P1gSM.js → index-CCqOp-Za.js} +1 -1
- package/dist/assets/{index-DnCpGAd1.js → index-CJa6ovU3.js} +1 -1
- package/dist/assets/{index-DjeitGC0.js → index-CJyPQ1mo.js} +1 -1
- package/dist/assets/{index-D9Y4XTdQ.js → index-CSrSFpxe.js} +1 -1
- package/dist/assets/{index-DVCjSXXQ.js → index-CULZ0mkF.js} +1 -1
- package/dist/assets/{index-DgACMxU8.js → index-CW2CIHTp.js} +3 -3
- package/dist/assets/{index--lAtXWUP.js → index-C_qvrHaT.js} +1 -1
- package/dist/assets/{index-CO3XBdns.js → index-Cl-3FJwO.js} +24 -24
- package/dist/assets/{index-CPWzKNbm.js → index-CsfSVRfE.js} +1 -1
- package/dist/assets/{index-BwO8evpb.js → index-CtvADPIf.js} +1 -1
- package/dist/assets/{index-CzB8vcqG.js → index-D26anpmw.js} +1 -1
- package/dist/assets/{index-Ddjwpsss.js → index-D2OWAIQe.js} +1 -1
- package/dist/assets/{index-CK4YzYs2.js → index-DCBVsLjA.js} +1 -1
- package/dist/assets/{index-dNE4Zjbn.js → index-DW2t8iC0.js} +1 -1
- package/dist/assets/{index-6qj_2myu.js → index-DWVclhcu.js} +1 -1
- package/dist/assets/{index-DSNK0LXH.js → index-DYUzMTeE.js} +1 -1
- package/dist/assets/{index-C0sxtXdZ.js → index-DYWnnieF.js} +1 -1
- package/dist/assets/{index-w0kQr3JV.js → index-D_BatJpF.js} +1 -1
- package/dist/assets/{index-BuXw_Xo7.js → index-DbIDv5vn.js} +5 -5
- package/dist/assets/{index-CMItS6dn.js → index-DbvvMLGP.js} +1 -1
- package/dist/assets/{index-xNaUaJbp.js → index-DsLeGqeJ.js} +1 -1
- package/dist/assets/{index-cCHFi6J7.js → index-GUhpvgVQ.js} +1 -1
- package/dist/assets/{index-CuZGE_AM.js → index-GgPkBXj2.js} +1 -1
- package/dist/assets/{index-DSARI07I.js → index-H9fm7up4.js} +1 -1
- package/dist/assets/{index-8mvNLWje.js → index-J_t6WXFJ.js} +1 -1
- package/dist/assets/{index-ClZ_k_rD.js → index-OjlMsll8.js} +1 -1
- package/dist/assets/{index-BMBogC_q.js → index-mE_PHcX2.js} +1 -1
- package/dist/assets/{index-OdcWgCK_.js → index-s1rhSuA8.js} +1 -1
- package/dist/assets/{index.esm-CMv_mNgM.js → index.esm-CTLBmkxs.js} +1 -1
- package/dist/assets/{info-addon.es-DLpPCmn2.js → info-addon.es-D2RjkMEO.js} +1 -1
- package/dist/assets/{info.es-DnqW5M4e.js → info.es-B2Ei6tKR.js} +1 -1
- package/dist/assets/{install-from-url-CiqpeJac.js → install-from-url-BavWqY0O.js} +1 -1
- package/dist/assets/{invitation-CebbE0VE.js → invitation-B5aWiSWP.js} +1 -1
- package/dist/assets/is-path-prefix-equal-DRNfC8G7.js +1 -0
- package/dist/assets/{item-vU_-cc7I.js → item-Bnt9TARz.js} +1 -1
- package/dist/assets/{javascript.es-BnEFsbE5.js → javascript.es-Bpu4XBw4.js} +1 -1
- package/dist/assets/{jump-to-line.es-s2SwnJkg.js → jump-to-line.es-NCFTiPk3.js} +1 -1
- package/dist/assets/{jump.es-D1FTZeZy.js → jump.es-6CZW1_4U.js} +1 -1
- package/dist/assets/{lint.es-CLKH_qkK.js → lint.es-EY6FwDDf.js} +1 -1
- package/dist/assets/{lint.es2-odz9nmyZ.js → lint.es2-BKJ4qpZr.js} +1 -1
- package/dist/assets/{lint.es3-jNJ5qlRO.js → lint.es3-gvW3Dwxb.js} +1 -1
- package/dist/assets/{list-header-C-vpKvhr.js → list-header-oP6EeMA1.js} +1 -1
- package/dist/assets/{log-CaaCrZDx.js → log-ObTZchhD.js} +1 -1
- package/dist/assets/{lottie-react.esm-vzQP1aoG.js → lottie-react.esm-BOED-gDB.js} +1 -1
- package/dist/assets/{matchbrackets.es-B0khT0bu.js → matchbrackets.es-DXvGcnAN.js} +1 -1
- package/dist/assets/{memory-8GRWhGBe.js → memory-C0a7I4et.js} +1 -1
- package/dist/assets/{mode.es-8DdwTv6O.js → mode.es-BdipBeLR.js} +1 -1
- package/dist/assets/{mode.es2-Dm7F3amk.js → mode.es2-D6DVO5V7.js} +1 -1
- package/dist/assets/{mode.es3-C6LQItvl.js → mode.es3-Bk0sufip.js} +1 -1
- package/dist/assets/omit-BOdOfEDG.js +1 -0
- package/dist/assets/{onlineParser.es-697gH09d.js → onlineParser.es-DVbPOG4l.js} +1 -1
- package/dist/assets/{overview-4A1WnWrw.js → overview-uPHlb4Rk.js} +1 -1
- package/dist/assets/{permission-CoJIDKiq.js → permission-qJMVgxZB.js} +1 -1
- package/dist/assets/{preference-BSnQFWBu.js → preference-BGjmFkam.js} +3 -3
- package/dist/assets/{raf-schd.esm-DjoqsVPc.js → raf-schd.esm-DTLWr85K.js} +1 -1
- package/dist/assets/refType-DNRqRWnN.js +1 -0
- package/dist/assets/{resource-dialog-DXjH0dKy.js → resource-dialog-D7lp-mt5.js} +4 -4
- package/dist/assets/{runtime-Dlt-Nkw4.js → runtime-h-JvCmOV.js} +1 -1
- package/dist/assets/{schema-CfO6HjUI.js → schema-B5lLDdwS.js} +1 -1
- package/dist/assets/{search.es-C78nuVMk.js → search.es-CB_40e8N.js} +1 -1
- package/dist/assets/{searchcursor.es-BRgUQd7l.js → searchcursor.es-BsENbGJe.js} +1 -1
- package/dist/assets/{service-CaVokZ0Y.js → service-CO3-2J05.js} +1 -1
- package/dist/assets/session--KhzErQz.js +1 -0
- package/dist/assets/{shorten-label-BVrJaxJC.js → shorten-label-DC9lls-_.js} +1 -1
- package/dist/assets/{show-hint.es-RCR9dwPC.js → show-hint.es-DxDy9n4Y.js} +1 -1
- package/dist/assets/{simple-select-DarZpQR1.js → simple-select-Clgdh8XE.js} +1 -1
- package/dist/assets/{spaces-HyRwvQdH.js → spaces-BfGix7Ah.js} +1 -1
- package/dist/assets/{status-B6OYlotx.js → status-IieMMby4.js} +1 -1
- package/dist/assets/{status-De3FcWeh.js → status-oG8SDlCL.js} +1 -1
- package/dist/assets/{sublime.es-BM6BU8ya.js → sublime.es-DPwBOIkN.js} +1 -1
- package/dist/assets/{switch-control-CfY71NTZ.js → switch-control-BVU_Ad4A.js} +1 -1
- package/dist/assets/{table-icons-C7DLMt6_.js → table-icons-ChFb7Y_c.js} +1 -1
- package/dist/assets/{team-CznOtdKl.js → team-D9geX5Dv.js} +1 -1
- package/dist/assets/{toLower-e46SyAPI.js → toLower-Lpm_cWIY.js} +1 -1
- package/dist/assets/toUpper-wYFatpjb.js +1 -0
- package/dist/assets/{traffic-BVDBAzGe.js → traffic-MRoWejWm.js} +1 -1
- package/dist/assets/{url-evaluation-Dv0N_pok.js → url-evaluation-Dkim9UU-.js} +1 -1
- package/dist/assets/{url-join-B7iCgPgX.js → url-join-KcJhtet-.js} +1 -1
- package/dist/assets/{use-mobile-DT28abSy.js → use-mobile-BXuu7nKS.js} +1 -1
- package/dist/assets/{use-mobile-BDkfqLh5.js → use-mobile-DxoBGZ2C.js} +1 -1
- package/dist/assets/{useAsync-B4uBsSr_.js → useAsync-CXjZIHoB.js} +1 -1
- package/dist/assets/{useLocalStorage-euZsG16i.js → useLocalStorage-BGufc8fE.js} +1 -1
- package/dist/assets/{useThemeProps-DHnKAZsI.js → useThemeProps-DCQ65cqf.js} +1 -1
- package/dist/assets/{util-DWSWDAob.js → util-bCRieQtS.js} +1 -1
- package/dist/assets/{wait-container-DfWsgvzj.js → wait-container--jGsE1aw.js} +1 -1
- package/dist/assets/{withStyles-B0-9tX4-.js → withStyles-B4dvn7ww.js} +1 -1
- package/dist/assets/{wrap-locale-aHq8jAHn.js → wrap-locale-BvifS-n8.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-CWu-rIyH.js +0 -1
- package/dist/assets/appearance-CYge78ns.js +0 -1
- package/dist/assets/cloneDeep-vMO7xSKJ.js +0 -1
- package/dist/assets/emotion-react.browser.esm-CDAjTwPn.js +0 -1
- package/dist/assets/getValidReactChildren-Ced4squ1.js +0 -1
- package/dist/assets/index-nS9VTrx6.js +0 -1
- package/dist/assets/is-path-prefix-equal-Dz4CThga.js +0 -1
- package/dist/assets/omit-ysA7yEnR.js +0 -1
- package/dist/assets/refType-D9Sa_mOm.js +0 -1
- package/dist/assets/session-Bo2ZbX-l.js +0 -1
- package/dist/assets/toUpper-C34aTbM3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as R,j as n,M as a,aP as _,aQ as w,am as f,dp as z,m as C}from"./index-
|
|
1
|
+
import{s as R,j as n,M as a,aP as _,aQ as w,am as f,dp as z,m as C}from"./index-BScCZen8.js";function o({icon:t,title:e="",description:i="",extra:v,...E}){return n.jsxs(P,{...E,children:[t,typeof e=="string"?n.jsx(a,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:e}):e,typeof i=="string"?n.jsx(a,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:i}):i,n.jsx(a,{mt:3,children:v})]})}const P=R("div")`
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as g,bn as v,u as y,j as r,O as f,S as x,U as h}from"./index-
|
|
1
|
+
import{x as g,bn as v,u as y,j as r,O as f,S as x,U as h}from"./index-BScCZen8.js";import{L as j,D as S}from"./download-DSqZegJ2.js";import{_ as b}from"./useLocalStorage-BGufc8fE.js";import"./ButtonGroup-CcLHnhC4.js";import"./getValidReactChildren-4Syslwwk.js";function I(){const c=g(),[s,i]=b("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),a=l.routing.provider,n=[{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(a){const e=`Service Gateway(${a})`;n.push({id:`service-gateway-${a}`,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:n.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=n.find(e=>e.id===t)||n[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{I as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{an as ee,x as N,r as p,a as te,b as se,P as b,m as j,u as w,w as oe,ay as _,H as M,j as t,v as O,az as re,a3 as y,k as R,D as W,aA as ne,aB as ae,B as V,C as z,aC as le,y as H,Y as K,aD as ie,aE as ce,M as E,aF as ue,A as de,aG as D,L as pe,aH as he,n as G,ac as fe,a7 as me,a9 as ge,aa as xe,aI as be,ab as ke}from"./index-
|
|
1
|
+
import{an as ee,x as N,r as p,a as te,b as se,P as b,m as j,u as w,w as oe,ay as _,H as M,j as t,v as O,az as re,a3 as y,k as R,D as W,aA as ne,aB as ae,B as V,C as z,aC as le,y as H,Y as K,aD as ie,aE as ce,M as E,aF as ue,A as de,aG as D,L as pe,aH as he,n as G,ac as fe,a7 as me,a9 as ge,aa as xe,aI as be,ab as ke}from"./index-BScCZen8.js";import{_ as L}from"./useLocalStorage-BGufc8fE.js";import{c as ye,C as Se,A as je,M as we,a as Pe,d as ve,B as Re,S as Y,b as Ce,e as Le}from"./item-Bnt9TARz.js";import{g as T}from"./get-safe-url-CadEaGnF.js";import{P as Q}from"./permission-qJMVgxZB.js";import{d as Be}from"./ArrowDropDown-D5mGNR03.js";import{B as De}from"./Breadcrumbs-C2dg7iJH.js";import"./index-CCqOp-Za.js";import"./ChevronLeft-DHpx84Q3.js";import"./ChevronRight-BsKgMnVp.js";import"./Search-DQ4Y1c5N.js";import"./index-BX4S2ZnM.js";import"./blocklet-Dj2klNma.js";import"./Autocomplete-DuiLMv1o.js";import"./ListSubheader-eUJyCt4T.js";import"./Verified-tGi6fe3F.js";import"./VerifiedUser-CCkZHpu5.js";import"./Add-Cj1GwkKW.js";import"./Launch-DbAaLLdn.js";import"./Done-CKe-FMOo.js";import"./DeleteOutline-BZ3_z3iH.js";import"./delete-confirm-BNoGa68c.js";import"./click-to-copy-Bd1pbmjJ.js";import"./shorten-label-DC9lls-_.js";import"./MoreVert-61JL59bH.js";import"./session--KhzErQz.js";import"./get-safe-url-GbVPhyM0.js";import"./ButtonGroup-CcLHnhC4.js";import"./getValidReactChildren-4Syslwwk.js";function Ee(e){const r=ee(),c=N(),[s,o]=L(`sid:blocklet:purchase:${e}`),[a,u]=p.useState(!1),[h,l]=p.useState(null),f=()=>{const{pathname:n,searchParams:d}=new URL(window.location.href),i=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";d.get("sid")&&(o(""),c(n.replace(i,"/"),{replace:!0}))},m=!!(r.get("assetDid")&&s&&r.get("sid")===s);return te(se.BlockletEvents.purchaseChange,n=>{n.did===e&&(l(n.session),["declined","confirmed","error"].includes(n.session.status)&&(u(!0),setTimeout(f,2e3)))}),p.useEffect(()=>{h&&h.id!==s&&o(h.id)},[h]),{hasCompleted:a,hasPurchased:m,session:h,setSession:l,doRedirect:f}}function U({meta:e,onCancel:r,handlePaySuccess:c,storeUrl:s}){const{t:o}=j(),{info:a}=w(),[u,h]=p.useState("both"),[l,f]=p.useState(1),m=oe(a),n=_(e,a,s),d=v=>{v!==u&&h(v)},i=()=>{u&&(f(2),u==="verify"&&(window.location.href=T(n)))},k=(v,B)=>{B!=="backdropClick"&&r()},P=()=>{c(n)},g=M.getDisplayName({meta:e});if(u==="purchase"&&l===2)return t.jsx(O,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:re.create({baseURL:y(s,"/store")}).get,onSuccess:P,onClose:r,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:m,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:g}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(R,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(R,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:g})]})]})}});const x=W;return t.jsx(x,{title:o("store.purchase.title",{name:g}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:k,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(Se,{action:u,onNext:i,onSelect:d})})})}U.propTypes={...ye,storeUrl:b.string.isRequired,handlePaySuccess:b.func};U.defaultProps={handlePaySuccess:e=>{setTimeout(()=>{window.location.href=T(e,{allowDomains:null})},1e3)}};function I({meta:e,buttonText:r,storeUrl:c,isResource:s}){const{t:o}=j(),a=N(),{info:u}=w(),{api:h}=ne(),l=M.isFreeBlocklet(e)===!1,[f,m]=p.useState(!1),{hasPurchased:n}=Ee(e.did),[d,i]=p.useState(!1),[k]=L("instant-blocklet-install",!1),[P,g]=p.useState(!1),x=p.useMemo(()=>f?o(l?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[f,o,l]),v=p.useMemo(()=>s?o("blocklet.status.resource"):l?r.purchase:r.launch,[l,r,s]),B=S=>{S.preventDefault(),S.stopPropagation();try{if(m(!0),l){i(!0);return}if(k){g(!0);return}if(!l){const C=_(e,u,c);window.location.href=T(C)}}catch(C){H.error(K(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{m(!1)}},J=()=>{m(!1),i(!1)},X=S=>{m(!1),g(!1),a(`/blocklets/${S.appDid}/components`)},Z=()=>{m(!1),g(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(je,{children:t.jsx(Q,{permission:"mutate_blocklets",children:S=>t.jsx(ae,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(V,{onClick:B,size:"small",sx:{cursor:s?"not-allowed":"pointer"},disabled:!!(x||!S),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:x?t.jsxs(t.Fragment,{children:[t.jsx(z,{size:16,style:{marginRight:3}}),x]}):v},e.did)})})}),(n||d)&&t.jsx(U,{method:"launch",meta:e,mode:"both",onCancel:J,storeUrl:c}),P&&t.jsx(O,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:h.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(le(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:Z})]})}I.propTypes={isResource:b.bool,meta:b.object.isRequired,buttonText:b.shape({purchase:b.string.isRequired,launch:b.string.isRequired}).isRequired,storeUrl:b.string.isRequired};I.defaultProps={isResource:!1};const Te=(e,r,c)=>{const s=fe(r);return y(c,`/blocklets/${e.did}/?server-url=${s}`)},q=({meta:e,attribute:r,value:c})=>e._formatted?e._formatted[r]:c,Ue=(e,r)=>{if(!e||!r)return"";try{return y(r,e)}catch(c){return console.warn("Failed to construct avatar URL:",c),""}};function F({blocklet:e,endpoint:r,serverVersion:c}){var n,d;const{t:s}=j(),o=w();let a=y(o.imgPrefix,"blocklet.png");const u=r;if(u.startsWith("http")&&e.logo)a=y(u,ue(e.did,e.logo,e.version));else{let k=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");k&&(k=`/${k}`),a=y(k,`/blocklet/logo/${e.did}`)}try{const i=new URL(a);i.searchParams.set("v",e.version||+new Date),a=i.href}catch{}const h=(o==null?void 0:o.info.mode)!==de.NODE_MODES.SERVERLESS,l=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),f={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:u};let m=null;return h&&(m=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(Pe,{serverVersion:c,requirementVersion:(n=e.requirements)==null?void 0:n.server,size:"small",children:t.jsx(I,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...f})})})),t.jsx(pe,{href:Te(e,o.info,r),style:{color:"initial",textDecoration:"none"},onClick:l,target:"_blank",children:t.jsx(Ie,{title:q({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:q({meta:e,attribute:"description",value:e.description}),cover:e.logo?a:"",version:e.version,onButtonClick:null,icons:(d=e.docker)!=null&&d.image?[{key:"docker",icon:t.jsx(E,{display:"flex",color:"primary.main",children:t.jsx(he,{icon:ve})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ue(e.owner.avatar,r),download:e.stats.downloads,button:m})})}F.propTypes={blocklet:b.object.isRequired,serverVersion:b.string,endpoint:b.string};F.defaultProps={endpoint:"",serverVersion:""};function A({storeUrl:e,handleSearchSelect:r,extraFilter:c,...s}){var n;const{locale:o}=j(),a=w(),[u,h]=p.useState({}),l=d=>{h(d)},f=e,m=(n=a==null?void 0:a.info)==null?void 0:n.version;return p.useEffect(()=>{h({})},[f]),t.jsx(ie,{FallbackComponent:ce,resetKeys:[f],children:t.jsx(E,{...s,sx:{"& .title-bar":{pt:0}},children:t.jsx(we,{layout:{showExplore:!1,showTitle:!0},blockletRender:d=>{const i={...d,endpoint:f};return t.jsx(F,{...i})},baseSearch:!0,endpoint:f,locale:o,onFilterChange:l,onSearchSelect:r,filters:u,extraFilter:c,serverVersion:m})})})}A.propTypes={storeUrl:b.string.isRequired,handleSearchSelect:b.func,extraFilter:b.func};A.defaultProps={handleSearchSelect:null,extraFilter:void 0};const Ie=G(Re)`
|
|
2
2
|
.ms-highlight {
|
|
3
3
|
color: ${e=>e.theme.palette.primary.main};
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as x,bo as Y,bp as X,m as D,j as e,R as $,ax as I,P as C,A as Z,bq as P,br as fe,aZ as F,t as W,O as ne,Q as ae,S as re,U as ie,M as y,B as N,C as U,af as ce,f as xe,D as le,aY as ge,V as ye,n as _,l as he,bs as be,bt as je,W as J,bu as Ce,bv as ve,bw as ke,bx as Ae,H as Se,k as L,by as Te,aB as ee,X as Ke,Y as we,x as De,u as Re,bn as Ie,e as Pe,bz as _e}from"./index-
|
|
1
|
+
import{r as x,bo as Y,bp as X,m as D,j as e,R as $,ax as I,P as C,A as Z,bq as P,br as fe,aZ as F,t as W,O as ne,Q as ae,S as re,U as ie,M as y,B as N,C as U,af as ce,f as xe,D as le,aY as ge,V as ye,n as _,l as he,bs as be,bt as je,W as J,bu as Ce,bv as ve,bw as ke,bx as Ae,H as Se,k as L,by as Te,aB as ee,X as Ke,Y as we,x as De,u as Re,bn as Ie,e as Pe,bz as _e}from"./index-BScCZen8.js";import{T as Be}from"./index-DYWnnieF.js";import Ne from"./audit-logs-DaG555bS.js";import{T as me,M as Le}from"./index-CSrSFpxe.js";import{r as de,P as ze}from"./index-9mb4i7nG.js";import{u as B,T as $e}from"./team-D9geX5Dv.js";import{g as We,D as Fe}from"./index-H9fm7up4.js";import{d as Ue}from"./Add-Cj1GwkKW.js";import{C as te}from"./click-to-copy-Bd1pbmjJ.js";import{f as Me}from"./index-BojVbZw0.js";import{d as qe}from"./Delete-E4y6t1JP.js";import{D as Ee}from"./delete-confirm-BNoGa68c.js";import{d as Oe}from"./Edit-K2_xM3YP.js";import{P as Ve}from"./permission-qJMVgxZB.js";import{u as Qe}from"./blocklet-Dj2klNma.js";import{u as Ge}from"./useAsync-CXjZIHoB.js";import"./index-BX4S2ZnM.js";import"./TableSearch-CvOwepTo.js";import"./Search-DQ4Y1c5N.js";import"./Clear-CBus3YPN.js";import"./useLocalStorage-BGufc8fE.js";import"./index-B0AqZtHc.js";import"./shorten-label-DC9lls-_.js";import"./ViewList-BG98kh5u.js";import"./resource-dialog-D7lp-mt5.js";import"./use-mobile-DxoBGZ2C.js";import"./index-DbvvMLGP.js";import"./ListItemButton-Cd6Uq-Ac.js";import"./index-BWheHxyB.js";import"./emotion-react.browser.esm-BDvH2bbh.js";import"./index-C-czX6v8.js";import"./url-evaluation-Dkim9UU-.js";import"./index-BnuJug5D.js";import"./index-BJHGOv7L.js";import"./HelpOutline-BIx91aby.js";import"./index-DYUzMTeE.js";import"./ButtonGroup-CcLHnhC4.js";import"./getValidReactChildren-4Syslwwk.js";import"./AdapterDayjs-CvCGckYL.js";import"./useThemeProps-DCQ65cqf.js";import"./CSSTransition-D-xj_lEW.js";import"./refType-DNRqRWnN.js";import"./index-J_t6WXFJ.js";import"./Verified-tGi6fe3F.js";import"./DeleteOutline-BZ3_z3iH.js";import"./ErrorOutline-NhUNtUrq.js";import"./session--KhzErQz.js";import"./actions-sMg6nWfa.js";import"./MoreHoriz-Cly_ulfn.js";import"./LockIcon-CiguMpNN.js";import"./cloneDeep-B3IuXkH6.js";import"./chain-z6EbQN66.js";import"./list-header-oP6EeMA1.js";import"./ToggleButtonGroup-ClJp8lmK.js";import"./ViewColumn-Dug72V0B.js";import"./MoreVert-61JL59bH.js";var He=function(o,t){t===void 0&&(t=[]);var p=x.useState(0),h=p[0],l=p[1],r=Ge(o,Y(t,[h])),b=r.loading,c=x.useCallback(function(){b||l(function(n){return n+1})},Y(t,[b]));return X(X({},r),{retry:c})};function M({value:o}){const{t,locale:p}=D(),h=new Date;return new Date(o)<h?e.jsxs("span",{style:{color:"red"},children:[e.jsx($,{value:o,locale:p}),`${t("setting.accessKey.expired",{time:""})}`]}):I(o,p)}M.propTypes={value:C.string.isRequired};const z=()=>{const o=Z.RBAC_CONFIG.roles.filter(l=>l.passport),{inService:t}=P(),{roles:p}=B();return fe([...o,...t?p:[]],"name").filter(l=>l.name!==Z.ROLES.OWNER)};function q(o){const{remark:t,onCreate:p}=o,{api:h}=P(),{teamDid:l}=B(),{t:r}=D(),[b,c]=x.useState(!1),[n,f]=x.useState(null),v=z(),u=()=>{c(!1),f(null)},k=async d=>{const{remark:m,passport:i}=d;c(!0);const s=await h.createAccessKey({input:{teamDid:l,remark:m.trim(),passport:i,expireAt:d.expireAt?new Date(d.expireAt).getTime():null}}),{data:A}=s;p(A),f(null),c(!1)},g={title:`${r("common.create")} ${r("accessKey")}`,description:(d,m,i)=>e.jsxs(F,{gap:3,children:[e.jsx(W,{label:r("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:d.remark,onChange:s=>{m({...d,remark:s.target.value,__disableConfirm:!d.passport||!s.target.value.trim()}),s.target.value.trim()?i(""):i(r("setting.accessKey.remarkInvalid"))}}),e.jsxs(ne,{style:{width:"100%"},variant:"outlined",children:[e.jsx(ae,{children:r("setting.accessKey.passport")}),e.jsx(re,{"data-cy":"create-access-key-select-passport",value:d.passport,onChange:s=>{const A=s.target.value;i(null),m({...d,passport:A,__disableConfirm:!d.remark||!A})},fullWidth:!0,label:r("setting.accessKey.passport"),disabled:b,children:v.map(s=>e.jsx(ie,{value:s.name,"data-cy":`create-access-key-passport-option-${s.name}`,children:e.jsxs(y,{children:[e.jsx("span",{children:s.title||s.name}),e.jsx(y,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:s.description})]})},s.name))})]}),e.jsx(me,{placeholder:r("setting.accessKey.expireTime"),value:d.expireAt,onChange:s=>{m({...d,expireAt:s,__disableConfirm:!d.passport||!d.remark||!s})}})]}),confirm:r("common.confirm"),cancel:r("common.cancel"),color:"primary",params:{remark:t,__disableConfirm:!t.trim()},onConfirm:k,onCancel:u};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>f(g),className:"rule-action",children:[b?e.jsx(U,{size:16}):e.jsx(Ue,{style:{fontSize:16}}),r("common.create")]}),n&&e.jsx(ce,{title:n.title,description:n.description,confirm:n.confirm,color:n.color,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})]})}q.propTypes={remark:C.string,onCreate:C.func};q.defaultProps={onCreate:()=>{},remark:""};function E(o){const{onConfirm:t,accessKeyId:p,accessKeySecret:h}=o,{t:l}=x.useContext(xe),[r,b]=x.useState(!1),[c,n]=x.useState(!0),f=()=>{n(!c)},v=u=>{b(u.target.checked)};return e.jsxs(le,{title:l("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:t,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(N,{disabled:!r,onClick:t,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:l("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ye,{children:l("setting.accessKey.saveSecretTip")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(oe,{children:[e.jsx(se,{children:"Access Key"}),e.jsx(te,{children:p})]}),e.jsxs(oe,{children:[e.jsx(se,{children:"Access Secret"}),c?e.jsx(N,{"data-cy":"show-secret-btn",color:"primary",onClick:f,children:l("setting.accessKey.showSecret")}):e.jsx(te,{children:h})]}),e.jsx("div",{children:e.jsx(ge,{value:"end",disabled:c,control:e.jsx(ye,{checked:r,onChange:v}),label:l("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}E.propTypes={accessKeyId:C.string.isRequired,accessKeySecret:C.string.isRequired,onConfirm:C.func};E.defaultProps={onConfirm:()=>{}};const se=_.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as he,r as de,bZ as ot,dt as Si,du as Uw,b$ as Pn,dv as Oo,dw as lu,dx as Ww,dy as zw,dz as Gw,dA as qw,dB as Ns,dC as zt,dD as Gt,dE as os,dF as is,dG as ii,dH as Kw,dI as wg,dJ as _g,dK as Vw,dL as Tg,dM as $g,dN as Yw,dO as Xw,dP as Jw,dQ as Qw,av as Cg,dR as Zw,dS as e_,dT as t_,dU as r_,dV as n_,bX as ja,dW as a_,dX as o_,dY as i_,dZ as s_,d_ as l_,d$ as u_,e0 as c_,e1 as f_,e2 as d_,e3 as p_,e4 as v_,e5 as h_,am as Og,e6 as g_,e7 as y_,e8 as m_,a5 as Cs,e9 as b_,ea as S_,k as w_,eb as __,ec as T_,ed as $_,ee as C_,ef as O_,eg as x_,eh as I_,ei as P_,ej as R_,ek as E_,el as D_,em as A_,V as j_,en as k_,O as M_,eo as L_,ep as F_,eq as N_,aY as B_,er as H_,es as U_,ck as W_,et as z_,eu as G_,G as q_,ev as K_,ew as V_,ex as Y_,ey as X_,ez as J_,eA as Q_,Q as Z_,eB as eT,eC as tT,ab as Dc,eD as rT,eE as nT,eF as aT,eG as oT,b5 as xg,eH as iT,eI as sT,eJ as lT,eK as uT,U as Ac,eL as cT,eM as fT,S as dT,eN as pT,eO as vT,aB as jc,eP as hT,eQ as gT,c1 as Ao,c0 as jo,c2 as ko,eR as yT,c4 as Sa,c5 as Mo,eS as al,eT as mT,eU as bT,eV as ST,eW as wT,eX as _T,eY as TT,eZ as $T,e_ as CT,e$ as OT,cf as Cd,bW as xT,bY as IT,ce as Ig,t as PT,f0 as RT,f1 as ET,f2 as DT,f3 as Pg,f4 as AT,f5 as jT,f6 as kT,d3 as Qe,c_ as pt,f7 as MT,f8 as LT,bk as pf,aP as wi,aQ as _i,d1 as Bs,db as Rg,f9 as FT,$ as NT,fa as BT,P as ut,s as Ti,aI as Od,b3 as HT,d as UT,E as WT,fb as xd,a1 as zT,h as GT,C as qT}from"./index-
|
|
1
|
+
import{j as he,r as de,bZ as ot,dt as Si,du as Uw,b$ as Pn,dv as Oo,dw as lu,dx as Ww,dy as zw,dz as Gw,dA as qw,dB as Ns,dC as zt,dD as Gt,dE as os,dF as is,dG as ii,dH as Kw,dI as wg,dJ as _g,dK as Vw,dL as Tg,dM as $g,dN as Yw,dO as Xw,dP as Jw,dQ as Qw,av as Cg,dR as Zw,dS as e_,dT as t_,dU as r_,dV as n_,bX as ja,dW as a_,dX as o_,dY as i_,dZ as s_,d_ as l_,d$ as u_,e0 as c_,e1 as f_,e2 as d_,e3 as p_,e4 as v_,e5 as h_,am as Og,e6 as g_,e7 as y_,e8 as m_,a5 as Cs,e9 as b_,ea as S_,k as w_,eb as __,ec as T_,ed as $_,ee as C_,ef as O_,eg as x_,eh as I_,ei as P_,ej as R_,ek as E_,el as D_,em as A_,V as j_,en as k_,O as M_,eo as L_,ep as F_,eq as N_,aY as B_,er as H_,es as U_,ck as W_,et as z_,eu as G_,G as q_,ev as K_,ew as V_,ex as Y_,ey as X_,ez as J_,eA as Q_,Q as Z_,eB as eT,eC as tT,ab as Dc,eD as rT,eE as nT,eF as aT,eG as oT,b5 as xg,eH as iT,eI as sT,eJ as lT,eK as uT,U as Ac,eL as cT,eM as fT,S as dT,eN as pT,eO as vT,aB as jc,eP as hT,eQ as gT,c1 as Ao,c0 as jo,c2 as ko,eR as yT,c4 as Sa,c5 as Mo,eS as al,eT as mT,eU as bT,eV as ST,eW as wT,eX as _T,eY as TT,eZ as $T,e_ as CT,e$ as OT,cf as Cd,bW as xT,bY as IT,ce as Ig,t as PT,f0 as RT,f1 as ET,f2 as DT,f3 as Pg,f4 as AT,f5 as jT,f6 as kT,d3 as Qe,c_ as pt,f7 as MT,f8 as LT,bk as pf,aP as wi,aQ as _i,d1 as Bs,db as Rg,f9 as FT,$ as NT,fa as BT,P as ut,s as Ti,aI as Od,b3 as HT,d as UT,E as WT,fb as xd,a1 as zT,h as GT,C as qT}from"./index-BScCZen8.js";import{u as KT}from"./useThemeProps-DCQ65cqf.js";import{r as VT,a as Eg}from"./emotion-react.browser.esm-BDvH2bbh.js";import{c as YT,R as XT,V as JT,d as QT}from"./ViewColumn-Dug72V0B.js";import{S as ZT}from"./Search-DQ4Y1c5N.js";import{C as e$}from"./Clear-CBus3YPN.js";import{D as t$}from"./Delete-E4y6t1JP.js";import{E as Id}from"./index-BX4S2ZnM.js";import{d as r$}from"./MoreVert-61JL59bH.js";import{u as ol,T as n$,D as a$}from"./TableSearch-CvOwepTo.js";const vf="mode",hf="color-scheme",Dg="data-color-scheme";function o$(e){const{defaultMode:t="light",defaultLightColorScheme:r="light",defaultDarkColorScheme:n="dark",modeStorageKey:a=vf,colorSchemeStorageKey:o=hf,attribute:l=Dg,colorSchemeNode:c="document.documentElement",nonce:d}=e||{};return he.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(function() {
|
|
2
2
|
try {
|
|
3
3
|
var mode = localStorage.getItem('${a}') || '${t}';
|
|
4
4
|
var colorScheme = '';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,k as i,dq as x,dr as c,s as p}from"./index-
|
|
1
|
+
import{j as e,k as i,dq as x,dr as c,s as p}from"./index-BScCZen8.js";function w({name:t,nameFormatter:a=o=>typeof o=="string"?o.split(" ").map(m=>x(c(m))).join(" "):o,layout:n="horizontal",children:r,valueComponent:l="div",nameWidth:s=90,...f}){return e.jsxs(d,{layout:n,width:s,...f,children:[e.jsx(i,{color:"textSecondary",className:"info-row__name",children:a(t)}),r&&e.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:r})]})}const d=p("div")`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
|
|
4
4
|
justify-content: flex-start;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cr as x,r as o,f as g,cs as r,z as u,j as s,M as m,ct as d}from"./index-
|
|
1
|
+
import{cr as x,r as o,f as g,cs as r,z as u,j as s,M as m,ct as d}from"./index-BScCZen8.js";function P(){const a=x(),{blocklets:c,refresh:l}=a,{t:y}=o.useContext(g),f=r.generateKey(),[i]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(f)??{},t=i.get("entityId"),e=i.get("severity"),p={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(p)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:y("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:a,filterType:"entity",type:"server"})]})}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,cF as j,M as v,x as P,r as l,f as S,aA as w,u as k,w as b,am as E,aT as K,dl as U,cu as u,bb as W,v as _,Z as R,C as F,dm as L,dn as T}from"./index-
|
|
1
|
+
import{j as e,cF as j,M as v,x as P,r as l,f as S,aA as w,u as k,w as b,am as E,aT as K,dl as U,cu as u,bb as W,v as _,Z as R,C as F,dm as L,dn as T}from"./index-BScCZen8.js";import{R as d}from"./index-DbvvMLGP.js";function a({children:r,...s}){var o,c;return e.jsx(j,{...s,did:((o=window==null?void 0:window.blocklet)==null?void 0:o.appPid)||((c=window==null?void 0:window.env)==null?void 0:c.appPid),children:e.jsx(v,{sx:{maxWidth:"100%",height:"100%"},children:r})})}function z(){const r=P(),{t:s,locale:o}=l.useContext(S),{api:c}=w(),{info:p}=k(),f=b(p),m=E(),n=K({ready:!1,success:!1,error:null,invalidSession:!1}),i=U(),x=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const g=t.searchParams.get("__connect_url__"),y=L(g);if(!T(y))throw new Error;n.ready=!0}catch{n.invalidSession=!0,r("#invalid",{replace:!0})}};l.useLayoutEffect(()=>x(),[]);const h=u(t=>{n.error=t.message,r("#invalid",{replace:!0})}),C=u(()=>{n.success=!0});if(n.invalidSession)return e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.invalidSession"),description:s("didConnect.common.invalidSessionDesc")})});if(n.error){const t=n.error;return e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"error",title:s("didConnect.common.connectionError"),description:t})})}return n.success?e.jsx(a,{children:e.jsx(d,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(W,{style:{color:m.palette.success.main,fontSize:72}}),title:s("didConnect.genKeyPair.success"),description:s("didConnect.genKeyPair.successDesc")})}):n.ready?e.jsx(a,{children:e.jsx(_,{className:"connect",action:"gen-key-pair",checkFn:c.get,checkTimeout:10*60*1e3,extraParams:{sourceAppPid:i==null?void 0:i.appPid,forceSwitch:!0},saveConnect:!1,forceConnected:!1,webWalletUrl:f,onSuccess:C,onError:h,locale:o,messages:{title:s("didConnect.genKeyPair.title"),scan:s("didConnect.genKeyPair.scan"),confirm:s("auth.confirm"),success:s("didConnect.genKeyPair.success")},popup:!0,open:!0,hideCloseButton:!0})},"ready"):e.jsx(R,{children:e.jsx(F,{})})}export{z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as x,u as Z,_ as ze,aJ as ri,j as e,A as E,aK as An,aL as pr,aM as ii,aN as In,aO as nt,aP as we,aQ as Ce,P as m,n as ee,m as z,af as le,aR as Ln,aS as oi,aT as On,aU as ai,y as ae,N as Fn,k as A,t as H,aB as pe,aV as Le,C as V,X as be,B as X,aW as gr,Y as xe,M as q,f as Kt,R as hr,aX as si,e as Gt,aY as rt,aZ as fe,ac as li,a_ as ci,a$ as di,a3 as ui,x as xr,W as Nn,T as $n,h as ne,b0 as Vt,a as Ft,U as J,b as ft,b1 as yr,b2 as vr,V as mi,a5 as Nt,b3 as fi,b4 as pi,b5 as gi,b6 as hi,b7 as it,aa as xi,H as yi,b8 as vi,aI as Xe,b9 as bi,ab as Tt,a8 as Et,ba as ji,a9 as $t,L as Yt,J as wi,bb as Ci,bc as br,bd as Te,be as Ee,bf as Si,bg as Di,D as jr,q as Ut,am as ki,g as Pi,ax as Un,bh as _i,bi as zn,an as Ri,bj as Ti,bk as wr,bl as se,S as Bn,p as Mn,l as Wn,bm as Ei,bn as Ai}from"./index-
|
|
1
|
+
import{r as x,u as Z,_ as ze,aJ as ri,j as e,A as E,aK as An,aL as pr,aM as ii,aN as In,aO as nt,aP as we,aQ as Ce,P as m,n as ee,m as z,af as le,aR as Ln,aS as oi,aT as On,aU as ai,y as ae,N as Fn,k as A,t as H,aB as pe,aV as Le,C as V,X as be,B as X,aW as gr,Y as xe,M as q,f as Kt,R as hr,aX as si,e as Gt,aY as rt,aZ as fe,ac as li,a_ as ci,a$ as di,a3 as ui,x as xr,W as Nn,T as $n,h as ne,b0 as Vt,a as Ft,U as J,b as ft,b1 as yr,b2 as vr,V as mi,a5 as Nt,b3 as fi,b4 as pi,b5 as gi,b6 as hi,b7 as it,aa as xi,H as yi,b8 as vi,aI as Xe,b9 as bi,ab as Tt,a8 as Et,ba as ji,a9 as $t,L as Yt,J as wi,bb as Ci,bc as br,bd as Te,be as Ee,bf as Si,bg as Di,D as jr,q as Ut,am as ki,g as Pi,ax as Un,bh as _i,bi as zn,an as Ri,bj as Ti,bk as wr,bl as se,S as Bn,p as Mn,l as Wn,bm as Ei,bn as Ai}from"./index-BScCZen8.js";import{T as Ii}from"./index-DYWnnieF.js";import{d as Li}from"./ArrowDropDown-D5mGNR03.js";import{u as Xt,C as M,a as qn}from"./index.esm-CTLBmkxs.js";import{S as oe}from"./switch-control-BVU_Ad4A.js";import{P as re}from"./permission-qJMVgxZB.js";import{D as Cr,g as Oi}from"./index-H9fm7up4.js";import{d as Sr}from"./Link-BQNrDjfd.js";import{d as je}from"./Delete-E4y6t1JP.js";import{D as pt}from"./delete-confirm-BNoGa68c.js";import{I as ot}from"./index-J_t6WXFJ.js";import{s as Fi}from"./logo-BKA11TRi.js";import{R as Dr,a as zt,b as Ni,W as Qe}from"./url-evaluation-Dkim9UU-.js";import{_ as $i}from"./useLocalStorage-BGufc8fE.js";import{d as Ui}from"./Refresh-2FBzb_uQ.js";import{L as zi}from"./LoadingButton-DVPu322x.js";import{C as Bi,R as Mi,d as kr}from"./Public-EAyGtHHi.js";import{d as Ne}from"./Add-Cj1GwkKW.js";import{B as Pr,D as Hn}from"./status-IieMMby4.js";import{i as Wi}from"./is-path-prefix-equal-DRNfC8G7.js";import{d as qi}from"./ChevronRight-BsKgMnVp.js";import{d as Hi}from"./MoreVert-61JL59bH.js";import{d as _r}from"./Edit-K2_xM3YP.js";import{d as Ki}from"./CallMerge-XaiMaWvF.js";import{C as Gi}from"./CardContent-DFEMxexG.js";import{w as Vi}from"./withStyles-B4dvn7ww.js";import{S as Yi}from"./Slider-BQJhsQiK.js";import"./index-C-czX6v8.js";import"./session--KhzErQz.js";import"./useThemeProps-DCQ65cqf.js";import"./emotion-react.browser.esm-BDvH2bbh.js";import"./ViewColumn-Dug72V0B.js";import"./Search-DQ4Y1c5N.js";import"./Clear-CBus3YPN.js";import"./index-BX4S2ZnM.js";import"./TableSearch-CvOwepTo.js";import"./click-to-copy-Bd1pbmjJ.js";import"./shorten-label-DC9lls-_.js";const ve="Dashboard",Rr=x.createContext({}),{Provider:Xi,Consumer:qs}=Rr,Kn=[ve,E.DOMAIN_FOR_IP_SITE,E.DOMAIN_FOR_IP_SITE_REGEXP],Qi=(t,n)=>{if(t.name===E.DOMAIN_FOR_DEFAULT_SITE)return-1;if(n.name===E.DOMAIN_FOR_DEFAULT_SITE)return 1;const r=Kn.includes(t.name),i=Kn.includes(n.name);return r&&i?In(t.name,n.name):r?-1:i?1:In(t.name,n.name)},Zi=({sites:t,nodePort:n})=>{const r=window.location.host,o=(t||[]).map(a=>{const{id:s,rules:d=[],corsAllowedOrigins:g=[]}=a;let{domain:c,domainAliases:u}=a;u=u||[],[E.DOMAIN_FOR_IP_SITE,E.DOMAIN_FOR_IP_SITE_REGEXP].includes(c)&&(c=ve,u.find(w=>w.value===r)||u.unshift({protected:!1,value:r}));const f={id:s,name:c,type:"domain",items:[],domainAliases:u,isProtected:a.isProtected,corsAllowedOrigins:g};return(d||[]).forEach(w=>{const{id:j,isProtected:_,from:{pathPrefix:v},to:k}=w;if(k.type===E.ROUTING_RULE_TYPES.BLOCKLET){let P="";Number.parseInt(k.port,10)===Number.parseInt(n,10)?(P="Blocklet Server Dashboard",k.type=E.ROUTING_RULE_TYPES.DAEMON):P=k.did,f.items.push({id:j,name:An(v||"/"),title:P,type:"rule",isProtected:_,pathPrefix:v,to:k})}else f.items.push({id:j,pathPrefix:v,name:An(v||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:_,to:k})}),f.items=pr(f.items,w=>w.name),f}).sort(Qi),l=o.reduce((a,s)=>{let{name:d}=s;return d.endsWith(E.BLOCKLET_SITE_GROUP_SUFFIX)&&([d]=d.split(".")),a[d]={...s,rules:s.items},a},{});return{sites:o,siteMap:l}},Ji=({did:t,domain:n,mountPoint:r,siteMap:i,params:o}={})=>{if(!i)return null;const l=i[t];if(!l)return null;const a=n||(l.domainAliases||[])[0];if(!a)return null;let s=r;if(!s){const d=l.rules.filter(g=>!g.name.startsWith(E.WELLKNOWN_PATH_PREFIX))[0];s=d?d.name:"/"}return nt(a.value,s,o)},eo=({did:t,mountPoint:n,siteMap:r,params:i}={})=>{if(!r)return[];const o=r[t];if(!o)return[];const l=o.domainAliases||[];if(!l.length)return[];let a=n;if(!a){const s=o.rules.filter(d=>!d.name.startsWith(E.WELLKNOWN_PATH_PREFIX))[0];a=s?s.name:"/"}return l.map(s=>nt(s.value,a,i))},to=t=>{const n=t.map(i=>i.domain).filter(i=>![E.DOMAIN_FOR_IP_SITE_REGEXP,E.DOMAIN_FOR_DEFAULT_SITE].includes(i));let r=[];return t.forEach(i=>r.push(...i.domainAliases||[])),r=r.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:n,domainsAliases:r}};function Gn({children:t}){const{api:n,info:r}=Z(),[i,o]=x.useState([]),[l,a]=x.useState([]),[s,d]=x.useState([]),g=ze(async()=>{const{sites:b}=await n.getRoutingSites({input:{snapshotHash:""}}),y=b||[];await Promise.all(y.map(async T=>(T.domainAliases=await ri(T.domainAliases,{getIP:ii}),T)));const S=to(y);o(y),a(S.domains),d([window.location.hostname,...S.domains,...S.domainsAliases.map(T=>T.value)])},[r]),c=(b,y)=>{o(S=>S.map(T=>T.id===b?y.domain?y:{...y,domain:T.domain}:T))},u=b=>n.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(b)}}),f=async b=>{const y=await n.addRoutingSite({input:b});o(i.concat(y.site))},w=async(b,y)=>{const S=await n.updateRoutingSite({input:{id:b,...y}});if(S.site&&S.site.id){const T=i.findIndex($=>$.id===S.site.id);T!==-1&&(i.splice(T,1,S.site),o([].concat(i)))}},j=async b=>{await n.deleteRoutingSite({input:{id:b}}),o(i.filter(y=>y.id!==b))},_=async(b,y,S)=>{const T=await n.addDomainAlias({input:{id:b,domainAlias:y,force:S}});c(b,T.site)},v=async(b,y)=>{const S=await n.deleteDomainAlias({input:{id:b,domainAlias:y}});c(b,S.site)},k=async(b,y)=>{const{site:S}=await n.addRoutingRule({input:{id:b,rule:y}});c(b,S)},P=async(b,y)=>{const{site:S}=await n.updateRoutingRule({input:{id:b,rule:y}});c(b,S)},D=async(b,y)=>{const{site:S}=await n.deleteRoutingRule({input:{id:b,ruleId:y}});c(b,S)},p={loading:g.loading,error:g.error,refresh:g.retry,api:n,actions:{addSite:f,updateSite:w,deleteSite:j,addDomainAlias:_,deleteDomainAlias:v,takeSnapshot:u,addRule:k,updateRule:P,deleteRule:D}},{sites:C,siteMap:h}=Zi({sites:i,nodePort:r.port});return p.sites=C,p.siteMap=h,p.domains=l,p.allDomains=s,p.getBlockletUrl=({did:b,domain:y,mountPoint:S,params:T})=>Ji({did:b,domain:y,mountPoint:S,siteMap:p.siteMap,params:T}),p.getBlockletUrls=({did:b,mountPoint:y,params:S})=>eo({did:b,mountPoint:y,siteMap:p.siteMap,params:S}),e.jsx(Xi,{value:{routing:p},children:t})}function ue(){const{routing:t}=x.useContext(Rr);return t}function Qt(t){const n=[E.DOMAIN_FOR_IP_SITE_REGEXP,E.DOMAIN_FOR_DEFAULT_SITE,E.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&n.push(window.location.hostname),n.includes(t)}var Zt={},no=Ce;Object.defineProperty(Zt,"__esModule",{value:!0});var Tr=Zt.default=void 0,ro=no(we()),io=e;Tr=Zt.default=(0,ro.default)((0,io.jsx)("path",{d:"m7 14 5-5 5 5z"}),"ArrowDropUp");function oo(){return null}function Jt({confirm:t}){const[n,r]=x.useState(null),{t:i}=z(),o=()=>{r(null)},l=async s=>{if(s){let d=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";d==="/"?Ln.push(`${s.pathname}`):(d.endsWith("/")&&(d=d.substring(0,d.length-1)),Ln.push(`${d}${s.pathname}`)),window.location.reload()}},a=(s,...d)=>{let g=typeof t=="function"?t(s,...d):t;return g?(typeof g=="string"&&(g={description:g}),r({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>l(s),onCancel:()=>o(),...g}),!1):!0};return e.jsxs(ao,{children:[e.jsx(oo,{message:a}),n&&e.jsx(le,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})]})}Jt.propTypes={confirm:m.oneOfType([m.object,m.string,m.func])};Jt.defaultProps={confirm:null};const ao=ee.div`
|
|
2
2
|
margin-bottom: 24px;
|
|
3
3
|
.top-btns-alert {
|
|
4
4
|
@media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bg as b}from"./index-B7UfL6V6.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{bg as b}from"./index-BScCZen8.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-s2Rr8TMK.js";import"./index-DbIDv5vn.js";import"./index-BScCZen8.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-s2Rr8TMK.js";import{g as E,a as C,b as N,c as _,d as V,e as x}from"./SchemaReference.es-CYEXItFR.js";import"./info-addon.es-D2RjkMEO.js";import{Y as A,r as F}from"./index-DbIDv5vn.js";import"./index-BScCZen8.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,fc as Gt,d3 as O,fd as qt,b as Ht,M as jt,fe as Kt,a7 as Vt,bg as zt,r as P,aa as Jt,a5 as Yt,ab as Xt,bl as Qt,bq as Zt,m as kt,H as te,W as ee,k as re,t as ie,D as ne,B as ft,C as pt,q as se,X as oe,v as ae,bA as le,Y as ce}from"./index-B7UfL6V6.js";import{W as he}from"./url-evaluation-Dv0N_pok.js";import{s as St,n as ue}from"./schema-CfO6HjUI.js";import{r as fe}from"./cloneDeep-vMO7xSKJ.js";import{I as mt}from"./index-8mvNLWje.js";import{u as pe}from"./session-Bo2ZbX-l.js";import{d as me}from"./Delete-BBkD2GAm.js";import{_ as de}from"./useLocalStorage-euZsG16i.js";import{A as ge}from"./Autocomplete-8l10UH26.js";import{L as ve}from"./ListItemButton-Bu0_R2ca.js";import{S as ye,a as be,b as xe}from"./Stepper-B9jFEqOQ.js";function je({mode:t,...e}){return t==="development"?u.jsx(he,{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 Ae=Ee,N=Symbol("max"),L=Symbol("length"),H=Symbol("lengthCalculator"),Q=Symbol("allowStale"),M=Symbol("maxAge"),U=Symbol("dispose"),yt=Symbol("noDisposeOnSet"),S=Symbol("lruList"),A=Symbol("cache"),It=Symbol("updateAgeOnGet"),nt=()=>1;class Re{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[M]=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[M]=e,X(this)}get maxAge(){return this[M]}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[A]=new Map,this[S]=new Ae,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[M],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[A].has(e)){if(a>this[N])return V(this,this[A].get(e)),!1;const d=this[A].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[A].set(e,this[S].head),X(this),!0)}has(e){if(!this[A].has(e))return!1;const r=this[A].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[A].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[A].forEach((e,r)=>st(this,r,!1))}}const st=(t,e,r)=>{const i=t[A].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[M])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[M]&&r>t[M]},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[A].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=Re,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,Me(t,e)),ot.get(r)}};function Me(t,e){if(!(t==null||t==="")){var r=Be($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 Be(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,B={},R={},Ge=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(R,"__esModule",{value:!0});R.setService=R.findService=R.getDefaultServiceConfig=R.getServiceConfig=void 0;const qe=Ge(fe),He=St,At={},ct=t=>{At[t.name]={validate:t.schema.validate.bind(t.schema),defaultConfig:t.default}};R.setService=ct;ct({name:"auth",schema:He.authConfigSchema,default:{}});const Rt=t=>{if(!t)throw new Error("service name should not be empty");const e=At[t];if(!e)throw new Error(`service ${t} does not exist`);return e},Ot=(t,e,{validate:r}={})=>{const i=Rt(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};R.getServiceConfig=Ot;const Pt=t=>{const{defaultConfig:e}=Rt(t);return e};R.getDefaultServiceConfig=Pt;const Ut=(t,e)=>{const r=[e];return(t||[]).find(i=>r.includes(i.name))};R.findService=Ut;R.default={getServiceConfig:Ot,getDefaultServiceConfig:Pt,findService:Ut,setService:ct};Object.defineProperty(B,"__esModule",{value:!0});B.fixAndValidateService=B.validateMeta=void 0;const Ke=St,Ve=R,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);B.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};B.validateMeta=Lt;B.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=B;Object.defineProperty(t,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const y=ue,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}=pe(),[d,y]=P.useState(!1),[h,j]=P.useState(""),{t:m,locale:F}=kt(),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: ${ce(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()},Mt=()=>{y(!1),o(!1)};P.useEffect(()=>{t&&J()},[t]);const $t=[{name:m("common.name"),value:te.getDisplayName({meta:_},!0)},{name:m("common.version"),value:_.version},{name:m("common.did"),value:_.did?u.jsx(ee,{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}],Bt=()=>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(re,{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(ie,{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:Bt(),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(ne,{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(se,{component:"div",style:{marginTop:24},children:D.body}),!!h&&u.jsx(oe,{severity:"error",style:{width:"100%",marginTop:8},children:h})]}),_&&n&&u.jsx(ae,{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:le(_),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:Mt})]})}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,fc as Gt,d3 as O,fd as qt,b as Ht,M as jt,fe as Kt,a7 as Vt,bg as zt,r as P,aa as Jt,a5 as Yt,ab as Xt,bl as Qt,bq as Zt,m as kt,H as te,W as ee,k as re,t as ie,D as ne,B as ft,C as pt,q as se,X as oe,v as ae,bA as le,Y as ce}from"./index-BScCZen8.js";import{W as he}from"./url-evaluation-Dkim9UU-.js";import{s as St,n as ue}from"./schema-B5lLDdwS.js";import{r as fe}from"./cloneDeep-B3IuXkH6.js";import{I as mt}from"./index-J_t6WXFJ.js";import{u as pe}from"./session--KhzErQz.js";import{d as me}from"./Delete-E4y6t1JP.js";import{_ as de}from"./useLocalStorage-BGufc8fE.js";import{A as ge}from"./Autocomplete-DuiLMv1o.js";import{L as ve}from"./ListItemButton-Cd6Uq-Ac.js";import{S as ye,a as be,b as xe}from"./Stepper-zGEKMQJb.js";function je({mode:t,...e}){return t==="development"?u.jsx(he,{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 Ae=Ee,N=Symbol("max"),L=Symbol("length"),H=Symbol("lengthCalculator"),Q=Symbol("allowStale"),M=Symbol("maxAge"),U=Symbol("dispose"),yt=Symbol("noDisposeOnSet"),S=Symbol("lruList"),A=Symbol("cache"),It=Symbol("updateAgeOnGet"),nt=()=>1;class Re{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[M]=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[M]=e,X(this)}get maxAge(){return this[M]}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[A]=new Map,this[S]=new Ae,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[M],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[A].has(e)){if(a>this[N])return V(this,this[A].get(e)),!1;const d=this[A].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[A].set(e,this[S].head),X(this),!0)}has(e){if(!this[A].has(e))return!1;const r=this[A].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[A].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[A].forEach((e,r)=>st(this,r,!1))}}const st=(t,e,r)=>{const i=t[A].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[M])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[M]&&r>t[M]},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[A].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=Re,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,Me(t,e)),ot.get(r)}};function Me(t,e){if(!(t==null||t==="")){var r=Be($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 Be(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,B={},R={},Ge=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(R,"__esModule",{value:!0});R.setService=R.findService=R.getDefaultServiceConfig=R.getServiceConfig=void 0;const qe=Ge(fe),He=St,At={},ct=t=>{At[t.name]={validate:t.schema.validate.bind(t.schema),defaultConfig:t.default}};R.setService=ct;ct({name:"auth",schema:He.authConfigSchema,default:{}});const Rt=t=>{if(!t)throw new Error("service name should not be empty");const e=At[t];if(!e)throw new Error(`service ${t} does not exist`);return e},Ot=(t,e,{validate:r}={})=>{const i=Rt(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};R.getServiceConfig=Ot;const Pt=t=>{const{defaultConfig:e}=Rt(t);return e};R.getDefaultServiceConfig=Pt;const Ut=(t,e)=>{const r=[e];return(t||[]).find(i=>r.includes(i.name))};R.findService=Ut;R.default={getServiceConfig:Ot,getDefaultServiceConfig:Pt,findService:Ut,setService:ct};Object.defineProperty(B,"__esModule",{value:!0});B.fixAndValidateService=B.validateMeta=void 0;const Ke=St,Ve=R,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);B.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};B.validateMeta=Lt;B.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=B;Object.defineProperty(t,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const y=ue,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}=pe(),[d,y]=P.useState(!1),[h,j]=P.useState(""),{t:m,locale:F}=kt(),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: ${ce(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()},Mt=()=>{y(!1),o(!1)};P.useEffect(()=>{t&&J()},[t]);const $t=[{name:m("common.name"),value:te.getDisplayName({meta:_},!0)},{name:m("common.version"),value:_.version},{name:m("common.did"),value:_.did?u.jsx(ee,{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}],Bt=()=>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(re,{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(ie,{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:Bt(),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(ne,{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(se,{component:"div",style:{marginTop:24},children:D.body}),!!h&&u.jsx(oe,{severity:"error",style:{width:"100%",marginTop:8},children:h})]}),_&&n&&u.jsx(ae,{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:le(_),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:Mt})]})}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{bW as D,j as s,P as r,n as x,r as m,f as A,bh as E,D as H,m as j,aT as M,cQ as $,cR as U,cu as P,a3 as q,cS as F,A as O,cT as V,cE as W,cU as S,cV as N,aw as Y,M as L,bb as B,bs as X,C as J}from"./index-
|
|
1
|
+
import{bW as D,j as s,P as r,n as x,r as m,f as A,bh as E,D as H,m as j,aT as M,cQ as $,cR as U,cu as P,a3 as q,cS as F,A as O,cT as V,cE as W,cU as S,cV as N,aw as Y,M as L,bb as B,bs as X,C as J}from"./index-BScCZen8.js";import{R as K}from"./index-DbvvMLGP.js";import{N as Q}from"./index-BWheHxyB.js";import{C as z}from"./index-DCBVsLjA.js";import{u as G}from"./session--KhzErQz.js";import{w as Z}from"./wrap-locale-BvifS-n8.js";const ee=D(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 b({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(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,l]),f=m.useCallback(()=>{o(!0)},[]),i=m.useCallback(()=>{o(!1)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(se,{children:s.jsxs("div",{className:"invite-passport__card",onClick:f,children:[!!e.display&&s.jsx(Q,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&s.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:u}})]})}),s.jsx(H,{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(ee,{style:{width:"30px",height:"30px"}}),s.jsx("div",{children:t("invite.emptyPermission")})]})})]})}b.propTypes={invitation:r.object.isRequired,createPassportSvg:r.func.isRequired,passportColor:r.string};b.defaultProps={passportColor:"auto"};const se=x.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
max-width: 350px;
|
|
4
4
|
margin: 30px auto;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bk as i,gc as e}from"./index-BScCZen8.js";const a=e;var o=(r,t)=>a(r)===a(t);const P=i(o);export{P as i};
|