@abtnode/blocklet-services 1.17.6-beta-20251221-021146-1a145a92 → 1.17.7-beta-20251223-090654-55d57623

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 (121) hide show
  1. package/api/services/notification/queue.js +4 -0
  2. package/dist/assets/{access-control-BhOT85R4.js → access-control-CcqhN9eH.js} +1 -1
  3. package/dist/assets/{add-component-core-heDvzsX8.js → add-component-core-C7Ksojy0.js} +1 -1
  4. package/dist/assets/{add-resource-BkuSIexh.js → add-resource-CyoiDXcs.js} +1 -1
  5. package/dist/assets/{addon-B_DwHOas.js → addon-DbU0Ni5H.js} +1 -1
  6. package/dist/assets/{advanced-swM31Eiv.js → advanced-DyGgZSKn.js} +1 -1
  7. package/dist/assets/{aigne-CQrMsm7D.js → aigne-Biwp5TgZ.js} +1 -1
  8. package/dist/assets/{appearance-1Y_gCbL9.js → appearance-CP2saN8e.js} +1 -1
  9. package/dist/assets/{audit-logs-CHjIu_sG.js → audit-logs-ClC8rsLg.js} +1 -1
  10. package/dist/assets/{authorize-BjNz4CIx.js → authorize-C8addT1l.js} +1 -1
  11. package/dist/assets/{bind-account-Cp_jRmuc.js → bind-account-C3ikaqbA.js} +1 -1
  12. package/dist/assets/{branding-Cy4S7ifJ.js → branding-BWDcuHK0.js} +1 -1
  13. package/dist/assets/{branding-DclrAcmZ.js → branding-BYJ9wBmN.js} +1 -1
  14. package/dist/assets/{branding-BkFb6cTS.js → branding-eZco46gS.js} +1 -1
  15. package/dist/assets/{bundle-avatar-BZ_OHQ8d.js → bundle-avatar-CBW9tbvC.js} +1 -1
  16. package/dist/assets/{complete-BBxVJgzT.js → complete-owQjgqP2.js} +1 -1
  17. package/dist/assets/{component-DTec6zax.js → component-CZUGuhBp.js} +2 -2
  18. package/dist/assets/{config-uF2iao7N.js → config-BwLMiIKp.js} +1 -1
  19. package/dist/assets/{config-Bu8dI7mW.js → config-C9Q_3I9H.js} +1 -1
  20. package/dist/assets/{config-B6DS9_16.js → config-DPHytSzB.js} +1 -1
  21. package/dist/assets/{config-navigation-hnPNfA90.js → config-navigation-DRx0q2MD.js} +2 -2
  22. package/dist/assets/{config-space-OgBdtdQ7.js → config-space-B7BwTKLT.js} +1 -1
  23. package/dist/assets/{confirm-btfSjmnK.js → confirm-D3ZOq19V.js} +1 -1
  24. package/dist/assets/{connect-0rgz4tLV.js → connect-DC4M6Sfk.js} +1 -1
  25. package/dist/assets/{connect-C_8n2GAP.js → connect-b5hYafr7.js} +1 -1
  26. package/dist/assets/{connect-to-_CNpUNET.js → connect-to-BqMkANDm.js} +1 -1
  27. package/dist/assets/{dashboard-C0oSA3oj.js → dashboard-DPCpuxBj.js} +2 -2
  28. package/dist/assets/{delete-confirm-dqp-ol9_.js → delete-confirm-CvVgX89H.js} +1 -1
  29. package/dist/assets/{domain-C8SVzMQz.js → domain-DBV8eBwE.js} +1 -1
  30. package/dist/assets/{domain-action-card-B9GypCwf.js → domain-action-card-BTzoEvCg.js} +1 -1
  31. package/dist/assets/{domains-CiKmqXgC.js → domains-3VVRUwD7.js} +1 -1
  32. package/dist/assets/{email-Dg6hVyjU.js → email-CJqJ73o8.js} +1 -1
  33. package/dist/assets/engine-Ctj5gh6M.js +1 -0
  34. package/dist/assets/{exchange-passport-DBGg6mtf.js → exchange-passport-CWSz84jX.js} +1 -1
  35. package/dist/assets/{form-ayzBN20_.js → form-BDqnlPbC.js} +1 -1
  36. package/dist/assets/{fuel-Vs28WoOz.js → fuel-DS6CQdbE.js} +1 -1
  37. package/dist/assets/{gen-access-key-BzRnSZMg.js → gen-access-key-DSBH6387.js} +1 -1
  38. package/dist/assets/{gen-simple-access-key-ClX05cKV.js → gen-simple-access-key-OIDIjNLc.js} +1 -1
  39. package/dist/assets/{get-safe-url-BW-k89rQ.js → get-safe-url-BIGE7_Qp.js} +1 -1
  40. package/dist/assets/{home-Ds1wkYQ9.js → home-C6D8L8l9.js} +1 -1
  41. package/dist/assets/{iframe-CXruOREe.js → iframe-8V4ttVHV.js} +1 -1
  42. package/dist/assets/{index-DVQWYAIC.js → index-BAErdc3T.js} +1 -1
  43. package/dist/assets/{index-LIDGq9IJ.js → index-BB3pIdTj.js} +1 -1
  44. package/dist/assets/{index-B4oHJYN3.js → index-BDPrAFK5.js} +1 -1
  45. package/dist/assets/{index-C8ve20rA.js → index-BMBR4jWm.js} +1 -1
  46. package/dist/assets/{index-CF3y44xd.js → index-BQFqfTN1.js} +1 -1
  47. package/dist/assets/{index-Bgm1pC2t.js → index-Bik7zY2I.js} +1 -1
  48. package/dist/assets/{index-Cn9-WXPN.js → index-BmEXU6vj.js} +1 -1
  49. package/dist/assets/{index-DQ6KmrJ_.js → index-BoNPkce-.js} +1 -1
  50. package/dist/assets/{index-DgEP8auA.js → index-Bu1nTc5x.js} +1 -1
  51. package/dist/assets/{index-BAO6XTWC.js → index-CA8KVVfT.js} +1 -1
  52. package/dist/assets/{index-DwK0GIrs.js → index-CDZlfV0h.js} +65 -65
  53. package/dist/assets/{index-BmSuXiNh.js → index-COc3cI68.js} +1 -1
  54. package/dist/assets/{index-C6f1LKt3.js → index-C_0pT37U.js} +1 -1
  55. package/dist/assets/{index-jh20BesS.js → index-CbA_EJi-.js} +1 -1
  56. package/dist/assets/{index-u9yYWXco.js → index-CtBJPFT5.js} +2 -2
  57. package/dist/assets/{index-DajrAixi.js → index-D1ZBWiBh.js} +1 -1
  58. package/dist/assets/{index-BqmdsAZZ.js → index-DK6Ws14k.js} +1 -1
  59. package/dist/assets/{index-D-q1dCoY.js → index-DbhZjmcw.js} +1 -1
  60. package/dist/assets/{index-B88jTj-J.js → index-DfH5MtA4.js} +1 -1
  61. package/dist/assets/{index-DooQPBUl.js → index-YVLFMapw.js} +1 -1
  62. package/dist/assets/{index-DG2f1wAe.js → index-f9kknM1U.js} +1 -1
  63. package/dist/assets/{index-BvsQyxi_.js → index-fvFGLK4q.js} +3 -3
  64. package/dist/assets/{index-Bcpfja_q.js → index-qF59ePP4.js} +1 -1
  65. package/dist/assets/{index-DQ5hcDOb.js → index-qXLxdehr.js} +1 -1
  66. package/dist/assets/{index-B5Fc7Exm.js → index-qbQiaInB.js} +1 -1
  67. package/dist/assets/{index-B1BMtpDu.js → index-sxg2jpz1.js} +1 -1
  68. package/dist/assets/{invitation-BcEFpMQA.js → invitation-BL-oq-bZ.js} +1 -1
  69. package/dist/assets/{invitations-DmsPff5b.js → invitations-D_WuwVBY.js} +1 -1
  70. package/dist/assets/{invite-GF63A7GD.js → invite-CZXWbdah.js} +1 -1
  71. package/dist/assets/{isURL-CkV6bNHJ.js → isURL-CRNOx2AN.js} +1 -1
  72. package/dist/assets/{issue-passport-BXOKXvyV.js → issue-passport-C8DmKg9H.js} +1 -1
  73. package/dist/assets/{item-BSFssoYN.js → item-NbVFwplA.js} +1 -1
  74. package/dist/assets/{landing-page-BE08UeOH.js → landing-page-CBmSfoFm.js} +1 -1
  75. package/dist/assets/{layout-BPsPNtH9.js → layout-BFN2VPgc.js} +1 -1
  76. package/dist/assets/{list-CLOYr71b.js → list-BHVkP4fU.js} +1 -1
  77. package/dist/assets/{list-Byc72bDA.js → list-D6uynRH5.js} +1 -1
  78. package/dist/assets/{localization-L4ZbLe_a.js → localization-DnFDOrOQ.js} +1 -1
  79. package/dist/assets/{log-D198F7U3.js → log-CzJDSGek.js} +1 -1
  80. package/dist/assets/{login-wDtMfbHT.js → login-CU3trWD-.js} +1 -1
  81. package/dist/assets/{login-oauth-callback-CC9N1S9d.js → login-oauth-callback-37mFmo_M.js} +1 -1
  82. package/dist/assets/{logo-uploader-BL-x4TAv.js → logo-uploader-CdD4-48m.js} +1 -1
  83. package/dist/assets/{lost-passport-CKHtQDwr.js → lost-passport-C9Hyh4Ed.js} +1 -1
  84. package/dist/assets/{open-window-CU415CjG.js → open-window-0VJZR9pK.js} +1 -1
  85. package/dist/assets/{over-due-invoice-payment-Bux67LFM.js → over-due-invoice-payment-1xzXw3lQ.js} +1 -1
  86. package/dist/assets/{overview-DLpRsiS6.js → overview-BJcUiexv.js} +1 -1
  87. package/dist/assets/{passport-jAMdp3_i.js → passport-CWGJXEtt.js} +1 -1
  88. package/dist/assets/{passport-item-regWhYCV.js → passport-item-Bu_f0D0b.js} +1 -1
  89. package/dist/assets/{permission-PnySJGEl.js → permission-ZblvP8BW.js} +1 -1
  90. package/dist/assets/{preferences-BdtsycEO.js → preferences-DEzl011I.js} +1 -1
  91. package/dist/assets/{profile-embed-BjhIRlnb.js → profile-embed-iCopDM3E.js} +1 -1
  92. package/dist/assets/{publish-resource-B_cHs_c_.js → publish-resource-uZOmj-Xz.js} +1 -1
  93. package/dist/assets/{runtime-B9zsyQJH.js → runtime-Cucy5KcL.js} +1 -1
  94. package/dist/assets/sdk-aly4y-HK.js +1 -0
  95. package/dist/assets/{security-DsvOVk8Y.js → security-B5St5gtl.js} +1 -1
  96. package/dist/assets/{session-nLCSznMa.js → session-BqnhIOZD.js} +1 -1
  97. package/dist/assets/{setup-D28cEOB_.js → setup-DAJjDkED.js} +1 -1
  98. package/dist/assets/{spaces-B6hICxl4.js → spaces-CWRlaHIZ.js} +1 -1
  99. package/dist/assets/{start-D6x0fYx9.js → start-BnztTpX3.js} +1 -1
  100. package/dist/assets/{starting-progress-D4qoLrH0.js → starting-progress-CGjjGpuY.js} +1 -1
  101. package/dist/assets/{status-BOjZ6Vaq.js → status-Bk4He7Xx.js} +1 -1
  102. package/dist/assets/{step-actions-Cfagh9Pk.js → step-actions-CNIiIH7j.js} +1 -1
  103. package/dist/assets/{studio-D_ap2IaO.js → studio-BasxWENX.js} +1 -1
  104. package/dist/assets/{team-BETRxUUw.js → team-CF6hrmVi.js} +1 -1
  105. package/dist/assets/{traffic-CYr-3G37.js → traffic-C3uP0LAp.js} +1 -1
  106. package/dist/assets/{transfer-Cg9oSSyL.js → transfer-IX3OJWyW.js} +1 -1
  107. package/dist/assets/{unsubscribe-Csiks0SI.js → unsubscribe-BvvM7eMA.js} +1 -1
  108. package/dist/assets/{use-app-logo-BgQdzlhG.js → use-app-logo-7cAapfl7.js} +1 -1
  109. package/dist/assets/{user-center-CGXOHu_w.js → user-center-ChblBbZV.js} +1 -1
  110. package/dist/assets/{user-follower-__aq0tH0.js → user-follower-CVGmlOad.js} +1 -1
  111. package/dist/assets/{util-Bps9wpLH.js → util-4RKb-Srn.js} +1 -1
  112. package/dist/assets/{util-D27AtnBb.js → util-DE6S-EwK.js} +1 -1
  113. package/dist/assets/{wait-connect-AqdGAvY7.js → wait-connect-COGsNIA_.js} +1 -1
  114. package/dist/assets/{wizard-asHyteJr.js → wizard-5PG9Y1qa.js} +1 -1
  115. package/dist/assets/{wizard-components-YsOxzGWe.js → wizard-components-BgKNgavh.js} +1 -1
  116. package/dist/assets/{wrap-locale-Dfmt13Mn.js → wrap-locale-DJbgvexA.js} +1 -1
  117. package/dist/assets/{zh-DEgV10nE.js → zh-CeRIETvo.js} +1 -1
  118. package/dist/index.html +1 -1
  119. package/package.json +23 -23
  120. package/dist/assets/engine-0ct2xW2c.js +0 -1
  121. package/dist/assets/sdk-CkLW4ZmH.js +0 -1
@@ -402,6 +402,7 @@ const init = ({ node, notificationService }) => {
402
402
  job: {
403
403
  email,
404
404
  notificationId: notification.id,
405
+ teamDid: teamDid ?? nodeInfo.did,
405
406
  input: {
406
407
  notification,
407
408
  sender,
@@ -525,6 +526,7 @@ const init = ({ node, notificationService }) => {
525
526
  job: {
526
527
  url,
527
528
  notificationId: notification.id,
529
+ teamDid: teamDid ?? nodeInfo.did,
528
530
  input: {
529
531
  notification,
530
532
  sender,
@@ -607,6 +609,7 @@ const init = ({ node, notificationService }) => {
607
609
  receiver: receiverDid,
608
610
  isResend,
609
611
  pushOnly: props.pushOnly && !isResend,
612
+ teamDid: teamDid ?? nodeInfo.did,
610
613
  },
611
614
  delay: 10,
612
615
  });
@@ -652,6 +655,7 @@ const init = ({ node, notificationService }) => {
652
655
  isResend,
653
656
  pushOnly: props.pushOnly && !isResend,
654
657
  source,
658
+ teamDid: teamDid ?? nodeInfo.did,
655
659
  },
656
660
  delay: 5,
657
661
  });
@@ -1,4 +1,4 @@
1
- import{D as E,j as e,ak as l,y as h,bW as A,bX as g,bY as y,at as L,W as N}from"./vendor-mui-core-DnR6WYuU.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{V as I,H as j}from"./vendor-ux-DfSgTRg5.js";import{A as b}from"./config-B6DS9_16.js";import{a as O}from"./page-header-CHAwrgX-.js";import{y as v,q as R,c as o,r as Y}from"./index-DwK0GIrs.js";import{S as T}from"./layout-BPsPNtH9.js";import{S as W}from"./step-actions-Cfagh9Pk.js";import{S as D}from"./button-D6RwAFss.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";function P({onNext:a=()=>{}}){const C=E(),{t:n,locale:p}=I(),[i,c]=m.useState(!1),[S,d]=m.useState(""),{blocklet:r}=v();m.useEffect(()=>{const t=R.findServiceFromMeta(r.meta,o.NODE_SERVICES.AUTH);d(t?.config?.whoCanAccess||o.WHO_CAN_ACCESS.ALL)},[r]);const f=async t=>{let s=o.ACCESS_POLICY_PUBLIC;t===o.WHO_CAN_ACCESS.ALL?s=o.ACCESS_POLICY_PUBLIC:t===o.WHO_CAN_ACCESS.INVITED?s=o.ACCESS_POLICY_INVITED_ONLY:t===o.WHO_CAN_ACCESS.OWNER?s=o.ACCESS_POLICY_OWNER_ONLY:t===o.WHO_CAN_ACCESS.ADMIN&&(s=o.ACCESS_POLICY_ADMIN_ONLY);try{c(!0),await Y.updateBlockletSecurityRule({input:{did:r.meta.did,data:{id:o.SECURITY_RULE_DEFAULT_ID,accessPolicyId:s}}}),c(!1)}catch(_){c(!1),j.error(_.message)}},x=async t=>{i||(d(t.target.value),await f(t.target.value))},u={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:C.palette.text.secondary};return e.jsxs(k,{children:[e.jsx(l,{className:"header",children:e.jsx(O,{title:n("blocklet.config.access.title"),subTitle:n("blocklet.config.access.description")})}),e.jsx(l,{className:"form-container",children:e.jsx(h,{component:"fieldset",children:e.jsx(A,{name:"inherit",value:S,onChange:x,children:b.map(t=>e.jsxs(l,{sx:{mb:2,"&:last-child":{mb:0}},children:[e.jsx(g,{value:t.value,control:e.jsx(y,{size:"small",color:"primary"}),label:e.jsxs("span",{style:{display:"flex",alignItems:"center",position:"relative"},children:[e.jsx(t.icon,{style:u}),e.jsx("span",{style:{marginTop:2},children:t.title[p]})]})}),e.jsx(l,{className:"tip",children:t.description[p]})]},t.value))})})}),e.jsx(W,{mt:8,disabled:i,blocklet:r,onStartNow:()=>a("complete"),children:e.jsx(D,{loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:n("setup.continue")})})]})}P.propTypes={onNext:N.func};const k=L(T)`
1
+ import{D as E,j as e,ak as l,y as h,bW as A,bX as g,bY as y,at as L,W as N}from"./vendor-mui-core-DnR6WYuU.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{V as I,H as j}from"./vendor-ux-DfSgTRg5.js";import{A as b}from"./config-DPHytSzB.js";import{a as O}from"./page-header-CHAwrgX-.js";import{y as v,q as R,c as o,r as Y}from"./index-CDZlfV0h.js";import{S as T}from"./layout-BFN2VPgc.js";import{S as W}from"./step-actions-CNIiIH7j.js";import{S as D}from"./button-D6RwAFss.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";function P({onNext:a=()=>{}}){const C=E(),{t:n,locale:p}=I(),[i,c]=m.useState(!1),[S,d]=m.useState(""),{blocklet:r}=v();m.useEffect(()=>{const t=R.findServiceFromMeta(r.meta,o.NODE_SERVICES.AUTH);d(t?.config?.whoCanAccess||o.WHO_CAN_ACCESS.ALL)},[r]);const f=async t=>{let s=o.ACCESS_POLICY_PUBLIC;t===o.WHO_CAN_ACCESS.ALL?s=o.ACCESS_POLICY_PUBLIC:t===o.WHO_CAN_ACCESS.INVITED?s=o.ACCESS_POLICY_INVITED_ONLY:t===o.WHO_CAN_ACCESS.OWNER?s=o.ACCESS_POLICY_OWNER_ONLY:t===o.WHO_CAN_ACCESS.ADMIN&&(s=o.ACCESS_POLICY_ADMIN_ONLY);try{c(!0),await Y.updateBlockletSecurityRule({input:{did:r.meta.did,data:{id:o.SECURITY_RULE_DEFAULT_ID,accessPolicyId:s}}}),c(!1)}catch(_){c(!1),j.error(_.message)}},x=async t=>{i||(d(t.target.value),await f(t.target.value))},u={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:C.palette.text.secondary};return e.jsxs(k,{children:[e.jsx(l,{className:"header",children:e.jsx(O,{title:n("blocklet.config.access.title"),subTitle:n("blocklet.config.access.description")})}),e.jsx(l,{className:"form-container",children:e.jsx(h,{component:"fieldset",children:e.jsx(A,{name:"inherit",value:S,onChange:x,children:b.map(t=>e.jsxs(l,{sx:{mb:2,"&:last-child":{mb:0}},children:[e.jsx(g,{value:t.value,control:e.jsx(y,{size:"small",color:"primary"}),label:e.jsxs("span",{style:{display:"flex",alignItems:"center",position:"relative"},children:[e.jsx(t.icon,{style:u}),e.jsx("span",{style:{marginTop:2},children:t.title[p]})]})}),e.jsx(l,{className:"tip",children:t.description[p]})]},t.value))})})}),e.jsx(W,{mt:8,disabled:i,blocklet:r,onStartNow:()=>a("complete"),children:e.jsx(D,{loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:n("setup.continue")})})]})}P.propTypes={onNext:N.func};const k=L(T)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
  .header {
@@ -1,4 +1,4 @@
1
- import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as Ut,T as je,J as Yt,bX as ei,a5 as ti,I as No,cy as Ao,S as Do,cu as va,ba as ya,aP as Mo,F as ba,z as Hn,bv as xa,bw as wa,bx as Sa,bf as Ea,aZ as Bo,V as ka,aO as Ta,cP as ja,cQ as Oa,cq as Ca,cG as Ia,M as ni,am as Fo,aq as Ra,b6 as lt,c5 as Pa,c7 as La,a8 as $o,ad as Uo,aV as _a,aj as qo,Q as jn,Y as Na,ca as Wo,o as zo,aU as Aa,ar as Xt,cR as Da,cS as Ma,b4 as ki,U as Ti,ah as Ba,bg as Fa,O as $a,K as Ua,P as qa,ai as Wa,an as Vo,A as ji,aI as za,cT as Va}from"./vendor-mui-core-DnR6WYuU.js";import{r as q,g as ri,j as Ka,u as Ga,p as Ha,e as Xa,a as $t,d as Ya,f as Rn,m as Ja}from"./vendor-react-CTtPmzVP.js";import{r as ii,S as Qa,s as Ko,A as Za}from"./item-BSFssoYN.js";import{w as vt,aJ as oi,J as Go,V as xt,z as yt,p as el,r as tl,o as Xn,H as Yn,bh as Oi,l as Qt,K as Ho,$ as Vn,aX as Xo,aa as nl,aN as rl,ay as Fr,bi as il}from"./vendor-ux-DfSgTRg5.js";import{Z as dn,q as Ft,c as ol,bB as sl,bC as al,bD as Yo,bE as ll,bF as cl,bG as ul,bH as dl,z as hl,J as Mt,_ as fl,l as Jo,bI as pl,bJ as ml,ay as gl,bK as vl,Y as Jn,bL as Qo,bw as Zo,k as Qn,be as Ci,bM as yl,bu as bl,bN as xl,bO as wl,bP as Pn,bQ as Ii,bR as Sl}from"./index-DwK0GIrs.js";import{j as Ri,o as El,T as kl,L as Tl,P as jl}from"./vendor-arcblock-CPCSE54a.js";import{u as Pi}from"./launch-result-message-MNpx7ysR.js";import{a as $r}from"./page-header-CHAwrgX-.js";import{e as gt,B as Ol,C as rn,J as Zn,D as Li,a4 as es,$ as Cl,a9 as Il,A as Rl,o as sr,aa as Pl,ah as Ll,ai as _l,aj as Nl,a as xn,ak as Al,b as Dl}from"./vendor-utils-drLlzTVq.js";import{f as Ur}from"./index-DBs9Ljax.js";import{e as Ml}from"./engine-0ct2xW2c.js";import{u as Bl,C as Fl}from"./config-space-OgBdtdQ7.js";import{R as Ln}from"./required-BQln5OcV.js";import{S as $l}from"./index-DVQWYAIC.js";import{s as ts,h as Ul,w as ql,f as Wl,a as zl,b as Vl,c as Kl,M as Gl}from"./index-B0Q9wWG1.js";import{q as On,a as Hl,b as Xl,u as ns,g as Yl,v as Jl}from"./vendor-hooks-cYMUGE4V.js";import{g as Ql}from"./get-safe-url-BW-k89rQ.js";import{r as rs,A as Zl}from"./config-uF2iao7N.js";import{r as ec}from"./index-_tncRnTu.js";import{r as tc}from"./cloneDeep-BbaR0xRl.js";import{u as si}from"./useLocalStorage-BV1BIwfo.js";import{v as _i}from"./index-BP_Fl0Mu.js";import{u as nc}from"./session-nLCSznMa.js";import{W as rc}from"./did-address-DqhneWXa.js";import{a as Ni}from"./api-C_w0YD2j.js";import{v as ic,e as oc}from"./util-D27AtnBb.js";import{u as is}from"./use-mobile-BINJTzMb.js";import{C as sc}from"./content-layout-DmSBGGVm.js";import{C as ac,D as lc,a as cc}from"./connect-to-_CNpUNET.js";import{d as ar}from"./search-4YYphs0l.js";const _f="blocklet-add-component-registry",Nf="server-add-registry",Af=e=>`resource-${e}-add-registry`;function os(e){const{info:t}=dn();return q.useMemo(()=>!e||!e.docker?.image||e.docker?.image&&e.docker?.runBaseScript?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork,[e,t])}function ss({disabled:e=!1,children:t,onConfirm:r}){return q.useEffect(()=>{if(e)return()=>{};const i=s=>{s.code==="Enter"&&(s.metaKey===!0||s.ctrlKey===!0)&&(s.preventDefault(),s.stopPropagation(),r())};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[e,r]),t}ss.propTypes={disabled:B.bool,children:B.any.isRequired,onConfirm:B.func.isRequired};function as({onContinue:e,nextDisabled:t=!1,launching:r=!1,texts:i={listenName:"",launchingText:"",buttonNext:""},description:s=""}){const[n,o]=q.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(uc,{children:l.jsxs(ss,{disabled:t,onConfirm:e,children:[l.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:i.listenName}),l.jsx(vt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:r?l.jsxs(l.Fragment,{children:[l.jsx(Tt,{size:14}),i.launchingText]}):i.buttonNext})]})}),l.jsx(oi,{open:n,title:i.listenName,onClose:()=>o(!1),children:s})]})}as.propTypes={onContinue:B.func.isRequired,nextDisabled:B.bool,launching:B.bool,description:B.any,texts:B.object};const uc=tt.div`
1
+ import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as Ut,T as je,J as Yt,bX as ei,a5 as ti,I as No,cy as Ao,S as Do,cu as va,ba as ya,aP as Mo,F as ba,z as Hn,bv as xa,bw as wa,bx as Sa,bf as Ea,aZ as Bo,V as ka,aO as Ta,cP as ja,cQ as Oa,cq as Ca,cG as Ia,M as ni,am as Fo,aq as Ra,b6 as lt,c5 as Pa,c7 as La,a8 as $o,ad as Uo,aV as _a,aj as qo,Q as jn,Y as Na,ca as Wo,o as zo,aU as Aa,ar as Xt,cR as Da,cS as Ma,b4 as ki,U as Ti,ah as Ba,bg as Fa,O as $a,K as Ua,P as qa,ai as Wa,an as Vo,A as ji,aI as za,cT as Va}from"./vendor-mui-core-DnR6WYuU.js";import{r as q,g as ri,j as Ka,u as Ga,p as Ha,e as Xa,a as $t,d as Ya,f as Rn,m as Ja}from"./vendor-react-CTtPmzVP.js";import{r as ii,S as Qa,s as Ko,A as Za}from"./item-NbVFwplA.js";import{w as vt,aJ as oi,J as Go,V as xt,z as yt,p as el,r as tl,o as Xn,H as Yn,bh as Oi,l as Qt,K as Ho,$ as Vn,aX as Xo,aa as nl,aN as rl,ay as Fr,bi as il}from"./vendor-ux-DfSgTRg5.js";import{Z as dn,q as Ft,c as ol,bB as sl,bC as al,bD as Yo,bE as ll,bF as cl,bG as ul,bH as dl,z as hl,J as Mt,_ as fl,l as Jo,bI as pl,bJ as ml,ay as gl,bK as vl,Y as Jn,bL as Qo,bw as Zo,k as Qn,be as Ci,bM as yl,bu as bl,bN as xl,bO as wl,bP as Pn,bQ as Ii,bR as Sl}from"./index-CDZlfV0h.js";import{j as Ri,o as El,T as kl,L as Tl,P as jl}from"./vendor-arcblock-CPCSE54a.js";import{u as Pi}from"./launch-result-message-MNpx7ysR.js";import{a as $r}from"./page-header-CHAwrgX-.js";import{e as gt,B as Ol,C as rn,J as Zn,D as Li,a4 as es,$ as Cl,a9 as Il,A as Rl,o as sr,aa as Pl,ah as Ll,ai as _l,aj as Nl,a as xn,ak as Al,b as Dl}from"./vendor-utils-drLlzTVq.js";import{f as Ur}from"./index-DBs9Ljax.js";import{e as Ml}from"./engine-Ctj5gh6M.js";import{u as Bl,C as Fl}from"./config-space-B7BwTKLT.js";import{R as Ln}from"./required-BQln5OcV.js";import{S as $l}from"./index-BAErdc3T.js";import{s as ts,h as Ul,w as ql,f as Wl,a as zl,b as Vl,c as Kl,M as Gl}from"./index-B0Q9wWG1.js";import{q as On,a as Hl,b as Xl,u as ns,g as Yl,v as Jl}from"./vendor-hooks-cYMUGE4V.js";import{g as Ql}from"./get-safe-url-BIGE7_Qp.js";import{r as rs,A as Zl}from"./config-BwLMiIKp.js";import{r as ec}from"./index-_tncRnTu.js";import{r as tc}from"./cloneDeep-BbaR0xRl.js";import{u as si}from"./useLocalStorage-BV1BIwfo.js";import{v as _i}from"./index-BP_Fl0Mu.js";import{u as nc}from"./session-BqnhIOZD.js";import{W as rc}from"./did-address-DqhneWXa.js";import{a as Ni}from"./api-C_w0YD2j.js";import{v as ic,e as oc}from"./util-DE6S-EwK.js";import{u as is}from"./use-mobile-BINJTzMb.js";import{C as sc}from"./content-layout-DmSBGGVm.js";import{C as ac,D as lc,a as cc}from"./connect-to-BqMkANDm.js";import{d as ar}from"./search-4YYphs0l.js";const _f="blocklet-add-component-registry",Nf="server-add-registry",Af=e=>`resource-${e}-add-registry`;function os(e){const{info:t}=dn();return q.useMemo(()=>!e||!e.docker?.image||e.docker?.image&&e.docker?.runBaseScript?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork,[e,t])}function ss({disabled:e=!1,children:t,onConfirm:r}){return q.useEffect(()=>{if(e)return()=>{};const i=s=>{s.code==="Enter"&&(s.metaKey===!0||s.ctrlKey===!0)&&(s.preventDefault(),s.stopPropagation(),r())};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[e,r]),t}ss.propTypes={disabled:B.bool,children:B.any.isRequired,onConfirm:B.func.isRequired};function as({onContinue:e,nextDisabled:t=!1,launching:r=!1,texts:i={listenName:"",launchingText:"",buttonNext:""},description:s=""}){const[n,o]=q.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(uc,{children:l.jsxs(ss,{disabled:t,onConfirm:e,children:[l.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:i.listenName}),l.jsx(vt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:r?l.jsxs(l.Fragment,{children:[l.jsx(Tt,{size:14}),i.launchingText]}):i.buttonNext})]})}),l.jsx(oi,{open:n,title:i.listenName,onClose:()=>o(!1),children:s})]})}as.propTypes={onContinue:B.func.isRequired,nextDisabled:B.bool,launching:B.bool,description:B.any,texts:B.object};const uc=tt.div`
2
2
  margin: 0 auto;
3
3
  display: flex;
4
4
  justify-content: space-between;
@@ -1 +1 @@
1
- import{J as v,j as l}from"./vendor-mui-core-DnR6WYuU.js";import{m as B,r}from"./vendor-react-CTtPmzVP.js";import{C as W,D as L}from"./vendor-utils-drLlzTVq.js";import{V as O,aJ as A}from"./vendor-ux-DfSgTRg5.js";import{h as d,b as T,t as _}from"./vendor-hooks-cYMUGE4V.js";import{A as $,S as F}from"./add-component-core-heDvzsX8.js";import{y as K,an as J}from"./index-DwK0GIrs.js";import"./lottie-web-4koyQiv_.js";import"./item-BSFssoYN.js";import"./index-DBs9Ljax.js";import"./delete-confirm-dqp-ol9_.js";import"./click-to-copy-B2HIKJMV.js";import"./confirm-btfSjmnK.js";import"./session-nLCSznMa.js";import"./get-safe-url-BW-k89rQ.js";import"./did-address-DqhneWXa.js";import"./wait-connect-AqdGAvY7.js";import"./vendor-arcblock-CPCSE54a.js";import"./launch-result-message-MNpx7ysR.js";import"./page-header-CHAwrgX-.js";import"./engine-0ct2xW2c.js";import"./config-space-OgBdtdQ7.js";import"./spaces-B6hICxl4.js";import"./api-C_w0YD2j.js";import"./required-BQln5OcV.js";import"./index-DVQWYAIC.js";import"./Google-Cwpw9PRe.js";import"./cloneDeep-BbaR0xRl.js";import"./create-passport-svg-BQhmIwWD.js";import"./form-wrapper-PT5ZzMQy.js";import"./logo-uploader-BL-x4TAv.js";import"./collapse-B7gUzFaX.js";import"./index-B0Q9wWG1.js";import"./config-uF2iao7N.js";import"./isURL-CkV6bNHJ.js";import"./section-jXB9AxBb.js";import"./form-text-input-BjQKx89L.js";import"./edit.svg-RRSklUg-.js";import"./index-_tncRnTu.js";import"./useLocalStorage-BV1BIwfo.js";import"./index-BP_Fl0Mu.js";import"./util-D27AtnBb.js";import"./use-mobile-BINJTzMb.js";import"./content-layout-DmSBGGVm.js";import"./connect-to-_CNpUNET.js";import"./index-B5Fc7Exm.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-CHuKoofS.js";import"./search-4YYphs0l.js";function $t(){const{t:u}=O(),{blocklet:h}=K(),{componentDid:s}=B(),w=v(t=>t.breakpoints.down("md")),e=new URL(window.location.href),f=e.searchParams.get("mode")==="dialog",n=e.searchParams.get("resourceType")||"",m=e.searchParams.get("resourceDid")||s,g=e.searchParams.get("store")||"",C=e.searchParams.get("showFromUrl")!=="false",R=e.searchParams.get("showResourcesSwitch")!=="false",y=e.searchParams.get("enableRunBackground")!=="false",S=e.searchParams.get("showCategory")!=="false",a=h?.meta?.did,i=g.split(",").filter(Boolean).map(t=>{try{return new URL(t.startsWith("http")?t:`https://${t}`).origin}catch(o){return console.error(o),null}}).filter(Boolean),[b,E]=r.useState(i.map(t=>({url:t,name:t.replace("https://","")}))),[P,D]=r.useState(null),[U,j]=r.useState("");r.useEffect(()=>{(async()=>{try{const t=await Promise.all(i.map(async o=>{const x=W(o,"/api/store.json"),{data:M}=await L.get(x);return{url:o,name:M.name}}));E(t||[])}catch(t){console.error(t)}})()},[i.join(",")]);const k=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const t=J();return a&&t.connect(),()=>{a&&t.isConnected()&&t.disconnect()}},[a]),d(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const c=T(t=>{t.data?.event==="resourceDialog.select"&&t.data?.componentDid===s&&(D(t.data.data),j(t.data.storeUrl))});d(()=>{window.addEventListener("message",c)}),_(()=>{window.removeEventListener("message",c)});const p=({inDialog:t=!0}={})=>l.jsx($,{stores:b,selectedMeta:P,storeUrl:U,resourceType:n,resourceDid:m,mode:"embed",inDialog:t,storageKey:F(`${n}+${m}`),showResourcesSwitch:R,showFromUrl:C,enableRunBackground:y,showCategory:S});return f?l.jsx(A,{className:"resource-dialog",title:u("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:w?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(t,o)=>{o!=="backdropClick"&&k()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:p()}):p({inDialog:!1})}export{$t as default};
1
+ import{J as v,j as l}from"./vendor-mui-core-DnR6WYuU.js";import{m as B,r}from"./vendor-react-CTtPmzVP.js";import{C as W,D as L}from"./vendor-utils-drLlzTVq.js";import{V as O,aJ as A}from"./vendor-ux-DfSgTRg5.js";import{h as d,b as T,t as _}from"./vendor-hooks-cYMUGE4V.js";import{A as $,S as F}from"./add-component-core-C7Ksojy0.js";import{y as K,an as J}from"./index-CDZlfV0h.js";import"./lottie-web-4koyQiv_.js";import"./item-NbVFwplA.js";import"./index-DBs9Ljax.js";import"./delete-confirm-CvVgX89H.js";import"./click-to-copy-B2HIKJMV.js";import"./confirm-D3ZOq19V.js";import"./session-BqnhIOZD.js";import"./get-safe-url-BIGE7_Qp.js";import"./did-address-DqhneWXa.js";import"./wait-connect-COGsNIA_.js";import"./vendor-arcblock-CPCSE54a.js";import"./launch-result-message-MNpx7ysR.js";import"./page-header-CHAwrgX-.js";import"./engine-Ctj5gh6M.js";import"./config-space-B7BwTKLT.js";import"./spaces-CWRlaHIZ.js";import"./api-C_w0YD2j.js";import"./required-BQln5OcV.js";import"./index-BAErdc3T.js";import"./Google-Cwpw9PRe.js";import"./cloneDeep-BbaR0xRl.js";import"./create-passport-svg-BQhmIwWD.js";import"./form-wrapper-PT5ZzMQy.js";import"./logo-uploader-CdD4-48m.js";import"./collapse-B7gUzFaX.js";import"./index-B0Q9wWG1.js";import"./config-BwLMiIKp.js";import"./isURL-CRNOx2AN.js";import"./section-jXB9AxBb.js";import"./form-text-input-BjQKx89L.js";import"./edit.svg-RRSklUg-.js";import"./index-_tncRnTu.js";import"./useLocalStorage-BV1BIwfo.js";import"./index-BP_Fl0Mu.js";import"./util-DE6S-EwK.js";import"./use-mobile-BINJTzMb.js";import"./content-layout-DmSBGGVm.js";import"./connect-to-BqMkANDm.js";import"./index-qbQiaInB.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-CHuKoofS.js";import"./search-4YYphs0l.js";function $t(){const{t:u}=O(),{blocklet:h}=K(),{componentDid:s}=B(),w=v(t=>t.breakpoints.down("md")),e=new URL(window.location.href),f=e.searchParams.get("mode")==="dialog",n=e.searchParams.get("resourceType")||"",m=e.searchParams.get("resourceDid")||s,g=e.searchParams.get("store")||"",C=e.searchParams.get("showFromUrl")!=="false",R=e.searchParams.get("showResourcesSwitch")!=="false",y=e.searchParams.get("enableRunBackground")!=="false",S=e.searchParams.get("showCategory")!=="false",a=h?.meta?.did,i=g.split(",").filter(Boolean).map(t=>{try{return new URL(t.startsWith("http")?t:`https://${t}`).origin}catch(o){return console.error(o),null}}).filter(Boolean),[b,E]=r.useState(i.map(t=>({url:t,name:t.replace("https://","")}))),[P,D]=r.useState(null),[U,j]=r.useState("");r.useEffect(()=>{(async()=>{try{const t=await Promise.all(i.map(async o=>{const x=W(o,"/api/store.json"),{data:M}=await L.get(x);return{url:o,name:M.name}}));E(t||[])}catch(t){console.error(t)}})()},[i.join(",")]);const k=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const t=J();return a&&t.connect(),()=>{a&&t.isConnected()&&t.disconnect()}},[a]),d(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const c=T(t=>{t.data?.event==="resourceDialog.select"&&t.data?.componentDid===s&&(D(t.data.data),j(t.data.storeUrl))});d(()=>{window.addEventListener("message",c)}),_(()=>{window.removeEventListener("message",c)});const p=({inDialog:t=!0}={})=>l.jsx($,{stores:b,selectedMeta:P,storeUrl:U,resourceType:n,resourceDid:m,mode:"embed",inDialog:t,storageKey:F(`${n}+${m}`),showResourcesSwitch:R,showFromUrl:C,enableRunBackground:y,showCategory:S});return f?l.jsx(A,{className:"resource-dialog",title:u("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:w?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(t,o)=>{o!=="backdropClick"&&k()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:p()}):p({inDialog:!1})}export{$t as default};
@@ -1,4 +1,4 @@
1
- import{r as t,i as x}from"./vendor-react-CTtPmzVP.js";import{j as e,I as u,at as C,W as o}from"./vendor-mui-core-DnR6WYuU.js";import{aT as M,aK as b,aL as f}from"./vendor-ux-DfSgTRg5.js";import{X as H}from"./index-DwK0GIrs.js";import{t as Z}from"./question-mark-circle.svg-CByEVDhb.js";const g=s=>t.createElement("svg",{width:21,height:20,viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg",...s},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.60567 17.3203C7.38971 16.9661 7.19606 16.5686 7.02468 16.1402C6.86016 15.7289 6.7127 15.2804 6.58436 14.801C6.01415 15.0849 5.48171 15.439 4.99946 15.855C5.7556 16.5015 6.63848 17.004 7.60567 17.3203ZM8.26264 15.645C8.10246 15.2446 7.95842 14.7971 7.83425 14.3104C8.53612 14.104 9.26539 13.9991 9.9998 14H10.0015C10.7359 13.9991 11.4652 14.104 12.167 14.3104C12.0429 14.7971 11.8988 15.2446 11.7386 15.645C11.4556 16.3525 11.1353 16.8804 10.8137 17.2204C10.4935 17.559 10.2185 17.6667 10.0006 17.6667C9.78281 17.6667 9.50783 17.559 9.18757 17.2204C8.86599 16.8804 8.54566 16.3525 8.26264 15.645ZM10.0007 12.6667C10.8258 12.6657 11.6453 12.7785 12.4365 13.0005C12.5533 12.274 12.6295 11.49 12.6565 10.6666H7.34483C7.37175 11.49 7.448 12.274 7.56482 13.0006C8.35599 12.7785 9.17556 12.6657 10.0007 12.6667ZM7.34483 9.33331C7.37175 8.50999 7.448 7.72596 7.56482 6.99945C8.35598 7.22152 9.17556 7.33433 10.0007 7.33334C10.8258 7.33433 11.6453 7.22153 12.4365 6.99947C12.5533 7.72597 12.6295 8.51 12.6565 9.33331H7.34483ZM13.9905 10.6666C13.9603 11.6495 13.8639 12.5916 13.7104 13.4645C14.5207 13.8311 15.2715 14.3159 15.9385 14.9026C16.9065 13.7315 17.5347 12.2691 17.6722 10.6666H13.9905ZM17.6721 9.33331H13.9904C13.9603 8.35043 13.8639 7.40842 13.7104 6.5355C14.5207 6.16891 15.2715 5.68412 15.9385 5.09743C16.9065 6.26854 17.5347 7.73084 17.6721 9.33331ZM19.0006 10.0017C18.9997 14.9715 14.9706 19 10.0006 19H10.0006C5.03005 19 1.00061 14.9706 1.00061 10C1.00061 9.99999 1.00061 9.99999 1.00061 9.99998C1.00062 5.02943 5.03005 1 10.0006 1C14.9712 1 19.0006 5.02944 19.0006 10C19.0006 10.0006 19.0006 10.0011 19.0006 10.0017ZM2.32907 9.33331C2.46651 7.73082 3.09476 6.2685 4.0628 5.09738C4.72975 5.68407 5.48055 6.16888 6.29084 6.53548C6.13742 7.40841 6.041 8.35042 6.01083 9.33331H2.32907ZM2.32907 10.6666H6.01083C6.04099 11.6496 6.13742 12.5916 6.29084 13.4645C5.48055 13.8311 4.72975 14.3159 4.06281 14.9026C3.09475 13.7315 2.46649 12.2692 2.32907 10.6666ZM12.9766 16.1402C13.1411 15.7289 13.2886 15.2804 13.4169 14.8009C13.9871 15.0849 14.5196 15.4389 15.0018 15.8549C14.2457 16.5014 13.3628 17.004 12.3956 17.3202C12.6116 16.9661 12.8052 16.5686 12.9766 16.1402ZM12.3956 2.67976C13.3628 2.996 14.2457 3.49858 15.0018 4.14508C14.5196 4.56106 13.9871 4.91516 13.4169 5.19908C13.2886 4.71963 13.1411 4.2711 12.9766 3.85979C12.8052 3.43137 12.6116 3.03387 12.3956 2.67976ZM11.7386 4.355C11.8988 4.75545 12.0429 5.20292 12.167 5.68962C11.4652 5.89603 10.7359 6.00096 10.0015 6.00001H9.9998C9.26539 6.00096 8.53612 5.89602 7.83424 5.68961C7.95841 5.20291 8.10246 4.75544 8.26264 4.355C8.54566 3.64747 8.86599 3.11964 9.18757 2.7796C9.50783 2.44096 9.78281 2.33333 10.0006 2.33333C10.2185 2.33333 10.4935 2.44096 10.8137 2.7796C11.1353 3.11964 11.4556 3.64747 11.7386 4.355ZM7.02468 3.85979C6.86015 4.2711 6.71269 4.71961 6.58436 5.19906C6.01414 4.91513 5.4817 4.56103 4.99945 4.14504C5.7556 3.49854 6.63848 2.99596 7.60567 2.67973C7.38971 3.03385 7.19606 3.43136 7.02468 3.85979Z",fill:"currentColor"}));function j({SessionContext:s,extraItems:n=[],showLocale:r=!0,showHelper:l=!0,showSessionManager:c=!0,sessionManagerProps:i={}}){const{session:d}=t.useContext(s),{locale:p}=t.useContext(M),w=x(),h=()=>{if(w.pathname.indexOf("/store")>-1){window.open("https://www.arcblock.io/content/docs/createblocklet","_blank");return}window.open("https://www.arcblock.io/content/docs/blocklet-developer","_blank")};return e.jsxs(e.Fragment,{children:[n.map((a,m)=>t.cloneElement(a,{key:m})),r&&e.jsx(v,{"data-cy":"locale-addon",icon:g,size:23,showText:!1,className:"locale-addon"}),e.jsx(H,{}),l&&e.jsx(u,{onClick:h,children:e.jsx(Z,{})}),c&&e.jsx(k,{locale:p,session:d,size:24,showRole:!0,...i,showManageBlocklet:!1})]})}j.propTypes={SessionContext:o.object.isRequired,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};const k=C(f)`
1
+ import{r as t,i as x}from"./vendor-react-CTtPmzVP.js";import{j as e,I as u,at as C,W as o}from"./vendor-mui-core-DnR6WYuU.js";import{aT as M,aK as b,aL as f}from"./vendor-ux-DfSgTRg5.js";import{X as H}from"./index-CDZlfV0h.js";import{t as Z}from"./question-mark-circle.svg-CByEVDhb.js";const g=s=>t.createElement("svg",{width:21,height:20,viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg",...s},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.60567 17.3203C7.38971 16.9661 7.19606 16.5686 7.02468 16.1402C6.86016 15.7289 6.7127 15.2804 6.58436 14.801C6.01415 15.0849 5.48171 15.439 4.99946 15.855C5.7556 16.5015 6.63848 17.004 7.60567 17.3203ZM8.26264 15.645C8.10246 15.2446 7.95842 14.7971 7.83425 14.3104C8.53612 14.104 9.26539 13.9991 9.9998 14H10.0015C10.7359 13.9991 11.4652 14.104 12.167 14.3104C12.0429 14.7971 11.8988 15.2446 11.7386 15.645C11.4556 16.3525 11.1353 16.8804 10.8137 17.2204C10.4935 17.559 10.2185 17.6667 10.0006 17.6667C9.78281 17.6667 9.50783 17.559 9.18757 17.2204C8.86599 16.8804 8.54566 16.3525 8.26264 15.645ZM10.0007 12.6667C10.8258 12.6657 11.6453 12.7785 12.4365 13.0005C12.5533 12.274 12.6295 11.49 12.6565 10.6666H7.34483C7.37175 11.49 7.448 12.274 7.56482 13.0006C8.35599 12.7785 9.17556 12.6657 10.0007 12.6667ZM7.34483 9.33331C7.37175 8.50999 7.448 7.72596 7.56482 6.99945C8.35598 7.22152 9.17556 7.33433 10.0007 7.33334C10.8258 7.33433 11.6453 7.22153 12.4365 6.99947C12.5533 7.72597 12.6295 8.51 12.6565 9.33331H7.34483ZM13.9905 10.6666C13.9603 11.6495 13.8639 12.5916 13.7104 13.4645C14.5207 13.8311 15.2715 14.3159 15.9385 14.9026C16.9065 13.7315 17.5347 12.2691 17.6722 10.6666H13.9905ZM17.6721 9.33331H13.9904C13.9603 8.35043 13.8639 7.40842 13.7104 6.5355C14.5207 6.16891 15.2715 5.68412 15.9385 5.09743C16.9065 6.26854 17.5347 7.73084 17.6721 9.33331ZM19.0006 10.0017C18.9997 14.9715 14.9706 19 10.0006 19H10.0006C5.03005 19 1.00061 14.9706 1.00061 10C1.00061 9.99999 1.00061 9.99999 1.00061 9.99998C1.00062 5.02943 5.03005 1 10.0006 1C14.9712 1 19.0006 5.02944 19.0006 10C19.0006 10.0006 19.0006 10.0011 19.0006 10.0017ZM2.32907 9.33331C2.46651 7.73082 3.09476 6.2685 4.0628 5.09738C4.72975 5.68407 5.48055 6.16888 6.29084 6.53548C6.13742 7.40841 6.041 8.35042 6.01083 9.33331H2.32907ZM2.32907 10.6666H6.01083C6.04099 11.6496 6.13742 12.5916 6.29084 13.4645C5.48055 13.8311 4.72975 14.3159 4.06281 14.9026C3.09475 13.7315 2.46649 12.2692 2.32907 10.6666ZM12.9766 16.1402C13.1411 15.7289 13.2886 15.2804 13.4169 14.8009C13.9871 15.0849 14.5196 15.4389 15.0018 15.8549C14.2457 16.5014 13.3628 17.004 12.3956 17.3202C12.6116 16.9661 12.8052 16.5686 12.9766 16.1402ZM12.3956 2.67976C13.3628 2.996 14.2457 3.49858 15.0018 4.14508C14.5196 4.56106 13.9871 4.91516 13.4169 5.19908C13.2886 4.71963 13.1411 4.2711 12.9766 3.85979C12.8052 3.43137 12.6116 3.03387 12.3956 2.67976ZM11.7386 4.355C11.8988 4.75545 12.0429 5.20292 12.167 5.68962C11.4652 5.89603 10.7359 6.00096 10.0015 6.00001H9.9998C9.26539 6.00096 8.53612 5.89602 7.83424 5.68961C7.95841 5.20291 8.10246 4.75544 8.26264 4.355C8.54566 3.64747 8.86599 3.11964 9.18757 2.7796C9.50783 2.44096 9.78281 2.33333 10.0006 2.33333C10.2185 2.33333 10.4935 2.44096 10.8137 2.7796C11.1353 3.11964 11.4556 3.64747 11.7386 4.355ZM7.02468 3.85979C6.86015 4.2711 6.71269 4.71961 6.58436 5.19906C6.01414 4.91513 5.4817 4.56103 4.99945 4.14504C5.7556 3.49854 6.63848 2.99596 7.60567 2.67973C7.38971 3.03385 7.19606 3.43136 7.02468 3.85979Z",fill:"currentColor"}));function j({SessionContext:s,extraItems:n=[],showLocale:r=!0,showHelper:l=!0,showSessionManager:c=!0,sessionManagerProps:i={}}){const{session:d}=t.useContext(s),{locale:p}=t.useContext(M),w=x(),h=()=>{if(w.pathname.indexOf("/store")>-1){window.open("https://www.arcblock.io/content/docs/createblocklet","_blank");return}window.open("https://www.arcblock.io/content/docs/blocklet-developer","_blank")};return e.jsxs(e.Fragment,{children:[n.map((a,m)=>t.cloneElement(a,{key:m})),r&&e.jsx(v,{"data-cy":"locale-addon",icon:g,size:23,showText:!1,className:"locale-addon"}),e.jsx(H,{}),l&&e.jsx(u,{onClick:h,children:e.jsx(Z,{})}),c&&e.jsx(k,{locale:p,session:d,size:24,showRole:!0,...i,showManageBlocklet:!1})]})}j.propTypes={SessionContext:o.object.isRequired,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};const k=C(f)`
2
2
  .user-addon {
3
3
  .user-avatar {
4
4
  width: 28px;
@@ -1,4 +1,4 @@
1
- import{r as z}from"./vendor-react-CTtPmzVP.js";import{j as k,a6 as ce,ak as T,Q as Me,dK as Pe,T as te,W as J,bX as Ne,a5 as Fe,bf as ze,aZ as Je,at as ke,U as Be,b6 as ie,z as Ue,A as Ve,dL as Se,bn as Y,a3 as V,dM as We,am as ge,bl as ye}from"./vendor-mui-core-DnR6WYuU.js";import{Z as re,Y as Ke,l as Re,q as He,a3 as Ge,cj as Ze,C as Ye,ck as Qe,c as Xe,R as be,G as Oe,ak as Ae,J as Z,cl as et}from"./index-DwK0GIrs.js";import{w as ue,P as tt}from"./permission-PnySJGEl.js";import{V as le,w as G,H as W,aJ as Ee,cr as rt,p as st,o as nt,q as H,J as ve,aT as at}from"./vendor-ux-DfSgTRg5.js";import{x as Ce}from"./vendor-hooks-cYMUGE4V.js";import{C as me}from"./confirm-btfSjmnK.js";import{f as oe}from"./index-DBs9Ljax.js";import{u as it}from"./useSetState-L-f8mSga.js";import{u as De}from"./session-nLCSznMa.js";import{S as U}from"./section-jXB9AxBb.js";import{C as ot}from"./click-to-copy-B2HIKJMV.js";import{b as Ie}from"./team-BETRxUUw.js";import{v as lt,ac as ct}from"./vendor-utils-drLlzTVq.js";import{v as ut}from"./index-BP_Fl0Mu.js";import{W as ft}from"./did-address-DqhneWXa.js";import{V as dt}from"./status-BOjZ6Vaq.js";import{F as _e}from"./form-text-input-BjQKx89L.js";import"./vendor-arcblock-CPCSE54a.js";import"./lottie-web-4koyQiv_.js";import"./required-BQln5OcV.js";import"./isURL-CkV6bNHJ.js";import"./use-app-logo-BgQdzlhG.js";import"./omit-BgmLPtMY.js";import"./form-wrapper-PT5ZzMQy.js";import"./edit.svg-RRSklUg-.js";const mt=localStorage.getItem("enableDebug")==="true";function ht({teamDid:$,size:q="small",...P}){const{t:C}=le(),{api:j}=re(),[w,p]=z.useState(!1),[o,g]=z.useState(null),m=()=>{p(!1),g(null)},f=async()=>{try{p(!0);const a=await j.clearCache({input:{teamDid:$}});W.success(C("blocklet.config.clearCache.success",{count:a.removed?.length||0}))}catch(a){W.error(oe(a))}finally{p(!1),g(null)}},e={title:C("blocklet.config.clearCache.title"),description:C("blocklet.config.clearCache.description"),confirm:C("common.confirm"),cancel:C("common.cancel"),onConfirm:f,onCancel:m};return k.jsxs("div",{...P,children:[k.jsxs(G,{onClick:()=>g(e),color:"error",variant:"outlined",size:q,children:[w?k.jsx(ce,{size:16,style:{marginRight:5}}):null,C("blocklet.config.clearCache.action")]}),o&&k.jsx(me,{title:o.title,description:o.description,confirm:o.confirm,cancel:o.cancel,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}function Te({onChange:$=()=>{},disabled:q=!1,loading:P=!1,inService:C=!1}){const{t:j}=le(),{api:w,session:p}=De(),{blocklet:o}=Ke(),[g,m]=it({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),f=()=>m({isConnectOpen:!1}),e=()=>{if(He.isInProgress(o.status)){W.error(j("blocklet.error.isInProgress"));return}m({confirmDialogOpen:!0})};return k.jsxs(k.Fragment,{children:[k.jsx(U,{title:j("blocklet.config.migrate.button"),desc:j("blocklet.config.migrate.description"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(Me,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:q||P,onClick:e,children:[k.jsx(Pe,{style:{fontSize:"1.3em",marginRight:4}}),j("blocklet.config.migrate.button")]})})}),k.jsxs(k.Fragment,{children:[g.isConnectOpen&&k.jsx(Re,{popup:!0,open:g.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:w.get,checkTimeout:5*60*1e3,onSuccess:()=>{$(),C&&p.logout(),f()},extraParams:{appDid:o.appDid},messages:{title:j("setup.keyPair.title"),scan:j("setup.keyPair.scan"),confirm:j("setup.keyPair.confirm"),success:j("setup.keyPair.success")},onClose:f}),g.confirmDialogOpen&&k.jsx(me,{title:k.jsx(te,{sx:{fontSize:"20px",fontWeight:"500"},children:j("blocklet.config.migrate.title")}),description:k.jsx(te,{sx:{fontSize:"14px",color:"#9397A1"},children:j("blocklet.config.migrate.confirm")}),confirm:j("common.confirm"),cancel:j("common.cancel"),onConfirm:()=>m({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>m({confirmDialogOpen:!1})})]})]})}Te.propTypes={onChange:J.func,disabled:J.bool,loading:J.bool,inService:J.bool};function Le({onCancel:$,onSuccess:q,onError:P=()=>{}}){const{api:C}=z.useContext(Ge),[j,w]=z.useState(!1),{t:p,locale:o}=le(),[g,m]=z.useState(""),[f,e]=z.useState(!1),[a,n]=z.useState(0),[r,t]=z.useState(""),{endpoint:l}=Ie(),[s,i]=z.useState(!1),u=c=>{m(null),w(!0);try{t(c.result),n(_.length-1)}catch(h){const b=oe(h);m(b),P(h)}finally{w(!1)}},d=()=>{e(!0),n(1)},y=()=>{e(!1),n(0)},_=[{body:k.jsxs(T,{children:[k.jsx(te,{children:p("team.transferApp.transferDialog.tips.progress")}),k.jsx(te,{sx:{mt:3,mb:2},children:p("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:p("common.cancel"),confirm:p("team.transferApp.transferDialog.createTransferLink"),onCancel:$,onConfirm:d},{cancel:p("common.cancel"),confirm:p("team.transferApp.transferDialog.createTransferLink"),body:()=>k.jsx(Re,{action:"transfer-app-owner",open:f,locale:o,checkFn:C.get,onClose:y,onSuccess:u,checkTimeout:5*60*1e3,extraParams:{},messages:{title:p("team.transferApp.connectDialog.title"),scan:p("team.transferApp.connectDialog.scan"),confirm:p("team.transferApp.connectDialog.confirm"),success:p("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const c=Ze({transferId:r.transferId,endpoint:l});return k.jsxs(k.Fragment,{children:[k.jsx(T,{component:Q,dangerouslySetInnerHTML:{__html:p("team.transferApp.transferDialog.createSuccessTip1")}}),k.jsx(T,{component:Q,sx:{mt:2},children:k.jsx(Q,{children:p("team.transferApp.transferDialog.createSuccessTip3")})}),k.jsxs(T,{children:[k.jsx(T,{component:Q,sx:{mt:2},children:k.jsx(Q,{children:p("team.transferApp.transferDialog.createSuccessTip2",{expireDate:Ye(r.expireDate,o)})})}),k.jsx(T,{sx:{my:1},children:k.jsx(ot,{children:c})})]}),k.jsx("div",{children:k.jsx(Ne,{value:"end",control:k.jsx(Fe,{checked:s,onChange:h=>i(h.target.checked)}),label:p("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:p("common.confirm"),onConfirm:q}],v=_[a];return k.jsxs(Ee,{title:k.jsx(Q,{className:"title",children:p("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:k.jsxs(k.Fragment,{children:[v.cancel&&k.jsx(G,{onClick:v.onCancel,color:"inherit",children:v.cancel}),k.jsxs(G,{onClick:v.onConfirm,color:"error",disabled:j||a===_.length-1&&!s,variant:"contained",autoFocus:!0,children:[j&&k.jsx(ce,{size:16}),v.confirm]})]}),children:[k.jsx(ze,{component:"div",children:typeof v.body=="function"?v.body():v.body}),!!g&&k.jsx(Je,{severity:"error",variant:"icon",children:g})]})}Le.propTypes={onCancel:J.func.isRequired,onSuccess:J.func.isRequired,onError:J.func};const Q=ke.div`
1
+ import{r as z}from"./vendor-react-CTtPmzVP.js";import{j as k,a6 as ce,ak as T,Q as Me,dK as Pe,T as te,W as J,bX as Ne,a5 as Fe,bf as ze,aZ as Je,at as ke,U as Be,b6 as ie,z as Ue,A as Ve,dL as Se,bn as Y,a3 as V,dM as We,am as ge,bl as ye}from"./vendor-mui-core-DnR6WYuU.js";import{Z as re,Y as Ke,l as Re,q as He,a3 as Ge,cj as Ze,C as Ye,ck as Qe,c as Xe,R as be,G as Oe,ak as Ae,J as Z,cl as et}from"./index-CDZlfV0h.js";import{w as ue,P as tt}from"./permission-ZblvP8BW.js";import{V as le,w as G,H as W,aJ as Ee,cr as rt,p as st,o as nt,q as H,J as ve,aT as at}from"./vendor-ux-DfSgTRg5.js";import{x as Ce}from"./vendor-hooks-cYMUGE4V.js";import{C as me}from"./confirm-D3ZOq19V.js";import{f as oe}from"./index-DBs9Ljax.js";import{u as it}from"./useSetState-L-f8mSga.js";import{u as De}from"./session-BqnhIOZD.js";import{S as U}from"./section-jXB9AxBb.js";import{C as ot}from"./click-to-copy-B2HIKJMV.js";import{b as Ie}from"./team-CF6hrmVi.js";import{v as lt,ac as ct}from"./vendor-utils-drLlzTVq.js";import{v as ut}from"./index-BP_Fl0Mu.js";import{W as ft}from"./did-address-DqhneWXa.js";import{V as dt}from"./status-Bk4He7Xx.js";import{F as _e}from"./form-text-input-BjQKx89L.js";import"./vendor-arcblock-CPCSE54a.js";import"./lottie-web-4koyQiv_.js";import"./required-BQln5OcV.js";import"./isURL-CRNOx2AN.js";import"./use-app-logo-7cAapfl7.js";import"./omit-BgmLPtMY.js";import"./form-wrapper-PT5ZzMQy.js";import"./edit.svg-RRSklUg-.js";const mt=localStorage.getItem("enableDebug")==="true";function ht({teamDid:$,size:q="small",...P}){const{t:C}=le(),{api:j}=re(),[w,p]=z.useState(!1),[o,g]=z.useState(null),m=()=>{p(!1),g(null)},f=async()=>{try{p(!0);const a=await j.clearCache({input:{teamDid:$}});W.success(C("blocklet.config.clearCache.success",{count:a.removed?.length||0}))}catch(a){W.error(oe(a))}finally{p(!1),g(null)}},e={title:C("blocklet.config.clearCache.title"),description:C("blocklet.config.clearCache.description"),confirm:C("common.confirm"),cancel:C("common.cancel"),onConfirm:f,onCancel:m};return k.jsxs("div",{...P,children:[k.jsxs(G,{onClick:()=>g(e),color:"error",variant:"outlined",size:q,children:[w?k.jsx(ce,{size:16,style:{marginRight:5}}):null,C("blocklet.config.clearCache.action")]}),o&&k.jsx(me,{title:o.title,description:o.description,confirm:o.confirm,cancel:o.cancel,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}function Te({onChange:$=()=>{},disabled:q=!1,loading:P=!1,inService:C=!1}){const{t:j}=le(),{api:w,session:p}=De(),{blocklet:o}=Ke(),[g,m]=it({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),f=()=>m({isConnectOpen:!1}),e=()=>{if(He.isInProgress(o.status)){W.error(j("blocklet.error.isInProgress"));return}m({confirmDialogOpen:!0})};return k.jsxs(k.Fragment,{children:[k.jsx(U,{title:j("blocklet.config.migrate.button"),desc:j("blocklet.config.migrate.description"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(Me,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:q||P,onClick:e,children:[k.jsx(Pe,{style:{fontSize:"1.3em",marginRight:4}}),j("blocklet.config.migrate.button")]})})}),k.jsxs(k.Fragment,{children:[g.isConnectOpen&&k.jsx(Re,{popup:!0,open:g.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:w.get,checkTimeout:5*60*1e3,onSuccess:()=>{$(),C&&p.logout(),f()},extraParams:{appDid:o.appDid},messages:{title:j("setup.keyPair.title"),scan:j("setup.keyPair.scan"),confirm:j("setup.keyPair.confirm"),success:j("setup.keyPair.success")},onClose:f}),g.confirmDialogOpen&&k.jsx(me,{title:k.jsx(te,{sx:{fontSize:"20px",fontWeight:"500"},children:j("blocklet.config.migrate.title")}),description:k.jsx(te,{sx:{fontSize:"14px",color:"#9397A1"},children:j("blocklet.config.migrate.confirm")}),confirm:j("common.confirm"),cancel:j("common.cancel"),onConfirm:()=>m({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>m({confirmDialogOpen:!1})})]})]})}Te.propTypes={onChange:J.func,disabled:J.bool,loading:J.bool,inService:J.bool};function Le({onCancel:$,onSuccess:q,onError:P=()=>{}}){const{api:C}=z.useContext(Ge),[j,w]=z.useState(!1),{t:p,locale:o}=le(),[g,m]=z.useState(""),[f,e]=z.useState(!1),[a,n]=z.useState(0),[r,t]=z.useState(""),{endpoint:l}=Ie(),[s,i]=z.useState(!1),u=c=>{m(null),w(!0);try{t(c.result),n(_.length-1)}catch(h){const b=oe(h);m(b),P(h)}finally{w(!1)}},d=()=>{e(!0),n(1)},y=()=>{e(!1),n(0)},_=[{body:k.jsxs(T,{children:[k.jsx(te,{children:p("team.transferApp.transferDialog.tips.progress")}),k.jsx(te,{sx:{mt:3,mb:2},children:p("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:p("common.cancel"),confirm:p("team.transferApp.transferDialog.createTransferLink"),onCancel:$,onConfirm:d},{cancel:p("common.cancel"),confirm:p("team.transferApp.transferDialog.createTransferLink"),body:()=>k.jsx(Re,{action:"transfer-app-owner",open:f,locale:o,checkFn:C.get,onClose:y,onSuccess:u,checkTimeout:5*60*1e3,extraParams:{},messages:{title:p("team.transferApp.connectDialog.title"),scan:p("team.transferApp.connectDialog.scan"),confirm:p("team.transferApp.connectDialog.confirm"),success:p("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const c=Ze({transferId:r.transferId,endpoint:l});return k.jsxs(k.Fragment,{children:[k.jsx(T,{component:Q,dangerouslySetInnerHTML:{__html:p("team.transferApp.transferDialog.createSuccessTip1")}}),k.jsx(T,{component:Q,sx:{mt:2},children:k.jsx(Q,{children:p("team.transferApp.transferDialog.createSuccessTip3")})}),k.jsxs(T,{children:[k.jsx(T,{component:Q,sx:{mt:2},children:k.jsx(Q,{children:p("team.transferApp.transferDialog.createSuccessTip2",{expireDate:Ye(r.expireDate,o)})})}),k.jsx(T,{sx:{my:1},children:k.jsx(ot,{children:c})})]}),k.jsx("div",{children:k.jsx(Ne,{value:"end",control:k.jsx(Fe,{checked:s,onChange:h=>i(h.target.checked)}),label:p("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:p("common.confirm"),onConfirm:q}],v=_[a];return k.jsxs(Ee,{title:k.jsx(Q,{className:"title",children:p("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:k.jsxs(k.Fragment,{children:[v.cancel&&k.jsx(G,{onClick:v.onCancel,color:"inherit",children:v.cancel}),k.jsxs(G,{onClick:v.onConfirm,color:"error",disabled:j||a===_.length-1&&!s,variant:"contained",autoFocus:!0,children:[j&&k.jsx(ce,{size:16}),v.confirm]})]}),children:[k.jsx(ze,{component:"div",children:typeof v.body=="function"?v.body():v.body}),!!g&&k.jsx(Je,{severity:"error",variant:"icon",children:g})]})}Le.propTypes={onCancel:J.func.isRequired,onSuccess:J.func.isRequired,onError:J.func};const Q=ke.div`
2
2
  font-size: 16px;
3
3
  font-weight: bold;
4
4
  &.title {
@@ -1,4 +1,4 @@
1
- import{j as t,ak as d,Q as p,at as x,W as u}from"./vendor-mui-core-DnR6WYuU.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{aT as g}from"./vendor-ux-DfSgTRg5.js";import{a as h}from"./page-header-CHAwrgX-.js";import{Y as j}from"./index-DwK0GIrs.js";import{A as b}from"./config-uF2iao7N.js";import{S as k}from"./step-actions-Cfagh9Pk.js";import{S}from"./layout-BPsPNtH9.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./isURL-CkV6bNHJ.js";import"./section-jXB9AxBb.js";import"./required-BQln5OcV.js";import"./form-wrapper-PT5ZzMQy.js";import"./form-text-input-BjQKx89L.js";import"./edit.svg-RRSklUg-.js";import"./wait-connect-AqdGAvY7.js";import"./get-safe-url-BW-k89rQ.js";import"./index-_tncRnTu.js";import"./index-DBs9Ljax.js";import"./use-mobile-D5clNlrm.js";import"./content-layout-DmSBGGVm.js";function y({onNext:s=()=>{},onPrevious:l=()=>{}}){const{t:r}=o.useContext(g),{blocklet:e}=j(),i=o.useMemo(()=>e?.meta?.requirements,[e]),n=o.useRef(null),[a,m]=o.useState(!1),f=async()=>{try{m(!0),(await n.current.onSubmit()||!i?.aigne)&&s()}catch(c){console.error("error",c)}finally{m(!1)}};return t.jsxs(C,{children:[t.jsx("div",{className:"header",children:t.jsx(h,{title:r("setting.aigne.config"),onClickBack:l})}),t.jsx(d,{className:"form-container",children:t.jsx(b,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,ref:n,source:"setup",forceValidate:i?.aigne})}),t.jsxs(k,{blocklet:e,children:[!i?.aigne&&t.jsx(p,{className:"bottom-button-skip",sx:{mr:1},onClick:()=>s(),children:r("setup.skip")}),t.jsx(p,{className:"start-now bottom-button",loading:a,variant:"contained",disabled:a,onClick:f,children:r("setup.continue")})]})]})}y.propTypes={onNext:u.func,onPrevious:u.func};const C=x(S)`
1
+ import{j as t,ak as d,Q as p,at as x,W as u}from"./vendor-mui-core-DnR6WYuU.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{aT as g}from"./vendor-ux-DfSgTRg5.js";import{a as h}from"./page-header-CHAwrgX-.js";import{Y as j}from"./index-CDZlfV0h.js";import{A as b}from"./config-BwLMiIKp.js";import{S as k}from"./step-actions-CNIiIH7j.js";import{S}from"./layout-BFN2VPgc.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./isURL-CRNOx2AN.js";import"./section-jXB9AxBb.js";import"./required-BQln5OcV.js";import"./form-wrapper-PT5ZzMQy.js";import"./form-text-input-BjQKx89L.js";import"./edit.svg-RRSklUg-.js";import"./wait-connect-COGsNIA_.js";import"./get-safe-url-BIGE7_Qp.js";import"./index-_tncRnTu.js";import"./index-DBs9Ljax.js";import"./use-mobile-D5clNlrm.js";import"./content-layout-DmSBGGVm.js";function y({onNext:s=()=>{},onPrevious:l=()=>{}}){const{t:r}=o.useContext(g),{blocklet:e}=j(),i=o.useMemo(()=>e?.meta?.requirements,[e]),n=o.useRef(null),[a,m]=o.useState(!1),f=async()=>{try{m(!0),(await n.current.onSubmit()||!i?.aigne)&&s()}catch(c){console.error("error",c)}finally{m(!1)}};return t.jsxs(C,{children:[t.jsx("div",{className:"header",children:t.jsx(h,{title:r("setting.aigne.config"),onClickBack:l})}),t.jsx(d,{className:"form-container",children:t.jsx(b,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,ref:n,source:"setup",forceValidate:i?.aigne})}),t.jsxs(k,{blocklet:e,children:[!i?.aigne&&t.jsx(p,{className:"bottom-button-skip",sx:{mr:1},onClick:()=>s(),children:r("setup.skip")}),t.jsx(p,{className:"start-now bottom-button",loading:a,variant:"contained",disabled:a,onClick:f,children:r("setup.continue")})]})]})}y.propTypes={onNext:u.func,onPrevious:u.func};const C=x(S)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
 
@@ -1 +1 @@
1
- import{C as E,A as k}from"./vendor-utils-drLlzTVq.js";import{Z as T,Y as j,c as M}from"./index-DwK0GIrs.js";import{r as e}from"./vendor-react-CTtPmzVP.js";import{V as B}from"./vendor-ux-DfSgTRg5.js";import{u as D}from"./use-mobile-BINJTzMb.js";import{D as H,j as o,ak as w,a6 as I}from"./vendor-mui-core-DnR6WYuU.js";import"./vendor-arcblock-CPCSE54a.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";function K(){const{info:x,inService:g}=T(),{blocklet:y}=j(),{locale:u}=B(),f=e.useRef(null),r=H(),[L,R]=e.useState(0),m=D(),[t,S]=e.useState(!0),s=e.useRef(null);let a="";g?a=M.WELLKNOWN_SERVICE_PATH_PREFIX:a=x.routing.adminPath;const c=new URLSearchParams;g?c.set("appUrl",window.location.origin):c.set("authKey","__sst"),c.set("schemaKey",E(window.location.origin,a,`/api/theme?id=${encodeURIComponent(y.meta.did)}`));const l=e.useCallback(()=>{if(s.current){const n=k(JSON.parse(JSON.stringify(r)),["palette","typography","shape","direction","breakpoints","mixins","shadows","transitions","zIndex"]);s.current.contentWindow.postMessage({type:"SEND_THEME",payload:n},window.location.origin)}},[r]),d=e.useCallback(()=>{s.current&&s.current.contentWindow.postMessage({type:"SEND_LOCALE",payload:u},window.location.origin)},[u]);return e.useEffect(()=>{const n=i=>{i.origin===window.location.origin&&(i.data.type==="REQUEST_THEME"&&l(),i.data.type==="THEME_BUILDER_LOADED"&&(d(),S(!1)))};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[l,d]),e.useEffect(()=>{t===!1&&l()},[r,t,l]),e.useEffect(()=>{t===!1&&d()},[u,t,d]),e.useEffect(()=>{const n=document.querySelector("#arc__dashboard-main"),i=document.querySelector(".dashboard-content"),p=()=>{if(f.current){const{height:C}=n.getBoundingClientRect(),{top:b}=i.getBoundingClientRect(),{top:_}=f.current.getBoundingClientRect();let h=C-_+b-(m?108:164);m&&(h=Math.min(h,600)),R(h)}};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[m,r]),o.jsxs(o.Fragment,{children:[o.jsx(w,{ref:f}),t&&o.jsx(w,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px"},children:o.jsx(I,{})}),o.jsx("iframe",{title:"Theme Builder",ref:s,src:`${E(window.location.origin,a,"/hosted/theme-builder/")}?${c.toString()}`,style:{border:0,width:"100%",height:`${L}px`,display:t?"none":"block"}})]})}export{K as default};
1
+ import{C as E,A as k}from"./vendor-utils-drLlzTVq.js";import{Z as T,Y as j,c as M}from"./index-CDZlfV0h.js";import{r as e}from"./vendor-react-CTtPmzVP.js";import{V as B}from"./vendor-ux-DfSgTRg5.js";import{u as D}from"./use-mobile-BINJTzMb.js";import{D as H,j as o,ak as w,a6 as I}from"./vendor-mui-core-DnR6WYuU.js";import"./vendor-arcblock-CPCSE54a.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";function K(){const{info:x,inService:g}=T(),{blocklet:y}=j(),{locale:u}=B(),f=e.useRef(null),r=H(),[L,R]=e.useState(0),m=D(),[t,S]=e.useState(!0),s=e.useRef(null);let a="";g?a=M.WELLKNOWN_SERVICE_PATH_PREFIX:a=x.routing.adminPath;const c=new URLSearchParams;g?c.set("appUrl",window.location.origin):c.set("authKey","__sst"),c.set("schemaKey",E(window.location.origin,a,`/api/theme?id=${encodeURIComponent(y.meta.did)}`));const l=e.useCallback(()=>{if(s.current){const n=k(JSON.parse(JSON.stringify(r)),["palette","typography","shape","direction","breakpoints","mixins","shadows","transitions","zIndex"]);s.current.contentWindow.postMessage({type:"SEND_THEME",payload:n},window.location.origin)}},[r]),d=e.useCallback(()=>{s.current&&s.current.contentWindow.postMessage({type:"SEND_LOCALE",payload:u},window.location.origin)},[u]);return e.useEffect(()=>{const n=i=>{i.origin===window.location.origin&&(i.data.type==="REQUEST_THEME"&&l(),i.data.type==="THEME_BUILDER_LOADED"&&(d(),S(!1)))};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[l,d]),e.useEffect(()=>{t===!1&&l()},[r,t,l]),e.useEffect(()=>{t===!1&&d()},[u,t,d]),e.useEffect(()=>{const n=document.querySelector("#arc__dashboard-main"),i=document.querySelector(".dashboard-content"),p=()=>{if(f.current){const{height:C}=n.getBoundingClientRect(),{top:b}=i.getBoundingClientRect(),{top:_}=f.current.getBoundingClientRect();let h=C-_+b-(m?108:164);m&&(h=Math.min(h,600)),R(h)}};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[m,r]),o.jsxs(o.Fragment,{children:[o.jsx(w,{ref:f}),t&&o.jsx(w,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px"},children:o.jsx(I,{})}),o.jsx("iframe",{title:"Theme Builder",ref:s,src:`${E(window.location.origin,a,"/hosted/theme-builder/")}?${c.toString()}`,style:{border:0,width:"100%",height:`${L}px`,display:t?"none":"block"}})]})}export{K as default};
@@ -1,4 +1,4 @@
1
- import{H as U,V as _,b1 as H,b9 as F,bp as Z,aN as G,aU as K}from"./vendor-ux-DfSgTRg5.js";import{Z as N,c as A}from"./index-DwK0GIrs.js";import{j as e,D as I,ak as g,b2 as X,T as $,am as W,bl as J,I as D,cj as Q,dP as q,J as Y,a6 as ee,y as te,x as ne,bZ as oe,M as se,b_ as re,at as ae}from"./vendor-mui-core-DnR6WYuU.js";import{r as i,L as ie}from"./vendor-react-CTtPmzVP.js";import{p as le}from"./util-Bps9wpLH.js";import{u as ce}from"./useLocalStorage-BV1BIwfo.js";import{M as T}from"./index-B0Q9wWG1.js";import{d as de,e as M}from"./vendor-utils-drLlzTVq.js";import{S as V}from"./shorten-label-C4py9TLA.js";import{r as O}from"./index-CRAuhYSg.js";import{b as ue}from"./team-BETRxUUw.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./base32-CXgP3JJ5.js";import"./session-nLCSznMa.js";import"./isURL-CkV6bNHJ.js";import"./use-app-logo-BgQdzlhG.js";const B=i.createContext({}),{Provider:pe,Consumer:We}=B;function fe(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function me({children:t,scope:c="",categories:o=[],showScope:l,scopeFormatter:p,blocklets:x}){const{api:h,info:v}=N(),[C,f]=i.useState([]),[m,y]=i.useState({total:0,pageSize:fe(),pageCount:0,page:1}),[L,s]=i.useState(!1),[w,a]=i.useState(""),[d,n]=ce(`audit-log-category-${c}`,"all"),j=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter(P=>o.length?P.value==="all"||o.includes(P.value):!0),b=async({page:P=1,pageSize:r=20,silent:z=!0}={})=>{if(!L){z||s(!0);try{const S=await h.getAuditLogs({input:{paging:{page:P,pageSize:r},category:d==="all"?"":d,scope:c,actionOrContent:w}});l&&(S.list||[]).forEach(E=>{E.scope!==v.did&&(E.link=`/blocklets/${E.scope}/components`)}),f(S.list),y(S.paging),s(!1)}catch(S){U.error(S.message),s(!1)}}};i.useEffect(()=>{localStorage.setItem("audit-log-page-size",m.pageSize)},[m.pageSize]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[d,w]);const k={loading:L,fetch:b,filter:{category:d,scope:c},categories:j,blocklets:x,setCategory:n,data:C,paging:m,setPaging:y,showScope:l,scopeFormatter:p,actionOrContent:w,setActionOrContent:a};return e.jsx(pe,{value:{auditLogs:k},children:t})}function R(){const{auditLogs:t}=i.useContext(B);return t}function ge(t){if(!t)return[];const c=/\[([^\]]+)\]\(([^)]+)\)/g,o=[];let l;for(;(l=c.exec(t))!==null;)o.push({text:l[1],url:l[2]});return o}const xe=`
1
+ import{H as U,V as _,b1 as H,b9 as F,bp as Z,aN as G,aU as K}from"./vendor-ux-DfSgTRg5.js";import{Z as N,c as A}from"./index-CDZlfV0h.js";import{j as e,D as I,ak as g,b2 as X,T as $,am as W,bl as J,I as D,cj as Q,dP as q,J as Y,a6 as ee,y as te,x as ne,bZ as oe,M as se,b_ as re,at as ae}from"./vendor-mui-core-DnR6WYuU.js";import{r as i,L as ie}from"./vendor-react-CTtPmzVP.js";import{p as le}from"./util-4RKb-Srn.js";import{u as ce}from"./useLocalStorage-BV1BIwfo.js";import{M as T}from"./index-B0Q9wWG1.js";import{d as de,e as M}from"./vendor-utils-drLlzTVq.js";import{S as V}from"./shorten-label-C4py9TLA.js";import{r as O}from"./index-CRAuhYSg.js";import{b as ue}from"./team-CF6hrmVi.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./base32-CXgP3JJ5.js";import"./session-BqnhIOZD.js";import"./isURL-CRNOx2AN.js";import"./use-app-logo-7cAapfl7.js";const B=i.createContext({}),{Provider:pe,Consumer:We}=B;function fe(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function me({children:t,scope:c="",categories:o=[],showScope:l,scopeFormatter:p,blocklets:x}){const{api:h,info:v}=N(),[C,f]=i.useState([]),[m,y]=i.useState({total:0,pageSize:fe(),pageCount:0,page:1}),[L,s]=i.useState(!1),[w,a]=i.useState(""),[d,n]=ce(`audit-log-category-${c}`,"all"),j=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter(P=>o.length?P.value==="all"||o.includes(P.value):!0),b=async({page:P=1,pageSize:r=20,silent:z=!0}={})=>{if(!L){z||s(!0);try{const S=await h.getAuditLogs({input:{paging:{page:P,pageSize:r},category:d==="all"?"":d,scope:c,actionOrContent:w}});l&&(S.list||[]).forEach(E=>{E.scope!==v.did&&(E.link=`/blocklets/${E.scope}/components`)}),f(S.list),y(S.paging),s(!1)}catch(S){U.error(S.message),s(!1)}}};i.useEffect(()=>{localStorage.setItem("audit-log-page-size",m.pageSize)},[m.pageSize]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[d,w]);const k={loading:L,fetch:b,filter:{category:d,scope:c},categories:j,blocklets:x,setCategory:n,data:C,paging:m,setPaging:y,showScope:l,scopeFormatter:p,actionOrContent:w,setActionOrContent:a};return e.jsx(pe,{value:{auditLogs:k},children:t})}function R(){const{auditLogs:t}=i.useContext(B);return t}function ge(t){if(!t)return[];const c=/\[([^\]]+)\]\(([^)]+)\)/g,o=[];let l;for(;(l=c.exec(t))!==null;)o.push({text:l[1],url:l[2]});return o}const xe=`
2
2
  <svg style="width:38px;height:38px;" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path fill-rule="evenodd" clip-rule="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_606_96)"/>
4
4
  <path fill-rule="evenodd" clip-rule="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_606_96)"/>
@@ -1 +1 @@
1
- import{J as A,j as e,ak as t,a6 as E,Q as l,cm as W,T as o,b2 as z,am as I,b$ as R,bX as L,a5 as O,a3 as T,bb as f,b6 as F}from"./vendor-mui-core-DnR6WYuU.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{x as D}from"./vendor-hooks-cYMUGE4V.js";import{C as b}from"./vendor-utils-drLlzTVq.js";import{u as B,c as u,V as H,H as U,b6 as M,o as V}from"./index-DwK0GIrs.js";import{K as p}from"./landing-page-BE08UeOH.js";import{V as K,M as y}from"./vendor-ux-DfSgTRg5.js";import{W as Q}from"./did-address-DqhneWXa.js";import"./vendor-arcblock-CPCSE54a.js";import"./lottie-web-4koyQiv_.js";function re(){const{searchParams:r}=new URL(window.location.href),{session:d}=B(),{t:c}=K(),m=r.get("client_id"),_=r.get("scope")||"profile:read",[g,w]=x.useState(_.split(" ").filter(Boolean)),v=A("(max-width: 600px)"),k=b(window.location.origin,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/oauth/authorize"),C=x.useCallback(i=>i?i.startsWith("http")?i:`${b(u.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/media/upload",window.blocklet.appPid)}/${i}`:"",[]),[h,j]=D({client:null,loading:!0});x.useEffect(()=>{(async()=>{const{data:n}=await V.get("/oauth/client",{params:{clientId:m}});j({client:n,loading:!1})})()},[m,j]);const S=i=>{i!=="profile:read"&&w(n=>n.includes(i)?n.filter(P=>P!==i):[...n,i])};if(h.loading||!d?.user)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(E,{})})});if(!h.client)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(H,{style:{backgroundColor:"transparent"},status:"error",title:c("notFoundOauthClient"),extra:e.jsx(l,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(W,{}),href:"/",style:{borderRadius:4},children:c("connectCli.home")})})})});const{client:s}=h,{user:a}=d,N=(s.scope||"").split(" ");return e.jsxs(p,{did:window.blocklet?.appPid,standalone:!0,children:[e.jsx(U,{children:e.jsxs("title",{children:[c("oauth.authorize")," | ",window.blocklet?.appName]})}),e.jsx(M,{hideCloseButton:!0,children:e.jsxs(t,{sx:{display:"flex",flexDirection:"column",p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},className:"page-authorize",children:[e.jsxs(t,{sx:{textAlign:"center",mb:2},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:[e.jsx(y,{src:window.blocklet?.appLogo,alt:"Server",width:48,height:48}),e.jsxs(t,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"})]}),e.jsx(y,{src:C(s.logo_uri),alt:s.client_name,width:48,height:48})]}),e.jsxs(o,{sx:{mb:1,fontSize:"1.2rem","& .app-name":{color:"primary.main"}},children:["Authorize ",e.jsx("span",{className:"app-name",children:s.client_name})]})]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",width:"100%",overflow:"hidden",mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},className:"info",children:[e.jsx(z,{src:a.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(t,{sx:{flex:1,overflow:"hidden"},children:[e.jsx(I,{title:a.fullName,children:e.jsx(t,{className:"name",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:a.fullName})}),e.jsx(t,{className:"did",children:e.jsx(Q,{compact:!0,responsive:!1,did:a.did,showQrcode:!v})})]})]}),e.jsxs(o,{variant:"subtitle1",sx:{mb:2,fontWeight:500},children:["Allow ",s.client_name," to do the following on your behalf:"]}),e.jsxs(t,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden"},children:[e.jsx(t,{sx:{p:2},children:e.jsx(R,{children:Object.entries(u.OAUTH_SCOPES).filter(([i])=>N.includes(i)).map(([i,n])=>e.jsx(L,{control:e.jsx(O,{checked:g.includes(i),onChange:()=>S(i),disabled:i==="profile:read"||["blocklet:read","blocklet:write"].includes(i)&&!["owner","admin","member"].includes(a.role),color:"primary",sx:{"&.Mui-checked":{color:"success.main"}}}),label:e.jsx(t,{children:e.jsx(o,{variant:"body1",sx:{fontWeight:500},children:n})}),sx:{mb:0}},i))})}),(s.tos_uri||s.policy_uri)&&e.jsxs(e.Fragment,{children:[e.jsx(T,{}),e.jsx(t,{sx:{height:1,bgcolor:"divider"}}),e.jsx(t,{sx:{p:2,color:"text.secondary"},children:e.jsxs(o,{variant:"body2",children:["By authorize the access, you also agree with the"," ",!!s.tos_uri&&e.jsx(f,{href:s.tos_uri,target:"_blank",children:"Terms of Use"}),!!s.tos_uri&&!!s.policy_uri&&" and ",!!s.policy_uri&&e.jsx(f,{href:s.policy_uri,target:"_blank",children:"Privacy Policy"})]})})]})]}),e.jsxs("form",{method:"POST",action:k,children:[r.get("client_id")&&e.jsx("input",{type:"hidden",name:"client_id",value:r.get("client_id")}),r.get("response_type")&&e.jsx("input",{type:"hidden",name:"response_type",value:r.get("response_type")}),r.get("redirect_uri")&&e.jsx("input",{type:"hidden",name:"redirect_uri",value:r.get("redirect_uri")}),r.get("code_challenge")&&e.jsx("input",{type:"hidden",name:"code_challenge",value:r.get("code_challenge")}),r.get("code_challenge_method")&&e.jsx("input",{type:"hidden",name:"code_challenge_method",value:r.get("code_challenge_method")}),r.get("state")&&e.jsx("input",{type:"hidden",name:"state",value:r.get("state")}),e.jsx("input",{type:"hidden",name:"scope",value:g.join(" ")}),e.jsx(t,{sx:{mt:"auto",pt:3},children:e.jsxs(F,{direction:"row",spacing:2,children:[e.jsx(l,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(l,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),r.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(o,{variant:"body2",sx:{color:"text.secondary"},children:"You will be redirected to"}),e.jsx(o,{variant:"body2",sx:{color:"text.secondary",wordBreak:"break-all"},children:r.get("redirect_uri")})]}),e.jsx(t,{sx:{mt:2,textAlign:"center"},children:e.jsxs(o,{variant:"body2",children:["Not you?"," ",e.jsx(l,{variant:"text",color:"primary",onClick:()=>d.switchDid(),sx:{p:0,minWidth:"auto",textTransform:"none",verticalAlign:"baseline",fontWeight:"inherit",fontSize:"inherit","&:hover":{background:"none",textDecoration:"underline"}},children:"Use another account"})]})})]})]})})]})}export{re as default};
1
+ import{J as A,j as e,ak as t,a6 as E,Q as l,cm as W,T as o,b2 as z,am as I,b$ as R,bX as L,a5 as O,a3 as T,bb as f,b6 as F}from"./vendor-mui-core-DnR6WYuU.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{x as D}from"./vendor-hooks-cYMUGE4V.js";import{C as b}from"./vendor-utils-drLlzTVq.js";import{u as B,c as u,V as H,H as U,b6 as M,o as V}from"./index-CDZlfV0h.js";import{K as p}from"./landing-page-CBmSfoFm.js";import{V as K,M as y}from"./vendor-ux-DfSgTRg5.js";import{W as Q}from"./did-address-DqhneWXa.js";import"./vendor-arcblock-CPCSE54a.js";import"./lottie-web-4koyQiv_.js";function re(){const{searchParams:r}=new URL(window.location.href),{session:d}=B(),{t:c}=K(),m=r.get("client_id"),_=r.get("scope")||"profile:read",[g,w]=x.useState(_.split(" ").filter(Boolean)),v=A("(max-width: 600px)"),k=b(window.location.origin,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/oauth/authorize"),C=x.useCallback(i=>i?i.startsWith("http")?i:`${b(u.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/media/upload",window.blocklet.appPid)}/${i}`:"",[]),[h,j]=D({client:null,loading:!0});x.useEffect(()=>{(async()=>{const{data:n}=await V.get("/oauth/client",{params:{clientId:m}});j({client:n,loading:!1})})()},[m,j]);const S=i=>{i!=="profile:read"&&w(n=>n.includes(i)?n.filter(P=>P!==i):[...n,i])};if(h.loading||!d?.user)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(E,{})})});if(!h.client)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(H,{style:{backgroundColor:"transparent"},status:"error",title:c("notFoundOauthClient"),extra:e.jsx(l,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(W,{}),href:"/",style:{borderRadius:4},children:c("connectCli.home")})})})});const{client:s}=h,{user:a}=d,N=(s.scope||"").split(" ");return e.jsxs(p,{did:window.blocklet?.appPid,standalone:!0,children:[e.jsx(U,{children:e.jsxs("title",{children:[c("oauth.authorize")," | ",window.blocklet?.appName]})}),e.jsx(M,{hideCloseButton:!0,children:e.jsxs(t,{sx:{display:"flex",flexDirection:"column",p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},className:"page-authorize",children:[e.jsxs(t,{sx:{textAlign:"center",mb:2},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:[e.jsx(y,{src:window.blocklet?.appLogo,alt:"Server",width:48,height:48}),e.jsxs(t,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"})]}),e.jsx(y,{src:C(s.logo_uri),alt:s.client_name,width:48,height:48})]}),e.jsxs(o,{sx:{mb:1,fontSize:"1.2rem","& .app-name":{color:"primary.main"}},children:["Authorize ",e.jsx("span",{className:"app-name",children:s.client_name})]})]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",width:"100%",overflow:"hidden",mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},className:"info",children:[e.jsx(z,{src:a.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(t,{sx:{flex:1,overflow:"hidden"},children:[e.jsx(I,{title:a.fullName,children:e.jsx(t,{className:"name",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:a.fullName})}),e.jsx(t,{className:"did",children:e.jsx(Q,{compact:!0,responsive:!1,did:a.did,showQrcode:!v})})]})]}),e.jsxs(o,{variant:"subtitle1",sx:{mb:2,fontWeight:500},children:["Allow ",s.client_name," to do the following on your behalf:"]}),e.jsxs(t,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden"},children:[e.jsx(t,{sx:{p:2},children:e.jsx(R,{children:Object.entries(u.OAUTH_SCOPES).filter(([i])=>N.includes(i)).map(([i,n])=>e.jsx(L,{control:e.jsx(O,{checked:g.includes(i),onChange:()=>S(i),disabled:i==="profile:read"||["blocklet:read","blocklet:write"].includes(i)&&!["owner","admin","member"].includes(a.role),color:"primary",sx:{"&.Mui-checked":{color:"success.main"}}}),label:e.jsx(t,{children:e.jsx(o,{variant:"body1",sx:{fontWeight:500},children:n})}),sx:{mb:0}},i))})}),(s.tos_uri||s.policy_uri)&&e.jsxs(e.Fragment,{children:[e.jsx(T,{}),e.jsx(t,{sx:{height:1,bgcolor:"divider"}}),e.jsx(t,{sx:{p:2,color:"text.secondary"},children:e.jsxs(o,{variant:"body2",children:["By authorize the access, you also agree with the"," ",!!s.tos_uri&&e.jsx(f,{href:s.tos_uri,target:"_blank",children:"Terms of Use"}),!!s.tos_uri&&!!s.policy_uri&&" and ",!!s.policy_uri&&e.jsx(f,{href:s.policy_uri,target:"_blank",children:"Privacy Policy"})]})})]})]}),e.jsxs("form",{method:"POST",action:k,children:[r.get("client_id")&&e.jsx("input",{type:"hidden",name:"client_id",value:r.get("client_id")}),r.get("response_type")&&e.jsx("input",{type:"hidden",name:"response_type",value:r.get("response_type")}),r.get("redirect_uri")&&e.jsx("input",{type:"hidden",name:"redirect_uri",value:r.get("redirect_uri")}),r.get("code_challenge")&&e.jsx("input",{type:"hidden",name:"code_challenge",value:r.get("code_challenge")}),r.get("code_challenge_method")&&e.jsx("input",{type:"hidden",name:"code_challenge_method",value:r.get("code_challenge_method")}),r.get("state")&&e.jsx("input",{type:"hidden",name:"state",value:r.get("state")}),e.jsx("input",{type:"hidden",name:"scope",value:g.join(" ")}),e.jsx(t,{sx:{mt:"auto",pt:3},children:e.jsxs(F,{direction:"row",spacing:2,children:[e.jsx(l,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(l,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),r.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(o,{variant:"body2",sx:{color:"text.secondary"},children:"You will be redirected to"}),e.jsx(o,{variant:"body2",sx:{color:"text.secondary",wordBreak:"break-all"},children:r.get("redirect_uri")})]}),e.jsx(t,{sx:{mt:2,textAlign:"center"},children:e.jsxs(o,{variant:"body2",children:["Not you?"," ",e.jsx(l,{variant:"text",color:"primary",onClick:()=>d.switchDid(),sx:{p:0,minWidth:"auto",textTransform:"none",verticalAlign:"baseline",fontWeight:"inherit",fontSize:"inherit","&:hover":{background:"none",textDecoration:"underline"}},children:"Use another account"})]})})]})]})})]})}export{re as default};
@@ -1 +1 @@
1
- import{j as e,ak as l,aZ as B,T as f,D as H,n as Z,am as $,W as u}from"./vendor-mui-core-DnR6WYuU.js";import{Y as O,u as F,aF as I,l as P,c1 as U}from"./index-DwK0GIrs.js";import{V as D,z as k,ar as Q,J as Y}from"./vendor-ux-DfSgTRg5.js";import{a as J}from"./page-header-CHAwrgX-.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{S as W}from"./button-D6RwAFss.js";import{S as _}from"./layout-BPsPNtH9.js";import{S as G}from"./step-actions-Cfagh9Pk.js";import"./vendor-arcblock-CPCSE54a.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";const K={width:24,height:24,body:'<path fill="currentColor" d="M17 17q.625 0 1.063-.438T18.5 15.5q0-.625-.438-1.063T17 14q-.625 0-1.063.438T15.5 15.5q0 .625.438 1.063T17 17Zm0 3q.775 0 1.425-.363t1.05-.962q-.55-.325-1.175-.5T17 18q-.675 0-1.3.175t-1.175.5q.4.6 1.05.963T17 20Zm0 2q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22Zm-5 0q-3.475-.875-5.738-3.988T4 11.1V5l8-3l8 3v5.675q-.65-.325-1.463-.5T17 10q-2.9 0-4.95 2.05T10 17q0 1.55.588 2.8t1.487 2.175q-.025 0-.037.013T12 22Z"/>'},X={width:24,height:24,body:'<path fill="currentColor" d="M7 15q1.25 0 2.125-.875T10 12q0-1.25-.875-2.125T7 9q-1.25 0-2.125.875T4 12q0 1.25.875 2.125T7 15Zm0 3q-2.5 0-4.25-1.75T1 12q0-2.5 1.75-4.25T7 6q2.025 0 3.538 1.15T12.65 10h8.375L23 11.975l-3.5 4L17 14l-2 2l-2-2h-.35q-.625 1.8-2.175 2.9T7 18Z"/>'},ee={width:24,height:24,body:'<path fill="currentColor" d="M4 20q-.825 0-1.413-.588T2 18V6q0-.825.588-1.413T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.588 1.413T20 20H4Zm8-7L4 8v10h16V8l-8 5Zm0-2l8-5H4l8 5ZM4 8V6v12V8Z"/>'},te={width:24,height:24,body:'<path fill="currentColor" d="M6 20q-1.65 0-2.825-1.175T2 16V8q0-1.65 1.175-2.825T6 4h12q1.65 0 2.825 1.175T22 8v8q0 1.65-1.175 2.825T18 20H6ZM6 8h12q.55 0 1.05.125t.95.4V8q0-.825-.588-1.413T18 6H6q-.825 0-1.413.588T4 8v.525q.45-.275.95-.4T6 8Zm-1.85 3.25l11.125 2.7q.225.05.45 0t.425-.2l3.475-2.9q-.275-.375-.7-.613T18 10H6q-.65 0-1.137.338t-.713.912Z"/>'},z=n=>({wallet:{icon:te,label:n("setup.connectAccount.wallet"),description:n("setup.connectAccount.walletDesc"),isDefault:!1,priority:1},passkey:{icon:X,label:n("setup.connectAccount.passkey"),description:n("setup.connectAccount.passkeyDesc"),isDefault:!1,priority:2},email:{icon:ee,label:n("setup.connectAccount.email"),description:n("setup.connectAccount.emailDesc"),isDefault:!0,priority:3}});function M({type:n,account:b=null,onBind:s,bindButton:g=null,loading:q=!1,recommended:o=!1}){const{t:m}=D(),a=z(m)[n],h=!!b,i=H();return e.jsx(l,{sx:{mb:2,p:{xs:1.5,sm:2},border:1,borderColor:o?Z(i.palette.primary.main,.2):"divider",borderRadius:1,bgcolor:o?Z(i.palette.primary.main,.08):"background.paper"},children:e.jsxs(l,{sx:{display:"flex",alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",flexDirection:{xs:"column",sm:"row"},gap:{xs:1.5,sm:2}},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1.5,width:{xs:"100%",sm:"auto"}},children:[e.jsx(k,{icon:a.icon,style:{fontSize:"20px"}}),e.jsxs(l,{sx:{flex:1,minWidth:0},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[e.jsx(f,{variant:"subtitle2",sx:{fontWeight:500,fontSize:{xs:"0.875rem",sm:"1rem"}},children:a.label}),h&&c("mobile"),o&&e.jsx(f,{variant:"caption",sx:{color:"warning.main",fontWeight:500,fontSize:"0.7rem"},children:m("setup.connectAccount.recommended")})]}),e.jsx(l,{sx:{mt:.5},children:C(b)})]})]}),a.isDefault?c():e.jsx(l,{sx:{width:{xs:"100%",sm:"auto"},display:"flex",justifyContent:"center"},children:h?c():g||e.jsx(W,{variant:"outlined",size:"small",onClick:()=>s(n),disabled:q,fullWidth:{xs:!0,sm:!1},sx:{borderColor:"primary.main",height:"32px !important",minWidth:{xs:"100%",sm:"60px"},fontSize:{xs:"0.875rem",sm:"0.8125rem"}},children:m("setup.connectAccount.connect")})})]})});function C(d){return h?d.displayName===d.did?e.jsx(Y,{did:d.did,showQrcode:!0}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{fontFamily:"monospace",mt:.5},children:d.displayName}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:a.description})}function c(d){const p=d==="mobile";return e.jsx(l,{sx:{minWidth:p?"auto":{xs:"100%",sm:"60px"},display:p?{xs:"flex",md:"none"}:{xs:"none",md:"flex"},alignItems:"center",justifyContent:"center"},children:e.jsx($,{title:m("setup.connectAccount.connected"),placement:"top",children:e.jsx(k,{icon:U,style:{color:i.palette.success.main,fontSize:p?"18px":"24px"}})})})}}M.propTypes={type:u.string.isRequired,account:u.object,onBind:u.func.isRequired,bindButton:u.node,loading:u.bool,recommended:u.bool};function se({onNext:n=()=>{},onPrevious:b=()=>{}}){const{t:s}=D(),{blocklet:g}=O(),[q,o]=x.useState(!1),[m,a]=x.useState(!1),[h,i]=x.useState(null),{api:C,session:c}=F(),d=x.useRef(null),p=()=>{const t=c.user?.connectedAccounts||[],r={};return t.forEach(j=>{const{provider:S,userInfo:E,did:T,id:L}=j;S==="email"?r.email={did:T,displayName:L?.replace("email|","")||c.user?.email,...j}:S==="wallet"?r.wallet={did:T,displayName:T,...j}:S==="passkey"&&(r.passkey={did:T,displayName:E?.name||T,...j})}),r},[y,N]=x.useState(p());x.useEffect(()=>{N(p())},[c]);const R=t=>{i(t),o(!0),t==="wallet"?a(!0):t==="passkey"&&d.current.click()},w=()=>{c.refresh(),o(!1),a(!1),i(null)},v=z(s),V=Object.keys(v).filter(r=>!y[r]&&!v[r].isDefault).slice(0,2),A=Object.values(y).filter(Boolean).length;return e.jsxs(_,{children:[e.jsx("div",{className:"header",children:e.jsx(J,{title:s("setup.connectAccount.title"),onClickBack:b})}),e.jsxs(l,{className:"form-container",sx:{maxWidth:"700px",px:{xs:1,sm:0},width:"100%"},children:[Object.entries(v).filter(([t])=>y[t]||t!=="email").sort(([,t],[,r])=>t.priority-r.priority).map(([t])=>e.jsx(M,{type:t,account:y[t],onBind:R,bindButton:t==="passkey"?e.jsx(I,{behavior:"only-new",action:"connect",sx:{height:"32px",minWidth:{xs:"100%",sm:"60px"},border:"1px solid",borderColor:"primary.main","& .MuiTypography-root":{color:"primary.main",textAlign:"center",fontSize:{xs:"0.875rem",sm:"0.8125rem"}},"& > div:first-child":{display:"none"},"& > svg":{display:"none !important"}},createButtonText:s("setup.connectAccount.connect"),createMode:"connect",onConnect:()=>{o(!0),i("passkey")},onSuccess:()=>{w()},onError:()=>{o(!1),i(null)},dense:!0},"passkey"):null,loading:q&&h===t,recommended:V.includes(t)},t)),A===1?!!y.email&&e.jsx(B,{severity:"warning",sx:{mt:-1},children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.securityTip")})}):e.jsx(B,{severity:"success",sx:{mb:{xs:2,sm:3}},icon:e.jsx(k,{icon:K}),children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.statusSuccess",{count:A})})}),e.jsx(P,{popup:!0,open:m,action:"bind-wallet",checkFn:C.get,checkTimeout:10*60*1e3,webWalletUrl:Q(),onClose:()=>{a(!1),o(!1),i(null)},onSuccess:()=>{w()},locale:"zh",messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{previousUserDid:c.user?.did,skipMigrateAccount:!0,isService:!0}})]}),e.jsx(G,{blocklet:g,children:e.jsx(W,{variant:"contained",onClick:()=>n(),disabled:q,sx:{minWidth:{xs:100,sm:120}},children:A>0?s("setup.continue"):s("setup.connectAccount.skipBinding")})})]})}se.propTypes={onNext:u.func,onPrevious:u.func};export{se as default};
1
+ import{j as e,ak as l,aZ as B,T as f,D as H,n as Z,am as $,W as u}from"./vendor-mui-core-DnR6WYuU.js";import{Y as O,u as F,aF as I,l as P,c1 as U}from"./index-CDZlfV0h.js";import{V as D,z as k,ar as Q,J as Y}from"./vendor-ux-DfSgTRg5.js";import{a as J}from"./page-header-CHAwrgX-.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{S as W}from"./button-D6RwAFss.js";import{S as _}from"./layout-BFN2VPgc.js";import{S as G}from"./step-actions-CNIiIH7j.js";import"./vendor-arcblock-CPCSE54a.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";const K={width:24,height:24,body:'<path fill="currentColor" d="M17 17q.625 0 1.063-.438T18.5 15.5q0-.625-.438-1.063T17 14q-.625 0-1.063.438T15.5 15.5q0 .625.438 1.063T17 17Zm0 3q.775 0 1.425-.363t1.05-.962q-.55-.325-1.175-.5T17 18q-.675 0-1.3.175t-1.175.5q.4.6 1.05.963T17 20Zm0 2q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22Zm-5 0q-3.475-.875-5.738-3.988T4 11.1V5l8-3l8 3v5.675q-.65-.325-1.463-.5T17 10q-2.9 0-4.95 2.05T10 17q0 1.55.588 2.8t1.487 2.175q-.025 0-.037.013T12 22Z"/>'},X={width:24,height:24,body:'<path fill="currentColor" d="M7 15q1.25 0 2.125-.875T10 12q0-1.25-.875-2.125T7 9q-1.25 0-2.125.875T4 12q0 1.25.875 2.125T7 15Zm0 3q-2.5 0-4.25-1.75T1 12q0-2.5 1.75-4.25T7 6q2.025 0 3.538 1.15T12.65 10h8.375L23 11.975l-3.5 4L17 14l-2 2l-2-2h-.35q-.625 1.8-2.175 2.9T7 18Z"/>'},ee={width:24,height:24,body:'<path fill="currentColor" d="M4 20q-.825 0-1.413-.588T2 18V6q0-.825.588-1.413T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.588 1.413T20 20H4Zm8-7L4 8v10h16V8l-8 5Zm0-2l8-5H4l8 5ZM4 8V6v12V8Z"/>'},te={width:24,height:24,body:'<path fill="currentColor" d="M6 20q-1.65 0-2.825-1.175T2 16V8q0-1.65 1.175-2.825T6 4h12q1.65 0 2.825 1.175T22 8v8q0 1.65-1.175 2.825T18 20H6ZM6 8h12q.55 0 1.05.125t.95.4V8q0-.825-.588-1.413T18 6H6q-.825 0-1.413.588T4 8v.525q.45-.275.95-.4T6 8Zm-1.85 3.25l11.125 2.7q.225.05.45 0t.425-.2l3.475-2.9q-.275-.375-.7-.613T18 10H6q-.65 0-1.137.338t-.713.912Z"/>'},z=n=>({wallet:{icon:te,label:n("setup.connectAccount.wallet"),description:n("setup.connectAccount.walletDesc"),isDefault:!1,priority:1},passkey:{icon:X,label:n("setup.connectAccount.passkey"),description:n("setup.connectAccount.passkeyDesc"),isDefault:!1,priority:2},email:{icon:ee,label:n("setup.connectAccount.email"),description:n("setup.connectAccount.emailDesc"),isDefault:!0,priority:3}});function M({type:n,account:b=null,onBind:s,bindButton:g=null,loading:q=!1,recommended:o=!1}){const{t:m}=D(),a=z(m)[n],h=!!b,i=H();return e.jsx(l,{sx:{mb:2,p:{xs:1.5,sm:2},border:1,borderColor:o?Z(i.palette.primary.main,.2):"divider",borderRadius:1,bgcolor:o?Z(i.palette.primary.main,.08):"background.paper"},children:e.jsxs(l,{sx:{display:"flex",alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",flexDirection:{xs:"column",sm:"row"},gap:{xs:1.5,sm:2}},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1.5,width:{xs:"100%",sm:"auto"}},children:[e.jsx(k,{icon:a.icon,style:{fontSize:"20px"}}),e.jsxs(l,{sx:{flex:1,minWidth:0},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[e.jsx(f,{variant:"subtitle2",sx:{fontWeight:500,fontSize:{xs:"0.875rem",sm:"1rem"}},children:a.label}),h&&c("mobile"),o&&e.jsx(f,{variant:"caption",sx:{color:"warning.main",fontWeight:500,fontSize:"0.7rem"},children:m("setup.connectAccount.recommended")})]}),e.jsx(l,{sx:{mt:.5},children:C(b)})]})]}),a.isDefault?c():e.jsx(l,{sx:{width:{xs:"100%",sm:"auto"},display:"flex",justifyContent:"center"},children:h?c():g||e.jsx(W,{variant:"outlined",size:"small",onClick:()=>s(n),disabled:q,fullWidth:{xs:!0,sm:!1},sx:{borderColor:"primary.main",height:"32px !important",minWidth:{xs:"100%",sm:"60px"},fontSize:{xs:"0.875rem",sm:"0.8125rem"}},children:m("setup.connectAccount.connect")})})]})});function C(d){return h?d.displayName===d.did?e.jsx(Y,{did:d.did,showQrcode:!0}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{fontFamily:"monospace",mt:.5},children:d.displayName}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:a.description})}function c(d){const p=d==="mobile";return e.jsx(l,{sx:{minWidth:p?"auto":{xs:"100%",sm:"60px"},display:p?{xs:"flex",md:"none"}:{xs:"none",md:"flex"},alignItems:"center",justifyContent:"center"},children:e.jsx($,{title:m("setup.connectAccount.connected"),placement:"top",children:e.jsx(k,{icon:U,style:{color:i.palette.success.main,fontSize:p?"18px":"24px"}})})})}}M.propTypes={type:u.string.isRequired,account:u.object,onBind:u.func.isRequired,bindButton:u.node,loading:u.bool,recommended:u.bool};function se({onNext:n=()=>{},onPrevious:b=()=>{}}){const{t:s}=D(),{blocklet:g}=O(),[q,o]=x.useState(!1),[m,a]=x.useState(!1),[h,i]=x.useState(null),{api:C,session:c}=F(),d=x.useRef(null),p=()=>{const t=c.user?.connectedAccounts||[],r={};return t.forEach(j=>{const{provider:S,userInfo:E,did:T,id:L}=j;S==="email"?r.email={did:T,displayName:L?.replace("email|","")||c.user?.email,...j}:S==="wallet"?r.wallet={did:T,displayName:T,...j}:S==="passkey"&&(r.passkey={did:T,displayName:E?.name||T,...j})}),r},[y,N]=x.useState(p());x.useEffect(()=>{N(p())},[c]);const R=t=>{i(t),o(!0),t==="wallet"?a(!0):t==="passkey"&&d.current.click()},w=()=>{c.refresh(),o(!1),a(!1),i(null)},v=z(s),V=Object.keys(v).filter(r=>!y[r]&&!v[r].isDefault).slice(0,2),A=Object.values(y).filter(Boolean).length;return e.jsxs(_,{children:[e.jsx("div",{className:"header",children:e.jsx(J,{title:s("setup.connectAccount.title"),onClickBack:b})}),e.jsxs(l,{className:"form-container",sx:{maxWidth:"700px",px:{xs:1,sm:0},width:"100%"},children:[Object.entries(v).filter(([t])=>y[t]||t!=="email").sort(([,t],[,r])=>t.priority-r.priority).map(([t])=>e.jsx(M,{type:t,account:y[t],onBind:R,bindButton:t==="passkey"?e.jsx(I,{behavior:"only-new",action:"connect",sx:{height:"32px",minWidth:{xs:"100%",sm:"60px"},border:"1px solid",borderColor:"primary.main","& .MuiTypography-root":{color:"primary.main",textAlign:"center",fontSize:{xs:"0.875rem",sm:"0.8125rem"}},"& > div:first-child":{display:"none"},"& > svg":{display:"none !important"}},createButtonText:s("setup.connectAccount.connect"),createMode:"connect",onConnect:()=>{o(!0),i("passkey")},onSuccess:()=>{w()},onError:()=>{o(!1),i(null)},dense:!0},"passkey"):null,loading:q&&h===t,recommended:V.includes(t)},t)),A===1?!!y.email&&e.jsx(B,{severity:"warning",sx:{mt:-1},children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.securityTip")})}):e.jsx(B,{severity:"success",sx:{mb:{xs:2,sm:3}},icon:e.jsx(k,{icon:K}),children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.statusSuccess",{count:A})})}),e.jsx(P,{popup:!0,open:m,action:"bind-wallet",checkFn:C.get,checkTimeout:10*60*1e3,webWalletUrl:Q(),onClose:()=>{a(!1),o(!1),i(null)},onSuccess:()=>{w()},locale:"zh",messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{previousUserDid:c.user?.did,skipMigrateAccount:!0,isService:!0}})]}),e.jsx(G,{blocklet:g,children:e.jsx(W,{variant:"contained",onClick:()=>n(),disabled:q,sx:{minWidth:{xs:100,sm:120}},children:A>0?s("setup.continue"):s("setup.connectAccount.skipBinding")})})]})}se.propTypes={onNext:u.func,onPrevious:u.func};export{se as default};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
2
- import{V as fe,_ as be}from"./vendor-ux-DfSgTRg5.js";import{j as e,b6 as U,T as E,ak as x,b2 as je,am as Y,I as A,bO as J,Y as se,at as ve,b5 as ye,$ as we,ca as Ce,A as Z,aJ as Se,cb as Ie,R as ke,Q as W,W as k}from"./vendor-mui-core-DnR6WYuU.js";import{c as D}from"./index-DwK0GIrs.js";import{E as N}from"./empty-spinner-BYDonf35.js";import{q as Pe,u as Re}from"./vendor-hooks-cYMUGE4V.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{D as Q,C as G,P as ee}from"./react-beautiful-dnd.esm-89LKdt03.js";import{S as F}from"./studio-D_ap2IaO.js";import"./vendor-utils-drLlzTVq.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./raf-schd.esm-XXBRsnmf.js";import"./index-LIDGq9IJ.js";var I={},te;function Ee(){if(te)return I;te=1,Object.defineProperty(I,"__esModule",{value:!0}),I.getVideoId=b,I.getEmbedUrl=c,I.getVideoCoverUrl=P,I.getVideoCheckUrl=y,I.getYoutubeId=r,I.getVimeoId=a,I.isVideoUrl=w;function r(s){const t=s.trim();return t.includes("youtu.be/")?t.split("youtu.be/")[1]?.split("?")[0]:t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?t.split("/shorts/")[1]?.split("?")[0]:""}function a(s){const t=s.trim();return t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("vimeo.com/video/")?t.split("/video/")[1]?.split("?")[0]:t.includes("vimeo.com/channels/")?t.split("/channels/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/groups/")?t.split("/groups/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/")?t.split("vimeo.com/")[1]?.split("?")[0]:""}const p={};function b(s){const t=s.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(p[t]||(p[t]=(()=>{const u=new URL(t);return u.host.includes("youtube.com")||u.host.includes("youtu.be")?[r(t),"youtube"]:u.host.includes("vimeo.com")?[a(t),"vimeo"]:[]})()),p[t])}const n={};function c(s,{modestbranding:t=1,controls:u=0,autoplay:g=0}={}){const j=s.trim();if(!j)return"";if(n[j]!==void 0)return n[j];const[O,l]=b(j);return l==="youtube"?n[j]=`https://www.youtube.com/embed/${O}?modestbranding=${t}&controls=${u}&autoplay=${g}`:l==="vimeo"?n[j]=`https://player.vimeo.com/video/${O}?autoplay=${g}`:n[j]="",n[j]}const d={};function P(s){const t=s.trim();if(!t)return"";if(d[t]!==void 0)return d[t];const[u,g]=b(t);return g==="youtube"?d[t]=`https://img.youtube.com/vi/${u}/mqdefault.jpg`:g==="vimeo"?d[t]=`https://i.vimeocdn.com/${u}/1000x563`:d[t]="",d[t]}function y(s){const t=s.trim();if(!t)return"";const[u,g]=b(t);return g==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${u}&format=json`:g==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${u}`:""}function w(s){const t=s.trim();return b(t).length>0}return I}var q=Ee();const re=m.lazy(()=>be(()=>import("./index-u9yYWXco.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader}))),Oe=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Ve=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Le=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,_=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,De=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,oe=5,ie=3;function Xe(){const{t:r,locale:a}=fe(),[p,b]=m.useState(!1),[n,c]=m.useState(!1),[d,P]=m.useState([]),[y,w]=m.useState([]),[s,t]=m.useState(""),[u,g]=m.useState(""),[j,O]=m.useState(Date.now()),l=Pe(async()=>{const i=await(await fetch(_)).json();return P(i.screenshots||[]),w(i.videos?.filter(h=>!!h)||[]),i}),f=m.useRef(null),C=m.useRef(null);if(l.loading&&!l.data)return e.jsx(F,{children:e.jsx(N,{size:40})});if(l.error)return e.jsx(F,{children:e.jsx(U,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(E,{sx:{color:"error.main",fontWeight:"bold"},children:l.error.message})})});const T=async o=>{const i=o.filter(h=>!!h);w(i),await fetch(De,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:i})})},le=async o=>{const i=Array.from(y),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),await T(i)},ce=async o=>{const i=Array.from(d),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),P(i),await fetch(`${_}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:i})})},H=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},B=o=>{g(o.trim()),c(!0)},K=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await T(h),l.runAsync()},de=o=>{b(!0),t(o)},M=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx($,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Le}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx($,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(Q,{onDragEnd:H,children:e.jsx(G,{droppableId:"screenshots",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>{const X=`${_}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(X,{method:"DELETE"}),l.runAsync()},children:e.jsx(J,{})})})]})}},S)),v.placeholder,d.length<oe&&h()]})})})});function h(){return e.jsx(x,{onClick:()=>C.current?.open(),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function he(){const o=[{label:r("studio.count"),value:`1~${ie}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],i=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs($,{title:r("studio.video"),tips:i,rules:o,children:[e.jsx(Q,{onDragEnd:H,children:e.jsx(G,{droppableId:"videos",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:q.getVideoCoverUrl(S),onClick:()=>B(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>B(S),children:e.jsx(ae,{})}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>K(null,S),children:e.jsx(J,{})})})]})},S)),v.placeholder,y.length<ie&&h()]})})}),n&&e.jsx(ne,{t:r,handleOperateVideo:K,defaultUrl:u,videos:y})]});function h(){return e.jsx(x,{onClick:()=>c(!0),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function me(){return e.jsx(se,{open:p,onClose:M,maxWidth:"xl",slotProps:{paper:{style:{backgroundColor:"transparent",boxShadow:"none"}}},children:e.jsx("img",{src:`${_}/${s}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:M})})}function xe(){return e.jsxs(m.Suspense,{fallback:e.jsx(N,{size:40}),children:[e.jsx(re,{ref:f,locale:a,popup:!0,onUploadFinish:()=>{f.current?.close(),O(Date.now()),l.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Oe,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,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,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),e.jsx(re,{ref:C,locale:a,popup:!0,onUploadFinish:()=>{C.current?.close(),l.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Ve,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.length}},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:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(F,{children:e.jsxs(Te,{children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(E,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:l.data?.title})}),e.jsxs(E,{variant:"body2",sx:{color:"text.secondary"},children:[r("studio.description")," ",e.jsx("a",{href:ge,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),ue(),pe(),he(),me(),xe()]})})}function $({title:r,rules:a,tips:p,children:b}){return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",mb:4},children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(E,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(U,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:a.map(c=>n(c.label,c.value))}),p.map(c=>e.jsx(x,{sx:{fontSize:"13px",opacity:.8},children:n(c.label,c.value)}))]}),b]});function n(c,d){return e.jsxs(x,{component:"span",children:[e.jsxs(x,{component:"span",sx:{color:"#555",mr:.5},children:[c,":"]}),e.jsx(x,{component:"span",sx:{color:"#007ec6"},children:d})]})}}$.propTypes={title:k.string.isRequired,rules:k.array.isRequired,tips:k.array.isRequired,children:k.node.isRequired};function ne({handleOperateVideo:r,t:a,defaultUrl:p="",videos:b}){const[n,c]=m.useState(p),[d,P]=m.useState(!1),[y,w]=m.useState(!1),s=m.useRef(n),t=n!==p&&b.includes(n),u=!n&&p,g=!t&&(n&&n!==s.current||d),j=!!navigator.clipboard?.readText,{run:O}=Re(l,{wait:500,leading:!0});return e.jsxs(se,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(ye,{children:a(p?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(we,{children:[e.jsx(Ce,{fullWidth:!0,value:n,onChange:f=>{const C=f.target.value.trim();c(C),C?O(C):w(!1)},placeholder:a("studio.videoInputLabel"),endAdornment:n?e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:()=>{c(""),l("")},children:e.jsx(Se,{})})}):j&&e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();c(f),l(f)}catch(f){console.error(f)}},children:e.jsx(Ie,{})})})}),e.jsxs(x,{sx:{mb:2,mt:.5},children:[t&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.duplicateVideo")}),!t&&y&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.videoDialogNoSrc")})]}),s.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${s.current}`,src:q.getEmbedUrl(s.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:d?e.jsx(N,{size:40}):e.jsx(E,{variant:"h5",sx:{color:"text.secondary"},children:e.jsx(ae,{})})})]}),e.jsxs(ke,{children:[e.jsx(W,{onClick:()=>r(),children:a("studio.cancel")}),u&&e.jsx(W,{variant:"contained",color:"error",onClick:()=>r(null,p),children:a("studio.delete")}),g&&e.jsx(W,{variant:"contained",onClick:()=>l(n),disabled:!n||d,children:a("studio.preview")}),!u&&!g&&e.jsx(W,{variant:"contained",onClick:()=>r(s.current),disabled:!s.current||p===s.current||t,children:a("studio.confirm")})]})]});function l(f){s.current="";const C=q.getVideoCheckUrl(f);w(f?!C:!1),C&&(P(!0),fetch(C).then(T=>{T.ok?(s.current=f,w(!1)):w(!0)}).catch(()=>{w(!0)}).finally(()=>P(!1)))}}ne.propTypes={handleOperateVideo:k.func.isRequired,t:k.func.isRequired,defaultUrl:k.string,videos:k.array.isRequired};function ae(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Te=ve.div`
2
+ import{V as fe,_ as be}from"./vendor-ux-DfSgTRg5.js";import{j as e,b6 as U,T as E,ak as x,b2 as je,am as Y,I as A,bO as J,Y as se,at as ve,b5 as ye,$ as we,ca as Ce,A as Z,aJ as Se,cb as Ie,R as ke,Q as W,W as k}from"./vendor-mui-core-DnR6WYuU.js";import{c as D}from"./index-CDZlfV0h.js";import{E as N}from"./empty-spinner-BYDonf35.js";import{q as Pe,u as Re}from"./vendor-hooks-cYMUGE4V.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{D as Q,C as G,P as ee}from"./react-beautiful-dnd.esm-89LKdt03.js";import{S as F}from"./studio-BasxWENX.js";import"./vendor-utils-drLlzTVq.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./raf-schd.esm-XXBRsnmf.js";import"./index-BB3pIdTj.js";var I={},te;function Ee(){if(te)return I;te=1,Object.defineProperty(I,"__esModule",{value:!0}),I.getVideoId=b,I.getEmbedUrl=c,I.getVideoCoverUrl=P,I.getVideoCheckUrl=y,I.getYoutubeId=r,I.getVimeoId=a,I.isVideoUrl=w;function r(s){const t=s.trim();return t.includes("youtu.be/")?t.split("youtu.be/")[1]?.split("?")[0]:t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?t.split("/shorts/")[1]?.split("?")[0]:""}function a(s){const t=s.trim();return t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("vimeo.com/video/")?t.split("/video/")[1]?.split("?")[0]:t.includes("vimeo.com/channels/")?t.split("/channels/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/groups/")?t.split("/groups/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/")?t.split("vimeo.com/")[1]?.split("?")[0]:""}const p={};function b(s){const t=s.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(p[t]||(p[t]=(()=>{const u=new URL(t);return u.host.includes("youtube.com")||u.host.includes("youtu.be")?[r(t),"youtube"]:u.host.includes("vimeo.com")?[a(t),"vimeo"]:[]})()),p[t])}const n={};function c(s,{modestbranding:t=1,controls:u=0,autoplay:g=0}={}){const j=s.trim();if(!j)return"";if(n[j]!==void 0)return n[j];const[O,l]=b(j);return l==="youtube"?n[j]=`https://www.youtube.com/embed/${O}?modestbranding=${t}&controls=${u}&autoplay=${g}`:l==="vimeo"?n[j]=`https://player.vimeo.com/video/${O}?autoplay=${g}`:n[j]="",n[j]}const d={};function P(s){const t=s.trim();if(!t)return"";if(d[t]!==void 0)return d[t];const[u,g]=b(t);return g==="youtube"?d[t]=`https://img.youtube.com/vi/${u}/mqdefault.jpg`:g==="vimeo"?d[t]=`https://i.vimeocdn.com/${u}/1000x563`:d[t]="",d[t]}function y(s){const t=s.trim();if(!t)return"";const[u,g]=b(t);return g==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${u}&format=json`:g==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${u}`:""}function w(s){const t=s.trim();return b(t).length>0}return I}var q=Ee();const re=m.lazy(()=>be(()=>import("./index-CtBJPFT5.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader}))),Oe=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Ve=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Le=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,_=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,De=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,oe=5,ie=3;function Xe(){const{t:r,locale:a}=fe(),[p,b]=m.useState(!1),[n,c]=m.useState(!1),[d,P]=m.useState([]),[y,w]=m.useState([]),[s,t]=m.useState(""),[u,g]=m.useState(""),[j,O]=m.useState(Date.now()),l=Pe(async()=>{const i=await(await fetch(_)).json();return P(i.screenshots||[]),w(i.videos?.filter(h=>!!h)||[]),i}),f=m.useRef(null),C=m.useRef(null);if(l.loading&&!l.data)return e.jsx(F,{children:e.jsx(N,{size:40})});if(l.error)return e.jsx(F,{children:e.jsx(U,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(E,{sx:{color:"error.main",fontWeight:"bold"},children:l.error.message})})});const T=async o=>{const i=o.filter(h=>!!h);w(i),await fetch(De,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:i})})},le=async o=>{const i=Array.from(y),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),await T(i)},ce=async o=>{const i=Array.from(d),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),P(i),await fetch(`${_}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:i})})},H=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},B=o=>{g(o.trim()),c(!0)},K=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await T(h),l.runAsync()},de=o=>{b(!0),t(o)},M=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx($,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Le}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx($,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(Q,{onDragEnd:H,children:e.jsx(G,{droppableId:"screenshots",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>{const X=`${_}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(X,{method:"DELETE"}),l.runAsync()},children:e.jsx(J,{})})})]})}},S)),v.placeholder,d.length<oe&&h()]})})})});function h(){return e.jsx(x,{onClick:()=>C.current?.open(),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function he(){const o=[{label:r("studio.count"),value:`1~${ie}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],i=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs($,{title:r("studio.video"),tips:i,rules:o,children:[e.jsx(Q,{onDragEnd:H,children:e.jsx(G,{droppableId:"videos",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:q.getVideoCoverUrl(S),onClick:()=>B(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>B(S),children:e.jsx(ae,{})}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>K(null,S),children:e.jsx(J,{})})})]})},S)),v.placeholder,y.length<ie&&h()]})})}),n&&e.jsx(ne,{t:r,handleOperateVideo:K,defaultUrl:u,videos:y})]});function h(){return e.jsx(x,{onClick:()=>c(!0),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function me(){return e.jsx(se,{open:p,onClose:M,maxWidth:"xl",slotProps:{paper:{style:{backgroundColor:"transparent",boxShadow:"none"}}},children:e.jsx("img",{src:`${_}/${s}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:M})})}function xe(){return e.jsxs(m.Suspense,{fallback:e.jsx(N,{size:40}),children:[e.jsx(re,{ref:f,locale:a,popup:!0,onUploadFinish:()=>{f.current?.close(),O(Date.now()),l.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Oe,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,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,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),e.jsx(re,{ref:C,locale:a,popup:!0,onUploadFinish:()=>{C.current?.close(),l.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Ve,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.length}},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:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(F,{children:e.jsxs(Te,{children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(E,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:l.data?.title})}),e.jsxs(E,{variant:"body2",sx:{color:"text.secondary"},children:[r("studio.description")," ",e.jsx("a",{href:ge,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),ue(),pe(),he(),me(),xe()]})})}function $({title:r,rules:a,tips:p,children:b}){return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",mb:4},children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(E,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(U,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:a.map(c=>n(c.label,c.value))}),p.map(c=>e.jsx(x,{sx:{fontSize:"13px",opacity:.8},children:n(c.label,c.value)}))]}),b]});function n(c,d){return e.jsxs(x,{component:"span",children:[e.jsxs(x,{component:"span",sx:{color:"#555",mr:.5},children:[c,":"]}),e.jsx(x,{component:"span",sx:{color:"#007ec6"},children:d})]})}}$.propTypes={title:k.string.isRequired,rules:k.array.isRequired,tips:k.array.isRequired,children:k.node.isRequired};function ne({handleOperateVideo:r,t:a,defaultUrl:p="",videos:b}){const[n,c]=m.useState(p),[d,P]=m.useState(!1),[y,w]=m.useState(!1),s=m.useRef(n),t=n!==p&&b.includes(n),u=!n&&p,g=!t&&(n&&n!==s.current||d),j=!!navigator.clipboard?.readText,{run:O}=Re(l,{wait:500,leading:!0});return e.jsxs(se,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(ye,{children:a(p?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(we,{children:[e.jsx(Ce,{fullWidth:!0,value:n,onChange:f=>{const C=f.target.value.trim();c(C),C?O(C):w(!1)},placeholder:a("studio.videoInputLabel"),endAdornment:n?e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:()=>{c(""),l("")},children:e.jsx(Se,{})})}):j&&e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();c(f),l(f)}catch(f){console.error(f)}},children:e.jsx(Ie,{})})})}),e.jsxs(x,{sx:{mb:2,mt:.5},children:[t&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.duplicateVideo")}),!t&&y&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.videoDialogNoSrc")})]}),s.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${s.current}`,src:q.getEmbedUrl(s.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:d?e.jsx(N,{size:40}):e.jsx(E,{variant:"h5",sx:{color:"text.secondary"},children:e.jsx(ae,{})})})]}),e.jsxs(ke,{children:[e.jsx(W,{onClick:()=>r(),children:a("studio.cancel")}),u&&e.jsx(W,{variant:"contained",color:"error",onClick:()=>r(null,p),children:a("studio.delete")}),g&&e.jsx(W,{variant:"contained",onClick:()=>l(n),disabled:!n||d,children:a("studio.preview")}),!u&&!g&&e.jsx(W,{variant:"contained",onClick:()=>r(s.current),disabled:!s.current||p===s.current||t,children:a("studio.confirm")})]})]});function l(f){s.current="";const C=q.getVideoCheckUrl(f);w(f?!C:!1),C&&(P(!0),fetch(C).then(T=>{T.ok?(s.current=f,w(!1)):w(!0)}).catch(()=>{w(!0)}).finally(()=>P(!1)))}}ne.propTypes={handleOperateVideo:k.func.isRequired,t:k.func.isRequired,defaultUrl:k.string,videos:k.array.isRequired};function ae(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Te=ve.div`
3
3
  margin-top: 24px;
4
4
  .image-wrapper {
5
5
  margin-bottom: 16px;
@@ -1,4 +1,4 @@
1
- import{r as g}from"./vendor-react-CTtPmzVP.js";import{j as e,cy as o1,at as G,ak as c,aj as W,z as h1,U as n1,I as Y,a6 as d1,by as p1,F as f1,O as x1,dg as $,W as r,c5 as v1,b2 as m1,ar as g1,T as v,a3 as u,Q as V,b6 as u1}from"./vendor-mui-core-DnR6WYuU.js";import{k as j1,M as y1,J as Z1,aT as L1,H as w1}from"./vendor-ux-DfSgTRg5.js";import{x as E1}from"./vendor-hooks-cYMUGE4V.js";import{Z as q,G as _1,ak as b1,J as d}from"./index-DwK0GIrs.js";import{s as k1}from"./sanitize-DyRfEGVu.js";import{F as O1}from"./form-text-input-BjQKx89L.js";import{R as M1}from"./required-BQln5OcV.js";import{F as B1}from"./form-wrapper-PT5ZzMQy.js";import{w as J}from"./permission-PnySJGEl.js";import{u as R1}from"./use-app-logo-BgQdzlhG.js";import{L as j}from"./logo-uploader-BL-x4TAv.js";import{S as E}from"./section-jXB9AxBb.js";import"./vendor-utils-drLlzTVq.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./omit-BgmLPtMY.js";import"./index-_tncRnTu.js";import"./edit.svg-RRSklUg-.js";import"./session-nLCSznMa.js";function Q({label:i="",disabled:h=!1,required:p=!1,initialValue:s="",onChange:M=()=>{},style:z={},onSubmit:f=()=>{},triggers:m=[],options:a=[],formatterBeforeSubmit:_=Z=>Z.join(","),helperText:B="",placeholder:T="",renderImage:I=()=>null,renderLabel:N=()=>"",filterKeys:y=["name"],noEmpty:b=!1,...R}){const[Z,C]=g.useState(!1),[P,A]=g.useState(!1),[k,U]=g.useState(""),O=g.useRef(null),[L,S]=g.useState(s),[l,n]=g.useState(L),w=g.useMemo(()=>{if(!a)return{};const o={};return a.forEach(t=>{o[t.code]=t}),o},[a]),H=()=>{if(!a)return[];if(!k)return a.map(t=>t.code);const o=new RegExp(k.toLowerCase());return a.filter(t=>{for(let x=0;x<y.length;x++){const K=y[x];if(o.test(t[K]?.toLowerCase()))return!0}return!1}).map(t=>t.code)},c1=async()=>{A(!0);try{await f(typeof _=="function"?_(l):l)===!1?n(L):b&&!l.length?(n(s),S(s)):(n(l),S(l))}catch{n(L)}finally{A(!1),C(!1)}},t1=(o,t)=>{if(!Array.isArray(t)){n([]),M([]);return}const x=t.filter(K=>w[K]);if(!x.length){n([]),M([]);return}n(x),M(x)},s1=o=>{o.stopPropagation(),C(!0),setTimeout(()=>{if(O.current){const t=O.current.querySelector("input");t&&t.focus()}},500)},r1=Z?e.jsx(o1,{ref:O,options:a,value:l,onChange:t1,inputValue:k,onInputChange:(o,t)=>{U(t)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:H,getOptionLabel:o=>w[o]?.name,renderInput:o=>e.jsx(h1,{...o,label:"",placeholder:T}),renderOption:(o,t)=>{const x=l.indexOf(t)!==-1;return g.createElement(C1,{component:"li",...o,key:t},I(w[t]||{}),e.jsx(c,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:x?"700":"normal"},children:N(t,w[t])||w[t]?.name}),e.jsx(c,{component:W,sx:{opacity:.5,width:18,height:18},style:{visibility:x?"visible":"hidden"}}))},...R,slots:{popper:P1}}):e.jsx(c,{className:"form-item-input slot",onClick:s1,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:l.filter(o=>a.some(t=>t.code===o)).map(o=>e.jsx(n1,{label:a.find(t=>t.code===o).name,style:{marginRight:8},size:"small"},o))});return e.jsx(B1,{className:"form",style:z,children:e.jsxs(c,{className:"form-item",children:[e.jsxs(c,{className:"form-item-label",children:[i,p&&e.jsx(M1,{})]}),e.jsxs(c,{className:"form-item-body",children:[e.jsx(c,{className:"form-item-input",children:r1}),Z?e.jsx(c,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(Y,{"data-cy":"schema-form-item-confirm",onClick:c1,disabled:h||P,size:"large",children:P?e.jsx(d1,{size:24}):e.jsx(p1,{})}),e.jsx(Y,{"data-cy":"schema-form-item-cancel",onClick:()=>{n(L),C(!1)},disabled:h||P,size:"large",children:e.jsx(W,{})})]})}):null]}),Z&&B&&e.jsx(f1,{children:B})]})})}Q.propTypes={style:r.object,onSubmit:r.func,onChange:r.func,label:r.string,initialValue:r.string,required:r.bool,disabled:r.bool,triggers:r.array,options:r.array,helperText:r.string,formatterBeforeSubmit:r.func,placeholder:r.string,renderImage:r.func,filterKeys:r.arrayOf(r.string),noEmpty:r.bool,renderLabel:r.func};const C1=G.div`
1
+ import{r as g}from"./vendor-react-CTtPmzVP.js";import{j as e,cy as o1,at as G,ak as c,aj as W,z as h1,U as n1,I as Y,a6 as d1,by as p1,F as f1,O as x1,dg as $,W as r,c5 as v1,b2 as m1,ar as g1,T as v,a3 as u,Q as V,b6 as u1}from"./vendor-mui-core-DnR6WYuU.js";import{k as j1,M as y1,J as Z1,aT as L1,H as w1}from"./vendor-ux-DfSgTRg5.js";import{x as E1}from"./vendor-hooks-cYMUGE4V.js";import{Z as q,G as _1,ak as b1,J as d}from"./index-CDZlfV0h.js";import{s as k1}from"./sanitize-DyRfEGVu.js";import{F as O1}from"./form-text-input-BjQKx89L.js";import{R as M1}from"./required-BQln5OcV.js";import{F as B1}from"./form-wrapper-PT5ZzMQy.js";import{w as J}from"./permission-ZblvP8BW.js";import{u as R1}from"./use-app-logo-7cAapfl7.js";import{L as j}from"./logo-uploader-CdD4-48m.js";import{S as E}from"./section-jXB9AxBb.js";import"./vendor-utils-drLlzTVq.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./omit-BgmLPtMY.js";import"./index-_tncRnTu.js";import"./edit.svg-RRSklUg-.js";import"./session-BqnhIOZD.js";function Q({label:i="",disabled:h=!1,required:p=!1,initialValue:s="",onChange:M=()=>{},style:z={},onSubmit:f=()=>{},triggers:m=[],options:a=[],formatterBeforeSubmit:_=Z=>Z.join(","),helperText:B="",placeholder:T="",renderImage:I=()=>null,renderLabel:N=()=>"",filterKeys:y=["name"],noEmpty:b=!1,...R}){const[Z,C]=g.useState(!1),[P,A]=g.useState(!1),[k,U]=g.useState(""),O=g.useRef(null),[L,S]=g.useState(s),[l,n]=g.useState(L),w=g.useMemo(()=>{if(!a)return{};const o={};return a.forEach(t=>{o[t.code]=t}),o},[a]),H=()=>{if(!a)return[];if(!k)return a.map(t=>t.code);const o=new RegExp(k.toLowerCase());return a.filter(t=>{for(let x=0;x<y.length;x++){const K=y[x];if(o.test(t[K]?.toLowerCase()))return!0}return!1}).map(t=>t.code)},c1=async()=>{A(!0);try{await f(typeof _=="function"?_(l):l)===!1?n(L):b&&!l.length?(n(s),S(s)):(n(l),S(l))}catch{n(L)}finally{A(!1),C(!1)}},t1=(o,t)=>{if(!Array.isArray(t)){n([]),M([]);return}const x=t.filter(K=>w[K]);if(!x.length){n([]),M([]);return}n(x),M(x)},s1=o=>{o.stopPropagation(),C(!0),setTimeout(()=>{if(O.current){const t=O.current.querySelector("input");t&&t.focus()}},500)},r1=Z?e.jsx(o1,{ref:O,options:a,value:l,onChange:t1,inputValue:k,onInputChange:(o,t)=>{U(t)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:H,getOptionLabel:o=>w[o]?.name,renderInput:o=>e.jsx(h1,{...o,label:"",placeholder:T}),renderOption:(o,t)=>{const x=l.indexOf(t)!==-1;return g.createElement(C1,{component:"li",...o,key:t},I(w[t]||{}),e.jsx(c,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:x?"700":"normal"},children:N(t,w[t])||w[t]?.name}),e.jsx(c,{component:W,sx:{opacity:.5,width:18,height:18},style:{visibility:x?"visible":"hidden"}}))},...R,slots:{popper:P1}}):e.jsx(c,{className:"form-item-input slot",onClick:s1,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:l.filter(o=>a.some(t=>t.code===o)).map(o=>e.jsx(n1,{label:a.find(t=>t.code===o).name,style:{marginRight:8},size:"small"},o))});return e.jsx(B1,{className:"form",style:z,children:e.jsxs(c,{className:"form-item",children:[e.jsxs(c,{className:"form-item-label",children:[i,p&&e.jsx(M1,{})]}),e.jsxs(c,{className:"form-item-body",children:[e.jsx(c,{className:"form-item-input",children:r1}),Z?e.jsx(c,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(Y,{"data-cy":"schema-form-item-confirm",onClick:c1,disabled:h||P,size:"large",children:P?e.jsx(d1,{size:24}):e.jsx(p1,{})}),e.jsx(Y,{"data-cy":"schema-form-item-cancel",onClick:()=>{n(L),C(!1)},disabled:h||P,size:"large",children:e.jsx(W,{})})]})}):null]}),Z&&B&&e.jsx(f1,{children:B})]})})}Q.propTypes={style:r.object,onSubmit:r.func,onChange:r.func,label:r.string,initialValue:r.string,required:r.bool,disabled:r.bool,triggers:r.array,options:r.array,helperText:r.string,formatterBeforeSubmit:r.func,placeholder:r.string,renderImage:r.func,filterKeys:r.arrayOf(r.string),noEmpty:r.bool,renderLabel:r.func};const C1=G.div`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{j as t,ak as r,W as p}from"./vendor-mui-core-DnR6WYuU.js";import m from"./branding-DclrAcmZ.js";import{J as o}from"./index-DwK0GIrs.js";import"./vendor-react-CTtPmzVP.js";import"./vendor-ux-DfSgTRg5.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./sanitize-DyRfEGVu.js";import"./omit-BgmLPtMY.js";import"./index-_tncRnTu.js";import"./form-text-input-BjQKx89L.js";import"./required-BQln5OcV.js";import"./form-wrapper-PT5ZzMQy.js";import"./edit.svg-RRSklUg-.js";import"./permission-PnySJGEl.js";import"./session-nLCSznMa.js";import"./use-app-logo-BgQdzlhG.js";import"./logo-uploader-BL-x4TAv.js";import"./section-jXB9AxBb.js";import"./vendor-arcblock-CPCSE54a.js";function s({blocklet:i}){return t.jsx(r,{sx:{width:"100%","& .section-left":{width:340},"& .section":{gap:3}},children:t.jsx(m,{blocklet:i,showFields:[o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO]})})}s.propTypes={blocklet:p.object.isRequired};export{s as default};
1
+ import{j as t,ak as r,W as p}from"./vendor-mui-core-DnR6WYuU.js";import m from"./branding-BYJ9wBmN.js";import{J as o}from"./index-CDZlfV0h.js";import"./vendor-react-CTtPmzVP.js";import"./vendor-ux-DfSgTRg5.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./sanitize-DyRfEGVu.js";import"./omit-BgmLPtMY.js";import"./index-_tncRnTu.js";import"./form-text-input-BjQKx89L.js";import"./required-BQln5OcV.js";import"./form-wrapper-PT5ZzMQy.js";import"./edit.svg-RRSklUg-.js";import"./permission-ZblvP8BW.js";import"./session-BqnhIOZD.js";import"./use-app-logo-7cAapfl7.js";import"./logo-uploader-CdD4-48m.js";import"./section-jXB9AxBb.js";import"./vendor-arcblock-CPCSE54a.js";function s({blocklet:i}){return t.jsx(r,{sx:{width:"100%","& .section-left":{width:340},"& .section":{gap:3}},children:t.jsx(m,{blocklet:i,showFields:[o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO]})})}s.propTypes={blocklet:p.object.isRequired};export{s as default};
@@ -1 +1 @@
1
- import{j as u,b2 as x,W as e}from"./vendor-mui-core-DnR6WYuU.js";import{$}from"./vendor-ux-DfSgTRg5.js";import{C as c}from"./vendor-utils-drLlzTVq.js";import{Z as l,ai as v,bs as j,c as y,bt as E,bu as P}from"./index-DwK0GIrs.js";function R({blocklet:o,ancestors:d=[]}){const t=l(),{inService:s}=t,a=v(o?.status)||j(o?.status),r=`?v=${o?.meta?.version}${a?"~":""}`;let n=s?`${c(E,y.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${r}`:c(t.imgPrefix,"blocklet.png");if(o.source==="registry"&&o.deployedFrom&&o.meta.logo)n=`${c(o.deployedFrom,P(o.meta.bundleDid,o.meta.logo))}${r}`;else{const g=window.env?.apiPrefix||"/",i=d.concat(o),p=s?i.slice(1):i;n=`${c(g,`/blocklet/logo-bundle${p.map(m=>`/${m.meta.did}`).join("")}`)}${r}`}return{logoUrl:n,inService:s}}function h({blocklet:o,style:d={},size:t=40,ancestors:s=[],...a}){const r=l(),{logoUrl:n,inService:g}=R({blocklet:o,ancestors:s}),{variant:i}=a,p=g?()=>{}:f=>{f.target.src=`${r.imgPrefix}/blocklet.png`};let m=u.jsx("img",{src:n,onError:p,alt:o.meta.name,style:{width:t}});return o.meta.logo||(m=u.jsx($,{did:o.meta.did||"",responsive:!0})),u.jsx(x,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:t,height:t,borderRadius:10},d),...a,children:m})}h.propTypes={blocklet:e.object.isRequired,style:e.object,size:e.oneOfType([e.number,e.string]),ancestors:e.array};export{h as B};
1
+ import{j as u,b2 as x,W as e}from"./vendor-mui-core-DnR6WYuU.js";import{$}from"./vendor-ux-DfSgTRg5.js";import{C as c}from"./vendor-utils-drLlzTVq.js";import{Z as l,ai as v,bs as j,c as y,bt as E,bu as P}from"./index-CDZlfV0h.js";function R({blocklet:o,ancestors:d=[]}){const t=l(),{inService:s}=t,a=v(o?.status)||j(o?.status),r=`?v=${o?.meta?.version}${a?"~":""}`;let n=s?`${c(E,y.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${r}`:c(t.imgPrefix,"blocklet.png");if(o.source==="registry"&&o.deployedFrom&&o.meta.logo)n=`${c(o.deployedFrom,P(o.meta.bundleDid,o.meta.logo))}${r}`;else{const g=window.env?.apiPrefix||"/",i=d.concat(o),p=s?i.slice(1):i;n=`${c(g,`/blocklet/logo-bundle${p.map(m=>`/${m.meta.did}`).join("")}`)}${r}`}return{logoUrl:n,inService:s}}function h({blocklet:o,style:d={},size:t=40,ancestors:s=[],...a}){const r=l(),{logoUrl:n,inService:g}=R({blocklet:o,ancestors:s}),{variant:i}=a,p=g?()=>{}:f=>{f.target.src=`${r.imgPrefix}/blocklet.png`};let m=u.jsx("img",{src:n,onError:p,alt:o.meta.name,style:{width:t}});return o.meta.logo||(m=u.jsx($,{did:o.meta.did||"",responsive:!0})),u.jsx(x,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:t,height:t,borderRadius:10},d),...a,children:m})}h.propTypes={blocklet:e.object.isRequired,style:e.object,size:e.oneOfType([e.number,e.string]),ancestors:e.array};export{h as B};
@@ -1,4 +1,4 @@
1
- import{at as E,j as e,ak as m,W}from"./vendor-mui-core-DnR6WYuU.js";import{aA as Q,y as ne,K as H,cb as oe,q as ae,h as ie,cc as O,c as ce,o as le,r as ue,cd as de,O as me}from"./index-DwK0GIrs.js";import{r as d}from"./vendor-react-CTtPmzVP.js";import{aa as he,a2 as pe,B as fe,J as ge,C as K}from"./vendor-utils-drLlzTVq.js";import{b as we,a as j}from"./vendor-hooks-cYMUGE4V.js";import{u as xe}from"./launch-result-message-MNpx7ysR.js";import{V as be,K as ke,H as q}from"./vendor-ux-DfSgTRg5.js";import{g as Ue}from"./get-safe-url-BW-k89rQ.js";import{S as J}from"./button-D6RwAFss.js";import{S as ye}from"./layout-BPsPNtH9.js";import{p as Re,P as Se,S as Le}from"./starting-progress-D4qoLrH0.js";import"./vendor-arcblock-CPCSE54a.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-DmSBGGVm.js";const ve=E(xe)`
1
+ import{at as E,j as e,ak as m,W}from"./vendor-mui-core-DnR6WYuU.js";import{aA as Q,y as ne,K as H,cb as oe,q as ae,h as ie,cc as O,c as ce,o as le,r as ue,cd as de,O as me}from"./index-CDZlfV0h.js";import{r as d}from"./vendor-react-CTtPmzVP.js";import{aa as he,a2 as pe,B as fe,J as ge,C as K}from"./vendor-utils-drLlzTVq.js";import{b as we,a as j}from"./vendor-hooks-cYMUGE4V.js";import{u as xe}from"./launch-result-message-MNpx7ysR.js";import{V as be,K as ke,H as q}from"./vendor-ux-DfSgTRg5.js";import{g as Ue}from"./get-safe-url-BIGE7_Qp.js";import{S as J}from"./button-D6RwAFss.js";import{S as ye}from"./layout-BFN2VPgc.js";import{p as Re,P as Se,S as Le}from"./starting-progress-CGjjGpuY.js";import"./vendor-arcblock-CPCSE54a.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-DmSBGGVm.js";const ve=E(xe)`
2
2
  && .result-footer {
3
3
  height: 120px;
4
4
  > div {
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
2
- import{j as D,ak as ie,am as Tt,W as K,ax as ze,aD as dt,dx as ae,b as Ve,g as Ue,a as Te,m as Kh,s as oe,_ as U,h as We,T as rt,n as va,u as $e,dy as Qh,i as hl,k as Oa,E as Pf,G as Tf,l as Tn,B as Xh,H as Zh,D as In,c as Yt,I as tt,t as Jh,q as Sf,ar as eg,b4 as fr,Q as Dn,R as kf,K as tg,L as ng,N as lo,O as rg,P as ag,A as og,Y as Gi,Z as As,$ as Hi,J as _a,a0 as js,a1 as ig,a2 as lg,aH as Ls,at as st,aL as sg,c8 as ug,dz as cg,cG as dg,aJ as Bs,aI as fg,cS as pg,cR as Ns,dA as mg,dB as hg,dC as gg,cv as gl,cu as Mr,an as bg,bi as Rf,aZ as Fs,z as mt,b6 as Ef,cT as Mf,dD as vg,M as Vt,a6 as an,cC as Of,bT as yg,b2 as Cg,bb as Ia,dE as xg,bW as wg,bX as Yi,bY as $s,dF as Dg,bB as Pg,dG as Tg,be as _f,cd as If,bl as Sg,dH as kg,bI as Rg,dI as Eg,b5 as qs,a5 as zs,b1 as Mg,bn as Og}from"./vendor-mui-core-DnR6WYuU.js";import{au as Vs,n as Us,C as on,M as _g,av as Ig,J as Ws}from"./vendor-utils-drLlzTVq.js";import{d as Pe,a as Me,e as sn,g as Af,r as M,c as bl,b as Ag,u as vl}from"./vendor-react-CTtPmzVP.js";import{V as ut,H as je,br as re,bs as jf,bt as un,bu as Kt,bv as St,bw as Or,bx as Aa,by as Ye,bz as ja,bA as La,bB as yl,bC as Ba,bD as Lf,bE as Na,bF as Fa,bG as jg,bH as Lg,bI as Bg,bJ as Ng,bK as Fg,bL as $g,bM as qg,bN as zg,bO as Vg,bP as Ug,bQ as Wg,bR as jt,bS as It,bT as ne,bU as Gg,bV as $a,bW as cn,bX as Bf,bY as Cl,bZ as Nf,b_ as Hg,b$ as Yg,c0 as Kg,c1 as An,c2 as dn,c3 as Qg,c4 as Xg,c5 as Zg,c6 as Jg,c7 as eb,c8 as tb,c9 as _r,ca as nb,cb as rb,cc as ab,cd as ob,bd as Gs,be as ib,bf as lb,bg as sb,ce as Ff,cf as ub,cg as cb,ch as db,ci as fb,cj as pb,ck as mb,cl as hb,cm as gb,cn as bb,co as vb,cp as yb,aT as Qt,aJ as qa,_ as Cb,aU as xb,b1 as so,z as yt,w as uo,aN as wb}from"./vendor-ux-DfSgTRg5.js";import{Z as ft,Y as fn,ak as Sn,J as At,q as Ne,G as Cr,cg as Db,c as be,bP as kn,bO as $f,cd as qf,ch as zf,h as Pb,e as pr,aD as Tb,ci as Sb}from"./index-DwK0GIrs.js";import{f as Pt}from"./index-DBs9Ljax.js";import{b as kb,W as Rn,u as xl,B as Ki,m as Rb}from"./dashboard-C0oSA3oj.js";import{S as Eb}from"./switch-control-Bw0oiZZh.js";import{P as Qi,w as za}from"./permission-PnySJGEl.js";import{u as Vf,r as Mb}from"./vendor-mui-x-CQc01l4r.js";import{r as Se,a as wl,t as pt,b as De,e as Xi,d as Ob,s as ya,g as Zi,m as Uf,c as Wf,f as _b,h as Ib,i as Ji,j as Gf,k as Ab,l as jb,n as Hf,o as Dl,p as Hs,q as Lb,u as Ys,v as Bb,w as Nb,x as $t,y as Fb,z as Ks,A as $b,B as co,C as Qs,D as qb,E as qr,F as hn,G as zb,H as Vb,I as zr,J as fo,K as Vr,L as po,M as mo,N as Ub,O as Wb,P as Gb,Q as Hb,R as Yb,S as Kb,T as Qb,U as Xb,V as Zb,W as Jb}from"./index-DURonUPJ.js";import{_ as ev,a as Xs,b as tv,c as Oe,d as Re,e as Ee}from"./createClass-dudiLlP7.js";import{u as ke,a as ue,r as xr,w as Ca,g as Yf,b as pn,e as Kf,c as nv,d as rv,o as el}from"./raf-schd.esm-XXBRsnmf.js";import{s as av}from"./sanitize-DyRfEGVu.js";import{C as Zs}from"./click-to-copy-B2HIKJMV.js";import{v as ho}from"./index-CHuKoofS.js";import{A as ov,a as iv,b as lv,I as sv,f as uv,B as cv,d as dv}from"./add-component-core-heDvzsX8.js";import{C as jn}from"./confirm-btfSjmnK.js";import{a as xa,v as fv}from"./util-D27AtnBb.js";import{C as pv}from"./lock.svg-BgybwZNe.js";import{D as mv}from"./delete-confirm-dqp-ol9_.js";import{b as Qf}from"./vendor-hooks-cYMUGE4V.js";import{e as hv}from"./engine-0ct2xW2c.js";import{I as gv}from"./iframe-CXruOREe.js";import{B as Xf}from"./bundle-avatar-BZ_OHQ8d.js";import{A as Zf}from"./actions-Dfiiwkit.js";import{v as go}from"./index-BP_Fl0Mu.js";import{W as bv}from"./did-address-DqhneWXa.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./session-nLCSznMa.js";import"./team-BETRxUUw.js";import"./isURL-CkV6bNHJ.js";import"./use-app-logo-BgQdzlhG.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./useSetState-L-f8mSga.js";import"./index-LIDGq9IJ.js";import"./zh-DEgV10nE.js";import"./over-due-invoice-payment-Bux67LFM.js";import"./useLocalStorage-BV1BIwfo.js";import"./get-safe-url-BW-k89rQ.js";import"./passport-jAMdp3_i.js";import"./create-passport-svg-BQhmIwWD.js";import"./spaces-B6hICxl4.js";import"./api-C_w0YD2j.js";import"./index-Bxd7kK_i.js";import"./omit-BgmLPtMY.js";import"./index-_tncRnTu.js";import"./item-BSFssoYN.js";import"./wait-connect-AqdGAvY7.js";import"./launch-result-message-MNpx7ysR.js";import"./page-header-CHAwrgX-.js";import"./config-space-OgBdtdQ7.js";import"./required-BQln5OcV.js";import"./index-DVQWYAIC.js";import"./Google-Cwpw9PRe.js";import"./cloneDeep-BbaR0xRl.js";import"./form-wrapper-PT5ZzMQy.js";import"./logo-uploader-BL-x4TAv.js";import"./collapse-B7gUzFaX.js";import"./index-B0Q9wWG1.js";import"./config-uF2iao7N.js";import"./section-jXB9AxBb.js";import"./form-text-input-BjQKx89L.js";import"./edit.svg-RRSklUg-.js";import"./use-mobile-BINJTzMb.js";import"./content-layout-DmSBGGVm.js";import"./connect-to-_CNpUNET.js";import"./index-B5Fc7Exm.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./search-4YYphs0l.js";function Jf({children:e=null,...t}){const{t:n}=ut(),{api:a}=ft(),{blocklet:r}=fn(),o=r?.settings?.autoCheckUpdate,i=async s=>{await a.updateAutoCheckUpdate({input:{did:r.meta.did,autoCheckUpdate:s}})},l=async()=>{try{const s=!o?.enabled;await i({enabled:s}),je.success(n(s?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(s){je.error(s.message)}},u=!!o?.enabled;return D.jsxs(ie,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,D.jsx(Tt,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:D.jsx("div",{children:D.jsx(Eb,{checked:u,onChange:l,name:"enableWelcomePage",style:{...t.style,zoom:.8}})})})]})}Jf.propTypes={children:K.any};var bo={},vo={exports:{}},Js;function Ge(){return Js||(Js=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var o in r)({}).hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(vo)),vo.exports}var Vn={},yo={},Co={},xo={},eu;function vv(){return eu||(eu=1,function(e){var t=re();Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(Ge()),a=t(jf()),r=t(Pe()),o=t(ze()),i=un();function l(s){var f=(0,i.useTheme)();return r.default.createElement("div",{ref:s.forwardedRef,style:{display:"table",width:"100%",height:"100%",backgroundColor:f.palette.background.paper,opacity:.7}},r.default.createElement("div",{style:{display:"table-cell",width:"100%",height:"100%",verticalAlign:"middle",textAlign:"center"}},r.default.createElement(a.default,null)))}l.propTypes={theme:o.default.any};var u=r.default.forwardRef(function(f,d){return r.default.createElement(l,(0,n.default)({},f,{forwardedRef:d}))});e.default=u}(xo)),xo}var wo={},Do={},Dt={},Po={exports:{}},To={exports:{}},So={exports:{}},tu;function yv(){return tu||(tu=1,function(e){var t=Kt().default;function n(a,r){if(t(a)!="object"||!a)return a;var o=a[Symbol.toPrimitive];if(o!==void 0){var i=o.call(a,r||"default");if(t(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(a)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(So)),So.exports}var nu;function ep(){return nu||(nu=1,function(e){var t=Kt().default,n=yv();function a(r){var o=n(r,"string");return t(o)=="symbol"?o:o+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}(To)),To.exports}var ru;function nt(){return ru||(ru=1,function(e){var t=ep();function n(a,r,o){return(r=t(r))in a?Object.defineProperty(a,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[r]=o,a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Po)),Po.exports}const Cv={},au=e=>{let t;const n=new Set,a=(f,d)=>{const c=typeof f=="function"?f(t):f;if(!Object.is(c,t)){const v=t;t=d??(typeof c!="object"||c===null)?c:Object.assign({},t,c),n.forEach(y=>y(t,v))}},r=()=>t,u={setState:a,getState:r,getInitialState:()=>s,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(Cv?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=t=e(a,r,u);return u},tp=e=>e?au(e):au,{useDebugValue:xv}=Me,{useSyncExternalStoreWithSelector:wv}=Vf,Dv=e=>e;function np(e,t=Dv,n){const a=wv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return xv(a),a}const ou=e=>{const t=typeof e=="function"?tp(e):e,n=(a,r)=>np(t,a,r);return Object.assign(n,t),n},rp=e=>e?ou(e):ou;var Pv=e=>rp(e);const Tv=Object.freeze(Object.defineProperty({__proto__:null,create:rp,createStore:tp,default:Pv,useStore:np},Symbol.toStringTag,{value:"Module"})),Sv=sn(Tv),{useDebugValue:kv}=Me,{useSyncExternalStoreWithSelector:Rv}=Vf,Ev=e=>e;function Mv(e,t=Ev,n){const a=Rv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return kv(a),a}const{createElement:Ov,createContext:_v,useContext:iu,useMemo:Iv,useRef:Av}=Me;function jv(){const e=_v(void 0);return{Provider:({createStore:r,children:o})=>{const i=Av();return i.current||(i.current=r()),Ov(e.Provider,{value:i.current},o)},useStore:(r,o)=>{const i=iu(e);if(!i)throw new Error("Seems like you have not used zustand provider as an ancestor.");return Mv(i,r,o)},useStoreApi:()=>{const r=iu(e);if(!r)throw new Error("Seems like you have not used zustand provider as an ancestor.");return Iv(()=>({...r}),[r])}}}const Lv=Object.freeze(Object.defineProperty({__proto__:null,default:jv},Symbol.toStringTag,{value:"Module"})),Bv=sn(Lv);var Ur={exports:{}},ha={exports:{}},Nv=ha.exports,lu;function Fv(){return lu||(lu=1,function(e,t){(function(n,a){e.exports=a()})(Nv,function(){var n=typeof Promise=="function",a=function(x){if(typeof globalThis=="object")return globalThis;Object.defineProperty(x,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var P=typeDetectGlobalObject;return delete x.typeDetectGlobalObject,P}(Object.prototype),r=typeof Symbol<"u",o=typeof Map<"u",i=typeof Set<"u",l=typeof WeakMap<"u",u=typeof WeakSet<"u",s=typeof DataView<"u",f=r&&typeof Symbol.iterator<"u",d=r&&typeof Symbol.toStringTag<"u",c=i&&typeof Set.prototype.entries=="function",v=o&&typeof Map.prototype.entries=="function",y=c&&Object.getPrototypeOf(new Set().entries()),g=v&&Object.getPrototypeOf(new Map().entries()),C=f&&typeof Array.prototype[Symbol.iterator]=="function",h=C&&Object.getPrototypeOf([][Symbol.iterator]()),p=f&&typeof String.prototype[Symbol.iterator]=="function",m=p&&Object.getPrototypeOf(""[Symbol.iterator]()),b=8,k=-1;function w(x){var P=typeof x;if(P!=="object")return P;if(x===null)return"null";if(x===a)return"global";if(Array.isArray(x)&&(d===!1||!(Symbol.toStringTag in x)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&x===window.location)return"Location";if(typeof window.document=="object"&&x===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&x===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&x===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&x instanceof window.HTMLElement){if(x.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(x.tagName==="TD")return"HTMLTableDataCellElement";if(x.tagName==="TH")return"HTMLTableHeaderCellElement"}}var S=d&&x[Symbol.toStringTag];if(typeof S=="string")return S;var R=Object.getPrototypeOf(x);return R===RegExp.prototype?"RegExp":R===Date.prototype?"Date":n&&R===Promise.prototype?"Promise":i&&R===Set.prototype?"Set":o&&R===Map.prototype?"Map":u&&R===WeakSet.prototype?"WeakSet":l&&R===WeakMap.prototype?"WeakMap":s&&R===DataView.prototype?"DataView":o&&R===g?"Map Iterator":i&&R===y?"Set Iterator":C&&R===h?"Array Iterator":p&&R===m?"String Iterator":R===null?"Object":Object.prototype.toString.call(x).slice(b,k)}return w})}(ha)),ha.exports}var su;function ap(){if(su)return Ur.exports;su=1;/*!
2
+ import{j as D,ak as ie,am as Tt,W as K,ax as ze,aD as dt,dx as ae,b as Ve,g as Ue,a as Te,m as Kh,s as oe,_ as U,h as We,T as rt,n as va,u as $e,dy as Qh,i as hl,k as Oa,E as Pf,G as Tf,l as Tn,B as Xh,H as Zh,D as In,c as Yt,I as tt,t as Jh,q as Sf,ar as eg,b4 as fr,Q as Dn,R as kf,K as tg,L as ng,N as lo,O as rg,P as ag,A as og,Y as Gi,Z as As,$ as Hi,J as _a,a0 as js,a1 as ig,a2 as lg,aH as Ls,at as st,aL as sg,c8 as ug,dz as cg,cG as dg,aJ as Bs,aI as fg,cS as pg,cR as Ns,dA as mg,dB as hg,dC as gg,cv as gl,cu as Mr,an as bg,bi as Rf,aZ as Fs,z as mt,b6 as Ef,cT as Mf,dD as vg,M as Vt,a6 as an,cC as Of,bT as yg,b2 as Cg,bb as Ia,dE as xg,bW as wg,bX as Yi,bY as $s,dF as Dg,bB as Pg,dG as Tg,be as _f,cd as If,bl as Sg,dH as kg,bI as Rg,dI as Eg,b5 as qs,a5 as zs,b1 as Mg,bn as Og}from"./vendor-mui-core-DnR6WYuU.js";import{au as Vs,n as Us,C as on,M as _g,av as Ig,J as Ws}from"./vendor-utils-drLlzTVq.js";import{d as Pe,a as Me,e as sn,g as Af,r as M,c as bl,b as Ag,u as vl}from"./vendor-react-CTtPmzVP.js";import{V as ut,H as je,br as re,bs as jf,bt as un,bu as Kt,bv as St,bw as Or,bx as Aa,by as Ye,bz as ja,bA as La,bB as yl,bC as Ba,bD as Lf,bE as Na,bF as Fa,bG as jg,bH as Lg,bI as Bg,bJ as Ng,bK as Fg,bL as $g,bM as qg,bN as zg,bO as Vg,bP as Ug,bQ as Wg,bR as jt,bS as It,bT as ne,bU as Gg,bV as $a,bW as cn,bX as Bf,bY as Cl,bZ as Nf,b_ as Hg,b$ as Yg,c0 as Kg,c1 as An,c2 as dn,c3 as Qg,c4 as Xg,c5 as Zg,c6 as Jg,c7 as eb,c8 as tb,c9 as _r,ca as nb,cb as rb,cc as ab,cd as ob,bd as Gs,be as ib,bf as lb,bg as sb,ce as Ff,cf as ub,cg as cb,ch as db,ci as fb,cj as pb,ck as mb,cl as hb,cm as gb,cn as bb,co as vb,cp as yb,aT as Qt,aJ as qa,_ as Cb,aU as xb,b1 as so,z as yt,w as uo,aN as wb}from"./vendor-ux-DfSgTRg5.js";import{Z as ft,Y as fn,ak as Sn,J as At,q as Ne,G as Cr,cg as Db,c as be,bP as kn,bO as $f,cd as qf,ch as zf,h as Pb,e as pr,aD as Tb,ci as Sb}from"./index-CDZlfV0h.js";import{f as Pt}from"./index-DBs9Ljax.js";import{b as kb,W as Rn,u as xl,B as Ki,m as Rb}from"./dashboard-DPCpuxBj.js";import{S as Eb}from"./switch-control-Bw0oiZZh.js";import{P as Qi,w as za}from"./permission-ZblvP8BW.js";import{u as Vf,r as Mb}from"./vendor-mui-x-CQc01l4r.js";import{r as Se,a as wl,t as pt,b as De,e as Xi,d as Ob,s as ya,g as Zi,m as Uf,c as Wf,f as _b,h as Ib,i as Ji,j as Gf,k as Ab,l as jb,n as Hf,o as Dl,p as Hs,q as Lb,u as Ys,v as Bb,w as Nb,x as $t,y as Fb,z as Ks,A as $b,B as co,C as Qs,D as qb,E as qr,F as hn,G as zb,H as Vb,I as zr,J as fo,K as Vr,L as po,M as mo,N as Ub,O as Wb,P as Gb,Q as Hb,R as Yb,S as Kb,T as Qb,U as Xb,V as Zb,W as Jb}from"./index-DURonUPJ.js";import{_ as ev,a as Xs,b as tv,c as Oe,d as Re,e as Ee}from"./createClass-dudiLlP7.js";import{u as ke,a as ue,r as xr,w as Ca,g as Yf,b as pn,e as Kf,c as nv,d as rv,o as el}from"./raf-schd.esm-XXBRsnmf.js";import{s as av}from"./sanitize-DyRfEGVu.js";import{C as Zs}from"./click-to-copy-B2HIKJMV.js";import{v as ho}from"./index-CHuKoofS.js";import{A as ov,a as iv,b as lv,I as sv,f as uv,B as cv,d as dv}from"./add-component-core-C7Ksojy0.js";import{C as jn}from"./confirm-D3ZOq19V.js";import{a as xa,v as fv}from"./util-DE6S-EwK.js";import{C as pv}from"./lock.svg-BgybwZNe.js";import{D as mv}from"./delete-confirm-CvVgX89H.js";import{b as Qf}from"./vendor-hooks-cYMUGE4V.js";import{e as hv}from"./engine-Ctj5gh6M.js";import{I as gv}from"./iframe-8V4ttVHV.js";import{B as Xf}from"./bundle-avatar-CBW9tbvC.js";import{A as Zf}from"./actions-Dfiiwkit.js";import{v as go}from"./index-BP_Fl0Mu.js";import{W as bv}from"./did-address-DqhneWXa.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./session-BqnhIOZD.js";import"./team-CF6hrmVi.js";import"./isURL-CRNOx2AN.js";import"./use-app-logo-7cAapfl7.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./useSetState-L-f8mSga.js";import"./index-BB3pIdTj.js";import"./zh-CeRIETvo.js";import"./over-due-invoice-payment-1xzXw3lQ.js";import"./useLocalStorage-BV1BIwfo.js";import"./get-safe-url-BIGE7_Qp.js";import"./passport-CWGJXEtt.js";import"./create-passport-svg-BQhmIwWD.js";import"./spaces-CWRlaHIZ.js";import"./api-C_w0YD2j.js";import"./index-Bxd7kK_i.js";import"./omit-BgmLPtMY.js";import"./index-_tncRnTu.js";import"./item-NbVFwplA.js";import"./wait-connect-COGsNIA_.js";import"./launch-result-message-MNpx7ysR.js";import"./page-header-CHAwrgX-.js";import"./config-space-B7BwTKLT.js";import"./required-BQln5OcV.js";import"./index-BAErdc3T.js";import"./Google-Cwpw9PRe.js";import"./cloneDeep-BbaR0xRl.js";import"./form-wrapper-PT5ZzMQy.js";import"./logo-uploader-CdD4-48m.js";import"./collapse-B7gUzFaX.js";import"./index-B0Q9wWG1.js";import"./config-BwLMiIKp.js";import"./section-jXB9AxBb.js";import"./form-text-input-BjQKx89L.js";import"./edit.svg-RRSklUg-.js";import"./use-mobile-BINJTzMb.js";import"./content-layout-DmSBGGVm.js";import"./connect-to-BqMkANDm.js";import"./index-qbQiaInB.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./search-4YYphs0l.js";function Jf({children:e=null,...t}){const{t:n}=ut(),{api:a}=ft(),{blocklet:r}=fn(),o=r?.settings?.autoCheckUpdate,i=async s=>{await a.updateAutoCheckUpdate({input:{did:r.meta.did,autoCheckUpdate:s}})},l=async()=>{try{const s=!o?.enabled;await i({enabled:s}),je.success(n(s?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(s){je.error(s.message)}},u=!!o?.enabled;return D.jsxs(ie,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,D.jsx(Tt,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:D.jsx("div",{children:D.jsx(Eb,{checked:u,onChange:l,name:"enableWelcomePage",style:{...t.style,zoom:.8}})})})]})}Jf.propTypes={children:K.any};var bo={},vo={exports:{}},Js;function Ge(){return Js||(Js=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var o in r)({}).hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(vo)),vo.exports}var Vn={},yo={},Co={},xo={},eu;function vv(){return eu||(eu=1,function(e){var t=re();Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(Ge()),a=t(jf()),r=t(Pe()),o=t(ze()),i=un();function l(s){var f=(0,i.useTheme)();return r.default.createElement("div",{ref:s.forwardedRef,style:{display:"table",width:"100%",height:"100%",backgroundColor:f.palette.background.paper,opacity:.7}},r.default.createElement("div",{style:{display:"table-cell",width:"100%",height:"100%",verticalAlign:"middle",textAlign:"center"}},r.default.createElement(a.default,null)))}l.propTypes={theme:o.default.any};var u=r.default.forwardRef(function(f,d){return r.default.createElement(l,(0,n.default)({},f,{forwardedRef:d}))});e.default=u}(xo)),xo}var wo={},Do={},Dt={},Po={exports:{}},To={exports:{}},So={exports:{}},tu;function yv(){return tu||(tu=1,function(e){var t=Kt().default;function n(a,r){if(t(a)!="object"||!a)return a;var o=a[Symbol.toPrimitive];if(o!==void 0){var i=o.call(a,r||"default");if(t(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(a)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(So)),So.exports}var nu;function ep(){return nu||(nu=1,function(e){var t=Kt().default,n=yv();function a(r){var o=n(r,"string");return t(o)=="symbol"?o:o+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}(To)),To.exports}var ru;function nt(){return ru||(ru=1,function(e){var t=ep();function n(a,r,o){return(r=t(r))in a?Object.defineProperty(a,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[r]=o,a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Po)),Po.exports}const Cv={},au=e=>{let t;const n=new Set,a=(f,d)=>{const c=typeof f=="function"?f(t):f;if(!Object.is(c,t)){const v=t;t=d??(typeof c!="object"||c===null)?c:Object.assign({},t,c),n.forEach(y=>y(t,v))}},r=()=>t,u={setState:a,getState:r,getInitialState:()=>s,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(Cv?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=t=e(a,r,u);return u},tp=e=>e?au(e):au,{useDebugValue:xv}=Me,{useSyncExternalStoreWithSelector:wv}=Vf,Dv=e=>e;function np(e,t=Dv,n){const a=wv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return xv(a),a}const ou=e=>{const t=typeof e=="function"?tp(e):e,n=(a,r)=>np(t,a,r);return Object.assign(n,t),n},rp=e=>e?ou(e):ou;var Pv=e=>rp(e);const Tv=Object.freeze(Object.defineProperty({__proto__:null,create:rp,createStore:tp,default:Pv,useStore:np},Symbol.toStringTag,{value:"Module"})),Sv=sn(Tv),{useDebugValue:kv}=Me,{useSyncExternalStoreWithSelector:Rv}=Vf,Ev=e=>e;function Mv(e,t=Ev,n){const a=Rv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return kv(a),a}const{createElement:Ov,createContext:_v,useContext:iu,useMemo:Iv,useRef:Av}=Me;function jv(){const e=_v(void 0);return{Provider:({createStore:r,children:o})=>{const i=Av();return i.current||(i.current=r()),Ov(e.Provider,{value:i.current},o)},useStore:(r,o)=>{const i=iu(e);if(!i)throw new Error("Seems like you have not used zustand provider as an ancestor.");return Mv(i,r,o)},useStoreApi:()=>{const r=iu(e);if(!r)throw new Error("Seems like you have not used zustand provider as an ancestor.");return Iv(()=>({...r}),[r])}}}const Lv=Object.freeze(Object.defineProperty({__proto__:null,default:jv},Symbol.toStringTag,{value:"Module"})),Bv=sn(Lv);var Ur={exports:{}},ha={exports:{}},Nv=ha.exports,lu;function Fv(){return lu||(lu=1,function(e,t){(function(n,a){e.exports=a()})(Nv,function(){var n=typeof Promise=="function",a=function(x){if(typeof globalThis=="object")return globalThis;Object.defineProperty(x,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var P=typeDetectGlobalObject;return delete x.typeDetectGlobalObject,P}(Object.prototype),r=typeof Symbol<"u",o=typeof Map<"u",i=typeof Set<"u",l=typeof WeakMap<"u",u=typeof WeakSet<"u",s=typeof DataView<"u",f=r&&typeof Symbol.iterator<"u",d=r&&typeof Symbol.toStringTag<"u",c=i&&typeof Set.prototype.entries=="function",v=o&&typeof Map.prototype.entries=="function",y=c&&Object.getPrototypeOf(new Set().entries()),g=v&&Object.getPrototypeOf(new Map().entries()),C=f&&typeof Array.prototype[Symbol.iterator]=="function",h=C&&Object.getPrototypeOf([][Symbol.iterator]()),p=f&&typeof String.prototype[Symbol.iterator]=="function",m=p&&Object.getPrototypeOf(""[Symbol.iterator]()),b=8,k=-1;function w(x){var P=typeof x;if(P!=="object")return P;if(x===null)return"null";if(x===a)return"global";if(Array.isArray(x)&&(d===!1||!(Symbol.toStringTag in x)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&x===window.location)return"Location";if(typeof window.document=="object"&&x===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&x===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&x===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&x instanceof window.HTMLElement){if(x.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(x.tagName==="TD")return"HTMLTableDataCellElement";if(x.tagName==="TH")return"HTMLTableHeaderCellElement"}}var S=d&&x[Symbol.toStringTag];if(typeof S=="string")return S;var R=Object.getPrototypeOf(x);return R===RegExp.prototype?"RegExp":R===Date.prototype?"Date":n&&R===Promise.prototype?"Promise":i&&R===Set.prototype?"Set":o&&R===Map.prototype?"Map":u&&R===WeakSet.prototype?"WeakSet":l&&R===WeakMap.prototype?"WeakMap":s&&R===DataView.prototype?"DataView":o&&R===g?"Map Iterator":i&&R===y?"Set Iterator":C&&R===h?"Array Iterator":p&&R===m?"String Iterator":R===null?"Object":Object.prototype.toString.call(x).slice(b,k)}return w})}(ha)),ha.exports}var su;function ap(){if(su)return Ur.exports;su=1;/*!
3
3
  * deep-eql
4
4
  * Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
5
5
  * MIT Licensed
@@ -346,7 +346,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
346
346
  .ux-dialog_closeButton {
347
347
  margin: 0;
348
348
  }
349
- `,iM=M.lazy(()=>Cb(()=>import("./index-u9yYWXco.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>({default:e.Uploader}))),lM="/blocklet/component/upload",wf=[".html",".htm",".tgz",".zip"],sM=Number(window.env?.maxUploadFileSize)||be.MAX_UPLOAD_FILE_SIZE,uM=sM*1024*1024;function Ih({did:e,prefix:t,headers:n=()=>({}),onUploaded:a=Us,open:r=!1,onClose:o=Us}){const{t:i,locale:l}=ut(),u=M.useRef(null),s=M.useCallback(f=>{const{status:d,data:c}=f;if(d===200){a(c);return}je.error(i("blocklet.component.addComponentTip.uploadFailed"))},[a,i]);return M.useEffect(()=>{r?u.current?.open():u.current?.close()},[r]),D.jsx(cM,{id:`component-uploader-${e}`,children:D.jsx(iM,{ref:u,locale:l,popup:!0,disableXssAttack:!0,onUploadFinish:s,plugins:[],onClose:o,installerProps:{disabled:!0},apiPathProps:{uploader:on(t,lM,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:wf,maxFileSize:uM,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:i("blocklet.component.addComponentTip.allowedFileTypes",{types:wf.map(f=>f.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}Ih.propTypes={did:K.string.isRequired,prefix:K.string.isRequired,open:K.bool,headers:K.func,onUploaded:K.func,onClose:K.func};const cM=oe(ie)`
349
+ `,iM=M.lazy(()=>Cb(()=>import("./index-CtBJPFT5.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>({default:e.Uploader}))),lM="/blocklet/component/upload",wf=[".html",".htm",".tgz",".zip"],sM=Number(window.env?.maxUploadFileSize)||be.MAX_UPLOAD_FILE_SIZE,uM=sM*1024*1024;function Ih({did:e,prefix:t,headers:n=()=>({}),onUploaded:a=Us,open:r=!1,onClose:o=Us}){const{t:i,locale:l}=ut(),u=M.useRef(null),s=M.useCallback(f=>{const{status:d,data:c}=f;if(d===200){a(c);return}je.error(i("blocklet.component.addComponentTip.uploadFailed"))},[a,i]);return M.useEffect(()=>{r?u.current?.open():u.current?.close()},[r]),D.jsx(cM,{id:`component-uploader-${e}`,children:D.jsx(iM,{ref:u,locale:l,popup:!0,disableXssAttack:!0,onUploadFinish:s,plugins:[],onClose:o,installerProps:{disabled:!0},apiPathProps:{uploader:on(t,lM,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:wf,maxFileSize:uM,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:i("blocklet.component.addComponentTip.allowedFileTypes",{types:wf.map(f=>f.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}Ih.propTypes={did:K.string.isRequired,prefix:K.string.isRequired,open:K.bool,headers:K.func,onUploaded:K.func,onClose:K.func};const cM=oe(ie)`
350
350
  .uploader-wrapper {
351
351
  display: inline-flex;
352
352
  position: relative;
@@ -1,4 +1,4 @@
1
- import{e as bt,r as K,f as je,p as J}from"./vendor-react-CTtPmzVP.js";import{D as Ct,j as c,bZ as Et,ak as W,z as jt,M as St,U as gr,I as qe,a6 as ge,by as Pt,aj as kt,F as Bt,cH as Qr,W as q,at as lr,n as At,Q as ur,ar as ce,T as ue,am as me,c_ as It,b4 as be,bI as Xr,c$ as et,cU as Ot,A as mr,cT as Dt,a3 as Tt,d0 as Rt,d1 as zt,cF as Lt,bb as Ft}from"./vendor-mui-core-DnR6WYuU.js";import{q as Nt,g as yr,b as de,t as qt,a as Ce}from"./vendor-hooks-cYMUGE4V.js";import{i as Ht}from"./isURL-CkV6bNHJ.js";import{h as Mt,bj as rt,bk as Ut,bl as Kt,n as $t,bm as Wt,aT as ye,z as He,H as ae}from"./vendor-ux-DfSgTRg5.js";import{bU as tt,bD as Vt,bV as Gt,bW as Yt,c as dr,ba as Zt,bb as xr,Z as Jt,Y as Qt,aD as Xt,aA as _r,q as en}from"./index-DwK0GIrs.js";import{S as _e}from"./section-jXB9AxBb.js";import{R as rn}from"./required-BQln5OcV.js";import{F as tn}from"./form-wrapper-PT5ZzMQy.js";import{I as nn,F as Ee}from"./form-text-input-BjQKx89L.js";import{u as sn,c as on,w as an}from"./wait-connect-AqdGAvY7.js";import{B as wr,b as nt,C as le,D as st,J as it,n as fr}from"./vendor-utils-drLlzTVq.js";import{r as Ue}from"./index-_tncRnTu.js";import{f as he}from"./index-DBs9Ljax.js";var cn=null;const ln=Object.freeze(Object.defineProperty({__proto__:null,default:cn},Symbol.toStringTag,{value:"Module"})),Ke=bt(ln),un=Qr`
1
+ import{e as bt,r as K,f as je,p as J}from"./vendor-react-CTtPmzVP.js";import{D as Ct,j as c,bZ as Et,ak as W,z as jt,M as St,U as gr,I as qe,a6 as ge,by as Pt,aj as kt,F as Bt,cH as Qr,W as q,at as lr,n as At,Q as ur,ar as ce,T as ue,am as me,c_ as It,b4 as be,bI as Xr,c$ as et,cU as Ot,A as mr,cT as Dt,a3 as Tt,d0 as Rt,d1 as zt,cF as Lt,bb as Ft}from"./vendor-mui-core-DnR6WYuU.js";import{q as Nt,g as yr,b as de,t as qt,a as Ce}from"./vendor-hooks-cYMUGE4V.js";import{i as Ht}from"./isURL-CRNOx2AN.js";import{h as Mt,bj as rt,bk as Ut,bl as Kt,n as $t,bm as Wt,aT as ye,z as He,H as ae}from"./vendor-ux-DfSgTRg5.js";import{bU as tt,bD as Vt,bV as Gt,bW as Yt,c as dr,ba as Zt,bb as xr,Z as Jt,Y as Qt,aD as Xt,aA as _r,q as en}from"./index-CDZlfV0h.js";import{S as _e}from"./section-jXB9AxBb.js";import{R as rn}from"./required-BQln5OcV.js";import{F as tn}from"./form-wrapper-PT5ZzMQy.js";import{I as nn,F as Ee}from"./form-text-input-BjQKx89L.js";import{u as sn,c as on,w as an}from"./wait-connect-COGsNIA_.js";import{B as wr,b as nt,C as le,D as st,J as it,n as fr}from"./vendor-utils-drLlzTVq.js";import{r as Ue}from"./index-_tncRnTu.js";import{f as he}from"./index-DBs9Ljax.js";var cn=null;const ln=Object.freeze(Object.defineProperty({__proto__:null,default:cn},Symbol.toStringTag,{value:"Module"})),Ke=bt(ln),un=Qr`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }