@abtnode/blocklet-services 1.16.38-beta-20250115-235439-bb5a1c1b → 1.16.38-beta-20250116-083413-dbd33222

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/assets/{Add-C6s-Vnmg.js → Add-DA06or_T.js} +1 -1
  2. package/dist/assets/{ArrowDropDown-vKf3f5eE.js → ArrowDropDown-ByvmY1fG.js} +1 -1
  3. package/dist/assets/{CheckCircle-D3sLlO8U.js → CheckCircle-61kAAbS7.js} +1 -1
  4. package/dist/assets/{ChevronLeft-COXTEKCd.js → ChevronLeft-BEMgr19u.js} +1 -1
  5. package/dist/assets/{ChevronRight-DnoIUF6_.js → ChevronRight-C9Sf_Tx7.js} +1 -1
  6. package/dist/assets/{DeleteOutline-BkfiCnRt.js → DeleteOutline-CUlVP0SU.js} +1 -1
  7. package/dist/assets/{Done-zh2eXk8O.js → Done-DBzH2QOU.js} +1 -1
  8. package/dist/assets/{Download-9HhUOVnv.js → Download-CufGBMcn.js} +1 -1
  9. package/dist/assets/{EditIcon-BF2eKBD0.js → EditIcon-BKaoBwhT.js} +1 -1
  10. package/dist/assets/{Error-CpLyAhkv.js → Error-BRj42iX7.js} +1 -1
  11. package/dist/assets/{Google-thaEal7z.js → Google-C9fXfahB.js} +1 -1
  12. package/dist/assets/{InfoOutlined-phoVf4hW.js → InfoOutlined-CB0cJwBU.js} +1 -1
  13. package/dist/assets/{Launch-B3dFrLjr.js → Launch-DhDcxyle.js} +1 -1
  14. package/dist/assets/{LaunchOutlined-DtUHpbN5.js → LaunchOutlined--NsW2V4X.js} +1 -1
  15. package/dist/assets/{LockIcon-DQtUl5vk.js → LockIcon-CJS2b0V1.js} +1 -1
  16. package/dist/assets/{Loop-AE9uCvcp.js → Loop-DecQ6hrf.js} +1 -1
  17. package/dist/assets/{MoreHoriz-CUgH0jV-.js → MoreHoriz-jR1hvlRv.js} +1 -1
  18. package/dist/assets/{PlayArrow-Du9tHm7-.js → PlayArrow-BQPL8ZKx.js} +1 -1
  19. package/dist/assets/{QuestionMarkCircle-gL_QM35Z.js → QuestionMarkCircle-yIKrKrCO.js} +1 -1
  20. package/dist/assets/{ServerLogo-UNPlRpuM.js → ServerLogo-BtnYTJe2.js} +1 -1
  21. package/dist/assets/{ViewList-BUKDlFq_.js → ViewList-COpI8i9D.js} +1 -1
  22. package/dist/assets/{_createAggregator-DqBCPv73.js → _createAggregator-D73d37er.js} +1 -1
  23. package/dist/assets/{access-control-CQEVUKlf.js → access-control-CyOr5O9b.js} +1 -1
  24. package/dist/assets/{actions-B2A8ao0K.js → actions-DDDMPf_w.js} +1 -1
  25. package/dist/assets/{add-component-core-CWVYZ8WA.js → add-component-core-BTs2P_Jp.js} +1 -1
  26. package/dist/assets/{add-resource-0OEygRwE.js → add-resource-Znwa5ovp.js} +1 -1
  27. package/dist/assets/{addon-BQKNb4Py.js → addon-DRWTut9y.js} +1 -1
  28. package/dist/assets/{analytics-BIzuxCPf.js → analytics-iIAmuHjx.js} +1 -1
  29. package/dist/assets/{audit-logs-CeDS3WGD.js → audit-logs-8Mi-fbdp.js} +1 -1
  30. package/dist/assets/{base32-C41aFfgE.js → base32-BJ0zdvwj.js} +1 -1
  31. package/dist/assets/{branding-Dmu7SZwa.js → branding-Y_Xiasx4.js} +2 -2
  32. package/dist/assets/{bundle-avatar-Dx7DsJvg.js → bundle-avatar-vdPLynfx.js} +1 -1
  33. package/dist/assets/button-bqdvVuzW.js +1 -0
  34. package/dist/assets/{click-to-copy-w1sXXA5-.js → click-to-copy-CmMy3CrF.js} +1 -1
  35. package/dist/assets/{complete-BkbfIahT.js → complete-CS43JIHv.js} +1 -1
  36. package/dist/assets/{component-SByzcdSk.js → component-BCTw0GKP.js} +1 -1
  37. package/dist/assets/{config-CJbAebUi.js → config-CJbVE0vv.js} +1 -1
  38. package/dist/assets/{config-DkAoqJrm.js → config-DmjSKN24.js} +1 -1
  39. package/dist/assets/{config-navigation-D3CEseYs.js → config-navigation-CNspwqbG.js} +3 -3
  40. package/dist/assets/{config-space-CVzrNiJs.js → config-space-DmPh1bZ_.js} +1 -1
  41. package/dist/assets/confirm-Cx-IVcgq.js +7 -0
  42. package/dist/assets/{connect-FahpyiOI.js → connect-B6MpXaBD.js} +1 -1
  43. package/dist/assets/{connect-D7u7zAHW.js → connect-Czw6WbQF.js} +1 -1
  44. package/dist/assets/{connect-to-DgFj0KxA.js → connect-to-DYBaYeJc.js} +1 -1
  45. package/dist/assets/{content-layout-CK_AzZZ-.js → content-layout-DAGIv17a.js} +1 -1
  46. package/dist/assets/{dashboard-z7zVrYGA.js → dashboard-CPxg5LvZ.js} +3 -3
  47. package/dist/assets/{did-address-vWQGhW6L.js → did-address-DsOFwsmU.js} +1 -1
  48. package/dist/assets/{domain-mBK5lWF5.js → domain-CZsQei8I.js} +1 -1
  49. package/dist/assets/{domain-list-D8GpnsIy.js → domain-list-D4Clgh5O.js} +1 -1
  50. package/dist/assets/{email-C14Xa0wL.js → email-CtCPE15h.js} +1 -1
  51. package/dist/assets/{exchange-passport-B1Fx0Rd9.js → exchange-passport-CZFdfxAy.js} +1 -1
  52. package/dist/assets/{form-text-input-IJ-ksbZ2.js → form-text-input-s_8M9qAU.js} +2 -2
  53. package/dist/assets/{fuel-Czk5ukUs.js → fuel-DQb6QtRb.js} +1 -1
  54. package/dist/assets/{fullpage-DTja3SmB.js → fullpage-vhYlt62g.js} +1 -1
  55. package/dist/assets/{get-safe-url-BuiowS2J.js → get-safe-url-Bg-eYJFz.js} +1 -1
  56. package/dist/assets/{get-safe-url-Ddj-Tmsl.js → get-safe-url-CUm2E-jn.js} +1 -1
  57. package/dist/assets/{home-CB9sf1Sa.js → home-X6wxlptK.js} +1 -1
  58. package/dist/assets/{iframe-ITMZuuxP.js → iframe-CVBJbqTp.js} +1 -1
  59. package/dist/assets/{index-CCUCWBor.js → index-8FWcj3Y4.js} +7 -7
  60. package/dist/assets/{index-CaHJ0Ch7.js → index-B0QYqr2A.js} +3 -3
  61. package/dist/assets/{index-DSZK2W1l.js → index-BFfaWqP3.js} +1 -1
  62. package/dist/assets/{index-DH5NMoAp.js → index-BP4o1Jjj.js} +4 -4
  63. package/dist/assets/{index-DB6VR6GM.js → index-BbrJG83p.js} +1 -1
  64. package/dist/assets/{index-DxdlbVnC.js → index-BfVR8O43.js} +17 -17
  65. package/dist/assets/{index-CYcmGLzu.js → index-BtxzZ9SO.js} +1 -1
  66. package/dist/assets/{index-CJxgi_0G.js → index-COiVRnOM.js} +1 -1
  67. package/dist/assets/{index-BjauMU9c.js → index-CYQoZJsb.js} +4 -4
  68. package/dist/assets/{index-BP6sEHV5.js → index-ChG5I_m-.js} +1 -1
  69. package/dist/assets/{index-Bi1xb9O8.js → index-CzV3SmGK.js} +1 -1
  70. package/dist/assets/{index-DaEfQ655.js → index-DcwCauP3.js} +1 -1
  71. package/dist/assets/{index-DmCoJI6s.js → index-Dl6rjJDp.js} +1 -1
  72. package/dist/assets/{index-DQSF6ElG.js → index-DvtOujRp.js} +1 -1
  73. package/dist/assets/{index-D7mJIWyJ.js → index-DwFu84UU.js} +1 -1
  74. package/dist/assets/{index-C76B4rKX.js → index-IvME2p33.js} +1 -1
  75. package/dist/assets/{index-DFJvHEx_.js → index-JFhSGIs6.js} +1 -1
  76. package/dist/assets/{index-CoELNYm2.js → index-iqfmQPLo.js} +1 -1
  77. package/dist/assets/{invitation-DPt0gdGE.js → invitation-CN9oEvb3.js} +1 -1
  78. package/dist/assets/{invite-DE-KlgyB.js → invite-C2OM8i63.js} +1 -1
  79. package/dist/assets/{issue-passport-D-nMcnvC.js → issue-passport-B6l3ZIL0.js} +1 -1
  80. package/dist/assets/{item-Bb-pZLx0.js → item-BG6Y4B38.js} +1 -1
  81. package/dist/assets/{launch-result-message-zXOcVqEr.js → launch-result-message-CeThGm85.js} +1 -1
  82. package/dist/assets/{layout-CIMojpa6.js → layout-mYIHD_Mg.js} +1 -1
  83. package/dist/assets/{list-header-BHxsELKC.js → list-header-Bce1kvpA.js} +1 -1
  84. package/dist/assets/localization-_hzGA-9a.js +1 -0
  85. package/dist/assets/{log-CoxkHKGx.js → log-CBfX52Lz.js} +1 -1
  86. package/dist/assets/{login-A4fvlgxL.js → login-b0vBgUs0.js} +1 -1
  87. package/dist/assets/{login-oauth-callback-C177kNaH.js → login-oauth-callback-BVkafEHi.js} +1 -1
  88. package/dist/assets/{logo-uploader-kxXncDgy.js → logo-uploader-B7OF9E82.js} +3 -3
  89. package/dist/assets/{lost-passport-kAphaEDd.js → lost-passport-z5GhQRa9.js} +1 -1
  90. package/dist/assets/{open-window-BeXz5cPG.js → open-window-CIN-c_8i.js} +1 -1
  91. package/dist/assets/{overview-BTCtLzrM.js → overview-BPRG92Fe.js} +1 -1
  92. package/dist/assets/{page-header-7_k_ugJy.js → page-header-PFRlhj0j.js} +1 -1
  93. package/dist/assets/{permission-BGRlqVt3.js → permission-BwvfjqYI.js} +1 -1
  94. package/dist/assets/{preferences-DamRKQ0e.js → preferences-DY1qnOCx.js} +1 -1
  95. package/dist/assets/publish-resource-Co4IkWOk.js +1 -0
  96. package/dist/assets/{react-beautiful-dnd.esm-BWxUJ9Xq.js → react-beautiful-dnd.esm-DZo8yE8C.js} +1 -1
  97. package/dist/assets/{relative-time-D4irHZ27.js → relative-time-D0LbFIi3.js} +1 -1
  98. package/dist/assets/sdk-CrCNIpAP.js +1 -0
  99. package/dist/assets/{session-DZl-cVQ_.js → session-Ku4cwX2M.js} +1 -1
  100. package/dist/assets/{setup-COWzvXcE.js → setup-LILji8SV.js} +3 -3
  101. package/dist/assets/{shorten-label-BnvWOC_s.js → shorten-label-B08EnqgB.js} +1 -1
  102. package/dist/assets/{simple-select-BwufbE2b.js → simple-select-mThFfFp5.js} +1 -1
  103. package/dist/assets/{slicedToArray-DNAGECrJ.js → slicedToArray-Ct1Y7NnY.js} +1 -1
  104. package/dist/assets/{start-ZxWVl-6C.js → start-DXNq6pym.js} +1 -1
  105. package/dist/assets/{step-actions-BJ6wYLRD.js → step-actions-ChI-f31y.js} +1 -1
  106. package/dist/assets/{studio-ClCPyH_R.js → studio-C8ceaGGk.js} +1 -1
  107. package/dist/assets/{switch-control-_nA0DJVI.js → switch-control-DzGhrJO3.js} +1 -1
  108. package/dist/assets/{toUpper-DFtRDHUH.js → toUpper-Ch8IcBS5.js} +1 -1
  109. package/dist/assets/{transfer-0U_178Ru.js → transfer-C_2vz0eA.js} +1 -1
  110. package/dist/assets/{unsubscribe-DF3iFxk4.js → unsubscribe-CbRJLLVz.js} +1 -1
  111. package/dist/assets/{use-mobile-DAR0hmJd.js → use-mobile-DoeLOxx6.js} +1 -1
  112. package/dist/assets/{useAsyncRetry-KXMle3o0.js → useAsyncRetry-ng-QDeMG.js} +1 -1
  113. package/dist/assets/{useLocalStorage-Bby1iRzv.js → useLocalStorage-CM8R1gkX.js} +1 -1
  114. package/dist/assets/{user-center-BWqF0ggv.js → user-center-Dvw2MR8N.js} +4 -4
  115. package/dist/assets/{util-BZGCzHyk.js → util-D7vfOed5.js} +1 -1
  116. package/dist/assets/{vendor-arcblock-CZGLzU01.js → vendor-arcblock-BlPSuvWz.js} +202 -202
  117. package/dist/assets/{vendor-mui-core-BlX2BJoA.js → vendor-mui-core-jh6OMVvU.js} +1 -1
  118. package/dist/assets/{vendor-mui-x-Bq1FyQ7S.js → vendor-mui-x-BRRfPRl8.js} +1 -1
  119. package/dist/assets/{wrap-locale-B1cP4AVb.js → wrap-locale-Df7FBKhT.js} +1 -1
  120. package/dist/index.html +3 -3
  121. package/dist/service-worker.js +1 -1
  122. package/package.json +42 -42
  123. package/dist/assets/button-pEMdQ6vg.js +0 -1
  124. package/dist/assets/confirm-BHRsp-P-.js +0 -7
  125. package/dist/assets/localization-XiAFT9tg.js +0 -1
  126. package/dist/assets/publish-resource-Cflic0Q5.js +0 -1
  127. package/dist/assets/sdk-CdMKuCxo.js +0 -1
@@ -1 +1 @@
1
- import{E as c,j as e,a3 as d,T as j,a4 as V,x as B,a2 as ie}from"./vendor-mui-core-BlX2BJoA.js";import{o as se,u as re,y as ce}from"./vendor-hooks-CLzfFpO7.js";import{r as $,k as ae}from"./vendor-react-D-afvo_7.js";import{Q as le,U as de,g as J,V as pe,W as fe,X as ue,Y as ge,P as O,C as me,Z as he,d as _,$ as L,a0 as xe,a1 as we,a2 as ye,z,a3 as Pe,a4 as je,a5 as ve}from"./vendor-arcblock-CZGLzU01.js";import{j as W,w as Ie}from"./vendor-utils-DCpRgzMR.js";import{u as ke}from"./use-passport-id-B-b-_oYF.js";import{g as X}from"./get-safe-url-Ddj-Tmsl.js";import{u as Ce,s as Te,a as be,b as Re}from"./index-BjauMU9c.js";import{d as _e}from"./LaunchOutlined-DtUHpbN5.js";function E({blocklet:s}){return e.jsxs(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(le,{variant:"rounded",shape:"square",did:s.appPid,src:s.appLogo,size:80}),e.jsx(j,{component:"h2",variant:"h6",children:s.appName}),e.jsx(de,{did:s.appPid})]})}const Le=$.memo(E);E.propTypes={blocklet:c.shape({appName:c.string,appLogo:c.string,appPid:c.string})};E.defaultProps={blocklet:window.blocklet};const We=()=>{var r,o;const s=(o=(r=window.blocklet)==null?void 0:r.componentMountPoints)==null?void 0:o.find(g=>g.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk");return s==null?void 0:s.mountPoint};function S({children:s,cta:r,...o}){return e.jsxs(d,{...o,children:[s?e.jsx(d,{sx:{maxHeight:"50vh",overflow:"hidden",position:"relative",":after":{content:'""',position:"absolute",left:0,right:0,bottom:0,height:"80%",background:"linear-gradient(transparent, #fff 85%)"}},children:s}):null,r?e.jsx(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:4,borderRadius:2},children:r}):null]})}S.propTypes={children:c.node,cta:c.node};S.defaultProps={children:null,cta:null};function U({passports:s,onConnect:r,onClose:o,redirect:g,...v}){const{t:p}=J(),x=We(),I=a=>{const u=a==null?void 0:a.payable;return x&&u?W(x,`/api/redirect/checkout/${u}?redirect=${g}`):null};return e.jsxs(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",maxWidth:"400px",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsx(Le,{}),e.jsx(S,{...v,cta:e.jsxs(e.Fragment,{children:[e.jsx(j,{variant:"h4",sx:{mx:2,textAlign:"center",fontWeight:"bold",color:"warning.main"},children:p("login.accessLimit.title")}),e.jsx(j,{variant:"body1",sx:{maxWidth:620,mt:2,mx:2,textAlign:"center",color:"gray"},children:p("login.accessLimit.description")}),e.jsx(d,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:1,mt:5},children:s==null?void 0:s.map(a=>{const u=I(a);return u?e.jsx(V,{title:p("login.accessLimit.buyPassport"),arrow:!0,placement:"top",children:e.jsx(B,{color:"primary",variant:"contained",endIcon:e.jsx(_e,{}),href:u,target:"_blank",children:a.title||a.name})},a.name):e.jsx(V,{title:p("login.connectWithPassport"),arrow:!0,placement:"top",children:e.jsx(B,{color:"inherit",variant:"contained",onClick:r,children:a.title||a.name})},a.name)})}),e.jsxs(j,{variant:"body1",sx:{mt:2,color:"grey.400"},children:[e.jsx(d,{component:"span",sx:{display:"inline-block",mr:1},children:p("login.accessLimit.alreadyHavePassport")}),e.jsx(d,{component:"span",sx:{textDecoration:"underline",cursor:"pointer",color:"primary.main"},onClick:r,children:p("common.connect")})]})]})})]})}U.propTypes={passports:c.arrayOf(c.shape({name:c.string.isRequired,title:c.string,payable:c.string})),onConnect:c.func,onClose:c.func,redirect:c.string.isRequired};U.defaultProps={passports:[],onConnect:()=>{},onClose:()=>{}};function Ke(){const s=$.useRef(null),{session:r}=Ce(),{t:o,locale:g}=J(),{getPassportId:v}=ke(),p=ae(),x=pe(),I=fe(),{encryptKey:a,decrypt:u}=ue(),{searchParams:t}=new URL(window.location.href),m={passportId:v()},D=t.get("componentId"),N=t.get("authenticated"),G=t.get("sessionToken"),Y=t.get("refreshToken"),Z=t.get("requiredRoles"),f=t.get("redirect"),l=t.get("forceConnected"),w=t.get("sourceAppPid"),k=t.get("origin"),A=t.get("autoConnectWebview"),q=t.get("popup"),F=t.get("showQuickConnect");let h=t.get("inviter");if(!h&&f)try{h=(f.startsWith("http")?new URL(f):new URL(f,window.location.origin)).searchParams.get("inviter")}catch{}h=h||localStorage.getItem("inviter"),D&&(m.componentId=D),x&&(m.visitorId=x),h&&(m.inviter=h),ge(w)||(w==="null"?m.sourceAppPid=null:w!==null&&(m.sourceAppPid=w));let H=[];try{H=JSON.parse(Z)}catch{}const ee=async n=>{const i=t.get("fromWallet");n&&String(i)==="1"&&I.wallet&&await Promise.any([ve.asyncCall("arcSetToken",n),Re(3e3)])},C=n=>t.get("encrypted")?u(n):n,K=async n=>{await ee(n),setTimeout(()=>{if(f){const i=decodeURIComponent(f);i.startsWith(_.WELLKNOWN_SERVICE_PATH_PREFIX)?p(i,{replace:!0}):window.location.replace(X(i))}else window.location.replace(window.env.pathPrefix||"/")},50)},Q=async(n,i)=>{const y=i(n.sessionToken),T=i(n.refreshToken),P=i(n.visitorId);Te(y),be(T),n.visitorId&&Pe(P);const b={connected_did:t.get("connected_did"),connected_pk:t.get("connected_pk"),connected_app:t.get("connected_app"),connected_wallet_os:t.get("connected_wallet_os")};je(b,!0),await r.refresh(),K({sessionToken:y,refreshToken:T,visitorId:P})},ne=se(()=>k==="switch-did"?l&&typeof l=="string"?{title:o("login.switchSpecifiedDid.title"),scan:o("login.switchSpecifiedDid.scan",{did:l}),confirm:o("login.switchSpecifiedDid.confirm"),success:o("login.switchSpecifiedDid.success")}:{title:o("login.switchDid.title"),scan:o("login.switchDid.scan"),confirm:o("login.switchDid.confirm"),success:o("login.switchDid.success")}:{title:o("login.connect.title"),scan:o("login.connect.scan"),confirm:o("login.connect.confirm"),success:o("login.connect.success")},[l,k,o]),M=re(()=>{const n=window==null?void 0:window.blocklet,i={className:"connect",popup:!1,action:"login",passkeyBehavior:"both",onSuccess:Q,onError:te,locale:g,messages:ne,extraParams:m,baseUrl:window.location.origin,prefix:W(window.location.origin,_.WELLKNOWN_SERVICE_PATH_PREFIX,he)};l&&(i.forceConnected=l,i.extraParams.enableSwitchApp=!1,i.extraParams.forceConnected=l),i.options||(i.options={}),k==="switch-did"?i.options.showQuickConnect=!0:L(F)||([!1,"false"].includes(F)?i.options.showQuickConnect=!1:i.options.showQuickConnect=!0);const y=xe(),P=we()?y.appUrl:window.location.origin,b=W(P,_.WELLKNOWN_SERVICE_PATH_PREFIX,"connect"),R={params:ye(encodeURIComponent(JSON.stringify(i))),appPid:n==null?void 0:n.appPid,appName:n==null?void 0:n.appName,locale:g,redirect:window.location.href,_ek_:a};L(A)||(R.autoConnectWebview=A),L(q)||(R.popup=q),window.location.href=X(Ie(b,R),{allowDomains:null})});ce(()=>{if(t.get("sessionToken")){const n=t.get("visitorId");if(!n){z.error("Unexpected login response from server: visitorId is required");return}Q({sessionToken:C(G),refreshToken:C(Y),visitorId:C(n)},i=>i)}else!r.user||l&&r.user.did!==l?M():!N&&!t.get("sessionToken")&&K()});const te=n=>{z.error(n.message)},oe=t.has("popup");if(r.loading||r.user){if(!N||t.get("sessionToken"))return e.jsxs(e.Fragment,{children:[e.jsx(O,{children:e.jsx("title",{children:o("pageTitle.login")})}),e.jsx(me,{children:oe?null:e.jsx(ie,{})})]});const n=f?new URL(f,window.location.origin).href:window.location.href;return e.jsx(U,{onConnect:M,passports:H,redirect:n})}return e.jsxs(e.Fragment,{children:[e.jsx(O,{children:e.jsx("title",{children:o("pageTitle.login")})}),e.jsx(d,{sx:{"box-sizing":"border-box",width:"100%",height:"100vh",position:"relative",display:"flex","flex-direction":"column",".connect":{background:"#fafafa"}},ref:s})]})}export{Ke as default};
1
+ import{E as c,j as e,a3 as d,T as j,a4 as V,x as B,a2 as ie}from"./vendor-mui-core-jh6OMVvU.js";import{o as se,u as re,y as ce}from"./vendor-hooks-CLzfFpO7.js";import{r as $,k as ae}from"./vendor-react-D-afvo_7.js";import{Q as le,U as de,g as J,V as pe,W as fe,X as ue,Y as ge,P as O,C as me,Z as he,d as _,$ as L,a0 as xe,a1 as we,a2 as ye,z,a3 as Pe,a4 as je,a5 as ve}from"./vendor-arcblock-BlPSuvWz.js";import{j as W,w as Ie}from"./vendor-utils-DCpRgzMR.js";import{u as ke}from"./use-passport-id-B-b-_oYF.js";import{g as X}from"./get-safe-url-Bg-eYJFz.js";import{u as Ce,s as Te,a as be,b as Re}from"./index-CYQoZJsb.js";import{d as _e}from"./LaunchOutlined--NsW2V4X.js";function E({blocklet:s}){return e.jsxs(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(le,{variant:"rounded",shape:"square",did:s.appPid,src:s.appLogo,size:80}),e.jsx(j,{component:"h2",variant:"h6",children:s.appName}),e.jsx(de,{did:s.appPid})]})}const Le=$.memo(E);E.propTypes={blocklet:c.shape({appName:c.string,appLogo:c.string,appPid:c.string})};E.defaultProps={blocklet:window.blocklet};const We=()=>{var r,o;const s=(o=(r=window.blocklet)==null?void 0:r.componentMountPoints)==null?void 0:o.find(g=>g.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk");return s==null?void 0:s.mountPoint};function S({children:s,cta:r,...o}){return e.jsxs(d,{...o,children:[s?e.jsx(d,{sx:{maxHeight:"50vh",overflow:"hidden",position:"relative",":after":{content:'""',position:"absolute",left:0,right:0,bottom:0,height:"80%",background:"linear-gradient(transparent, #fff 85%)"}},children:s}):null,r?e.jsx(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:4,borderRadius:2},children:r}):null]})}S.propTypes={children:c.node,cta:c.node};S.defaultProps={children:null,cta:null};function U({passports:s,onConnect:r,onClose:o,redirect:g,...v}){const{t:p}=J(),x=We(),I=a=>{const u=a==null?void 0:a.payable;return x&&u?W(x,`/api/redirect/checkout/${u}?redirect=${g}`):null};return e.jsxs(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",maxWidth:"400px",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsx(Le,{}),e.jsx(S,{...v,cta:e.jsxs(e.Fragment,{children:[e.jsx(j,{variant:"h4",sx:{mx:2,textAlign:"center",fontWeight:"bold",color:"warning.main"},children:p("login.accessLimit.title")}),e.jsx(j,{variant:"body1",sx:{maxWidth:620,mt:2,mx:2,textAlign:"center",color:"gray"},children:p("login.accessLimit.description")}),e.jsx(d,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:1,mt:5},children:s==null?void 0:s.map(a=>{const u=I(a);return u?e.jsx(V,{title:p("login.accessLimit.buyPassport"),arrow:!0,placement:"top",children:e.jsx(B,{color:"primary",variant:"contained",endIcon:e.jsx(_e,{}),href:u,target:"_blank",children:a.title||a.name})},a.name):e.jsx(V,{title:p("login.connectWithPassport"),arrow:!0,placement:"top",children:e.jsx(B,{color:"inherit",variant:"contained",onClick:r,children:a.title||a.name})},a.name)})}),e.jsxs(j,{variant:"body1",sx:{mt:2,color:"grey.400"},children:[e.jsx(d,{component:"span",sx:{display:"inline-block",mr:1},children:p("login.accessLimit.alreadyHavePassport")}),e.jsx(d,{component:"span",sx:{textDecoration:"underline",cursor:"pointer",color:"primary.main"},onClick:r,children:p("common.connect")})]})]})})]})}U.propTypes={passports:c.arrayOf(c.shape({name:c.string.isRequired,title:c.string,payable:c.string})),onConnect:c.func,onClose:c.func,redirect:c.string.isRequired};U.defaultProps={passports:[],onConnect:()=>{},onClose:()=>{}};function Ke(){const s=$.useRef(null),{session:r}=Ce(),{t:o,locale:g}=J(),{getPassportId:v}=ke(),p=ae(),x=pe(),I=fe(),{encryptKey:a,decrypt:u}=ue(),{searchParams:t}=new URL(window.location.href),m={passportId:v()},D=t.get("componentId"),N=t.get("authenticated"),G=t.get("sessionToken"),Y=t.get("refreshToken"),Z=t.get("requiredRoles"),f=t.get("redirect"),l=t.get("forceConnected"),w=t.get("sourceAppPid"),k=t.get("origin"),A=t.get("autoConnectWebview"),q=t.get("popup"),F=t.get("showQuickConnect");let h=t.get("inviter");if(!h&&f)try{h=(f.startsWith("http")?new URL(f):new URL(f,window.location.origin)).searchParams.get("inviter")}catch{}h=h||localStorage.getItem("inviter"),D&&(m.componentId=D),x&&(m.visitorId=x),h&&(m.inviter=h),ge(w)||(w==="null"?m.sourceAppPid=null:w!==null&&(m.sourceAppPid=w));let H=[];try{H=JSON.parse(Z)}catch{}const ee=async n=>{const i=t.get("fromWallet");n&&String(i)==="1"&&I.wallet&&await Promise.any([ve.asyncCall("arcSetToken",n),Re(3e3)])},C=n=>t.get("encrypted")?u(n):n,K=async n=>{await ee(n),setTimeout(()=>{if(f){const i=decodeURIComponent(f);i.startsWith(_.WELLKNOWN_SERVICE_PATH_PREFIX)?p(i,{replace:!0}):window.location.replace(X(i))}else window.location.replace(window.env.pathPrefix||"/")},50)},Q=async(n,i)=>{const y=i(n.sessionToken),T=i(n.refreshToken),P=i(n.visitorId);Te(y),be(T),n.visitorId&&Pe(P);const b={connected_did:t.get("connected_did"),connected_pk:t.get("connected_pk"),connected_app:t.get("connected_app"),connected_wallet_os:t.get("connected_wallet_os")};je(b,!0),await r.refresh(),K({sessionToken:y,refreshToken:T,visitorId:P})},ne=se(()=>k==="switch-did"?l&&typeof l=="string"?{title:o("login.switchSpecifiedDid.title"),scan:o("login.switchSpecifiedDid.scan",{did:l}),confirm:o("login.switchSpecifiedDid.confirm"),success:o("login.switchSpecifiedDid.success")}:{title:o("login.switchDid.title"),scan:o("login.switchDid.scan"),confirm:o("login.switchDid.confirm"),success:o("login.switchDid.success")}:{title:o("login.connect.title"),scan:o("login.connect.scan"),confirm:o("login.connect.confirm"),success:o("login.connect.success")},[l,k,o]),M=re(()=>{const n=window==null?void 0:window.blocklet,i={className:"connect",popup:!1,action:"login",passkeyBehavior:"both",onSuccess:Q,onError:te,locale:g,messages:ne,extraParams:m,baseUrl:window.location.origin,prefix:W(window.location.origin,_.WELLKNOWN_SERVICE_PATH_PREFIX,he)};l&&(i.forceConnected=l,i.extraParams.enableSwitchApp=!1,i.extraParams.forceConnected=l),i.options||(i.options={}),k==="switch-did"?i.options.showQuickConnect=!0:L(F)||([!1,"false"].includes(F)?i.options.showQuickConnect=!1:i.options.showQuickConnect=!0);const y=xe(),P=we()?y.appUrl:window.location.origin,b=W(P,_.WELLKNOWN_SERVICE_PATH_PREFIX,"connect"),R={params:ye(encodeURIComponent(JSON.stringify(i))),appPid:n==null?void 0:n.appPid,appName:n==null?void 0:n.appName,locale:g,redirect:window.location.href,_ek_:a};L(A)||(R.autoConnectWebview=A),L(q)||(R.popup=q),window.location.href=X(Ie(b,R),{allowDomains:null})});ce(()=>{if(t.get("sessionToken")){const n=t.get("visitorId");if(!n){z.error("Unexpected login response from server: visitorId is required");return}Q({sessionToken:C(G),refreshToken:C(Y),visitorId:C(n)},i=>i)}else!r.user||l&&r.user.did!==l?M():!N&&!t.get("sessionToken")&&K()});const te=n=>{z.error(n.message)},oe=t.has("popup");if(r.loading||r.user){if(!N||t.get("sessionToken"))return e.jsxs(e.Fragment,{children:[e.jsx(O,{children:e.jsx("title",{children:o("pageTitle.login")})}),e.jsx(me,{children:oe?null:e.jsx(ie,{})})]});const n=f?new URL(f,window.location.origin).href:window.location.href;return e.jsx(U,{onConnect:M,passports:H,redirect:n})}return e.jsxs(e.Fragment,{children:[e.jsx(O,{children:e.jsx("title",{children:o("pageTitle.login")})}),e.jsx(d,{sx:{"box-sizing":"border-box",width:"100%",height:"100vh",position:"relative",display:"flex","flex-direction":"column",".connect":{background:"#fafafa"}},ref:s})]})}export{Ke as default};
@@ -1 +1 @@
1
- import{j as s,aE as m,a3 as r,T as u,ad as x,x as p}from"./vendor-mui-core-BlX2BJoA.js";import{k as f,w as h,y as j}from"./vendor-hooks-CLzfFpO7.js";import{u as g}from"./vendor-react-D-afvo_7.js";import{d as y,a6 as w,a7 as C,a8 as v,g as L}from"./vendor-arcblock-CZGLzU01.js";import{j as M}from"./vendor-utils-DCpRgzMR.js";const A="authorization_response",E=v();function D(){const{t:e}=L(),[t]=g(),a=()=>{window.close()};return j(()=>{const i=t.get("state"),c=t.get("code"),n={type:A,response:{code:c}};if(window.opener)try{const o=new URL(i);window.opener.postMessage(n,o.origin),setTimeout(()=>{window.close()},2e3)}catch(o){console.error("Invalid login caller",o)}}),s.jsx(x,{severity:"success",children:s.jsxs(r,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",gap:1},children:[e("login.needManualClose"),s.jsx(r,{sx:{textAlign:"center"},children:s.jsx(p,{variant:"outlined",size:"small",onClick:a,children:e("login.closeWindow")})})]})})}function U(){var l;const{blocklet:e}=window,[t]=g(),a=t.get("error"),i=t.get("error_description"),c=t.get("state"),n=f({errorMesage:"",loading:!0});h(async()=>{if(a)n.errorMesage=i,n.loading=!1;else try{const d=new URL(c);(await E.federated.getTrustedDomains()).includes(d.host)||(n.errorMesage="Invalid login caller")}catch{n.errorMesage="Invalid login caller"}finally{n.loading=!1}},[a,i,c]);const o=M(y.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?imageFilter=convert&f=png&h=80&version=${((l=e==null?void 0:e.meta)==null?void 0:l.version)||""}`);return s.jsx(m,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",justifyContent:"center",alignContent:"center"},children:s.jsxs(r,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",margin:"auto",paddingBottom:{sx:0,md:15}},children:[s.jsxs(r,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:.5},children:[s.jsx(r,{component:"img",src:o,alt:`${(e==null?void 0:e.appName)||"site"} logo`,sx:{width:80}}),s.jsx(u,{variant:"h6",component:"p",children:e==null?void 0:e.appName})]}),n.loading?n.errorMesage?s.jsx(w,{error:{message:n.errorMesage}}):s.jsx(D,{}):null,s.jsx(C,{sx:{mt:4}})]})})}export{U as default};
1
+ import{j as s,aE as m,a3 as r,T as u,ad as x,x as p}from"./vendor-mui-core-jh6OMVvU.js";import{k as f,w as h,y as j}from"./vendor-hooks-CLzfFpO7.js";import{u as g}from"./vendor-react-D-afvo_7.js";import{d as y,a6 as w,a7 as C,a8 as v,g as L}from"./vendor-arcblock-BlPSuvWz.js";import{j as M}from"./vendor-utils-DCpRgzMR.js";const A="authorization_response",E=v();function D(){const{t:e}=L(),[t]=g(),a=()=>{window.close()};return j(()=>{const i=t.get("state"),c=t.get("code"),n={type:A,response:{code:c}};if(window.opener)try{const o=new URL(i);window.opener.postMessage(n,o.origin),setTimeout(()=>{window.close()},2e3)}catch(o){console.error("Invalid login caller",o)}}),s.jsx(x,{severity:"success",children:s.jsxs(r,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",gap:1},children:[e("login.needManualClose"),s.jsx(r,{sx:{textAlign:"center"},children:s.jsx(p,{variant:"outlined",size:"small",onClick:a,children:e("login.closeWindow")})})]})})}function U(){var l;const{blocklet:e}=window,[t]=g(),a=t.get("error"),i=t.get("error_description"),c=t.get("state"),n=f({errorMesage:"",loading:!0});h(async()=>{if(a)n.errorMesage=i,n.loading=!1;else try{const d=new URL(c);(await E.federated.getTrustedDomains()).includes(d.host)||(n.errorMesage="Invalid login caller")}catch{n.errorMesage="Invalid login caller"}finally{n.loading=!1}},[a,i,c]);const o=M(y.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?imageFilter=convert&f=png&h=80&version=${((l=e==null?void 0:e.meta)==null?void 0:l.version)||""}`);return s.jsx(m,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",justifyContent:"center",alignContent:"center"},children:s.jsxs(r,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",margin:"auto",paddingBottom:{sx:0,md:15}},children:[s.jsxs(r,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:.5},children:[s.jsx(r,{component:"img",src:o,alt:`${(e==null?void 0:e.appName)||"site"} logo`,sx:{width:80}}),s.jsx(u,{variant:"h6",component:"p",children:e==null?void 0:e.appName})]}),n.loading?n.errorMesage?s.jsx(w,{error:{message:n.errorMesage}}):s.jsx(D,{}):null,s.jsx(C,{sx:{mt:4}})]})})}export{U as default};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CaHJ0Ch7.js","assets/vendor-arcblock-CZGLzU01.js","assets/vendor-react-D-afvo_7.js","assets/vendor-utils-DCpRgzMR.js","assets/vendor-hooks-CLzfFpO7.js","assets/vendor-mui-core-BlX2BJoA.js","assets/vendor-arcblock-DhgPdlEj.css","assets/index-BGO2DsWz.js","assets/index-BjauMU9c.js","assets/_createAggregator-DqBCPv73.js","assets/index-DoZ2YM4T.js","assets/toUpper-DFtRDHUH.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{aa as s,a3 as d,E as o,j as i}from"./vendor-mui-core-BlX2BJoA.js";import{_ as q}from"./index-BjauMU9c.js";import{r as u}from"./vendor-react-D-afvo_7.js";import{j}from"./vendor-utils-DCpRgzMR.js";import{g as z,bl as S}from"./vendor-arcblock-CZGLzU01.js";import{c as E}from"./index-DoZ2YM4T.js";const O=s.span`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B0QYqr2A.js","assets/vendor-arcblock-BlPSuvWz.js","assets/vendor-react-D-afvo_7.js","assets/vendor-utils-DCpRgzMR.js","assets/vendor-hooks-CLzfFpO7.js","assets/vendor-mui-core-jh6OMVvU.js","assets/vendor-arcblock-DhgPdlEj.css","assets/index-BGO2DsWz.js","assets/index-CYQoZJsb.js","assets/_createAggregator-D73d37er.js","assets/index-DoZ2YM4T.js","assets/toUpper-Ch8IcBS5.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
+ import{aa as s,a3 as d,E as o,j as i}from"./vendor-mui-core-jh6OMVvU.js";import{_ as q}from"./index-CYQoZJsb.js";import{r as u}from"./vendor-react-D-afvo_7.js";import{j}from"./vendor-utils-DCpRgzMR.js";import{g as z,bl as S}from"./vendor-arcblock-BlPSuvWz.js";import{c as E}from"./index-DoZ2YM4T.js";const O=s.span`
3
3
  color: ${e=>e.theme.palette.error.main};
4
4
  &::before {
5
5
  content: '*';
@@ -100,7 +100,7 @@ import{aa as s,a3 as d,E as o,j as i}from"./vendor-mui-core-BlX2BJoA.js";import{
100
100
  }
101
101
  }
102
102
  }
103
- `,_=u.lazy(()=>q(()=>import("./index-CaHJ0Ch7.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(e=>({default:e.Uploader}))),F="/blocklet/logo/upload";function f({url:e,height:c,width:m,enabled:l,allowSVG:h,type:t,did:a,prefix:g,headers:x,aspectRatio:p,minWidth:b,minHeight:w,onUploaded:v}){const{t:y}=z(),n=u.useRef(null),R=()=>{var r;(r=n.current)==null||r.open()},k=()=>{var r;v(),(r=n.current)==null||r.close()},P={cursor:l?"pointer":"default","&::after":{content:`"${y("common.switch")}"`}},$=["square","favicon"].includes(t);return i.jsxs(U,{id:`uploader-${a}-${t}`,children:[i.jsx(_,{ref:n,popup:!0,onUploadFinish:k,plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:j(g,F,t,a),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:h?["image/*","application/svg+xml"]:["image/*"],maxFileSize:1024*1024*1,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:p,initialAspectRatio:p,croppedCanvasOptions:{minWidth:b,minHeight:w}}},tusProps:{headers:x}}),i.jsx(d,{className:E("uploader-wrapper",l&&"enabled"),sx:P,onClick:R,children:i.jsx("img",{alt:t,src:e,style:{width:$?m:"auto",height:c}})})]},`uploader-${a}-${t}`)}f.propTypes={url:o.string.isRequired,type:o.oneOf(["square","rect","favicon","splash-portrait","splash-landscape","og-image"]).isRequired,did:o.string.isRequired,prefix:o.string.isRequired,headers:o.func,onUploaded:o.func,height:o.number,width:o.any,enabled:o.bool,allowSVG:o.bool,aspectRatio:o.number,minWidth:o.number,minHeight:o.number};f.defaultProps={height:80,width:"auto",enabled:!0,allowSVG:!0,headers:()=>({}),onUploaded:S,aspectRatio:1,minWidth:120,minHeight:120};const U=s.div`
103
+ `,_=u.lazy(()=>q(()=>import("./index-B0QYqr2A.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(e=>({default:e.Uploader}))),F="/blocklet/logo/upload";function f({url:e,height:c,width:m,enabled:l,allowSVG:h,type:t,did:a,prefix:g,headers:x,aspectRatio:p,minWidth:b,minHeight:w,onUploaded:v}){const{t:y}=z(),n=u.useRef(null),R=()=>{var r;(r=n.current)==null||r.open()},k=()=>{var r;v(),(r=n.current)==null||r.close()},P={cursor:l?"pointer":"default","&::after":{content:`"${y("common.switch")}"`}},$=["square","favicon"].includes(t);return i.jsxs(U,{id:`uploader-${a}-${t}`,children:[i.jsx(_,{ref:n,popup:!0,onUploadFinish:k,plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:j(g,F,t,a),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:h?["image/*","application/svg+xml"]:["image/*"],maxFileSize:1024*1024*1,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:p,initialAspectRatio:p,croppedCanvasOptions:{minWidth:b,minHeight:w}}},tusProps:{headers:x}}),i.jsx(d,{className:E("uploader-wrapper",l&&"enabled"),sx:P,onClick:R,children:i.jsx("img",{alt:t,src:e,style:{width:$?m:"auto",height:c}})})]},`uploader-${a}-${t}`)}f.propTypes={url:o.string.isRequired,type:o.oneOf(["square","rect","favicon","splash-portrait","splash-landscape","og-image"]).isRequired,did:o.string.isRequired,prefix:o.string.isRequired,headers:o.func,onUploaded:o.func,height:o.number,width:o.any,enabled:o.bool,allowSVG:o.bool,aspectRatio:o.number,minWidth:o.number,minHeight:o.number};f.defaultProps={height:80,width:"auto",enabled:!0,allowSVG:!0,headers:()=>({}),onUploaded:S,aspectRatio:1,minWidth:120,minHeight:120};const U=s.div`
104
104
  .uploader-wrapper {
105
105
  display: inline-flex;
106
106
  position: relative;
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DVYdq7IA.js","assets/vendor-react-D-afvo_7.js"])))=>i.map(i=>d[i]);
2
- import{a1 as F,j as t,aa as W,E as v,t as H,a3 as d,aM as X,T as I,bt as B,bu as q,bv as G,aE as O}from"./vendor-mui-core-BlX2BJoA.js";import{i as _,_ as V,S as J,c as Q,s as K,a as Y}from"./index-BjauMU9c.js";import{r as u,L as Z}from"./vendor-react-D-afvo_7.js";import{d as ee}from"./CheckCircle-D3sLlO8U.js";import{d as te}from"./ViewList-BUKDlFq_.js";import{ad as se,ae,af as oe,W as ne,ab as $,ag as M,ah as re,ac as ie,g as ce,P as le}from"./vendor-arcblock-CZGLzU01.js";import{d as pe}from"./Done-zh2eXk8O.js";import{k as de,H as ue}from"./vendor-hooks-CLzfFpO7.js";import{W as me}from"./did-address-vWQGhW6L.js";import{w as he}from"./wrap-locale-B1cP4AVb.js";import{u as fe}from"./use-passport-id-B-b-_oYF.js";import{g as xe}from"./get-safe-url-BuiowS2J.js";import"./vendor-utils-DCpRgzMR.js";var S={},ge=F;Object.defineProperty(S,"__esModule",{value:!0});var E=S.default=void 0,ve=ge(se()),be=t;E=S.default=(0,ve.default)((0,be.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function k({list:s,width:c,height:m,cardSpace:l,onSelect:r,defaultIndex:h}){const[b,f]=u.useState(0),[a,x]=u.useState(0),w=u.useRef(null),g=n=>{if(n<0||n>s.length-1)return;f(n);const i=w.current.clientWidth;x(n*(c+l)-(i-c)/2+l*.5),r(n)};u.useEffect(()=>{g(h);const n=i=>i.preventDefault();w.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const j=n=>{o=n.touches[0].clientX},y=n=>{const i=n.changedTouches[0],P=o-i.clientX;Math.abs(P)>60&&(P>0?g(b+1):g(b-1))};return t.jsx(we,{ref:w,onTouchStart:j,onTouchEnd:y,children:t.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:s.map((n,i)=>t.jsx("div",{className:`card-item ${i===b?"selected":""}`,style:{width:c,height:m,margin:l/2},onClick:()=>g(i),children:n.display?t.jsx("div",{className:"card-content",children:t.jsx(ae,{data:n.display,style:{width:"100%",height:"100%"}})}):t.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const we=W.div`
2
+ import{a1 as F,j as t,aa as W,E as v,t as H,a3 as d,aM as X,T as I,bt as B,bu as q,bv as G,aE as O}from"./vendor-mui-core-jh6OMVvU.js";import{i as _,_ as V,S as J,c as Q,s as K,a as Y}from"./index-CYQoZJsb.js";import{r as u,L as Z}from"./vendor-react-D-afvo_7.js";import{d as ee}from"./CheckCircle-61kAAbS7.js";import{d as te}from"./ViewList-COpI8i9D.js";import{ad as se,ae,af as oe,W as ne,ab as $,ag as M,ah as re,ac as ie,g as ce,P as le}from"./vendor-arcblock-BlPSuvWz.js";import{d as pe}from"./Done-DBzH2QOU.js";import{k as de,H as ue}from"./vendor-hooks-CLzfFpO7.js";import{W as me}from"./did-address-DsOFwsmU.js";import{w as he}from"./wrap-locale-Df7FBKhT.js";import{u as fe}from"./use-passport-id-B-b-_oYF.js";import{g as xe}from"./get-safe-url-CUm2E-jn.js";import"./vendor-utils-DCpRgzMR.js";var S={},ge=F;Object.defineProperty(S,"__esModule",{value:!0});var E=S.default=void 0,ve=ge(se()),be=t;E=S.default=(0,ve.default)((0,be.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function k({list:s,width:c,height:m,cardSpace:l,onSelect:r,defaultIndex:h}){const[b,f]=u.useState(0),[a,x]=u.useState(0),w=u.useRef(null),g=n=>{if(n<0||n>s.length-1)return;f(n);const i=w.current.clientWidth;x(n*(c+l)-(i-c)/2+l*.5),r(n)};u.useEffect(()=>{g(h);const n=i=>i.preventDefault();w.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const j=n=>{o=n.touches[0].clientX},y=n=>{const i=n.changedTouches[0],P=o-i.clientX;Math.abs(P)>60&&(P>0?g(b+1):g(b-1))};return t.jsx(we,{ref:w,onTouchStart:j,onTouchEnd:y,children:t.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:s.map((n,i)=>t.jsx("div",{className:`card-item ${i===b?"selected":""}`,style:{width:c,height:m,margin:l/2},onClick:()=>g(i),children:n.display?t.jsx("div",{className:"card-content",children:t.jsx(ae,{data:n.display,style:{width:"100%",height:"100%"}})}):t.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const we=W.div`
3
3
  overflow: hidden;
4
4
  mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
5
5
  overflow: hidden;
@@ -1 +1 @@
1
- import{j as c}from"./vendor-mui-core-BlX2BJoA.js";import{r as t}from"./vendor-react-D-afvo_7.js";import{g as i}from"./get-safe-url-Ddj-Tmsl.js";import"./vendor-arcblock-CZGLzU01.js";import"./vendor-utils-DCpRgzMR.js";import"./vendor-hooks-CLzfFpO7.js";function g(){const e=t.useRef(null),n=t.useRef(Date.now());return t.useEffect(()=>{const r=`open-window-url-${new URLSearchParams(window.location.search).get("key")}`;return e.current=setInterval(()=>{if(Date.now()-n.current>10*1e3){localStorage.removeItem(r),clearInterval(e.current);return}const o=localStorage.getItem(r);if(o)try{const{url:a,time:s}=JSON.parse(o);localStorage.removeItem(r),Date.now()-s<10*1e3&&(window.location.href=i(a,{allowDomains:null}))}catch{}},200),()=>clearInterval(e.current)},[]),c.jsx("div",{})}export{g as default};
1
+ import{j as c}from"./vendor-mui-core-jh6OMVvU.js";import{r as t}from"./vendor-react-D-afvo_7.js";import{g as i}from"./get-safe-url-Bg-eYJFz.js";import"./vendor-arcblock-BlPSuvWz.js";import"./vendor-utils-DCpRgzMR.js";import"./vendor-hooks-CLzfFpO7.js";function g(){const e=t.useRef(null),n=t.useRef(Date.now());return t.useEffect(()=>{const r=`open-window-url-${new URLSearchParams(window.location.search).get("key")}`;return e.current=setInterval(()=>{if(Date.now()-n.current>10*1e3){localStorage.removeItem(r),clearInterval(e.current);return}const o=localStorage.getItem(r);if(o)try{const{url:a,time:s}=JSON.parse(o);localStorage.removeItem(r),Date.now()-s<10*1e3&&(window.location.href=i(a,{allowDomains:null}))}catch{}},200),()=>clearInterval(e.current)},[]),c.jsx("div",{})}export{g as default};
@@ -1,4 +1,4 @@
1
- import{j as o,a3 as k,a4 as D,aa as b,T as A}from"./vendor-mui-core-BlX2BJoA.js";import{r as S}from"./vendor-react-D-afvo_7.js";import{g as T,bH as B,ag as C,b2 as g,aq as L}from"./vendor-arcblock-CZGLzU01.js";import{K as N}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{I as P}from"./index-DFJvHEx_.js";import{y as q,B as E,f as Q,I as R,v as K,m as W}from"./index-BjauMU9c.js";import{W as r}from"./did-address-vWQGhW6L.js";import{B as _}from"./dashboard-z7zVrYGA.js";import{a as H}from"./domain-list-D8GpnsIy.js";import"./vendor-utils-DCpRgzMR.js";import"./vendor-hooks-CLzfFpO7.js";import"./useLocalStorage-Bby1iRzv.js";import"./confirm-BHRsp-P-.js";import"./format-error-C0Ke3VXF.js";import"./PlayArrow-Du9tHm7-.js";import"./get-safe-url-BuiowS2J.js";import"./index-CoELNYm2.js";import"./session-DZl-cVQ_.js";import"./useAsyncRetry-KXMle3o0.js";import"./useAsync-cdOzMWPw.js";import"./useSetState-Crt4S51m.js";import"./Add-C6s-Vnmg.js";import"./base32-C41aFfgE.js";import"./LockIcon-DQtUl5vk.js";import"./CheckCircle-D3sLlO8U.js";import"./util-BZGCzHyk.js";import"./permission-BGRlqVt3.js";import"./InfoOutlined-phoVf4hW.js";import"./api-C0C4sDJA.js";import"./actions-B2A8ao0K.js";import"./MoreHoriz-CUgH0jV-.js";const z={width:24,height:24,body:'<path fill="currentColor" d="m12 10.8l-3.9 3.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L12 10.8Z"/>'},O=z,$={arcblock:"ArcBlock",ethereum:"Ethereum"};function F(){var u,h,x,f,v;const{t,locale:j}=T(),{info:c,inService:w}=q(),[a,y]=S.useState(!1),{blocklet:e}=E(),{appDid:l,appPid:m,migratedFrom:s=[]}=e,p=(u=e.environments.find(n=>n.key==="BLOCKLET_APP_CHAIN_TYPE"))==null?void 0:u.value,d=[l?{name:t("blocklet.appId"),value:o.jsx(r,{did:l,showQrcode:!0})}:null,m&&l!==m?{name:o.jsxs(k,{sx:{display:"flex",alignItems:"center",gap:1},children:[t("blocklet.appPid"),o.jsx(D,{title:t("blocklet.whyNeedAppPid"),style:{cursor:"help",fontSize:16},children:o.jsx(B,{})})]}),value:o.jsx(r,{did:m,showQrcode:!0})}:null,(s==null?void 0:s.length)>1?{name:t("blocklet.alsoKnownAs"),value:o.jsxs("div",{children:[(a?s.slice(1):s.slice(1,2)).map(n=>o.jsx(r,{did:n.appDid,showQrcode:!0})),s.length>2&&o.jsx(C,{style:{marginLeft:"18px"},endIcon:a?o.jsx(g,{icon:O}):o.jsx(g,{icon:N}),onClick:()=>y(!a),children:t(a?"common.collapseAll":"blocklet.router.showAllDIDs")})]})}:null,{name:t("common.name"),value:Q.getDisplayName(e,!0)},{name:t("common.status"),value:o.jsx(_,{status:e.status,source:e.source,progress:e.progress})},R(e)?{name:"NFT",value:o.jsx(r,{external:!0,href:K((h=e==null?void 0:e.controller)==null?void 0:h.chainHost,(x=e==null?void 0:e.controller)==null?void 0:x.nftId,"asset"),did:(f=e==null?void 0:e.controller)==null?void 0:f.nftId,showQrcode:!0})}:null,{name:t("blocklet.installedAt"),value:W(e.installedAt,j)},{name:t("common.owner"),value:(v=e.settings)!=null&&v.owner?o.jsx(r,{did:e.settings.owner.did,showQrcode:!0}):"-"},{name:t("blocklet.config.walletType.name"),value:$[p||"arcblock"]||p},e.externalSkSource?{name:t("blocklet.skSource"),value:e.externalSkSource}:null].filter(Boolean);w&&d.push({name:t("common.serverDid"),value:o.jsx(r,{did:c.did,showQrcode:!0})},{name:t("common.serverVersion"),value:o.jsx(L,{children:c.version})});const I=n=>n.map(i=>o.jsx(P,{style:{display:"flex",alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:i.name,nameFormatter:()=>i.name,children:i.value},i.name));return o.jsxs(U,{component:"div",children:[o.jsx(H,{}),o.jsx("div",{className:"title",children:o.jsx("span",{children:t("common.basicInfo")})}),o.jsx("div",{className:"basicInfo",children:I(d)})]})}F.propTypes={};const U=b(A)`
1
+ import{j as o,a3 as k,a4 as D,aa as b,T as A}from"./vendor-mui-core-jh6OMVvU.js";import{r as S}from"./vendor-react-D-afvo_7.js";import{g as T,bH as B,ag as C,b2 as g,aq as L}from"./vendor-arcblock-BlPSuvWz.js";import{K as N}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{I as P}from"./index-JFhSGIs6.js";import{y as q,B as E,f as Q,I as R,v as K,m as W}from"./index-CYQoZJsb.js";import{W as r}from"./did-address-DsOFwsmU.js";import{B as _}from"./dashboard-CPxg5LvZ.js";import{a as H}from"./domain-list-D4Clgh5O.js";import"./vendor-utils-DCpRgzMR.js";import"./vendor-hooks-CLzfFpO7.js";import"./useLocalStorage-CM8R1gkX.js";import"./confirm-Cx-IVcgq.js";import"./format-error-C0Ke3VXF.js";import"./PlayArrow-BQPL8ZKx.js";import"./get-safe-url-CUm2E-jn.js";import"./index-iqfmQPLo.js";import"./session-Ku4cwX2M.js";import"./useAsyncRetry-ng-QDeMG.js";import"./useAsync-cdOzMWPw.js";import"./useSetState-Crt4S51m.js";import"./Add-DA06or_T.js";import"./base32-BJ0zdvwj.js";import"./LockIcon-CJS2b0V1.js";import"./CheckCircle-61kAAbS7.js";import"./util-D7vfOed5.js";import"./permission-BwvfjqYI.js";import"./InfoOutlined-CB0cJwBU.js";import"./api-C0C4sDJA.js";import"./actions-DDDMPf_w.js";import"./MoreHoriz-jR1hvlRv.js";const z={width:24,height:24,body:'<path fill="currentColor" d="m12 10.8l-3.9 3.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L12 10.8Z"/>'},O=z,$={arcblock:"ArcBlock",ethereum:"Ethereum"};function F(){var u,h,x,f,v;const{t,locale:j}=T(),{info:c,inService:w}=q(),[a,y]=S.useState(!1),{blocklet:e}=E(),{appDid:l,appPid:m,migratedFrom:s=[]}=e,p=(u=e.environments.find(n=>n.key==="BLOCKLET_APP_CHAIN_TYPE"))==null?void 0:u.value,d=[l?{name:t("blocklet.appId"),value:o.jsx(r,{did:l,showQrcode:!0})}:null,m&&l!==m?{name:o.jsxs(k,{sx:{display:"flex",alignItems:"center",gap:1},children:[t("blocklet.appPid"),o.jsx(D,{title:t("blocklet.whyNeedAppPid"),style:{cursor:"help",fontSize:16},children:o.jsx(B,{})})]}),value:o.jsx(r,{did:m,showQrcode:!0})}:null,(s==null?void 0:s.length)>1?{name:t("blocklet.alsoKnownAs"),value:o.jsxs("div",{children:[(a?s.slice(1):s.slice(1,2)).map(n=>o.jsx(r,{did:n.appDid,showQrcode:!0})),s.length>2&&o.jsx(C,{style:{marginLeft:"18px"},endIcon:a?o.jsx(g,{icon:O}):o.jsx(g,{icon:N}),onClick:()=>y(!a),children:t(a?"common.collapseAll":"blocklet.router.showAllDIDs")})]})}:null,{name:t("common.name"),value:Q.getDisplayName(e,!0)},{name:t("common.status"),value:o.jsx(_,{status:e.status,source:e.source,progress:e.progress})},R(e)?{name:"NFT",value:o.jsx(r,{external:!0,href:K((h=e==null?void 0:e.controller)==null?void 0:h.chainHost,(x=e==null?void 0:e.controller)==null?void 0:x.nftId,"asset"),did:(f=e==null?void 0:e.controller)==null?void 0:f.nftId,showQrcode:!0})}:null,{name:t("blocklet.installedAt"),value:W(e.installedAt,j)},{name:t("common.owner"),value:(v=e.settings)!=null&&v.owner?o.jsx(r,{did:e.settings.owner.did,showQrcode:!0}):"-"},{name:t("blocklet.config.walletType.name"),value:$[p||"arcblock"]||p},e.externalSkSource?{name:t("blocklet.skSource"),value:e.externalSkSource}:null].filter(Boolean);w&&d.push({name:t("common.serverDid"),value:o.jsx(r,{did:c.did,showQrcode:!0})},{name:t("common.serverVersion"),value:o.jsx(L,{children:c.version})});const I=n=>n.map(i=>o.jsx(P,{style:{display:"flex",alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:i.name,nameFormatter:()=>i.name,children:i.value},i.name));return o.jsxs(U,{component:"div",children:[o.jsx(H,{}),o.jsx("div",{className:"title",children:o.jsx("span",{children:t("common.basicInfo")})}),o.jsx("div",{className:"basicInfo",children:I(d)})]})}F.propTypes={};const U=b(A)`
2
2
  .title {
3
3
  font-size: 1.2rem;
4
4
  font-weight: bold;
@@ -1,4 +1,4 @@
1
- import{a1 as p,j as o,aa as c,E as t}from"./vendor-mui-core-BlX2BJoA.js";import{ad as u}from"./vendor-arcblock-CZGLzU01.js";var r={},d=p;Object.defineProperty(r,"__esModule",{value:!0});var i=r.default=void 0,f=d(u()),x=o;i=r.default=(0,f.default)((0,x.jsx)("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}),"ArrowBackIos");function s({title:e,subTitle:n,onClickBack:a,...l}){return o.jsxs(m,{...l,children:[a&&o.jsx(i,{className:"back-btn",onClick:a}),o.jsx("div",{className:"title",children:e}),o.jsx("div",{className:"sub-title",children:n})]})}const m=c.div`
1
+ import{a1 as p,j as o,aa as c,E as t}from"./vendor-mui-core-jh6OMVvU.js";import{ad as u}from"./vendor-arcblock-BlPSuvWz.js";var r={},d=p;Object.defineProperty(r,"__esModule",{value:!0});var i=r.default=void 0,f=d(u()),x=o;i=r.default=(0,f.default)((0,x.jsx)("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}),"ArrowBackIos");function s({title:e,subTitle:n,onClickBack:a,...l}){return o.jsxs(m,{...l,children:[a&&o.jsx(i,{className:"back-btn",onClick:a}),o.jsx("div",{className:"title",children:e}),o.jsx("div",{className:"sub-title",children:n})]})}const m=c.div`
2
2
  position: relative;
3
3
  width: 100%;
4
4
  text-align: center;
@@ -1 +1 @@
1
- import{E as n,j as p}from"./vendor-mui-core-BlX2BJoA.js";import{u as m}from"./session-DZl-cVQ_.js";function u({permission:i,role:t,component:s,children:o}){const{session:r}=m();let e=!0;const f=[].concat(i).filter(Boolean),l=[].concat(t).filter(Boolean);if(f.length){const c=r.user&&r.user.permissions||[];e=f.some(a=>c.includes(a))}return e&&l.length&&(e=l.includes(r.user.role)),typeof s=="function"?s(e):typeof o=="function"?o(e):e&&(s||o)||null}function d(i,t,s){return function(r){return p.jsx(u,{permission:t,role:s,children:e=>p.jsx(i,{...r,hasPermission:e})})}}u.propTypes={permission:n.oneOfType([n.string,n.arrayOf(n.string)]),role:n.oneOfType([n.string,n.arrayOf(n.string)]),component:n.oneOfType([n.func,n.node]),children:n.oneOfType([n.func,n.node])};u.defaultProps={permission:"",role:"",component:null,children:null};export{u as P,d as w};
1
+ import{E as n,j as p}from"./vendor-mui-core-jh6OMVvU.js";import{u as m}from"./session-Ku4cwX2M.js";function u({permission:i,role:t,component:s,children:o}){const{session:r}=m();let e=!0;const f=[].concat(i).filter(Boolean),l=[].concat(t).filter(Boolean);if(f.length){const c=r.user&&r.user.permissions||[];e=f.some(a=>c.includes(a))}return e&&l.length&&(e=l.includes(r.user.role)),typeof s=="function"?s(e):typeof o=="function"?o(e):e&&(s||o)||null}function d(i,t,s){return function(r){return p.jsx(u,{permission:t,role:s,children:e=>p.jsx(i,{...r,hasPermission:e})})}}u.propTypes={permission:n.oneOfType([n.string,n.arrayOf(n.string)]),role:n.oneOfType([n.string,n.arrayOf(n.string)]),component:n.oneOfType([n.func,n.node]),children:n.oneOfType([n.func,n.node])};u.defaultProps={permission:"",role:"",component:null,children:null};export{u as P,d as w};
@@ -1 +1 @@
1
- import{j as o}from"./vendor-mui-core-BlX2BJoA.js";import{j as e}from"./vendor-utils-DCpRgzMR.js";import{I as s}from"./iframe-ITMZuuxP.js";import{d as t}from"./vendor-arcblock-CZGLzU01.js";import{S as n}from"./studio-ClCPyH_R.js";import"./vendor-react-D-afvo_7.js";import"./vendor-hooks-CLzfFpO7.js";function l(){const r=new URLSearchParams;r.set("title","Preference Builder"),r.set("schemaKey",e(window.location.origin,t.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/studio/preferences"));const i=`${e(window.location.origin,t.WELLKNOWN_SERVICE_PATH_PREFIX,"/hosted/form-builder/")}?${r.toString()}`;return o.jsx(n,{children:o.jsx(s,{url:i,width:"100%",height:"100%",frameBorder:0,styles:{border:0}})})}export{l as default};
1
+ import{j as o}from"./vendor-mui-core-jh6OMVvU.js";import{j as e}from"./vendor-utils-DCpRgzMR.js";import{I as s}from"./iframe-CVBJbqTp.js";import{d as t}from"./vendor-arcblock-BlPSuvWz.js";import{S as n}from"./studio-C8ceaGGk.js";import"./vendor-react-D-afvo_7.js";import"./vendor-hooks-CLzfFpO7.js";function l(){const r=new URLSearchParams;r.set("title","Preference Builder"),r.set("schemaKey",e(window.location.origin,t.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/studio/preferences"));const i=`${e(window.location.origin,t.WELLKNOWN_SERVICE_PATH_PREFIX,"/hosted/form-builder/")}?${r.toString()}`;return o.jsx(n,{children:o.jsx(s,{url:i,width:"100%",height:"100%",frameBorder:0,styles:{border:0}})})}export{l as default};
@@ -0,0 +1 @@
1
+ import{t as n,j as i,a3 as l}from"./vendor-mui-core-jh6OMVvU.js";import{l as d,r as c}from"./vendor-react-D-afvo_7.js";import{g as u,al as h}from"./vendor-arcblock-BlPSuvWz.js";import g from"./index-BP4o1Jjj.js";import"./vendor-utils-DCpRgzMR.js";import"./vendor-hooks-CLzfFpO7.js";import"./index-CYQoZJsb.js";import"./Add-DA06or_T.js";import"./Error-BRj42iX7.js";import"./confirm-Cx-IVcgq.js";import"./format-error-C0Ke3VXF.js";import"./session-Ku4cwX2M.js";import"./did-address-DsOFwsmU.js";import"./react-beautiful-dnd.esm-DZo8yE8C.js";import"./raf-schd.esm-Cxhj8umC.js";import"./bundle-avatar-vdPLynfx.js";import"./shorten-label-B08EnqgB.js";import"./Download-CufGBMcn.js";import"./QuestionMarkCircle-yIKrKrCO.js";import"./useSetState-Crt4S51m.js";import"./index-DoZ2YM4T.js";import"./index-DvtOujRp.js";import"./index-Dl6rjJDp.js";import"./api-C0C4sDJA.js";import"./ChevronRight-C9Sf_Tx7.js";import"./vendor-mui-x-BRRfPRl8.js";import"./DeleteOutline-CUlVP0SU.js";import"./item-BG6Y4B38.js";import"./Launch-DhDcxyle.js";import"./Done-DBzH2QOU.js";import"./click-to-copy-CmMy3CrF.js";import"./get-safe-url-CUm2E-jn.js";import"./ArrowDropDown-ByvmY1fG.js";import"./index-CzV3SmGK.js";import"./index-DwFu84UU.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function _(){const{t:p}=u(),{componentDid:o}=d(),a=n(t=>t.breakpoints.down("md")),m=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:a?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:m,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{b as N,r as S,d as na,c as aa}from"./vendor-react-D-afvo_7.js";import{j as ct,a3 as ia,a2 as oa,E as la,c as er,_ as w,bm as dt,a9 as $t}from"./vendor-mui-core-BlX2BJoA.js";import{aY as pt,aZ as ua,a_ as sa,a$ as ca}from"./vendor-arcblock-CZGLzU01.js";import{u as x,a as A,w as rr,g as zt,r as Ae,e as jt,c as da,b as pa,d as ce,o as Tr}from"./raf-schd.esm-Cxhj8umC.js";function Yt({size:e,...r}){return ct.jsx(ia,{display:"flex",mt:4,...r,children:ct.jsx(oa,{size:e})})}Yt.propTypes={size:la.number};Yt.defaultProps={size:24};var Kt=N.createContext(null);function va(e){e()}var Jt=va,fa=function(r){return Jt=r},ga=function(){return Jt};function ma(){var e=ga(),r=null,t=null;return{clear:function(){r=null,t=null},notify:function(){e(function(){for(var i=r;i;)i.callback(),i=i.next})},get:function(){for(var i=[],a=r;a;)i.push(a),a=a.next;return i},subscribe:function(i){var a=!0,o=t={callback:i,next:null,prev:t};return o.prev?o.prev.next=o:r=o,function(){!a||r===null||(a=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:r=o.next)}}}}var vt={notify:function(){},get:function(){return[]}};function Xt(e,r){var t,n=vt;function i(u){return c(),n.subscribe(u)}function a(){n.notify()}function o(){p.onStateChange&&p.onStateChange()}function l(){return!!t}function c(){t||(t=r?r.addNestedSub(o):e.subscribe(o),n=ma())}function d(){t&&(t(),t=void 0,n.clear(),n=vt)}var p={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:o,isSubscribed:l,trySubscribe:c,tryUnsubscribe:d,getListeners:function(){return n}};return p}var Zt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?S.useLayoutEffect:S.useEffect;function ba(e){var r=e.store,t=e.context,n=e.children,i=S.useMemo(function(){var l=Xt(r);return{store:r,subscription:l}},[r]),a=S.useMemo(function(){return r.getState()},[r]);Zt(function(){var l=i.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),a!==r.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[i,a]);var o=t||Kt;return N.createElement(o.Provider,{value:i},n)}var Qt={exports:{}},O={};/** @license React v17.0.2
1
+ import{b as N,r as S,d as na,c as aa}from"./vendor-react-D-afvo_7.js";import{j as ct,a3 as ia,a2 as oa,E as la,c as er,_ as w,bj as dt,a9 as $t}from"./vendor-mui-core-jh6OMVvU.js";import{aY as pt,aZ as ua,a_ as sa,a$ as ca}from"./vendor-arcblock-BlPSuvWz.js";import{u as x,a as A,w as rr,g as zt,r as Ae,e as jt,c as da,b as pa,d as ce,o as Tr}from"./raf-schd.esm-Cxhj8umC.js";function Yt({size:e,...r}){return ct.jsx(ia,{display:"flex",mt:4,...r,children:ct.jsx(oa,{size:e})})}Yt.propTypes={size:la.number};Yt.defaultProps={size:24};var Kt=N.createContext(null);function va(e){e()}var Jt=va,fa=function(r){return Jt=r},ga=function(){return Jt};function ma(){var e=ga(),r=null,t=null;return{clear:function(){r=null,t=null},notify:function(){e(function(){for(var i=r;i;)i.callback(),i=i.next})},get:function(){for(var i=[],a=r;a;)i.push(a),a=a.next;return i},subscribe:function(i){var a=!0,o=t={callback:i,next:null,prev:t};return o.prev?o.prev.next=o:r=o,function(){!a||r===null||(a=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:r=o.next)}}}}var vt={notify:function(){},get:function(){return[]}};function Xt(e,r){var t,n=vt;function i(u){return c(),n.subscribe(u)}function a(){n.notify()}function o(){p.onStateChange&&p.onStateChange()}function l(){return!!t}function c(){t||(t=r?r.addNestedSub(o):e.subscribe(o),n=ma())}function d(){t&&(t(),t=void 0,n.clear(),n=vt)}var p={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:o,isSubscribed:l,trySubscribe:c,tryUnsubscribe:d,getListeners:function(){return n}};return p}var Zt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?S.useLayoutEffect:S.useEffect;function ba(e){var r=e.store,t=e.context,n=e.children,i=S.useMemo(function(){var l=Xt(r);return{store:r,subscription:l}},[r]),a=S.useMemo(function(){return r.getState()},[r]);Zt(function(){var l=i.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),a!==r.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[i,a]);var o=t||Kt;return N.createElement(o.Provider,{value:i},n)}var Qt={exports:{}},O={};/** @license React v17.0.2
2
2
  * react-is.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1 +1 @@
1
- import{r as d}from"./vendor-react-D-afvo_7.js";import{E as u,j as o,a4 as T}from"./vendor-mui-core-BlX2BJoA.js";import{p as h}from"./index-CoELNYm2.js";import{g as w}from"./vendor-arcblock-CZGLzU01.js";import{m as x,F as g}from"./index-BjauMU9c.js";function y({value:e,shouldUpdate:l=!1,...c}){const{t:i,locale:a}=w(),[I,v]=d.useState(1e3);if(d.useEffect(()=>{let t;if(l){const j=new Date(e).getTime(),p=Date.now(),f=Math.abs(Math.floor((j-p)/1e3)),s=()=>{v(p)};f<60?t=setInterval(s,1e3):f<60*60?t=setInterval(s,6e4):t=setInterval(s,36e5)}return()=>{clearInterval(t)}},[e,I,l]),!e)return"-";const m={locale:g(a),compact:!0},n=new Date(e).getTime(),r=Date.now();if(n>r){const t=h(n-r,m);return o.jsx(T,{title:x(e,a),placement:"top-end",enterTouchDelay:0,children:o.jsx("span",{...c,children:i("common.afterTime",{time:t})})})}const D=h(r-n,m);return o.jsx(T,{title:x(e,a),placement:"top-end",enterTouchDelay:0,children:o.jsx("span",{...c,children:i("common.timeAgo",{time:D})})})}y.propTypes={value:u.any,shouldUpdate:u.bool};y.defaultProps={value:"",shouldUpdate:!1};export{y as R};
1
+ import{r as d}from"./vendor-react-D-afvo_7.js";import{E as u,j as o,a4 as T}from"./vendor-mui-core-jh6OMVvU.js";import{p as h}from"./index-iqfmQPLo.js";import{g as w}from"./vendor-arcblock-BlPSuvWz.js";import{m as x,F as g}from"./index-CYQoZJsb.js";function y({value:e,shouldUpdate:l=!1,...c}){const{t:i,locale:a}=w(),[I,v]=d.useState(1e3);if(d.useEffect(()=>{let t;if(l){const j=new Date(e).getTime(),p=Date.now(),f=Math.abs(Math.floor((j-p)/1e3)),s=()=>{v(p)};f<60?t=setInterval(s,1e3):f<60*60?t=setInterval(s,6e4):t=setInterval(s,36e5)}return()=>{clearInterval(t)}},[e,I,l]),!e)return"-";const m={locale:g(a),compact:!0},n=new Date(e).getTime(),r=Date.now();if(n>r){const t=h(n-r,m);return o.jsx(T,{title:x(e,a),placement:"top-end",enterTouchDelay:0,children:o.jsx("span",{...c,children:i("common.afterTime",{time:t})})})}const D=h(r-n,m);return o.jsx(T,{title:x(e,a),placement:"top-end",enterTouchDelay:0,children:o.jsx("span",{...c,children:i("common.timeAgo",{time:D})})})}y.propTypes={value:u.any,shouldUpdate:u.bool};y.defaultProps={value:"",shouldUpdate:!1};export{y as R};
@@ -0,0 +1 @@
1
+ import{aL as o}from"./vendor-arcblock-BlPSuvWz.js";const e=new o;export{e as b};
@@ -1 +1 @@
1
- import{r as o}from"./vendor-react-D-afvo_7.js";import{aV as t}from"./vendor-arcblock-CZGLzU01.js";function r(){return o.useContext(t)}export{r as u};
1
+ import{r as o}from"./vendor-react-D-afvo_7.js";import{aV as t}from"./vendor-arcblock-BlPSuvWz.js";function r(){return o.useContext(t)}export{r as u};
@@ -1,10 +1,10 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-FahpyiOI.js","assets/vendor-mui-core-BlX2BJoA.js","assets/vendor-react-D-afvo_7.js","assets/vendor-utils-DCpRgzMR.js","assets/useAsync-cdOzMWPw.js","assets/vendor-hooks-CLzfFpO7.js","assets/vendor-arcblock-CZGLzU01.js","assets/vendor-arcblock-DhgPdlEj.css","assets/index-BjauMU9c.js","assets/config-DkAoqJrm.js","assets/index-CYcmGLzu.js","assets/Done-zh2eXk8O.js","assets/Google-thaEal7z.js","assets/logo-uploader-kxXncDgy.js","assets/index-DoZ2YM4T.js","assets/page-header-7_k_ugJy.js","assets/layout-CIMojpa6.js","assets/content-layout-CK_AzZZ-.js","assets/step-actions-BJ6wYLRD.js","assets/button-pEMdQ6vg.js","assets/index-CJxgi_0G.js","assets/config-space-CVzrNiJs.js","assets/api-C0C4sDJA.js","assets/connect-to-DgFj0KxA.js","assets/DeleteOutline-BkfiCnRt.js","assets/format-error-C0Ke3VXF.js","assets/domain-mBK5lWF5.js","assets/domain-list-D8GpnsIy.js","assets/Add-C6s-Vnmg.js","assets/base32-C41aFfgE.js","assets/LockIcon-DQtUl5vk.js","assets/CheckCircle-D3sLlO8U.js","assets/util-BZGCzHyk.js","assets/useSetState-Crt4S51m.js","assets/permission-BGRlqVt3.js","assets/session-DZl-cVQ_.js","assets/useAsyncRetry-KXMle3o0.js","assets/confirm-BHRsp-P-.js","assets/InfoOutlined-phoVf4hW.js","assets/index-DFJvHEx_.js","assets/actions-B2A8ao0K.js","assets/MoreHoriz-CUgH0jV-.js","assets/access-control-CQEVUKlf.js","assets/config-CJbAebUi.js","assets/fuel-Czk5ukUs.js","assets/Launch-B3dFrLjr.js","assets/did-address-vWQGhW6L.js","assets/complete-BkbfIahT.js","assets/launch-result-message-zXOcVqEr.js","assets/get-safe-url-Ddj-Tmsl.js"])))=>i.map(i=>d[i]);
2
- import{o as X,u as J,p as A,q as Y,r as ee,P as D,N as te,f as se,S as oe,_ as m,h as j}from"./index-BjauMU9c.js";import{j as e,aa as M,t as re,e as ne,bs as ae,a3 as ie,a2 as le,br as ce}from"./vendor-mui-core-BlX2BJoA.js";import{r as u,u as pe,k as ue,h as de,i as f,j as fe}from"./vendor-react-D-afvo_7.js";import{j as a}from"./vendor-utils-DCpRgzMR.js";import{g as me,a3 as Le,d as T,aj as he,ak as _e}from"./vendor-arcblock-CZGLzU01.js";import{C as ye}from"./config-space-CVzrNiJs.js";import{H as xe}from"./addon-BQKNb4Py.js";import{d as Ce}from"./ServerLogo-UNPlRpuM.js";import{g as je}from"./get-safe-url-Ddj-Tmsl.js";import"./vendor-hooks-CLzfFpO7.js";import"./api-C0C4sDJA.js";import"./QuestionMarkCircle-gL_QM35Z.js";var E={};Object.defineProperty(E,"__esModule",{value:!0});var N=E.default=void 0;ge(u);var c=e;function ge(t){return t&&t.__esModule?t:{default:t}}function $(t,o){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);o&&(r=r.filter(function(C){return Object.getOwnPropertyDescriptor(t,C).enumerable})),s.push.apply(s,r)}return s}function B(t){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?arguments[o]:{};o%2?$(Object(s),!0).forEach(function(r){Ee(t,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):$(Object(s)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(s,r))})}return t}function Ee(t,o,s){return(o=ve(o))in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s,t}function ve(t){var o=Pe(t,"string");return typeof o=="symbol"?o:o+""}function Pe(t,o){if(typeof t!="object"||!t)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var r=s.call(t,o||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}var v=function(o){return(0,c.jsxs)("svg",B(B({},o),{},{children:[(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z",fill:"url(#paint0_linear_615_426)"}),(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z",fill:"url(#paint1_linear_615_426)"}),(0,c.jsxs)("defs",{children:[(0,c.jsxs)("linearGradient",{id:"paint0_linear_615_426",x1:"31.72",y1:"95.7208",x2:"95.488",y2:"34.3249",gradientUnits:"userSpaceOnUse",children:[(0,c.jsx)("stop",{stopColor:"#0FA4B7"}),(0,c.jsx)("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),(0,c.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,c.jsxs)("linearGradient",{id:"paint1_linear_615_426",x1:"28.4374",y1:"99.2464",x2:"98.7613",y2:"44.9372",gradientUnits:"userSpaceOnUse",children:[(0,c.jsx)("stop",{stopColor:"#0FA4B7"}),(0,c.jsx)("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),(0,c.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};v.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"};v.displayName="server-logo-notext";N=E.default=v;const we=M.span`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-B6MpXaBD.js","assets/vendor-mui-core-jh6OMVvU.js","assets/vendor-react-D-afvo_7.js","assets/vendor-utils-DCpRgzMR.js","assets/useAsync-cdOzMWPw.js","assets/vendor-hooks-CLzfFpO7.js","assets/vendor-arcblock-BlPSuvWz.js","assets/vendor-arcblock-DhgPdlEj.css","assets/index-CYQoZJsb.js","assets/config-DmjSKN24.js","assets/index-BtxzZ9SO.js","assets/Done-DBzH2QOU.js","assets/Google-C9fXfahB.js","assets/logo-uploader-B7OF9E82.js","assets/index-DoZ2YM4T.js","assets/page-header-PFRlhj0j.js","assets/layout-mYIHD_Mg.js","assets/content-layout-DAGIv17a.js","assets/step-actions-ChI-f31y.js","assets/button-bqdvVuzW.js","assets/index-COiVRnOM.js","assets/config-space-DmPh1bZ_.js","assets/api-C0C4sDJA.js","assets/connect-to-DYBaYeJc.js","assets/DeleteOutline-CUlVP0SU.js","assets/format-error-C0Ke3VXF.js","assets/domain-CZsQei8I.js","assets/domain-list-D4Clgh5O.js","assets/Add-DA06or_T.js","assets/base32-BJ0zdvwj.js","assets/LockIcon-CJS2b0V1.js","assets/CheckCircle-61kAAbS7.js","assets/util-D7vfOed5.js","assets/useSetState-Crt4S51m.js","assets/permission-BwvfjqYI.js","assets/session-Ku4cwX2M.js","assets/useAsyncRetry-ng-QDeMG.js","assets/confirm-Cx-IVcgq.js","assets/InfoOutlined-CB0cJwBU.js","assets/index-JFhSGIs6.js","assets/actions-DDDMPf_w.js","assets/MoreHoriz-jR1hvlRv.js","assets/access-control-CyOr5O9b.js","assets/config-CJbVE0vv.js","assets/fuel-DQb6QtRb.js","assets/Launch-DhDcxyle.js","assets/did-address-DsOFwsmU.js","assets/complete-CS43JIHv.js","assets/launch-result-message-CeThGm85.js","assets/get-safe-url-Bg-eYJFz.js"])))=>i.map(i=>d[i]);
2
+ import{o as X,u as J,p as A,q as Y,r as ee,P as D,N as te,f as se,S as oe,_ as m,h as j}from"./index-CYQoZJsb.js";import{j as e,aa as M,t as re,e as ne,bs as ae,a3 as ie,a2 as le,bo as ce}from"./vendor-mui-core-jh6OMVvU.js";import{r as u,u as pe,k as ue,h as de,i as f,j as fe}from"./vendor-react-D-afvo_7.js";import{j as a}from"./vendor-utils-DCpRgzMR.js";import{g as me,a3 as Le,d as T,aj as he,ak as _e}from"./vendor-arcblock-BlPSuvWz.js";import{C as ye}from"./config-space-DmPh1bZ_.js";import{H as xe}from"./addon-DRWTut9y.js";import{d as Ce}from"./ServerLogo-BtnYTJe2.js";import{g as je}from"./get-safe-url-Bg-eYJFz.js";import"./vendor-hooks-CLzfFpO7.js";import"./api-C0C4sDJA.js";import"./QuestionMarkCircle-yIKrKrCO.js";var E={};Object.defineProperty(E,"__esModule",{value:!0});var N=E.default=void 0;ge(u);var c=e;function ge(t){return t&&t.__esModule?t:{default:t}}function $(t,o){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);o&&(r=r.filter(function(C){return Object.getOwnPropertyDescriptor(t,C).enumerable})),s.push.apply(s,r)}return s}function B(t){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?arguments[o]:{};o%2?$(Object(s),!0).forEach(function(r){Ee(t,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):$(Object(s)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(s,r))})}return t}function Ee(t,o,s){return(o=ve(o))in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s,t}function ve(t){var o=Pe(t,"string");return typeof o=="symbol"?o:o+""}function Pe(t,o){if(typeof t!="object"||!t)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var r=s.call(t,o||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}var v=function(o){return(0,c.jsxs)("svg",B(B({},o),{},{children:[(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z",fill:"url(#paint0_linear_615_426)"}),(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z",fill:"url(#paint1_linear_615_426)"}),(0,c.jsxs)("defs",{children:[(0,c.jsxs)("linearGradient",{id:"paint0_linear_615_426",x1:"31.72",y1:"95.7208",x2:"95.488",y2:"34.3249",gradientUnits:"userSpaceOnUse",children:[(0,c.jsx)("stop",{stopColor:"#0FA4B7"}),(0,c.jsx)("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),(0,c.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,c.jsxs)("linearGradient",{id:"paint1_linear_615_426",x1:"28.4374",y1:"99.2464",x2:"98.7613",y2:"44.9372",gradientUnits:"userSpaceOnUse",children:[(0,c.jsx)("stop",{stopColor:"#0FA4B7"}),(0,c.jsx)("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),(0,c.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};v.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"};v.displayName="server-logo-notext";N=E.default=v;const we=M.span`
3
3
  color: ${t=>t.theme.palette.error.main};
4
4
  &::before {
5
5
  content: '*';
6
6
  }
7
- `,g=we,Se=u.lazy(()=>m(()=>import("./connect-FahpyiOI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),Oe=u.lazy(()=>m(()=>import("./config-DkAoqJrm.js"),__vite__mapDeps([9,1,2,3,6,5,7,10,11,12,8,13,14,15,16,17,18,19]))),Re=u.lazy(()=>m(()=>import("./index-CJxgi_0G.js"),__vite__mapDeps([20,1,2,6,3,5,7,15,8,21,22,23,24,25,18,16,17]))),be=u.lazy(()=>m(()=>import("./domain-mBK5lWF5.js"),__vite__mapDeps([26,1,2,8,6,3,5,7,27,28,29,30,31,32,33,34,35,36,4,37,25,38,22,39,40,41,15,19,16,17,18]))),ke=u.lazy(()=>m(()=>import("./access-control-CQEVUKlf.js"),__vite__mapDeps([42,1,2,6,3,5,7,43,15,8,16,17,18,19]))),Ie=u.lazy(()=>m(()=>import("./fuel-Czk5ukUs.js"),__vite__mapDeps([44,1,2,3,45,6,5,7,46,15,8,16,17,18,19]))),Ve=u.lazy(()=>m(()=>import("./complete-BkbfIahT.js"),__vite__mapDeps([47,1,2,6,3,5,7,8,48,49,19,16,17])));function qe(){var k,I,V;const t=re(i=>i.breakpoints.down("md")),o=ne(),{t:s,locale:r}=me(),[C,U]=pe(),y=ue(),{meta:L,blocklet:p,actions:d,loading:F}=X(),H=localStorage.getItem("blocklet-server-url"),{session:P}=J(),Z=A("fromLauncher"),w=A("visitorId");w&&(Le(w),C.delete("visitorId"),U(C)),u.useEffect(()=>{Y(),P.user&&(d==null||d.refreshMeta(),d==null||d.refreshBlocklet({showError:!1}))},[P.user]),u.useEffect(()=>{d.refreshFuel({showError:!1})},[(k=p==null?void 0:p.meta)==null?void 0:k.did]);const n=`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/setup`,z=i=>{var x;const l=(x=i==null?void 0:i.capabilities)==null?void 0:x.didSpace;return l?l===j.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||l===j.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP?{key:"did-space",name:e.jsxs(e.Fragment,{children:[s("setup.steps.didSpace")," ",e.jsx(g,{})]}),path:a(n,"did-space")}:l===j.BLOCKLET_APP_SPACE_REQUIREMENT.OPTIONAL?{key:"did-space",name:e.jsx(e.Fragment,{children:s("setup.steps.didSpace")}),path:a(n,"did-space")}:(console.warn(`capabilities.didSpace cannot take the value ${l}`),null):null},h=[{key:"access",name:s("setup.steps.access"),path:a(n,"access")},{key:"domain",name:s("setup.steps.domain"),path:a(n,"domain")},z(p),{key:"config",name:e.jsxs(e.Fragment,{children:[s("setup.steps.config")," ",ee(L)&&e.jsx(g,{})]}),path:a(n,"config")},(V=(I=L==null?void 0:L.requirements)==null?void 0:I.fuels)!=null&&V.length?{key:"fuel",name:e.jsxs(e.Fragment,{children:[s("setup.steps.fuel")," ",e.jsx(g,{})]}),path:a(n,"fuel")}:null].filter(Boolean),S=h.findIndex(i=>`${D.replace(/\/$/,"")}${n}/${i.key}`===window.location.pathname),K=a(D,T.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?v=${p==null?void 0:p.updatedAt}`),Q=async i=>{const{search:l}=new URL(window.location.href);if(!i)h[S+1]?y(`${a(n,h[S+1].key)}${l}`):y(`${a(n,"complete")}${l}`);else{const x=h.findIndex(G=>G.key===i);x>-1?y(`${a(n,h[x].key)}${l}`):y(`${a(n,"complete")}${l}`)}await d.refreshBlocklet()},q=()=>{y(-1)};function _(i,l){return e.jsxs(Se,{children:[!p&&e.jsx(ie,{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(le,{})}),p&&e.jsx(i,{blocklet:p,...l,onNext:Q,onPrevious:q})]})}const O=()=>{window.open(je(H,{allowDomains:null}))},W=t?e.jsx(N,{onClick:O,width:"32",height:"32",style:{cursor:"pointer"}}):e.jsx(Ce,{onClick:O,width:"128",height:"48",style:{marginTop:-1,cursor:"pointer"}}),R=[{key:"install",name:s("launchBlocklet.steps.installApp"),path:a(n,"install")},{key:"setup",name:s("setup.steps.launchApp"),children:h}];let b=[{key:"agreement",name:s("launchBlocklet.introduction"),path:a(n,"agreement")},...R];return Z&&(b=[{key:"purchase-space",name:s("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:s("launchBlocklet.steps.prepareSpace")},...R]),e.jsx(he,{steps:b,children:e.jsx(te,{children:e.jsxs(ye,{children:[e.jsx(ae,{styles:Ae}),e.jsx(De,{locale:r,loading:F,blockletMeta:{...L,title:se.getDisplayName({...p,meta:L})},navLogo:W,pcWidth:"80%",style:{height:"100%"},logoUrl:K,useOfSkeleton:!1,headerEndAddons:e.jsx(xe,{SessionContext:oe,sessionManagerProps:{disableLogout:!0}}),theme:o,launchingText:s("setup.title"),children:e.jsxs(de,{children:[e.jsx(f,{path:"access",element:_(ke)}),e.jsx(f,{path:"domain",element:_(be)}),e.jsx(f,{path:"did-space",element:_(Re)}),e.jsx(f,{path:"config",element:_(Oe)}),e.jsx(f,{path:"fuel",element:_(Ie)}),e.jsx(f,{path:"complete",element:_(Ve)}),e.jsx(f,{path:"*",element:e.jsx(fe,{to:`access${window.location.search}`,replace:!0})})]})})]})})})}const Ae=ce`
7
+ `,g=we,Se=u.lazy(()=>m(()=>import("./connect-B6MpXaBD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),Oe=u.lazy(()=>m(()=>import("./config-DmjSKN24.js"),__vite__mapDeps([9,1,2,3,6,5,7,10,11,12,8,13,14,15,16,17,18,19]))),Re=u.lazy(()=>m(()=>import("./index-COiVRnOM.js"),__vite__mapDeps([20,1,2,6,3,5,7,15,8,21,22,23,24,25,18,16,17]))),be=u.lazy(()=>m(()=>import("./domain-CZsQei8I.js"),__vite__mapDeps([26,1,2,8,6,3,5,7,27,28,29,30,31,32,33,34,35,36,4,37,25,38,22,39,40,41,15,19,16,17,18]))),ke=u.lazy(()=>m(()=>import("./access-control-CyOr5O9b.js"),__vite__mapDeps([42,1,2,6,3,5,7,43,15,8,16,17,18,19]))),Ie=u.lazy(()=>m(()=>import("./fuel-DQb6QtRb.js"),__vite__mapDeps([44,1,2,3,45,6,5,7,46,15,8,16,17,18,19]))),Ve=u.lazy(()=>m(()=>import("./complete-CS43JIHv.js"),__vite__mapDeps([47,1,2,6,3,5,7,8,48,49,19,16,17])));function qe(){var k,I,V;const t=re(i=>i.breakpoints.down("md")),o=ne(),{t:s,locale:r}=me(),[C,U]=pe(),y=ue(),{meta:L,blocklet:p,actions:d,loading:F}=X(),H=localStorage.getItem("blocklet-server-url"),{session:P}=J(),Z=A("fromLauncher"),w=A("visitorId");w&&(Le(w),C.delete("visitorId"),U(C)),u.useEffect(()=>{Y(),P.user&&(d==null||d.refreshMeta(),d==null||d.refreshBlocklet({showError:!1}))},[P.user]),u.useEffect(()=>{d.refreshFuel({showError:!1})},[(k=p==null?void 0:p.meta)==null?void 0:k.did]);const n=`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/setup`,z=i=>{var x;const l=(x=i==null?void 0:i.capabilities)==null?void 0:x.didSpace;return l?l===j.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||l===j.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP?{key:"did-space",name:e.jsxs(e.Fragment,{children:[s("setup.steps.didSpace")," ",e.jsx(g,{})]}),path:a(n,"did-space")}:l===j.BLOCKLET_APP_SPACE_REQUIREMENT.OPTIONAL?{key:"did-space",name:e.jsx(e.Fragment,{children:s("setup.steps.didSpace")}),path:a(n,"did-space")}:(console.warn(`capabilities.didSpace cannot take the value ${l}`),null):null},h=[{key:"access",name:s("setup.steps.access"),path:a(n,"access")},{key:"domain",name:s("setup.steps.domain"),path:a(n,"domain")},z(p),{key:"config",name:e.jsxs(e.Fragment,{children:[s("setup.steps.config")," ",ee(L)&&e.jsx(g,{})]}),path:a(n,"config")},(V=(I=L==null?void 0:L.requirements)==null?void 0:I.fuels)!=null&&V.length?{key:"fuel",name:e.jsxs(e.Fragment,{children:[s("setup.steps.fuel")," ",e.jsx(g,{})]}),path:a(n,"fuel")}:null].filter(Boolean),S=h.findIndex(i=>`${D.replace(/\/$/,"")}${n}/${i.key}`===window.location.pathname),K=a(D,T.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?v=${p==null?void 0:p.updatedAt}`),Q=async i=>{const{search:l}=new URL(window.location.href);if(!i)h[S+1]?y(`${a(n,h[S+1].key)}${l}`):y(`${a(n,"complete")}${l}`);else{const x=h.findIndex(G=>G.key===i);x>-1?y(`${a(n,h[x].key)}${l}`):y(`${a(n,"complete")}${l}`)}await d.refreshBlocklet()},q=()=>{y(-1)};function _(i,l){return e.jsxs(Se,{children:[!p&&e.jsx(ie,{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(le,{})}),p&&e.jsx(i,{blocklet:p,...l,onNext:Q,onPrevious:q})]})}const O=()=>{window.open(je(H,{allowDomains:null}))},W=t?e.jsx(N,{onClick:O,width:"32",height:"32",style:{cursor:"pointer"}}):e.jsx(Ce,{onClick:O,width:"128",height:"48",style:{marginTop:-1,cursor:"pointer"}}),R=[{key:"install",name:s("launchBlocklet.steps.installApp"),path:a(n,"install")},{key:"setup",name:s("setup.steps.launchApp"),children:h}];let b=[{key:"agreement",name:s("launchBlocklet.introduction"),path:a(n,"agreement")},...R];return Z&&(b=[{key:"purchase-space",name:s("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:s("launchBlocklet.steps.prepareSpace")},...R]),e.jsx(he,{steps:b,children:e.jsx(te,{children:e.jsxs(ye,{children:[e.jsx(ae,{styles:Ae}),e.jsx(De,{locale:r,loading:F,blockletMeta:{...L,title:se.getDisplayName({...p,meta:L})},navLogo:W,pcWidth:"80%",style:{height:"100%"},logoUrl:K,useOfSkeleton:!1,headerEndAddons:e.jsx(xe,{SessionContext:oe,sessionManagerProps:{disableLogout:!0}}),theme:o,launchingText:s("setup.title"),children:e.jsxs(de,{children:[e.jsx(f,{path:"access",element:_(ke)}),e.jsx(f,{path:"domain",element:_(be)}),e.jsx(f,{path:"did-space",element:_(Re)}),e.jsx(f,{path:"config",element:_(Oe)}),e.jsx(f,{path:"fuel",element:_(Ie)}),e.jsx(f,{path:"complete",element:_(Ve)}),e.jsx(f,{path:"*",element:e.jsx(fe,{to:`access${window.location.search}`,replace:!0})})]})})]})})})}const Ae=ce`
8
8
  html,
9
9
  body,
10
10
  #app,
@@ -1 +1 @@
1
- import{j as n,T as t,a4 as a,E as i}from"./vendor-mui-core-BlX2BJoA.js";function s(e,o=10){return typeof e=="string"&&(e==null?void 0:e.length)>o?`${e.slice(0,o-1)}...${e.slice(-2)}`:e}function r({children:e,maxLength:o,sx:p,hiddenTip:u}){return(e==null?void 0:e.length)<=o?n.jsx(t,{sx:p,children:e}):u?n.jsx(t,{sx:p,children:s(e,o)}):n.jsx(a,{title:e,placement:"top",children:n.jsx(t,{sx:p,children:s(e,o)})})}r.propTypes={children:i.string.isRequired,maxLength:i.number,sx:i.object,hiddenTip:i.bool};r.defaultProps={maxLength:10,sx:null,hiddenTip:!1};export{r as S};
1
+ import{j as n,T as t,a4 as a,E as i}from"./vendor-mui-core-jh6OMVvU.js";function s(e,o=10){return typeof e=="string"&&(e==null?void 0:e.length)>o?`${e.slice(0,o-1)}...${e.slice(-2)}`:e}function r({children:e,maxLength:o,sx:p,hiddenTip:u}){return(e==null?void 0:e.length)<=o?n.jsx(t,{sx:p,children:e}):u?n.jsx(t,{sx:p,children:s(e,o)}):n.jsx(a,{title:e,placement:"top",children:n.jsx(t,{sx:p,children:s(e,o)})})}r.propTypes={children:i.string.isRequired,maxLength:i.number,sx:i.object,hiddenTip:i.bool};r.defaultProps={maxLength:10,sx:null,hiddenTip:!1};export{r as S};
@@ -1 +1 @@
1
- import{b as F}from"./vendor-react-D-afvo_7.js";import{E as re,j as P,bE as Ir,bF as Br,aP as Nr,bH as Pr,a3 as nr,A as Wr,T as Le,al as Ue,bq as qr,bM as Hr}from"./vendor-mui-core-BlX2BJoA.js";var ve=e=>e.type==="checkbox",ce=e=>e instanceof Date,H=e=>e==null;const hr=e=>typeof e=="object";var U=e=>!H(e)&&!Array.isArray(e)&&hr(e)&&!ce(e),vr=e=>U(e)&&e.target?ve(e.target)?e.target.checked:e.target.value:e,$r=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,br=(e,s)=>e.has($r(s)),zr=e=>{const s=e.constructor&&e.constructor.prototype;return U(s)&&s.hasOwnProperty("isPrototypeOf")},Ge=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function j(e){let s;const r=Array.isArray(e);if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Ge&&(e instanceof Blob||e instanceof FileList))&&(r||U(e)))if(s=r?[]:{},!r&&!zr(e))s=e;else for(const i in e)e.hasOwnProperty(i)&&(s[i]=j(e[i]));else return e;return s}var be=e=>Array.isArray(e)?e.filter(Boolean):[],C=e=>e===void 0,c=(e,s,r)=>{if(!s||!U(e))return r;const i=be(s.split(/[,[\].]+?/)).reduce((l,u)=>H(l)?l:l[u],e);return C(i)||i===e?C(e[s])?r:e[s]:i},J=e=>typeof e=="boolean",Ye=e=>/^\w*$/.test(e),mr=e=>be(e.replace(/["|']|\]/g,"").split(/\.|\[/)),E=(e,s,r)=>{let i=-1;const l=Ye(s)?[s]:mr(s),u=l.length,y=u-1;for(;++i<u;){const g=l[i];let x=r;if(i!==y){const O=e[g];x=U(O)||Array.isArray(O)?O:isNaN(+l[i+1])?{}:[]}if(g==="__proto__")return;e[g]=x,e=e[g]}return e};const Ae={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Q={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"},Kr=F.createContext(null),De=()=>F.useContext(Kr);var xr=(e,s,r,i=!0)=>{const l={defaultValues:s._defaultValues};for(const u in e)Object.defineProperty(l,u,{get:()=>{const y=u;return s._proxyFormState[y]!==Q.all&&(s._proxyFormState[y]=!i||Q.all),r&&(r[y]=!0),e[y]}});return l},q=e=>U(e)&&!Object.keys(e).length,Fr=(e,s,r,i)=>{r(e);const{name:l,...u}=e;return q(u)||Object.keys(u).length>=Object.keys(s).length||Object.keys(u).find(y=>s[y]===(!i||Q.all))},K=e=>Array.isArray(e)?e:[e],Ar=(e,s,r)=>!e||!s||e===s||K(e).some(i=>i&&(r?i===s:i.startsWith(s)||s.startsWith(i)));function ke(e){const s=F.useRef(e);s.current=e,F.useEffect(()=>{const r=!e.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function Gr(e){const s=De(),{control:r=s.control,disabled:i,name:l,exact:u}=e||{},[y,g]=F.useState(r._formState),x=F.useRef(!0),O=F.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),m=F.useRef(l);return m.current=l,ke({disabled:i,next:v=>x.current&&Ar(m.current,v.name,u)&&Fr(v,O.current,r._updateFormState)&&g({...r._formState,...v}),subject:r._subjects.state}),F.useEffect(()=>(x.current=!0,O.current.isValid&&r._updateValid(!0),()=>{x.current=!1}),[r]),xr(y,r,O.current,!1)}var se=e=>typeof e=="string",Vr=(e,s,r,i,l)=>se(e)?(i&&s.watch.add(e),c(r,e,l)):Array.isArray(e)?e.map(u=>(i&&s.watch.add(u),c(r,u))):(i&&(s.watchAll=!0),r);function Yr(e){const s=De(),{control:r=s.control,name:i,defaultValue:l,disabled:u,exact:y}=e||{},g=F.useRef(i);g.current=i,ke({disabled:u,subject:r._subjects.values,next:m=>{Ar(g.current,m.name,y)&&O(j(Vr(g.current,r._names,m.values||r._formValues,!1,l)))}});const[x,O]=F.useState(r._getWatch(i,l));return F.useEffect(()=>r._removeUnmounted()),x}function Jr(e){const s=De(),{name:r,disabled:i,control:l=s.control,shouldUnregister:u}=e,y=br(l._names.array,r),g=Yr({control:l,name:r,defaultValue:c(l._formValues,r,c(l._defaultValues,r,e.defaultValue)),exact:!0}),x=Gr({control:l,name:r,exact:!0}),O=F.useRef(l.register(r,{...e.rules,value:g,...J(e.disabled)?{disabled:e.disabled}:{}}));return F.useEffect(()=>{const m=l._options.shouldUnregister||u,v=(S,$)=>{const w=c(l._fields,S);w&&w._f&&(w._f.mount=$)};if(v(r,!0),m){const S=j(c(l._options.defaultValues,r));E(l._defaultValues,r,S),C(c(l._formValues,r))&&E(l._formValues,r,S)}return()=>{(y?m&&!l._state.action:m)?l.unregister(r):v(r,!1)}},[r,l,y,u]),F.useEffect(()=>{c(l._fields,r)&&l._updateDisabledField({disabled:i,fields:l._fields,name:r,value:c(l._fields,r)._f.value})},[i,r,l]),{field:{name:r,value:g,...J(i)||x.disabled?{disabled:x.disabled||i}:{},onChange:F.useCallback(m=>O.current.onChange({target:{value:vr(m),name:r},type:Ae.CHANGE}),[r]),onBlur:F.useCallback(()=>O.current.onBlur({target:{value:c(l._formValues,r),name:r},type:Ae.BLUR}),[r,l]),ref:F.useCallback(m=>{const v=c(l._fields,r);v&&m&&(v._f.ref={focus:()=>m.focus(),select:()=>m.select(),setCustomValidity:S=>m.setCustomValidity(S),reportValidity:()=>m.reportValidity()})},[l._fields,r])},formState:x,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!c(x.errors,r)},isDirty:{enumerable:!0,get:()=>!!c(x.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!c(x.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!c(x.validatingFields,r)},error:{enumerable:!0,get:()=>c(x.errors,r)}})}}const _t=e=>e.render(Jr(e));var Qr=(e,s,r,i,l)=>s?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:l||!0}}:{},ue=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const r=(Math.random()*16+e)%16|0;return(s=="x"?r:r&3|8).toString(16)})},Re=(e,s,r={})=>r.shouldFocus||C(r.shouldFocus)?r.focusName||`${e}.${C(r.focusIndex)?s:r.focusIndex}.`:"",he=e=>({isOnSubmit:!e||e===Q.onSubmit,isOnBlur:e===Q.onBlur,isOnChange:e===Q.onChange,isOnAll:e===Q.all,isOnTouch:e===Q.onTouched}),ze=(e,s,r)=>!r&&(s.watchAll||s.watch.has(e)||[...s.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const fe=(e,s,r,i)=>{for(const l of r||Object.keys(e)){const u=c(e,l);if(u){const{_f:y,...g}=u;if(y){if(y.refs&&y.refs[0]&&s(y.refs[0],l)&&!i)return!0;if(y.ref&&s(y.ref,y.name)&&!i)return!0;if(fe(g,s))break}else if(U(g)&&fe(g,s))break}}};var pr=(e,s,r)=>{const i=K(c(e,r));return E(i,"root",s[r]),E(e,r,i),e},Je=e=>e.type==="file",ae=e=>typeof e=="function",Ve=e=>{if(!Ge)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},Fe=e=>se(e),Qe=e=>e.type==="radio",pe=e=>e instanceof RegExp;const or={value:!1,isValid:!1},cr={value:!0,isValid:!0};var Sr=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!C(e[0].attributes.value)?C(e[0].value)||e[0].value===""?cr:{value:e[0].value,isValid:!0}:cr:or}return or};const fr={isValid:!1,value:null};var wr=e=>Array.isArray(e)?e.reduce((s,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:s,fr):fr;function dr(e,s,r="validate"){if(Fe(e)||Array.isArray(e)&&e.every(Fe)||J(e)&&!e)return{type:r,message:Fe(e)?e:"",ref:s}}var oe=e=>U(e)&&!pe(e)?e:{value:e,message:""},Ke=async(e,s,r,i,l)=>{const{ref:u,refs:y,required:g,maxLength:x,minLength:O,min:m,max:v,pattern:S,validate:$,name:w,valueAsNumber:te,mount:B,disabled:z}=e._f,p=c(s,w);if(!B||z)return{};const X=y?y[0]:u,Z=V=>{i&&X.reportValidity&&(X.setCustomValidity(J(V)?"":V||""),X.reportValidity())},_={},b=Qe(u),A=ve(u),T=b||A,G=(te||Je(u))&&C(u.value)&&C(p)||Ve(u)&&u.value===""||p===""||Array.isArray(p)&&!p.length,W=Qr.bind(null,w,r,_),me=(V,D,R,N=ie.maxLength,ee=ie.minLength)=>{const Y=V?D:R;_[w]={type:V?N:ee,message:Y,ref:u,...W(V?N:ee,Y)}};if(l?!Array.isArray(p)||!p.length:g&&(!T&&(G||H(p))||J(p)&&!p||A&&!Sr(y).isValid||b&&!wr(y).isValid)){const{value:V,message:D}=Fe(g)?{value:!!g,message:g}:oe(g);if(V&&(_[w]={type:ie.required,message:D,ref:X,...W(ie.required,D)},!r))return Z(D),_}if(!G&&(!H(m)||!H(v))){let V,D;const R=oe(v),N=oe(m);if(!H(p)&&!isNaN(p)){const ee=u.valueAsNumber||p&&+p;H(R.value)||(V=ee>R.value),H(N.value)||(D=ee<N.value)}else{const ee=u.valueAsDate||new Date(p),Y=ge=>new Date(new Date().toDateString()+" "+ge),de=u.type=="time",ye=u.type=="week";se(R.value)&&p&&(V=de?Y(p)>Y(R.value):ye?p>R.value:ee>new Date(R.value)),se(N.value)&&p&&(D=de?Y(p)<Y(N.value):ye?p<N.value:ee<new Date(N.value))}if((V||D)&&(me(!!V,R.message,N.message,ie.max,ie.min),!r))return Z(_[w].message),_}if((x||O)&&!G&&(se(p)||l&&Array.isArray(p))){const V=oe(x),D=oe(O),R=!H(V.value)&&p.length>+V.value,N=!H(D.value)&&p.length<+D.value;if((R||N)&&(me(R,V.message,D.message),!r))return Z(_[w].message),_}if(S&&!G&&se(p)){const{value:V,message:D}=oe(S);if(pe(V)&&!p.match(V)&&(_[w]={type:ie.pattern,message:D,ref:u,...W(ie.pattern,D)},!r))return Z(D),_}if($){if(ae($)){const V=await $(p,s),D=dr(V,X);if(D&&(_[w]={...D,...W(ie.validate,D.message)},!r))return Z(D.message),_}else if(U($)){let V={};for(const D in $){if(!q(V)&&!r)break;const R=dr(await $[D](p,s),X,D);R&&(V={...R,...W(D,R.message)},Z(R.message),r&&(_[w]=V))}if(!q(V)&&(_[w]={ref:X,...V},!r))return _}}return Z(!0),_},je=(e,s)=>[...e,...K(s)],Me=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Ie(e,s,r){return[...e.slice(0,s),...K(r),...e.slice(s)]}var Be=(e,s,r)=>Array.isArray(e)?(C(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(s,1)[0]),e):[],Ne=(e,s)=>[...K(s),...K(e)];function Xr(e,s){let r=0;const i=[...e];for(const l of s)i.splice(l-r,1),r++;return be(i).length?i:[]}var Pe=(e,s)=>C(s)?[]:Xr(e,K(s).sort((r,i)=>r-i)),We=(e,s,r)=>{[e[s],e[r]]=[e[r],e[s]]};function Zr(e,s){const r=s.slice(0,-1).length;let i=0;for(;i<r;)e=C(e)?i++:e[s[i++]];return e}function et(e){for(const s in e)if(e.hasOwnProperty(s)&&!C(e[s]))return!1;return!0}function L(e,s){const r=Array.isArray(s)?s:Ye(s)?[s]:mr(s),i=r.length===1?e:Zr(e,r),l=r.length-1,u=r[l];return i&&delete i[u],l!==0&&(U(i)&&q(i)||Array.isArray(i)&&et(i))&&L(e,r.slice(0,-1)),e}var yr=(e,s,r)=>(e[s]=r,e);function ht(e){const s=De(),{control:r=s.control,name:i,keyName:l="id",shouldUnregister:u}=e,[y,g]=F.useState(r._getFieldArray(i)),x=F.useRef(r._getFieldArray(i).map(ue)),O=F.useRef(y),m=F.useRef(i),v=F.useRef(!1);m.current=i,O.current=y,r._names.array.add(i),e.rules&&r.register(i,e.rules),ke({next:({values:_,name:b})=>{if(b===m.current||!b){const A=c(_,m.current);Array.isArray(A)&&(g(A),x.current=A.map(ue))}},subject:r._subjects.array});const S=F.useCallback(_=>{v.current=!0,r._updateFieldArray(i,_)},[r,i]),$=(_,b)=>{const A=K(j(_)),T=je(r._getFieldArray(i),A);r._names.focus=Re(i,T.length-1,b),x.current=je(x.current,A.map(ue)),S(T),g(T),r._updateFieldArray(i,T,je,{argA:Me(_)})},w=(_,b)=>{const A=K(j(_)),T=Ne(r._getFieldArray(i),A);r._names.focus=Re(i,0,b),x.current=Ne(x.current,A.map(ue)),S(T),g(T),r._updateFieldArray(i,T,Ne,{argA:Me(_)})},te=_=>{const b=Pe(r._getFieldArray(i),_);x.current=Pe(x.current,_),S(b),g(b),r._updateFieldArray(i,b,Pe,{argA:_})},B=(_,b,A)=>{const T=K(j(b)),G=Ie(r._getFieldArray(i),_,T);r._names.focus=Re(i,_,A),x.current=Ie(x.current,_,T.map(ue)),S(G),g(G),r._updateFieldArray(i,G,Ie,{argA:_,argB:Me(b)})},z=(_,b)=>{const A=r._getFieldArray(i);We(A,_,b),We(x.current,_,b),S(A),g(A),r._updateFieldArray(i,A,We,{argA:_,argB:b},!1)},p=(_,b)=>{const A=r._getFieldArray(i);Be(A,_,b),Be(x.current,_,b),S(A),g(A),r._updateFieldArray(i,A,Be,{argA:_,argB:b},!1)},X=(_,b)=>{const A=j(b),T=yr(r._getFieldArray(i),_,A);x.current=[...T].map((G,W)=>!G||W===_?ue():x.current[W]),S(T),g([...T]),r._updateFieldArray(i,T,yr,{argA:_,argB:A},!0,!1)},Z=_=>{const b=K(j(_));x.current=b.map(ue),S([...b]),g([...b]),r._updateFieldArray(i,[...b],A=>A,{},!0,!1)};return F.useEffect(()=>{if(r._state.action=!1,ze(i,r._names)&&r._subjects.state.next({...r._formState}),v.current&&(!he(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([i]).then(_=>{const b=c(_.errors,i),A=c(r._formState.errors,i);(A?!b&&A.type||b&&(A.type!==b.type||A.message!==b.message):b&&b.type)&&(b?E(r._formState.errors,i,b):L(r._formState.errors,i),r._subjects.state.next({errors:r._formState.errors}))});else{const _=c(r._fields,i);_&&_._f&&!(he(r._options.reValidateMode).isOnSubmit&&he(r._options.mode).isOnSubmit)&&Ke(_,r._formValues,r._options.criteriaMode===Q.all,r._options.shouldUseNativeValidation,!0).then(b=>!q(b)&&r._subjects.state.next({errors:pr(r._formState.errors,b,i)}))}r._subjects.values.next({name:i,values:{...r._formValues}}),r._names.focus&&fe(r._fields,(_,b)=>{if(r._names.focus&&b.startsWith(r._names.focus)&&_.focus)return _.focus(),1}),r._names.focus="",r._updateValid(),v.current=!1},[y,i,r]),F.useEffect(()=>(!c(r._formValues,i)&&r._updateFieldArray(i),()=>{(r._options.shouldUnregister||u)&&r.unregister(i)}),[i,r,l,u]),{swap:F.useCallback(z,[S,i,r]),move:F.useCallback(p,[S,i,r]),prepend:F.useCallback(w,[S,i,r]),append:F.useCallback($,[S,i,r]),remove:F.useCallback(te,[S,i,r]),insert:F.useCallback(B,[S,i,r]),update:F.useCallback(X,[S,i,r]),replace:F.useCallback(Z,[S,i,r]),fields:F.useMemo(()=>y.map((_,b)=>({..._,[l]:x.current[b]||ue()})),[y,l])}}var qe=()=>{let e=[];return{get observers(){return e},next:l=>{for(const u of e)u.next&&u.next(l)},subscribe:l=>(e.push(l),{unsubscribe:()=>{e=e.filter(u=>u!==l)}}),unsubscribe:()=>{e=[]}}},Se=e=>H(e)||!hr(e);function le(e,s){if(Se(e)||Se(s))return e===s;if(ce(e)&&ce(s))return e.getTime()===s.getTime();const r=Object.keys(e),i=Object.keys(s);if(r.length!==i.length)return!1;for(const l of r){const u=e[l];if(!i.includes(l))return!1;if(l!=="ref"){const y=s[l];if(ce(u)&&ce(y)||U(u)&&U(y)||Array.isArray(u)&&Array.isArray(y)?!le(u,y):u!==y)return!1}}return!0}var Dr=e=>e.type==="select-multiple",rt=e=>Qe(e)||ve(e),He=e=>Ve(e)&&e.isConnected,kr=e=>{for(const s in e)if(ae(e[s]))return!0;return!1};function we(e,s={}){const r=Array.isArray(e);if(U(e)||r)for(const i in e)Array.isArray(e[i])||U(e[i])&&!kr(e[i])?(s[i]=Array.isArray(e[i])?[]:{},we(e[i],s[i])):H(e[i])||(s[i]=!0);return s}function Er(e,s,r){const i=Array.isArray(e);if(U(e)||i)for(const l in e)Array.isArray(e[l])||U(e[l])&&!kr(e[l])?C(s)||Se(r[l])?r[l]=Array.isArray(e[l])?we(e[l],[]):{...we(e[l])}:Er(e[l],H(s)?{}:s[l],r[l]):r[l]=!le(e[l],s[l]);return r}var xe=(e,s)=>Er(e,s,we(s)),Cr=(e,{valueAsNumber:s,valueAsDate:r,setValueAs:i})=>C(e)?e:s?e===""?NaN:e&&+e:r&&se(e)?new Date(e):i?i(e):e;function $e(e){const s=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):s.disabled))return Je(s)?s.files:Qe(s)?wr(e.refs).value:Dr(s)?[...s.selectedOptions].map(({value:r})=>r):ve(s)?Sr(e.refs).value:Cr(C(s.value)?e.ref.value:s.value,e)}var tt=(e,s,r,i)=>{const l={};for(const u of e){const y=c(s,u);y&&E(l,u,y._f)}return{criteriaMode:r,names:[...e],fields:l,shouldUseNativeValidation:i}},_e=e=>C(e)?e:pe(e)?e.source:U(e)?pe(e.value)?e.value.source:e.value:e;const gr="AsyncFunction";var st=e=>(!e||!e.validate)&&!!(ae(e.validate)&&e.validate.constructor.name===gr||U(e.validate)&&Object.values(e.validate).find(s=>s.constructor.name===gr)),it=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function _r(e,s,r){const i=c(e,r);if(i||Ye(r))return{error:i,name:r};const l=r.split(".");for(;l.length;){const u=l.join("."),y=c(s,u),g=c(e,u);if(y&&!Array.isArray(y)&&r!==u)return{name:r};if(g&&g.type)return{name:u,error:g};l.pop()}return{name:r}}var at=(e,s,r,i,l)=>l.isOnAll?!1:!r&&l.isOnTouch?!(s||e):(r?i.isOnBlur:l.isOnBlur)?!e:(r?i.isOnChange:l.isOnChange)?e:!0,ut=(e,s)=>!be(c(e,s)).length&&L(e,s);const lt={mode:Q.onSubmit,reValidateMode:Q.onChange,shouldFocusError:!0};function nt(e={}){let s={...lt,...e},r={submitCount:0,isDirty:!1,isLoading:ae(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},i={},l=U(s.defaultValues)||U(s.values)?j(s.defaultValues||s.values)||{}:{},u=s.shouldUnregister?{}:j(l),y={action:!1,mount:!1,watch:!1},g={mount:new Set,unMount:new Set,array:new Set,watch:new Set},x,O=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:qe(),array:qe(),state:qe()},S=he(s.mode),$=he(s.reValidateMode),w=s.criteriaMode===Q.all,te=t=>a=>{clearTimeout(O),O=setTimeout(t,a)},B=async t=>{if(m.isValid||t){const a=s.resolver?q((await T()).errors):await W(i,!0);a!==r.isValid&&v.state.next({isValid:a})}},z=(t,a)=>{(m.isValidating||m.validatingFields)&&((t||Array.from(g.mount)).forEach(n=>{n&&(a?E(r.validatingFields,n,a):L(r.validatingFields,n))}),v.state.next({validatingFields:r.validatingFields,isValidating:!q(r.validatingFields)}))},p=(t,a=[],n,d,f=!0,o=!0)=>{if(d&&n){if(y.action=!0,o&&Array.isArray(c(i,t))){const h=n(c(i,t),d.argA,d.argB);f&&E(i,t,h)}if(o&&Array.isArray(c(r.errors,t))){const h=n(c(r.errors,t),d.argA,d.argB);f&&E(r.errors,t,h),ut(r.errors,t)}if(m.touchedFields&&o&&Array.isArray(c(r.touchedFields,t))){const h=n(c(r.touchedFields,t),d.argA,d.argB);f&&E(r.touchedFields,t,h)}m.dirtyFields&&(r.dirtyFields=xe(l,u)),v.state.next({name:t,isDirty:V(t,a),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else E(u,t,a)},X=(t,a)=>{E(r.errors,t,a),v.state.next({errors:r.errors})},Z=t=>{r.errors=t,v.state.next({errors:r.errors,isValid:!1})},_=(t,a,n,d)=>{const f=c(i,t);if(f){const o=c(u,t,C(n)?c(l,t):n);C(o)||d&&d.defaultChecked||a?E(u,t,a?o:$e(f._f)):N(t,o),y.mount&&B()}},b=(t,a,n,d,f)=>{let o=!1,h=!1;const k={name:t},M=!!(c(i,t)&&c(i,t)._f&&c(i,t)._f.disabled);if(!n||d){m.isDirty&&(h=r.isDirty,r.isDirty=k.isDirty=V(),o=h!==k.isDirty);const I=M||le(c(l,t),a);h=!!(!M&&c(r.dirtyFields,t)),I||M?L(r.dirtyFields,t):E(r.dirtyFields,t,!0),k.dirtyFields=r.dirtyFields,o=o||m.dirtyFields&&h!==!I}if(n){const I=c(r.touchedFields,t);I||(E(r.touchedFields,t,n),k.touchedFields=r.touchedFields,o=o||m.touchedFields&&I!==n)}return o&&f&&v.state.next(k),o?k:{}},A=(t,a,n,d)=>{const f=c(r.errors,t),o=m.isValid&&J(a)&&r.isValid!==a;if(e.delayError&&n?(x=te(()=>X(t,n)),x(e.delayError)):(clearTimeout(O),x=null,n?E(r.errors,t,n):L(r.errors,t)),(n?!le(f,n):f)||!q(d)||o){const h={...d,...o&&J(a)?{isValid:a}:{},errors:r.errors,name:t};r={...r,...h},v.state.next(h)}},T=async t=>{z(t,!0);const a=await s.resolver(u,s.context,tt(t||g.mount,i,s.criteriaMode,s.shouldUseNativeValidation));return z(t),a},G=async t=>{const{errors:a}=await T(t);if(t)for(const n of t){const d=c(a,n);d?E(r.errors,n,d):L(r.errors,n)}else r.errors=a;return a},W=async(t,a,n={valid:!0})=>{for(const d in t){const f=t[d];if(f){const{_f:o,...h}=f;if(o){const k=g.array.has(o.name),M=f._f&&st(f._f);M&&m.validatingFields&&z([d],!0);const I=await Ke(f,u,w,s.shouldUseNativeValidation&&!a,k);if(M&&m.validatingFields&&z([d]),I[o.name]&&(n.valid=!1,a))break;!a&&(c(I,o.name)?k?pr(r.errors,I,o.name):E(r.errors,o.name,I[o.name]):L(r.errors,o.name))}!q(h)&&await W(h,a,n)}}return n.valid},me=()=>{for(const t of g.unMount){const a=c(i,t);a&&(a._f.refs?a._f.refs.every(n=>!He(n)):!He(a._f.ref))&&Ee(t)}g.unMount=new Set},V=(t,a)=>(t&&a&&E(u,t,a),!le(Xe(),l)),D=(t,a,n)=>Vr(t,g,{...y.mount?u:C(a)?l:se(t)?{[t]:a}:a},n,a),R=t=>be(c(y.mount?u:l,t,e.shouldUnregister?c(l,t,[]):[])),N=(t,a,n={})=>{const d=c(i,t);let f=a;if(d){const o=d._f;o&&(!o.disabled&&E(u,t,Cr(a,o)),f=Ve(o.ref)&&H(a)?"":a,Dr(o.ref)?[...o.ref.options].forEach(h=>h.selected=f.includes(h.value)):o.refs?ve(o.ref)?o.refs.length>1?o.refs.forEach(h=>(!h.defaultChecked||!h.disabled)&&(h.checked=Array.isArray(f)?!!f.find(k=>k===h.value):f===h.value)):o.refs[0]&&(o.refs[0].checked=!!f):o.refs.forEach(h=>h.checked=h.value===f):Je(o.ref)?o.ref.value="":(o.ref.value=f,o.ref.type||v.values.next({name:t,values:{...u}})))}(n.shouldDirty||n.shouldTouch)&&b(t,f,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&ge(t)},ee=(t,a,n)=>{for(const d in a){const f=a[d],o=`${t}.${d}`,h=c(i,o);(g.array.has(t)||!Se(f)||h&&!h._f)&&!ce(f)?ee(o,f,n):N(o,f,n)}},Y=(t,a,n={})=>{const d=c(i,t),f=g.array.has(t),o=j(a);E(u,t,o),f?(v.array.next({name:t,values:{...u}}),(m.isDirty||m.dirtyFields)&&n.shouldDirty&&v.state.next({name:t,dirtyFields:xe(l,u),isDirty:V(t,o)})):d&&!d._f&&!H(o)?ee(t,o,n):N(t,o,n),ze(t,g)&&v.state.next({...r}),v.values.next({name:y.mount?t:void 0,values:{...u}})},de=async t=>{y.mount=!0;const a=t.target;let n=a.name,d=!0;const f=c(i,n),o=()=>a.type?$e(f._f):vr(t),h=k=>{d=Number.isNaN(k)||le(k,c(u,n,k))};if(f){let k,M;const I=o(),ne=t.type===Ae.BLUR||t.type===Ae.FOCUS_OUT,Rr=!it(f._f)&&!s.resolver&&!c(r.errors,n)&&!f._f.deps||at(ne,c(r.touchedFields,n),r.isSubmitted,$,S),Te=ze(n,g,ne);E(u,n,I),ne?(f._f.onBlur&&f._f.onBlur(t),x&&x(0)):f._f.onChange&&f._f.onChange(t);const Oe=b(n,I,ne,!1),jr=!q(Oe)||Te;if(!ne&&v.values.next({name:n,type:t.type,values:{...u}}),Rr)return m.isValid&&(e.mode==="onBlur"?ne&&B():B()),jr&&v.state.next({name:n,...Te?{}:Oe});if(!ne&&Te&&v.state.next({...r}),s.resolver){const{errors:ur}=await T([n]);if(h(I),d){const Mr=_r(r.errors,i,n),lr=_r(ur,i,Mr.name||n);k=lr.error,n=lr.name,M=q(ur)}}else z([n],!0),k=(await Ke(f,u,w,s.shouldUseNativeValidation))[n],z([n]),h(I),d&&(k?M=!1:m.isValid&&(M=await W(i,!0)));d&&(f._f.deps&&ge(f._f.deps),A(n,M,k,Oe))}},ye=(t,a)=>{if(c(r.errors,a)&&t.focus)return t.focus(),1},ge=async(t,a={})=>{let n,d;const f=K(t);if(s.resolver){const o=await G(C(t)?t:f);n=q(o),d=t?!f.some(h=>c(o,h)):n}else t?(d=(await Promise.all(f.map(async o=>{const h=c(i,o);return await W(h&&h._f?{[o]:h}:h)}))).every(Boolean),!(!d&&!r.isValid)&&B()):d=n=await W(i);return v.state.next({...!se(t)||m.isValid&&n!==r.isValid?{}:{name:t},...s.resolver||!t?{isValid:n}:{},errors:r.errors}),a.shouldFocus&&!d&&fe(i,ye,t?f:g.mount),d},Xe=t=>{const a={...y.mount?u:l};return C(t)?a:se(t)?c(a,t):t.map(n=>c(a,n))},Ze=(t,a)=>({invalid:!!c((a||r).errors,t),isDirty:!!c((a||r).dirtyFields,t),error:c((a||r).errors,t),isValidating:!!c(r.validatingFields,t),isTouched:!!c((a||r).touchedFields,t)}),Tr=t=>{t&&K(t).forEach(a=>L(r.errors,a)),v.state.next({errors:t?r.errors:{}})},er=(t,a,n)=>{const d=(c(i,t,{_f:{}})._f||{}).ref,f=c(r.errors,t)||{},{ref:o,message:h,type:k,...M}=f;E(r.errors,t,{...M,...a,ref:d}),v.state.next({name:t,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&d&&d.focus&&d.focus()},Or=(t,a)=>ae(t)?v.values.subscribe({next:n=>t(D(void 0,a),n)}):D(t,a,!0),Ee=(t,a={})=>{for(const n of t?K(t):g.mount)g.mount.delete(n),g.array.delete(n),a.keepValue||(L(i,n),L(u,n)),!a.keepError&&L(r.errors,n),!a.keepDirty&&L(r.dirtyFields,n),!a.keepTouched&&L(r.touchedFields,n),!a.keepIsValidating&&L(r.validatingFields,n),!s.shouldUnregister&&!a.keepDefaultValue&&L(l,n);v.values.next({values:{...u}}),v.state.next({...r,...a.keepDirty?{isDirty:V()}:{}}),!a.keepIsValid&&B()},rr=({disabled:t,name:a,field:n,fields:d,value:f})=>{if(J(t)&&y.mount||t){const o=t?void 0:C(f)?$e(n?n._f:c(d,a)._f):f;E(u,a,o),b(a,o,!1,!1,!0)}},Ce=(t,a={})=>{let n=c(i,t);const d=J(a.disabled)||J(e.disabled);return E(i,t,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:t}},name:t,mount:!0,...a}}),g.mount.add(t),n?rr({field:n,disabled:J(a.disabled)?a.disabled:e.disabled,name:t,value:a.value}):_(t,!0,a.value),{...d?{disabled:a.disabled||e.disabled}:{},...s.progressive?{required:!!a.required,min:_e(a.min),max:_e(a.max),minLength:_e(a.minLength),maxLength:_e(a.maxLength),pattern:_e(a.pattern)}:{},name:t,onChange:de,onBlur:de,ref:f=>{if(f){Ce(t,a),n=c(i,t);const o=C(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,h=rt(o),k=n._f.refs||[];if(h?k.find(M=>M===o):o===n._f.ref)return;E(i,t,{_f:{...n._f,...h?{refs:[...k.filter(He),o,...Array.isArray(c(l,t))?[{}]:[]],ref:{type:o.type,name:t}}:{ref:o}}}),_(t,!1,void 0,o)}else n=c(i,t,{}),n._f&&(n._f.mount=!1),(s.shouldUnregister||a.shouldUnregister)&&!(br(g.array,t)&&y.action)&&g.unMount.add(t)}}},tr=()=>s.shouldFocusError&&fe(i,ye,g.mount),Lr=t=>{J(t)&&(v.state.next({disabled:t}),fe(i,(a,n)=>{const d=c(i,n);d&&(a.disabled=d._f.disabled||t,Array.isArray(d._f.refs)&&d._f.refs.forEach(f=>{f.disabled=d._f.disabled||t}))},0,!1))},sr=(t,a)=>async n=>{let d;n&&(n.preventDefault&&n.preventDefault(),n.persist&&n.persist());let f=j(u);if(v.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:h}=await T();r.errors=o,f=h}else await W(i);if(L(r.errors,"root"),q(r.errors)){v.state.next({errors:{}});try{await t(f,n)}catch(o){d=o}}else a&&await a({...r.errors},n),tr(),setTimeout(tr);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:q(r.errors)&&!d,submitCount:r.submitCount+1,errors:r.errors}),d)throw d},Ur=(t,a={})=>{c(i,t)&&(C(a.defaultValue)?Y(t,j(c(l,t))):(Y(t,a.defaultValue),E(l,t,j(a.defaultValue))),a.keepTouched||L(r.touchedFields,t),a.keepDirty||(L(r.dirtyFields,t),r.isDirty=a.defaultValue?V(t,j(c(l,t))):V()),a.keepError||(L(r.errors,t),m.isValid&&B()),v.state.next({...r}))},ir=(t,a={})=>{const n=t?j(t):l,d=j(n),f=q(t),o=f?l:d;if(a.keepDefaultValues||(l=n),!a.keepValues){if(a.keepDirtyValues)for(const h of g.mount)c(r.dirtyFields,h)?E(o,h,c(u,h)):Y(h,c(o,h));else{if(Ge&&C(t))for(const h of g.mount){const k=c(i,h);if(k&&k._f){const M=Array.isArray(k._f.refs)?k._f.refs[0]:k._f.ref;if(Ve(M)){const I=M.closest("form");if(I){I.reset();break}}}}i={}}u=e.shouldUnregister?a.keepDefaultValues?j(l):{}:j(o),v.array.next({values:{...o}}),v.values.next({values:{...o}})}g={mount:a.keepDirtyValues?g.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},y.mount=!m.isValid||!!a.keepIsValid||!!a.keepDirtyValues,y.watch=!!e.shouldUnregister,v.state.next({submitCount:a.keepSubmitCount?r.submitCount:0,isDirty:f?!1:a.keepDirty?r.isDirty:!!(a.keepDefaultValues&&!le(t,l)),isSubmitted:a.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:f?{}:a.keepDirtyValues?a.keepDefaultValues&&u?xe(l,u):r.dirtyFields:a.keepDefaultValues&&t?xe(l,t):a.keepDirty?r.dirtyFields:{},touchedFields:a.keepTouched?r.touchedFields:{},errors:a.keepErrors?r.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},ar=(t,a)=>ir(ae(t)?t(u):t,a);return{control:{register:Ce,unregister:Ee,getFieldState:Ze,handleSubmit:sr,setError:er,_executeSchema:T,_getWatch:D,_getDirty:V,_updateValid:B,_removeUnmounted:me,_updateFieldArray:p,_updateDisabledField:rr,_getFieldArray:R,_reset:ir,_resetDefaultValues:()=>ae(s.defaultValues)&&s.defaultValues().then(t=>{ar(t,s.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:t=>{r={...r,...t}},_disableForm:Lr,_subjects:v,_proxyFormState:m,_setErrors:Z,get _fields(){return i},get _formValues(){return u},get _state(){return y},set _state(t){y=t},get _defaultValues(){return l},get _names(){return g},set _names(t){g=t},get _formState(){return r},set _formState(t){r=t},get _options(){return s},set _options(t){s={...s,...t}}},trigger:ge,register:Ce,handleSubmit:sr,watch:Or,setValue:Y,getValues:Xe,reset:ar,resetField:Ur,clearErrors:Tr,unregister:Ee,setError:er,setFocus:(t,a={})=>{const n=c(i,t),d=n&&n._f;if(d){const f=d.refs?d.refs[0]:d.ref;f.focus&&(f.focus(),a.shouldSelect&&f.select())}},getFieldState:Ze}}function vt(e={}){const s=F.useRef(),r=F.useRef(),[i,l]=F.useState({isDirty:!1,isValidating:!1,isLoading:ae(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ae(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...nt(e),formState:i});const u=s.current.control;return u._options=e,ke({subject:u._subjects.state,next:y=>{Fr(y,u._proxyFormState,u._updateFormState,!0)&&l({...u._formState})}}),F.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),F.useEffect(()=>{if(u._proxyFormState.isDirty){const y=u._getDirty();y!==i.isDirty&&u._subjects.state.next({isDirty:y})}},[u,i.isDirty]),F.useEffect(()=>{e.values&&!le(e.values,r.current)?(u._reset(e.values,u._options.resetOptions),r.current=e.values,l(y=>({...y}))):u._resetDefaultValues()},[e.values,u]),F.useEffect(()=>{e.errors&&u._setErrors(e.errors)},[e.errors,u]),F.useEffect(()=>{u._state.mount||(u._updateValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),F.useEffect(()=>{e.shouldUnregister&&u._subjects.values.next({values:u._getWatch()})},[e.shouldUnregister,u]),s.current.formState=xr(i,u),s.current}function ot({fullWidth:e=!1,multiple:s=!1,required:r=!1,label:i="",placeholer:l="",options:u=[],helperText:y="",error:g=!1,margin:x="",textDirection:O="row",size:m,...v}){const S=u.find(w=>w.value===v.value),$=S==null?void 0:S.title;return P.jsxs(Ir,{margin:x,fullWidth:e,error:g,children:[P.jsx(Br,{size:m,children:`${i}${r?"*":""}`}),P.jsxs(Nr,{multiple:s,input:P.jsx(Pr,{defaultValue:$,sx:{flex:1},required:r,label:i,inputProps:{margin:x},size:m}),renderValue:w=>{if(s)return P.jsx(nr,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:w.map(B=>{const z=u.find(p=>p.value===B);return z&&z.title&&P.jsx(Wr,{size:"small",label:z.title},B)})});const te=u.find(B=>B.value===w);return te&&te.title&&P.jsxs(nr,{children:[P.jsx(Le,{component:"span",children:te.title}),P.jsx(Le,{marginLeft:1,component:"span",variant:"body2",color:"text.secondary",children:te.description})]})},...v,children:[P.jsx(Ue,{disabled:!0,children:P.jsx("em",{children:l})}),!r&&!s&&P.jsx(Ue,{value:"",children:"None"}),u.map(w=>w&&w.value&&P.jsxs(Ue,{sx:[{justifyContent:"center"},O==="column"?{flexDirection:"column",alignItems:"flex-start"}:{}],value:w.value,children:[P.jsx(qr,{children:w.title}),w.description&&P.jsx(Le,{variant:"body2",color:"text.secondary",sx:{maxWidth:"100%",whiteSpace:"normal"},children:w.description})]},w.value))]}),P.jsx(Hr,{children:y})]})}ot.propTypes={error:re.bool,required:re.bool,multiple:re.bool,fullWidth:re.bool,label:re.string,placeholer:re.string,options:re.array,helperText:re.string,margin:re.string,size:re.string,textDirection:re.oneOf("row","column")};export{_t as C,ot as S,ht as a,vt as u};
1
+ import{b as F}from"./vendor-react-D-afvo_7.js";import{E as re,j as P,bE as Ir,bF as Br,aP as Nr,bH as Pr,a3 as lr,A as Wr,T as Le,al as Ue,bn as qr,bM as Hr}from"./vendor-mui-core-jh6OMVvU.js";var ve=e=>e.type==="checkbox",ce=e=>e instanceof Date,H=e=>e==null;const hr=e=>typeof e=="object";var U=e=>!H(e)&&!Array.isArray(e)&&hr(e)&&!ce(e),vr=e=>U(e)&&e.target?ve(e.target)?e.target.checked:e.target.value:e,$r=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,br=(e,s)=>e.has($r(s)),zr=e=>{const s=e.constructor&&e.constructor.prototype;return U(s)&&s.hasOwnProperty("isPrototypeOf")},Ge=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function j(e){let s;const r=Array.isArray(e);if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Ge&&(e instanceof Blob||e instanceof FileList))&&(r||U(e)))if(s=r?[]:{},!r&&!zr(e))s=e;else for(const i in e)e.hasOwnProperty(i)&&(s[i]=j(e[i]));else return e;return s}var be=e=>Array.isArray(e)?e.filter(Boolean):[],C=e=>e===void 0,c=(e,s,r)=>{if(!s||!U(e))return r;const i=be(s.split(/[,[\].]+?/)).reduce((n,u)=>H(n)?n:n[u],e);return C(i)||i===e?C(e[s])?r:e[s]:i},J=e=>typeof e=="boolean",Ye=e=>/^\w*$/.test(e),mr=e=>be(e.replace(/["|']|\]/g,"").split(/\.|\[/)),E=(e,s,r)=>{let i=-1;const n=Ye(s)?[s]:mr(s),u=n.length,y=u-1;for(;++i<u;){const g=n[i];let x=r;if(i!==y){const O=e[g];x=U(O)||Array.isArray(O)?O:isNaN(+n[i+1])?{}:[]}if(g==="__proto__")return;e[g]=x,e=e[g]}return e};const Ae={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Q={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"},Kr=F.createContext(null),De=()=>F.useContext(Kr);var xr=(e,s,r,i=!0)=>{const n={defaultValues:s._defaultValues};for(const u in e)Object.defineProperty(n,u,{get:()=>{const y=u;return s._proxyFormState[y]!==Q.all&&(s._proxyFormState[y]=!i||Q.all),r&&(r[y]=!0),e[y]}});return n},q=e=>U(e)&&!Object.keys(e).length,Fr=(e,s,r,i)=>{r(e);const{name:n,...u}=e;return q(u)||Object.keys(u).length>=Object.keys(s).length||Object.keys(u).find(y=>s[y]===(!i||Q.all))},K=e=>Array.isArray(e)?e:[e],Ar=(e,s,r)=>!e||!s||e===s||K(e).some(i=>i&&(r?i===s:i.startsWith(s)||s.startsWith(i)));function ke(e){const s=F.useRef(e);s.current=e,F.useEffect(()=>{const r=!e.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function Gr(e){const s=De(),{control:r=s.control,disabled:i,name:n,exact:u}=e||{},[y,g]=F.useState(r._formState),x=F.useRef(!0),O=F.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),m=F.useRef(n);return m.current=n,ke({disabled:i,next:v=>x.current&&Ar(m.current,v.name,u)&&Fr(v,O.current,r._updateFormState)&&g({...r._formState,...v}),subject:r._subjects.state}),F.useEffect(()=>(x.current=!0,O.current.isValid&&r._updateValid(!0),()=>{x.current=!1}),[r]),xr(y,r,O.current,!1)}var se=e=>typeof e=="string",Vr=(e,s,r,i,n)=>se(e)?(i&&s.watch.add(e),c(r,e,n)):Array.isArray(e)?e.map(u=>(i&&s.watch.add(u),c(r,u))):(i&&(s.watchAll=!0),r);function Yr(e){const s=De(),{control:r=s.control,name:i,defaultValue:n,disabled:u,exact:y}=e||{},g=F.useRef(i);g.current=i,ke({disabled:u,subject:r._subjects.values,next:m=>{Ar(g.current,m.name,y)&&O(j(Vr(g.current,r._names,m.values||r._formValues,!1,n)))}});const[x,O]=F.useState(r._getWatch(i,n));return F.useEffect(()=>r._removeUnmounted()),x}function Jr(e){const s=De(),{name:r,disabled:i,control:n=s.control,shouldUnregister:u}=e,y=br(n._names.array,r),g=Yr({control:n,name:r,defaultValue:c(n._formValues,r,c(n._defaultValues,r,e.defaultValue)),exact:!0}),x=Gr({control:n,name:r,exact:!0}),O=F.useRef(n.register(r,{...e.rules,value:g,...J(e.disabled)?{disabled:e.disabled}:{}}));return F.useEffect(()=>{const m=n._options.shouldUnregister||u,v=(S,$)=>{const w=c(n._fields,S);w&&w._f&&(w._f.mount=$)};if(v(r,!0),m){const S=j(c(n._options.defaultValues,r));E(n._defaultValues,r,S),C(c(n._formValues,r))&&E(n._formValues,r,S)}return()=>{(y?m&&!n._state.action:m)?n.unregister(r):v(r,!1)}},[r,n,y,u]),F.useEffect(()=>{c(n._fields,r)&&n._updateDisabledField({disabled:i,fields:n._fields,name:r,value:c(n._fields,r)._f.value})},[i,r,n]),{field:{name:r,value:g,...J(i)||x.disabled?{disabled:x.disabled||i}:{},onChange:F.useCallback(m=>O.current.onChange({target:{value:vr(m),name:r},type:Ae.CHANGE}),[r]),onBlur:F.useCallback(()=>O.current.onBlur({target:{value:c(n._formValues,r),name:r},type:Ae.BLUR}),[r,n]),ref:F.useCallback(m=>{const v=c(n._fields,r);v&&m&&(v._f.ref={focus:()=>m.focus(),select:()=>m.select(),setCustomValidity:S=>m.setCustomValidity(S),reportValidity:()=>m.reportValidity()})},[n._fields,r])},formState:x,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!c(x.errors,r)},isDirty:{enumerable:!0,get:()=>!!c(x.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!c(x.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!c(x.validatingFields,r)},error:{enumerable:!0,get:()=>c(x.errors,r)}})}}const _t=e=>e.render(Jr(e));var Qr=(e,s,r,i,n)=>s?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:n||!0}}:{},ue=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const r=(Math.random()*16+e)%16|0;return(s=="x"?r:r&3|8).toString(16)})},Re=(e,s,r={})=>r.shouldFocus||C(r.shouldFocus)?r.focusName||`${e}.${C(r.focusIndex)?s:r.focusIndex}.`:"",he=e=>({isOnSubmit:!e||e===Q.onSubmit,isOnBlur:e===Q.onBlur,isOnChange:e===Q.onChange,isOnAll:e===Q.all,isOnTouch:e===Q.onTouched}),ze=(e,s,r)=>!r&&(s.watchAll||s.watch.has(e)||[...s.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const fe=(e,s,r,i)=>{for(const n of r||Object.keys(e)){const u=c(e,n);if(u){const{_f:y,...g}=u;if(y){if(y.refs&&y.refs[0]&&s(y.refs[0],n)&&!i)return!0;if(y.ref&&s(y.ref,y.name)&&!i)return!0;if(fe(g,s))break}else if(U(g)&&fe(g,s))break}}};var pr=(e,s,r)=>{const i=K(c(e,r));return E(i,"root",s[r]),E(e,r,i),e},Je=e=>e.type==="file",ae=e=>typeof e=="function",Ve=e=>{if(!Ge)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},Fe=e=>se(e),Qe=e=>e.type==="radio",pe=e=>e instanceof RegExp;const or={value:!1,isValid:!1},cr={value:!0,isValid:!0};var Sr=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!C(e[0].attributes.value)?C(e[0].value)||e[0].value===""?cr:{value:e[0].value,isValid:!0}:cr:or}return or};const fr={isValid:!1,value:null};var wr=e=>Array.isArray(e)?e.reduce((s,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:s,fr):fr;function dr(e,s,r="validate"){if(Fe(e)||Array.isArray(e)&&e.every(Fe)||J(e)&&!e)return{type:r,message:Fe(e)?e:"",ref:s}}var oe=e=>U(e)&&!pe(e)?e:{value:e,message:""},Ke=async(e,s,r,i,n)=>{const{ref:u,refs:y,required:g,maxLength:x,minLength:O,min:m,max:v,pattern:S,validate:$,name:w,valueAsNumber:te,mount:B,disabled:z}=e._f,p=c(s,w);if(!B||z)return{};const X=y?y[0]:u,Z=V=>{i&&X.reportValidity&&(X.setCustomValidity(J(V)?"":V||""),X.reportValidity())},_={},b=Qe(u),A=ve(u),T=b||A,G=(te||Je(u))&&C(u.value)&&C(p)||Ve(u)&&u.value===""||p===""||Array.isArray(p)&&!p.length,W=Qr.bind(null,w,r,_),me=(V,D,R,N=ie.maxLength,ee=ie.minLength)=>{const Y=V?D:R;_[w]={type:V?N:ee,message:Y,ref:u,...W(V?N:ee,Y)}};if(n?!Array.isArray(p)||!p.length:g&&(!T&&(G||H(p))||J(p)&&!p||A&&!Sr(y).isValid||b&&!wr(y).isValid)){const{value:V,message:D}=Fe(g)?{value:!!g,message:g}:oe(g);if(V&&(_[w]={type:ie.required,message:D,ref:X,...W(ie.required,D)},!r))return Z(D),_}if(!G&&(!H(m)||!H(v))){let V,D;const R=oe(v),N=oe(m);if(!H(p)&&!isNaN(p)){const ee=u.valueAsNumber||p&&+p;H(R.value)||(V=ee>R.value),H(N.value)||(D=ee<N.value)}else{const ee=u.valueAsDate||new Date(p),Y=ge=>new Date(new Date().toDateString()+" "+ge),de=u.type=="time",ye=u.type=="week";se(R.value)&&p&&(V=de?Y(p)>Y(R.value):ye?p>R.value:ee>new Date(R.value)),se(N.value)&&p&&(D=de?Y(p)<Y(N.value):ye?p<N.value:ee<new Date(N.value))}if((V||D)&&(me(!!V,R.message,N.message,ie.max,ie.min),!r))return Z(_[w].message),_}if((x||O)&&!G&&(se(p)||n&&Array.isArray(p))){const V=oe(x),D=oe(O),R=!H(V.value)&&p.length>+V.value,N=!H(D.value)&&p.length<+D.value;if((R||N)&&(me(R,V.message,D.message),!r))return Z(_[w].message),_}if(S&&!G&&se(p)){const{value:V,message:D}=oe(S);if(pe(V)&&!p.match(V)&&(_[w]={type:ie.pattern,message:D,ref:u,...W(ie.pattern,D)},!r))return Z(D),_}if($){if(ae($)){const V=await $(p,s),D=dr(V,X);if(D&&(_[w]={...D,...W(ie.validate,D.message)},!r))return Z(D.message),_}else if(U($)){let V={};for(const D in $){if(!q(V)&&!r)break;const R=dr(await $[D](p,s),X,D);R&&(V={...R,...W(D,R.message)},Z(R.message),r&&(_[w]=V))}if(!q(V)&&(_[w]={ref:X,...V},!r))return _}}return Z(!0),_},je=(e,s)=>[...e,...K(s)],Me=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Ie(e,s,r){return[...e.slice(0,s),...K(r),...e.slice(s)]}var Be=(e,s,r)=>Array.isArray(e)?(C(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(s,1)[0]),e):[],Ne=(e,s)=>[...K(s),...K(e)];function Xr(e,s){let r=0;const i=[...e];for(const n of s)i.splice(n-r,1),r++;return be(i).length?i:[]}var Pe=(e,s)=>C(s)?[]:Xr(e,K(s).sort((r,i)=>r-i)),We=(e,s,r)=>{[e[s],e[r]]=[e[r],e[s]]};function Zr(e,s){const r=s.slice(0,-1).length;let i=0;for(;i<r;)e=C(e)?i++:e[s[i++]];return e}function et(e){for(const s in e)if(e.hasOwnProperty(s)&&!C(e[s]))return!1;return!0}function L(e,s){const r=Array.isArray(s)?s:Ye(s)?[s]:mr(s),i=r.length===1?e:Zr(e,r),n=r.length-1,u=r[n];return i&&delete i[u],n!==0&&(U(i)&&q(i)||Array.isArray(i)&&et(i))&&L(e,r.slice(0,-1)),e}var yr=(e,s,r)=>(e[s]=r,e);function ht(e){const s=De(),{control:r=s.control,name:i,keyName:n="id",shouldUnregister:u}=e,[y,g]=F.useState(r._getFieldArray(i)),x=F.useRef(r._getFieldArray(i).map(ue)),O=F.useRef(y),m=F.useRef(i),v=F.useRef(!1);m.current=i,O.current=y,r._names.array.add(i),e.rules&&r.register(i,e.rules),ke({next:({values:_,name:b})=>{if(b===m.current||!b){const A=c(_,m.current);Array.isArray(A)&&(g(A),x.current=A.map(ue))}},subject:r._subjects.array});const S=F.useCallback(_=>{v.current=!0,r._updateFieldArray(i,_)},[r,i]),$=(_,b)=>{const A=K(j(_)),T=je(r._getFieldArray(i),A);r._names.focus=Re(i,T.length-1,b),x.current=je(x.current,A.map(ue)),S(T),g(T),r._updateFieldArray(i,T,je,{argA:Me(_)})},w=(_,b)=>{const A=K(j(_)),T=Ne(r._getFieldArray(i),A);r._names.focus=Re(i,0,b),x.current=Ne(x.current,A.map(ue)),S(T),g(T),r._updateFieldArray(i,T,Ne,{argA:Me(_)})},te=_=>{const b=Pe(r._getFieldArray(i),_);x.current=Pe(x.current,_),S(b),g(b),r._updateFieldArray(i,b,Pe,{argA:_})},B=(_,b,A)=>{const T=K(j(b)),G=Ie(r._getFieldArray(i),_,T);r._names.focus=Re(i,_,A),x.current=Ie(x.current,_,T.map(ue)),S(G),g(G),r._updateFieldArray(i,G,Ie,{argA:_,argB:Me(b)})},z=(_,b)=>{const A=r._getFieldArray(i);We(A,_,b),We(x.current,_,b),S(A),g(A),r._updateFieldArray(i,A,We,{argA:_,argB:b},!1)},p=(_,b)=>{const A=r._getFieldArray(i);Be(A,_,b),Be(x.current,_,b),S(A),g(A),r._updateFieldArray(i,A,Be,{argA:_,argB:b},!1)},X=(_,b)=>{const A=j(b),T=yr(r._getFieldArray(i),_,A);x.current=[...T].map((G,W)=>!G||W===_?ue():x.current[W]),S(T),g([...T]),r._updateFieldArray(i,T,yr,{argA:_,argB:A},!0,!1)},Z=_=>{const b=K(j(_));x.current=b.map(ue),S([...b]),g([...b]),r._updateFieldArray(i,[...b],A=>A,{},!0,!1)};return F.useEffect(()=>{if(r._state.action=!1,ze(i,r._names)&&r._subjects.state.next({...r._formState}),v.current&&(!he(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([i]).then(_=>{const b=c(_.errors,i),A=c(r._formState.errors,i);(A?!b&&A.type||b&&(A.type!==b.type||A.message!==b.message):b&&b.type)&&(b?E(r._formState.errors,i,b):L(r._formState.errors,i),r._subjects.state.next({errors:r._formState.errors}))});else{const _=c(r._fields,i);_&&_._f&&!(he(r._options.reValidateMode).isOnSubmit&&he(r._options.mode).isOnSubmit)&&Ke(_,r._formValues,r._options.criteriaMode===Q.all,r._options.shouldUseNativeValidation,!0).then(b=>!q(b)&&r._subjects.state.next({errors:pr(r._formState.errors,b,i)}))}r._subjects.values.next({name:i,values:{...r._formValues}}),r._names.focus&&fe(r._fields,(_,b)=>{if(r._names.focus&&b.startsWith(r._names.focus)&&_.focus)return _.focus(),1}),r._names.focus="",r._updateValid(),v.current=!1},[y,i,r]),F.useEffect(()=>(!c(r._formValues,i)&&r._updateFieldArray(i),()=>{(r._options.shouldUnregister||u)&&r.unregister(i)}),[i,r,n,u]),{swap:F.useCallback(z,[S,i,r]),move:F.useCallback(p,[S,i,r]),prepend:F.useCallback(w,[S,i,r]),append:F.useCallback($,[S,i,r]),remove:F.useCallback(te,[S,i,r]),insert:F.useCallback(B,[S,i,r]),update:F.useCallback(X,[S,i,r]),replace:F.useCallback(Z,[S,i,r]),fields:F.useMemo(()=>y.map((_,b)=>({..._,[n]:x.current[b]||ue()})),[y,n])}}var qe=()=>{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=[]}}},Se=e=>H(e)||!hr(e);function ne(e,s){if(Se(e)||Se(s))return e===s;if(ce(e)&&ce(s))return e.getTime()===s.getTime();const r=Object.keys(e),i=Object.keys(s);if(r.length!==i.length)return!1;for(const n of r){const u=e[n];if(!i.includes(n))return!1;if(n!=="ref"){const y=s[n];if(ce(u)&&ce(y)||U(u)&&U(y)||Array.isArray(u)&&Array.isArray(y)?!ne(u,y):u!==y)return!1}}return!0}var Dr=e=>e.type==="select-multiple",rt=e=>Qe(e)||ve(e),He=e=>Ve(e)&&e.isConnected,kr=e=>{for(const s in e)if(ae(e[s]))return!0;return!1};function we(e,s={}){const r=Array.isArray(e);if(U(e)||r)for(const i in e)Array.isArray(e[i])||U(e[i])&&!kr(e[i])?(s[i]=Array.isArray(e[i])?[]:{},we(e[i],s[i])):H(e[i])||(s[i]=!0);return s}function Er(e,s,r){const i=Array.isArray(e);if(U(e)||i)for(const n in e)Array.isArray(e[n])||U(e[n])&&!kr(e[n])?C(s)||Se(r[n])?r[n]=Array.isArray(e[n])?we(e[n],[]):{...we(e[n])}:Er(e[n],H(s)?{}:s[n],r[n]):r[n]=!ne(e[n],s[n]);return r}var xe=(e,s)=>Er(e,s,we(s)),Cr=(e,{valueAsNumber:s,valueAsDate:r,setValueAs:i})=>C(e)?e:s?e===""?NaN:e&&+e:r&&se(e)?new Date(e):i?i(e):e;function $e(e){const s=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):s.disabled))return Je(s)?s.files:Qe(s)?wr(e.refs).value:Dr(s)?[...s.selectedOptions].map(({value:r})=>r):ve(s)?Sr(e.refs).value:Cr(C(s.value)?e.ref.value:s.value,e)}var tt=(e,s,r,i)=>{const n={};for(const u of e){const y=c(s,u);y&&E(n,u,y._f)}return{criteriaMode:r,names:[...e],fields:n,shouldUseNativeValidation:i}},_e=e=>C(e)?e:pe(e)?e.source:U(e)?pe(e.value)?e.value.source:e.value:e;const gr="AsyncFunction";var st=e=>(!e||!e.validate)&&!!(ae(e.validate)&&e.validate.constructor.name===gr||U(e.validate)&&Object.values(e.validate).find(s=>s.constructor.name===gr)),it=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function _r(e,s,r){const i=c(e,r);if(i||Ye(r))return{error:i,name:r};const n=r.split(".");for(;n.length;){const u=n.join("."),y=c(s,u),g=c(e,u);if(y&&!Array.isArray(y)&&r!==u)return{name:r};if(g&&g.type)return{name:u,error:g};n.pop()}return{name:r}}var at=(e,s,r,i,n)=>n.isOnAll?!1:!r&&n.isOnTouch?!(s||e):(r?i.isOnBlur:n.isOnBlur)?!e:(r?i.isOnChange:n.isOnChange)?e:!0,ut=(e,s)=>!be(c(e,s)).length&&L(e,s);const nt={mode:Q.onSubmit,reValidateMode:Q.onChange,shouldFocusError:!0};function lt(e={}){let s={...nt,...e},r={submitCount:0,isDirty:!1,isLoading:ae(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},i={},n=U(s.defaultValues)||U(s.values)?j(s.defaultValues||s.values)||{}:{},u=s.shouldUnregister?{}:j(n),y={action:!1,mount:!1,watch:!1},g={mount:new Set,unMount:new Set,array:new Set,watch:new Set},x,O=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:qe(),array:qe(),state:qe()},S=he(s.mode),$=he(s.reValidateMode),w=s.criteriaMode===Q.all,te=t=>a=>{clearTimeout(O),O=setTimeout(t,a)},B=async t=>{if(m.isValid||t){const a=s.resolver?q((await T()).errors):await W(i,!0);a!==r.isValid&&v.state.next({isValid:a})}},z=(t,a)=>{(m.isValidating||m.validatingFields)&&((t||Array.from(g.mount)).forEach(l=>{l&&(a?E(r.validatingFields,l,a):L(r.validatingFields,l))}),v.state.next({validatingFields:r.validatingFields,isValidating:!q(r.validatingFields)}))},p=(t,a=[],l,d,f=!0,o=!0)=>{if(d&&l){if(y.action=!0,o&&Array.isArray(c(i,t))){const h=l(c(i,t),d.argA,d.argB);f&&E(i,t,h)}if(o&&Array.isArray(c(r.errors,t))){const h=l(c(r.errors,t),d.argA,d.argB);f&&E(r.errors,t,h),ut(r.errors,t)}if(m.touchedFields&&o&&Array.isArray(c(r.touchedFields,t))){const h=l(c(r.touchedFields,t),d.argA,d.argB);f&&E(r.touchedFields,t,h)}m.dirtyFields&&(r.dirtyFields=xe(n,u)),v.state.next({name:t,isDirty:V(t,a),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else E(u,t,a)},X=(t,a)=>{E(r.errors,t,a),v.state.next({errors:r.errors})},Z=t=>{r.errors=t,v.state.next({errors:r.errors,isValid:!1})},_=(t,a,l,d)=>{const f=c(i,t);if(f){const o=c(u,t,C(l)?c(n,t):l);C(o)||d&&d.defaultChecked||a?E(u,t,a?o:$e(f._f)):N(t,o),y.mount&&B()}},b=(t,a,l,d,f)=>{let o=!1,h=!1;const k={name:t},M=!!(c(i,t)&&c(i,t)._f&&c(i,t)._f.disabled);if(!l||d){m.isDirty&&(h=r.isDirty,r.isDirty=k.isDirty=V(),o=h!==k.isDirty);const I=M||ne(c(n,t),a);h=!!(!M&&c(r.dirtyFields,t)),I||M?L(r.dirtyFields,t):E(r.dirtyFields,t,!0),k.dirtyFields=r.dirtyFields,o=o||m.dirtyFields&&h!==!I}if(l){const I=c(r.touchedFields,t);I||(E(r.touchedFields,t,l),k.touchedFields=r.touchedFields,o=o||m.touchedFields&&I!==l)}return o&&f&&v.state.next(k),o?k:{}},A=(t,a,l,d)=>{const f=c(r.errors,t),o=m.isValid&&J(a)&&r.isValid!==a;if(e.delayError&&l?(x=te(()=>X(t,l)),x(e.delayError)):(clearTimeout(O),x=null,l?E(r.errors,t,l):L(r.errors,t)),(l?!ne(f,l):f)||!q(d)||o){const h={...d,...o&&J(a)?{isValid:a}:{},errors:r.errors,name:t};r={...r,...h},v.state.next(h)}},T=async t=>{z(t,!0);const a=await s.resolver(u,s.context,tt(t||g.mount,i,s.criteriaMode,s.shouldUseNativeValidation));return z(t),a},G=async t=>{const{errors:a}=await T(t);if(t)for(const l of t){const d=c(a,l);d?E(r.errors,l,d):L(r.errors,l)}else r.errors=a;return a},W=async(t,a,l={valid:!0})=>{for(const d in t){const f=t[d];if(f){const{_f:o,...h}=f;if(o){const k=g.array.has(o.name),M=f._f&&st(f._f);M&&m.validatingFields&&z([d],!0);const I=await Ke(f,u,w,s.shouldUseNativeValidation&&!a,k);if(M&&m.validatingFields&&z([d]),I[o.name]&&(l.valid=!1,a))break;!a&&(c(I,o.name)?k?pr(r.errors,I,o.name):E(r.errors,o.name,I[o.name]):L(r.errors,o.name))}!q(h)&&await W(h,a,l)}}return l.valid},me=()=>{for(const t of g.unMount){const a=c(i,t);a&&(a._f.refs?a._f.refs.every(l=>!He(l)):!He(a._f.ref))&&Ee(t)}g.unMount=new Set},V=(t,a)=>(t&&a&&E(u,t,a),!ne(Xe(),n)),D=(t,a,l)=>Vr(t,g,{...y.mount?u:C(a)?n:se(t)?{[t]:a}:a},l,a),R=t=>be(c(y.mount?u:n,t,e.shouldUnregister?c(n,t,[]):[])),N=(t,a,l={})=>{const d=c(i,t);let f=a;if(d){const o=d._f;o&&(!o.disabled&&E(u,t,Cr(a,o)),f=Ve(o.ref)&&H(a)?"":a,Dr(o.ref)?[...o.ref.options].forEach(h=>h.selected=f.includes(h.value)):o.refs?ve(o.ref)?o.refs.length>1?o.refs.forEach(h=>(!h.defaultChecked||!h.disabled)&&(h.checked=Array.isArray(f)?!!f.find(k=>k===h.value):f===h.value)):o.refs[0]&&(o.refs[0].checked=!!f):o.refs.forEach(h=>h.checked=h.value===f):Je(o.ref)?o.ref.value="":(o.ref.value=f,o.ref.type||v.values.next({name:t,values:{...u}})))}(l.shouldDirty||l.shouldTouch)&&b(t,f,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ge(t)},ee=(t,a,l)=>{for(const d in a){const f=a[d],o=`${t}.${d}`,h=c(i,o);(g.array.has(t)||!Se(f)||h&&!h._f)&&!ce(f)?ee(o,f,l):N(o,f,l)}},Y=(t,a,l={})=>{const d=c(i,t),f=g.array.has(t),o=j(a);E(u,t,o),f?(v.array.next({name:t,values:{...u}}),(m.isDirty||m.dirtyFields)&&l.shouldDirty&&v.state.next({name:t,dirtyFields:xe(n,u),isDirty:V(t,o)})):d&&!d._f&&!H(o)?ee(t,o,l):N(t,o,l),ze(t,g)&&v.state.next({...r}),v.values.next({name:y.mount?t:void 0,values:{...u}})},de=async t=>{y.mount=!0;const a=t.target;let l=a.name,d=!0;const f=c(i,l),o=()=>a.type?$e(f._f):vr(t),h=k=>{d=Number.isNaN(k)||ne(k,c(u,l,k))};if(f){let k,M;const I=o(),le=t.type===Ae.BLUR||t.type===Ae.FOCUS_OUT,Rr=!it(f._f)&&!s.resolver&&!c(r.errors,l)&&!f._f.deps||at(le,c(r.touchedFields,l),r.isSubmitted,$,S),Te=ze(l,g,le);E(u,l,I),le?(f._f.onBlur&&f._f.onBlur(t),x&&x(0)):f._f.onChange&&f._f.onChange(t);const Oe=b(l,I,le,!1),jr=!q(Oe)||Te;if(!le&&v.values.next({name:l,type:t.type,values:{...u}}),Rr)return m.isValid&&(e.mode==="onBlur"?le&&B():B()),jr&&v.state.next({name:l,...Te?{}:Oe});if(!le&&Te&&v.state.next({...r}),s.resolver){const{errors:ur}=await T([l]);if(h(I),d){const Mr=_r(r.errors,i,l),nr=_r(ur,i,Mr.name||l);k=nr.error,l=nr.name,M=q(ur)}}else z([l],!0),k=(await Ke(f,u,w,s.shouldUseNativeValidation))[l],z([l]),h(I),d&&(k?M=!1:m.isValid&&(M=await W(i,!0)));d&&(f._f.deps&&ge(f._f.deps),A(l,M,k,Oe))}},ye=(t,a)=>{if(c(r.errors,a)&&t.focus)return t.focus(),1},ge=async(t,a={})=>{let l,d;const f=K(t);if(s.resolver){const o=await G(C(t)?t:f);l=q(o),d=t?!f.some(h=>c(o,h)):l}else t?(d=(await Promise.all(f.map(async o=>{const h=c(i,o);return await W(h&&h._f?{[o]:h}:h)}))).every(Boolean),!(!d&&!r.isValid)&&B()):d=l=await W(i);return v.state.next({...!se(t)||m.isValid&&l!==r.isValid?{}:{name:t},...s.resolver||!t?{isValid:l}:{},errors:r.errors}),a.shouldFocus&&!d&&fe(i,ye,t?f:g.mount),d},Xe=t=>{const a={...y.mount?u:n};return C(t)?a:se(t)?c(a,t):t.map(l=>c(a,l))},Ze=(t,a)=>({invalid:!!c((a||r).errors,t),isDirty:!!c((a||r).dirtyFields,t),error:c((a||r).errors,t),isValidating:!!c(r.validatingFields,t),isTouched:!!c((a||r).touchedFields,t)}),Tr=t=>{t&&K(t).forEach(a=>L(r.errors,a)),v.state.next({errors:t?r.errors:{}})},er=(t,a,l)=>{const d=(c(i,t,{_f:{}})._f||{}).ref,f=c(r.errors,t)||{},{ref:o,message:h,type:k,...M}=f;E(r.errors,t,{...M,...a,ref:d}),v.state.next({name:t,errors:r.errors,isValid:!1}),l&&l.shouldFocus&&d&&d.focus&&d.focus()},Or=(t,a)=>ae(t)?v.values.subscribe({next:l=>t(D(void 0,a),l)}):D(t,a,!0),Ee=(t,a={})=>{for(const l of t?K(t):g.mount)g.mount.delete(l),g.array.delete(l),a.keepValue||(L(i,l),L(u,l)),!a.keepError&&L(r.errors,l),!a.keepDirty&&L(r.dirtyFields,l),!a.keepTouched&&L(r.touchedFields,l),!a.keepIsValidating&&L(r.validatingFields,l),!s.shouldUnregister&&!a.keepDefaultValue&&L(n,l);v.values.next({values:{...u}}),v.state.next({...r,...a.keepDirty?{isDirty:V()}:{}}),!a.keepIsValid&&B()},rr=({disabled:t,name:a,field:l,fields:d,value:f})=>{if(J(t)&&y.mount||t){const o=t?void 0:C(f)?$e(l?l._f:c(d,a)._f):f;E(u,a,o),b(a,o,!1,!1,!0)}},Ce=(t,a={})=>{let l=c(i,t);const d=J(a.disabled)||J(e.disabled);return E(i,t,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:t}},name:t,mount:!0,...a}}),g.mount.add(t),l?rr({field:l,disabled:J(a.disabled)?a.disabled:e.disabled,name:t,value:a.value}):_(t,!0,a.value),{...d?{disabled:a.disabled||e.disabled}:{},...s.progressive?{required:!!a.required,min:_e(a.min),max:_e(a.max),minLength:_e(a.minLength),maxLength:_e(a.maxLength),pattern:_e(a.pattern)}:{},name:t,onChange:de,onBlur:de,ref:f=>{if(f){Ce(t,a),l=c(i,t);const o=C(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,h=rt(o),k=l._f.refs||[];if(h?k.find(M=>M===o):o===l._f.ref)return;E(i,t,{_f:{...l._f,...h?{refs:[...k.filter(He),o,...Array.isArray(c(n,t))?[{}]:[]],ref:{type:o.type,name:t}}:{ref:o}}}),_(t,!1,void 0,o)}else l=c(i,t,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||a.shouldUnregister)&&!(br(g.array,t)&&y.action)&&g.unMount.add(t)}}},tr=()=>s.shouldFocusError&&fe(i,ye,g.mount),Lr=t=>{J(t)&&(v.state.next({disabled:t}),fe(i,(a,l)=>{const d=c(i,l);d&&(a.disabled=d._f.disabled||t,Array.isArray(d._f.refs)&&d._f.refs.forEach(f=>{f.disabled=d._f.disabled||t}))},0,!1))},sr=(t,a)=>async l=>{let d;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let f=j(u);if(v.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:h}=await T();r.errors=o,f=h}else await W(i);if(L(r.errors,"root"),q(r.errors)){v.state.next({errors:{}});try{await t(f,l)}catch(o){d=o}}else a&&await a({...r.errors},l),tr(),setTimeout(tr);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:q(r.errors)&&!d,submitCount:r.submitCount+1,errors:r.errors}),d)throw d},Ur=(t,a={})=>{c(i,t)&&(C(a.defaultValue)?Y(t,j(c(n,t))):(Y(t,a.defaultValue),E(n,t,j(a.defaultValue))),a.keepTouched||L(r.touchedFields,t),a.keepDirty||(L(r.dirtyFields,t),r.isDirty=a.defaultValue?V(t,j(c(n,t))):V()),a.keepError||(L(r.errors,t),m.isValid&&B()),v.state.next({...r}))},ir=(t,a={})=>{const l=t?j(t):n,d=j(l),f=q(t),o=f?n:d;if(a.keepDefaultValues||(n=l),!a.keepValues){if(a.keepDirtyValues)for(const h of g.mount)c(r.dirtyFields,h)?E(o,h,c(u,h)):Y(h,c(o,h));else{if(Ge&&C(t))for(const h of g.mount){const k=c(i,h);if(k&&k._f){const M=Array.isArray(k._f.refs)?k._f.refs[0]:k._f.ref;if(Ve(M)){const I=M.closest("form");if(I){I.reset();break}}}}i={}}u=e.shouldUnregister?a.keepDefaultValues?j(n):{}:j(o),v.array.next({values:{...o}}),v.values.next({values:{...o}})}g={mount:a.keepDirtyValues?g.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},y.mount=!m.isValid||!!a.keepIsValid||!!a.keepDirtyValues,y.watch=!!e.shouldUnregister,v.state.next({submitCount:a.keepSubmitCount?r.submitCount:0,isDirty:f?!1:a.keepDirty?r.isDirty:!!(a.keepDefaultValues&&!ne(t,n)),isSubmitted:a.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:f?{}:a.keepDirtyValues?a.keepDefaultValues&&u?xe(n,u):r.dirtyFields:a.keepDefaultValues&&t?xe(n,t):a.keepDirty?r.dirtyFields:{},touchedFields:a.keepTouched?r.touchedFields:{},errors:a.keepErrors?r.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},ar=(t,a)=>ir(ae(t)?t(u):t,a);return{control:{register:Ce,unregister:Ee,getFieldState:Ze,handleSubmit:sr,setError:er,_executeSchema:T,_getWatch:D,_getDirty:V,_updateValid:B,_removeUnmounted:me,_updateFieldArray:p,_updateDisabledField:rr,_getFieldArray:R,_reset:ir,_resetDefaultValues:()=>ae(s.defaultValues)&&s.defaultValues().then(t=>{ar(t,s.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:t=>{r={...r,...t}},_disableForm:Lr,_subjects:v,_proxyFormState:m,_setErrors:Z,get _fields(){return i},get _formValues(){return u},get _state(){return y},set _state(t){y=t},get _defaultValues(){return n},get _names(){return g},set _names(t){g=t},get _formState(){return r},set _formState(t){r=t},get _options(){return s},set _options(t){s={...s,...t}}},trigger:ge,register:Ce,handleSubmit:sr,watch:Or,setValue:Y,getValues:Xe,reset:ar,resetField:Ur,clearErrors:Tr,unregister:Ee,setError:er,setFocus:(t,a={})=>{const l=c(i,t),d=l&&l._f;if(d){const f=d.refs?d.refs[0]:d.ref;f.focus&&(f.focus(),a.shouldSelect&&f.select())}},getFieldState:Ze}}function vt(e={}){const s=F.useRef(),r=F.useRef(),[i,n]=F.useState({isDirty:!1,isValidating:!1,isLoading:ae(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ae(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...lt(e),formState:i});const u=s.current.control;return u._options=e,ke({subject:u._subjects.state,next:y=>{Fr(y,u._proxyFormState,u._updateFormState,!0)&&n({...u._formState})}}),F.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),F.useEffect(()=>{if(u._proxyFormState.isDirty){const y=u._getDirty();y!==i.isDirty&&u._subjects.state.next({isDirty:y})}},[u,i.isDirty]),F.useEffect(()=>{e.values&&!ne(e.values,r.current)?(u._reset(e.values,u._options.resetOptions),r.current=e.values,n(y=>({...y}))):u._resetDefaultValues()},[e.values,u]),F.useEffect(()=>{e.errors&&u._setErrors(e.errors)},[e.errors,u]),F.useEffect(()=>{u._state.mount||(u._updateValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),F.useEffect(()=>{e.shouldUnregister&&u._subjects.values.next({values:u._getWatch()})},[e.shouldUnregister,u]),s.current.formState=xr(i,u),s.current}function ot({fullWidth:e=!1,multiple:s=!1,required:r=!1,label:i="",placeholer:n="",options:u=[],helperText:y="",error:g=!1,margin:x="",textDirection:O="row",size:m,...v}){const S=u.find(w=>w.value===v.value),$=S==null?void 0:S.title;return P.jsxs(Ir,{margin:x,fullWidth:e,error:g,children:[P.jsx(Br,{size:m,children:`${i}${r?"*":""}`}),P.jsxs(Nr,{multiple:s,input:P.jsx(Pr,{defaultValue:$,sx:{flex:1},required:r,label:i,inputProps:{margin:x},size:m}),renderValue:w=>{if(s)return P.jsx(lr,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:w.map(B=>{const z=u.find(p=>p.value===B);return z&&z.title&&P.jsx(Wr,{size:"small",label:z.title},B)})});const te=u.find(B=>B.value===w);return te&&te.title&&P.jsxs(lr,{children:[P.jsx(Le,{component:"span",children:te.title}),P.jsx(Le,{marginLeft:1,component:"span",variant:"body2",color:"text.secondary",children:te.description})]})},...v,children:[P.jsx(Ue,{disabled:!0,children:P.jsx("em",{children:n})}),!r&&!s&&P.jsx(Ue,{value:"",children:"None"}),u.map(w=>w&&w.value&&P.jsxs(Ue,{sx:[{justifyContent:"center"},O==="column"?{flexDirection:"column",alignItems:"flex-start"}:{}],value:w.value,children:[P.jsx(qr,{children:w.title}),w.description&&P.jsx(Le,{variant:"body2",color:"text.secondary",sx:{maxWidth:"100%",whiteSpace:"normal"},children:w.description})]},w.value))]}),P.jsx(Hr,{children:y})]})}ot.propTypes={error:re.bool,required:re.bool,multiple:re.bool,fullWidth:re.bool,label:re.string,placeholer:re.string,options:re.array,helperText:re.string,margin:re.string,size:re.string,textDirection:re.oneOf("row","column")};export{_t as C,ot as S,ht as a,vt as u};
@@ -1,2 +1,2 @@
1
- import{cr as I,cp as P,cB as w,c as R}from"./vendor-mui-core-BlX2BJoA.js";function q(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}const U=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"}));function M(r,e){if(e&&(I(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(r)}const N=Object.freeze(Object.defineProperty({__proto__:null,default:M},Symbol.toStringTag,{value:"Module"}));function d(r){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(r)}const B=Object.freeze(Object.defineProperty({__proto__:null,get default(){return d}},Symbol.toStringTag,{value:"Module"}));function L(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&w(r,e)}const D=Object.freeze(Object.defineProperty({__proto__:null,default:L},Symbol.toStringTag,{value:"Module"}));function m(r,e){if(r==null)return{};var o,t,n=R(r,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(t=0;t<a.length;t++)o=a[t],e.includes(o)||{}.propertyIsEnumerable.call(r,o)&&(n[o]=r[o])}return n}const $=Object.freeze(Object.defineProperty({__proto__:null,default:m},Symbol.toStringTag,{value:"Module"}));var c={exports:{}},f={exports:{}},h;function C(){return h||(h=1,function(r){function e(o){if(Array.isArray(o))return o}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports}(f)),f.exports}var y={exports:{}},A;function W(){return A||(A=1,function(r){function e(o,t){var n=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(n!=null){var a,i,s,l,p=[],u=!0,v=!1;try{if(s=(n=n.call(o)).next,t===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(a=s.call(n)).done)&&(p.push(a.value),p.length!==t);u=!0);}catch(S){v=!0,i=S}finally{try{if(!u&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(v)throw i}}return p}}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports}(y)),y.exports}var b={exports:{}},_={exports:{}},T;function k(){return T||(T=1,function(r){function e(o,t){(t==null||t>o.length)&&(t=o.length);for(var n=0,a=Array(t);n<t;n++)a[n]=o[n];return a}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports}(_)),_.exports}var O;function z(){return O||(O=1,function(r){var e=k();function o(t,n){if(t){if(typeof t=="string")return e(t,n);var a={}.toString.call(t).slice(8,-1);return a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set"?Array.from(t):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?e(t,n):void 0}}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports}(b)),b.exports}var x={exports:{}},g;function E(){return g||(g=1,function(r){function e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{cr as I,cp as P,cB as w,c as R}from"./vendor-mui-core-jh6OMVvU.js";function q(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}const U=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"}));function M(r,e){if(e&&(I(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(r)}const N=Object.freeze(Object.defineProperty({__proto__:null,default:M},Symbol.toStringTag,{value:"Module"}));function d(r){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(r)}const B=Object.freeze(Object.defineProperty({__proto__:null,get default(){return d}},Symbol.toStringTag,{value:"Module"}));function L(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&w(r,e)}const D=Object.freeze(Object.defineProperty({__proto__:null,default:L},Symbol.toStringTag,{value:"Module"}));function m(r,e){if(r==null)return{};var o,t,n=R(r,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(t=0;t<a.length;t++)o=a[t],e.includes(o)||{}.propertyIsEnumerable.call(r,o)&&(n[o]=r[o])}return n}const $=Object.freeze(Object.defineProperty({__proto__:null,default:m},Symbol.toStringTag,{value:"Module"}));var c={exports:{}},f={exports:{}},h;function C(){return h||(h=1,function(r){function e(o){if(Array.isArray(o))return o}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports}(f)),f.exports}var y={exports:{}},A;function W(){return A||(A=1,function(r){function e(o,t){var n=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(n!=null){var a,i,s,l,p=[],u=!0,v=!1;try{if(s=(n=n.call(o)).next,t===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(a=s.call(n)).done)&&(p.push(a.value),p.length!==t);u=!0);}catch(S){v=!0,i=S}finally{try{if(!u&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(v)throw i}}return p}}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports}(y)),y.exports}var b={exports:{}},_={exports:{}},T;function k(){return T||(T=1,function(r){function e(o,t){(t==null||t>o.length)&&(t=o.length);for(var n=0,a=Array(t);n<t;n++)a[n]=o[n];return a}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports}(_)),_.exports}var O;function z(){return O||(O=1,function(r){var e=k();function o(t,n){if(t){if(typeof t=="string")return e(t,n);var a={}.toString.call(t).slice(8,-1);return a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set"?Array.from(t):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?e(t,n):void 0}}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports}(b)),b.exports}var x={exports:{}},g;function E(){return g||(g=1,function(r){function e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports}(x)),x.exports}var j;function F(){return j||(j=1,function(r){var e=C(),o=W(),t=z(),n=E();function a(i,s){return e(i)||o(i,s)||t(i,s)||n()}r.exports=a,r.exports.__esModule=!0,r.exports.default=r.exports}(c)),c.exports}export{q as _,m as a,L as b,M as c,d,U as e,B as g,D as i,$ as o,N as p,F as r};
@@ -1,4 +1,4 @@
1
- import{t as $,j as t,a2 as W,bs as D,a3 as l,E as m,aQ as M,br as O,aa as j,v as F}from"./vendor-mui-core-BlX2BJoA.js";import{r as h,L as T}from"./vendor-react-D-afvo_7.js";import{I as H}from"./vendor-hooks-CLzfFpO7.js";import{j as q}from"./vendor-utils-DCpRgzMR.js";import{d as K}from"./PlayArrow-Du9tHm7-.js";import{d as V}from"./Error-CpLyAhkv.js";import{g as U,z as u,C as Q,d as b,ag as k,Q as X,ai as G}from"./vendor-arcblock-CZGLzU01.js";import{W as J}from"./did-address-vWQGhW6L.js";import{d as L,e as R,g as Y,f as g,S as Z,h as ee,j as te,k as oe,l as ie,m as I,n as ne}from"./index-BjauMU9c.js";import{d as re}from"./ServerLogo-UNPlRpuM.js";import{H as ae}from"./addon-BQKNb4Py.js";import{g as S}from"./get-safe-url-Ddj-Tmsl.js";import"./QuestionMarkCircle-gL_QM35Z.js";function z({appInfo:e,...r}){const[o,i]=h.useState(!1),s=$(d=>d.breakpoints.down("md"))?32:48;return o?t.jsx(X,{did:e.publisher,size:s}):t.jsx(G,{src:e.icon,alt:e.title,width:s,height:s,...r,onError:()=>i(!0)})}z.propTypes={appInfo:m.object.isRequired};const C=(e,r)=>g.findComponentByIdV2(e,r)||e;function _e(){var v,_,E,N;const{t:e,locale:r}=U(),[o,i]=H({blocklet:null,component:null,launcherSession:null,loading:!1,starting:!1,manageSubscriptionURL:""}),p=$(a=>a.breakpoints.down("md")),s=new URL(window.location.href),d=s.searchParams.get("componentId"),w=()=>{const a=s.searchParams.get("redirect")||"/";window.location.href=S(decodeURIComponent(a))},y=()=>{const a=setInterval(()=>{L.get("/blocklet/detail?nocache=1").then(({data:n})=>{const c=C(n,d);if(c.status==="running"){w();return}c.status!=="starting"&&(i({blocklet:n,starting:!1}),n!==c&&i({component:c}),clearInterval(a))}).catch(n=>{i({loading:!1}),u.error(n.message)})},3e3)};h.useEffect(()=>{i({loading:!0}),L.get("/blocklet/detail?nocache=1").then(({data:a})=>{const n=C(a,d);if(i({loading:!1}),n.status==="running"){w();return}i({blocklet:a}),a!==n&&i({component:n}),n.status==="starting"&&(i({starting:!0}),y())}).catch(a=>{i({loading:!1}),u.error(a.message)})},[]);const B=h.useCallback(()=>{var n;i({loading:!0,starting:!0});const a={did:(n=o.blocklet)==null?void 0:n.meta.did};o.component&&(a.componentDids=[o.component.meta.did]),R.startBlocklet({input:a}).then(()=>{y()}).catch(c=>{u.error(c.message),i({loading:!1,starting:!1})})},[o.component,o.blocklet]);if(h.useEffect(()=>{var a;(a=o.blocklet)!=null&&a.controller&&(Y({launcherUrl:o.blocklet.controller.launcherUrl,launcherSessionId:o.blocklet.controller.launcherSessionId,locale:r}).then(n=>{i({manageSubscriptionURL:n})}).catch(n=>{console.error("get manage subscription url error",n)}),R.getLauncherSession({input:{launcherSessionId:o.blocklet.controller.launcherSessionId,launcherUrl:o.blocklet.controller.launcherUrl}}).then(n=>{i({launcherSession:n.launcherSession}).catch(c=>{console.error("get launcher session error",c)})}))},[(v=o.blocklet)==null?void 0:v.controller]),!o.blocklet)return t.jsx(Q,{children:t.jsx(W,{})});const x={icon:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo`,title:g.getDisplayName(o.blocklet),publisher:o.blocklet.appDid},f=localStorage.getItem("blocklet-server-url"),P=()=>{f&&window.open(S(f,{allowDomains:null}))};return t.jsxs(le,{children:[t.jsx(D,{styles:se}),t.jsxs("header",{className:"root-header",children:[!p&&t.jsx("div",{className:"left",children:t.jsx(re,{width:"128",height:"48",onClick:P,style:{cursor:f?"pointer":""}})}),t.jsx("div",{className:"right",children:t.jsx(ae,{SessionContext:Z})})]}),t.jsxs(de,{elevation:0,children:[t.jsxs(ce,{children:[t.jsx(z,{appInfo:x}),t.jsxs("div",{className:"app-info_content",children:[t.jsx(l,{className:"app-info_name",children:x.title}),t.jsx(J,{size:14,className:"app-info_did",did:x.publisher})]})]}),((N=(E=(_=o.blocklet)==null?void 0:_.controller)==null?void 0:E.status)==null?void 0:N.value)!==ee.BLOCKLET_CONTROLLER_STATUS.suspended&&t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(l,{className:"icon",children:t.jsx(K,{})}),t.jsx(l,{className:"title",children:e("blocklet.startApplication")})]}),t.jsx(l,{className:"sub-title",children:e("blocklet.startDescription",{name:o.component?g.getDisplayName(o.component,!0):g.getDisplayName(o.blocklet)})}),t.jsx(l,{mt:8,children:t.jsx(k,{style:{minWidth:200},disabled:o.loading||o.starting,variant:"contained",color:"primary",size:"large",loading:o.starting,onClick:()=>B(),children:o.starting?e("blocklet.starting"):e("blocklet.start")})})]}),te(o.blocklet)&&t.jsx(A,{blocklet:o.blocklet,launcherSession:o.launcherSession,manageSubscriptionURL:o.manageSubscriptionURL}),t.jsx(l,{mt:5,children:t.jsx(T,{className:"footer-link",to:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/overview`,children:e("blocklet.dashboard")})})]})]})}function A({blocklet:e,launcherSession:r,manageSubscriptionURL:o}){const{t:i,locale:p}=U();if(!e||!r)return"";const s=oe(e,r),d=ie(e,r);return!s&&!d?"":t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(V,{className:"icon-error"}),t.jsxs(l,{className:"title error",children:[s&&i("blocklet.suspended"),d&&i("blocklet.terminated")]})]}),t.jsxs(l,{className:"sub-title",children:[s&&i("blocklet.suspendedCausedByExpired",{deadline:I(r==null?void 0:r.reservedUntil,p)}),d&&i("blocklet.suspendedCausedByTerminated",{canceledAt:I(r==null?void 0:r.terminatedAt,p),deadline:ne(r==null?void 0:r.terminatedAt,p)})]}),t.jsxs(l,{mt:8,children:[s&&t.jsx(k,{component:M,style:{minWidth:200},variant:"contained",color:"primary",size:"large",target:"_blank",href:o||"#",children:i("blocklet.manageSubscription")}),d&&t.jsx(k,{component:T,to:q(b.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/did-spaces"),style:{minWidth:200},variant:"contained",color:"primary",size:"large",children:i("common.backup")})]})]})}A.propTypes={blocklet:m.object.isRequired,launcherSession:m.object.isRequired,manageSubscriptionURL:m.string.isRequired};const se=O`
1
+ import{t as $,j as t,a2 as W,bs as D,a3 as l,E as m,bp as M,bo as O,aa as j,v as F}from"./vendor-mui-core-jh6OMVvU.js";import{r as h,L as T}from"./vendor-react-D-afvo_7.js";import{I as H}from"./vendor-hooks-CLzfFpO7.js";import{j as q}from"./vendor-utils-DCpRgzMR.js";import{d as K}from"./PlayArrow-BQPL8ZKx.js";import{d as V}from"./Error-BRj42iX7.js";import{g as U,z as u,C as X,d as b,ag as k,Q as G,ai as Q}from"./vendor-arcblock-BlPSuvWz.js";import{W as J}from"./did-address-DsOFwsmU.js";import{d as L,e as R,g as Y,f as g,S as Z,h as ee,j as te,k as oe,l as ie,m as I,n as ne}from"./index-CYQoZJsb.js";import{d as re}from"./ServerLogo-BtnYTJe2.js";import{H as ae}from"./addon-DRWTut9y.js";import{g as S}from"./get-safe-url-Bg-eYJFz.js";import"./QuestionMarkCircle-yIKrKrCO.js";function z({appInfo:e,...r}){const[o,i]=h.useState(!1),s=$(d=>d.breakpoints.down("md"))?32:48;return o?t.jsx(G,{did:e.publisher,size:s}):t.jsx(Q,{src:e.icon,alt:e.title,width:s,height:s,...r,onError:()=>i(!0)})}z.propTypes={appInfo:m.object.isRequired};const C=(e,r)=>g.findComponentByIdV2(e,r)||e;function _e(){var v,_,E,N;const{t:e,locale:r}=U(),[o,i]=H({blocklet:null,component:null,launcherSession:null,loading:!1,starting:!1,manageSubscriptionURL:""}),p=$(a=>a.breakpoints.down("md")),s=new URL(window.location.href),d=s.searchParams.get("componentId"),w=()=>{const a=s.searchParams.get("redirect")||"/";window.location.href=S(decodeURIComponent(a))},y=()=>{const a=setInterval(()=>{L.get("/blocklet/detail?nocache=1").then(({data:n})=>{const c=C(n,d);if(c.status==="running"){w();return}c.status!=="starting"&&(i({blocklet:n,starting:!1}),n!==c&&i({component:c}),clearInterval(a))}).catch(n=>{i({loading:!1}),u.error(n.message)})},3e3)};h.useEffect(()=>{i({loading:!0}),L.get("/blocklet/detail?nocache=1").then(({data:a})=>{const n=C(a,d);if(i({loading:!1}),n.status==="running"){w();return}i({blocklet:a}),a!==n&&i({component:n}),n.status==="starting"&&(i({starting:!0}),y())}).catch(a=>{i({loading:!1}),u.error(a.message)})},[]);const B=h.useCallback(()=>{var n;i({loading:!0,starting:!0});const a={did:(n=o.blocklet)==null?void 0:n.meta.did};o.component&&(a.componentDids=[o.component.meta.did]),R.startBlocklet({input:a}).then(()=>{y()}).catch(c=>{u.error(c.message),i({loading:!1,starting:!1})})},[o.component,o.blocklet]);if(h.useEffect(()=>{var a;(a=o.blocklet)!=null&&a.controller&&(Y({launcherUrl:o.blocklet.controller.launcherUrl,launcherSessionId:o.blocklet.controller.launcherSessionId,locale:r}).then(n=>{i({manageSubscriptionURL:n})}).catch(n=>{console.error("get manage subscription url error",n)}),R.getLauncherSession({input:{launcherSessionId:o.blocklet.controller.launcherSessionId,launcherUrl:o.blocklet.controller.launcherUrl}}).then(n=>{i({launcherSession:n.launcherSession}).catch(c=>{console.error("get launcher session error",c)})}))},[(v=o.blocklet)==null?void 0:v.controller]),!o.blocklet)return t.jsx(X,{children:t.jsx(W,{})});const x={icon:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo`,title:g.getDisplayName(o.blocklet),publisher:o.blocklet.appDid},f=localStorage.getItem("blocklet-server-url"),P=()=>{f&&window.open(S(f,{allowDomains:null}))};return t.jsxs(le,{children:[t.jsx(D,{styles:se}),t.jsxs("header",{className:"root-header",children:[!p&&t.jsx("div",{className:"left",children:t.jsx(re,{width:"128",height:"48",onClick:P,style:{cursor:f?"pointer":""}})}),t.jsx("div",{className:"right",children:t.jsx(ae,{SessionContext:Z})})]}),t.jsxs(de,{elevation:0,children:[t.jsxs(ce,{children:[t.jsx(z,{appInfo:x}),t.jsxs("div",{className:"app-info_content",children:[t.jsx(l,{className:"app-info_name",children:x.title}),t.jsx(J,{size:14,className:"app-info_did",did:x.publisher})]})]}),((N=(E=(_=o.blocklet)==null?void 0:_.controller)==null?void 0:E.status)==null?void 0:N.value)!==ee.BLOCKLET_CONTROLLER_STATUS.suspended&&t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(l,{className:"icon",children:t.jsx(K,{})}),t.jsx(l,{className:"title",children:e("blocklet.startApplication")})]}),t.jsx(l,{className:"sub-title",children:e("blocklet.startDescription",{name:o.component?g.getDisplayName(o.component,!0):g.getDisplayName(o.blocklet)})}),t.jsx(l,{mt:8,children:t.jsx(k,{style:{minWidth:200},disabled:o.loading||o.starting,variant:"contained",color:"primary",size:"large",loading:o.starting,onClick:()=>B(),children:o.starting?e("blocklet.starting"):e("blocklet.start")})})]}),te(o.blocklet)&&t.jsx(A,{blocklet:o.blocklet,launcherSession:o.launcherSession,manageSubscriptionURL:o.manageSubscriptionURL}),t.jsx(l,{mt:5,children:t.jsx(T,{className:"footer-link",to:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/overview`,children:e("blocklet.dashboard")})})]})]})}function A({blocklet:e,launcherSession:r,manageSubscriptionURL:o}){const{t:i,locale:p}=U();if(!e||!r)return"";const s=oe(e,r),d=ie(e,r);return!s&&!d?"":t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(V,{className:"icon-error"}),t.jsxs(l,{className:"title error",children:[s&&i("blocklet.suspended"),d&&i("blocklet.terminated")]})]}),t.jsxs(l,{className:"sub-title",children:[s&&i("blocklet.suspendedCausedByExpired",{deadline:I(r==null?void 0:r.reservedUntil,p)}),d&&i("blocklet.suspendedCausedByTerminated",{canceledAt:I(r==null?void 0:r.terminatedAt,p),deadline:ne(r==null?void 0:r.terminatedAt,p)})]}),t.jsxs(l,{mt:8,children:[s&&t.jsx(k,{component:M,style:{minWidth:200},variant:"contained",color:"primary",size:"large",target:"_blank",href:o||"#",children:i("blocklet.manageSubscription")}),d&&t.jsx(k,{component:T,to:q(b.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/did-spaces"),style:{minWidth:200},variant:"contained",color:"primary",size:"large",children:i("common.backup")})]})]})}A.propTypes={blocklet:m.object.isRequired,launcherSession:m.object.isRequired,manageSubscriptionURL:m.string.isRequired};const se=O`
2
2
  html,
3
3
  body,
4
4
  #app,
@@ -1,4 +1,4 @@
1
- import{e as c,t as w,j as o,a3 as r,E as e,aa as x}from"./vendor-mui-core-BlX2BJoA.js";import{g as b,ag as f}from"./vendor-arcblock-CZGLzU01.js";import{ae as h}from"./index-BjauMU9c.js";function y({key:t}={key:"sm"}){const n=c();return w(n.breakpoints.down(t))}function p({blocklet:t,onStartNow:n,children:s,disabled:l,startNowText:d,startNowProps:m}){const{t:u}=b(),a=y();return!t||h(t.meta)?o.jsx(i,{isMobile:a,children:s}):o.jsxs(i,{isMobile:a,children:[o.jsx(f,{className:"start-now",variant:"outlined",disabled:l,onClick:()=>n(),...m,children:d??u("setup.startNow")}),o.jsx(r,{display:"flex",variant:"contained",color:"primary",alignItems:"center",marginLeft:"32px",children:s})]})}p.propTypes={blocklet:e.object,onStartNow:e.func,children:e.any,disabled:e.bool,startNowText:e.string,startNowProps:e.any};p.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1,startNowText:void 0,startNowProps:{}};const i=x(r)`
1
+ import{e as c,t as w,j as o,a3 as r,E as e,aa as x}from"./vendor-mui-core-jh6OMVvU.js";import{g as b,ag as f}from"./vendor-arcblock-BlPSuvWz.js";import{ae as h}from"./index-CYQoZJsb.js";function y({key:t}={key:"sm"}){const n=c();return w(n.breakpoints.down(t))}function p({blocklet:t,onStartNow:n,children:s,disabled:l,startNowText:d,startNowProps:m}){const{t:u}=b(),a=y();return!t||h(t.meta)?o.jsx(i,{isMobile:a,children:s}):o.jsxs(i,{isMobile:a,children:[o.jsx(f,{className:"start-now",variant:"outlined",disabled:l,onClick:()=>n(),...m,children:d??u("setup.startNow")}),o.jsx(r,{display:"flex",variant:"contained",color:"primary",alignItems:"center",marginLeft:"32px",children:s})]})}p.propTypes={blocklet:e.object,onStartNow:e.func,children:e.any,disabled:e.bool,startNowText:e.string,startNowProps:e.any};p.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1,startNowText:void 0,startNowProps:{}};const i=x(r)`
2
2
  padding-top: 24px;
3
3
  margin-top: auto;
4
4
  width: 100%;