@abtnode/blocklet-services 1.16.45-beta-20250628-221915-2d6b9a34 → 1.16.45-beta-20250630-024910-24ef8c24

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 (89) hide show
  1. package/dist/assets/{access-control-BH4SKMry.js → access-control-BI8hR4m6.js} +1 -1
  2. package/dist/assets/{add-component-core-DsuA1aKD.js → add-component-core-DJ6wP3Fb.js} +1 -1
  3. package/dist/assets/{add-resource-BHpNuRRT.js → add-resource-Xzrl9J9E.js} +1 -1
  4. package/dist/assets/{advanced-Dv4hgvDN.js → advanced-DAKR9vq6.js} +1 -1
  5. package/dist/assets/{appearance-D25Cy4CD.js → appearance-CLcBa2If.js} +1 -1
  6. package/dist/assets/{ar-BN95HEFs.js → ar-muZ8yq-3.js} +1 -1
  7. package/dist/assets/{audit-logs-DxpLWxIb.js → audit-logs-BpxjWxH9.js} +1 -1
  8. package/dist/assets/{authorize-BYosyezE.js → authorize-CJAHvI6f.js} +1 -1
  9. package/dist/assets/{branding-0f-nlnTd.js → branding-BqmpdYqw.js} +1 -1
  10. package/dist/assets/{branding-qHr23kxy.js → branding-Ds5vrS60.js} +2 -2
  11. package/dist/assets/{bundle-avatar-o4aWU1WK.js → bundle-avatar-DAWssS61.js} +1 -1
  12. package/dist/assets/{complete-DZkXZTgu.js → complete-CoItwYYG.js} +1 -1
  13. package/dist/assets/{component-ufgkgw5l.js → component-D4dOU94T.js} +3 -3
  14. package/dist/assets/{config-4oY1pbez.js → config-CrGTIwll.js} +1 -1
  15. package/dist/assets/{config-navigation-Bc7wRQPN.js → config-navigation-Ba_9bXNB.js} +3 -3
  16. package/dist/assets/{config-space-CDOLSL71.js → config-space-C_-wUm8x.js} +1 -1
  17. package/dist/assets/{confirm-CYOuqhW9.js → confirm-Cr4yXaP3.js} +1 -1
  18. package/dist/assets/{connect-BLeEbq2b.js → connect-CT4V0Shw.js} +1 -1
  19. package/dist/assets/{connect-B0psb3-s.js → connect-LANmhgqd.js} +1 -1
  20. package/dist/assets/{connect-to-BNRP7uKc.js → connect-to-CcDyzDBC.js} +1 -1
  21. package/dist/assets/{dashboard-Cvfy6NEE.js → dashboard-BrJfe1tK.js} +3 -3
  22. package/dist/assets/{de-BmXl3Jnb.js → de-C7PyfZoI.js} +1 -1
  23. package/dist/assets/{delete-confirm-DkwIz2kG.js → delete-confirm-BTxOYOoY.js} +1 -1
  24. package/dist/assets/{domain-action-card-BePK3J5E.js → domain-action-card-C9RDnMzS.js} +1 -1
  25. package/dist/assets/{domain-syiX0-xT.js → domain-q-cSvLb-.js} +1 -1
  26. package/dist/assets/{domains-nIh9pvJN.js → domains-DzDEWZRA.js} +1 -1
  27. package/dist/assets/{email-D1fetol9.js → email-CslWHpNP.js} +1 -1
  28. package/dist/assets/{es-C0fHeuzj.js → es-DLm4lJg0.js} +1 -1
  29. package/dist/assets/{exchange-passport-6gauQ6xB.js → exchange-passport-CkSkVesx.js} +1 -1
  30. package/dist/assets/{fr-CO0NFjy0.js → fr-CKdoTmsi.js} +1 -1
  31. package/dist/assets/{fuel-C0n-khQ9.js → fuel-BWsBctX0.js} +1 -1
  32. package/dist/assets/{gen-access-key-CTcU_k3z.js → gen-access-key-jpSB31VW.js} +1 -1
  33. package/dist/assets/{hi-Cms3dwY-.js → hi-C_IKh6W5.js} +1 -1
  34. package/dist/assets/{id-Bo8dj7EE.js → id-DG7dMeJq.js} +1 -1
  35. package/dist/assets/{index-YTd3fqJi.js → index-B6novXpp.js} +1 -1
  36. package/dist/assets/{index-CssP44F_.js → index-B8h7EuKB.js} +1 -1
  37. package/dist/assets/{index-7mvFZreO.js → index-Br-eR92d.js} +1 -1
  38. package/dist/assets/{index-CW1Uu8tM.js → index-Bv_IEtVv.js} +1 -1
  39. package/dist/assets/{index-Cd0lzxjI.js → index-C0WYw-jd.js} +1 -1
  40. package/dist/assets/{index-CMYHZyLG.js → index-C0kIXw5r.js} +4 -4
  41. package/dist/assets/{index-avNWKuLM.js → index-CCuD6_Rj.js} +1 -1
  42. package/dist/assets/{index-DC-aJClV.js → index-CYp1xoZ4.js} +1 -1
  43. package/dist/assets/{index-DmckOkn6.js → index-D-vHTvCV.js} +1 -1
  44. package/dist/assets/{index-z4rrXifq.js → index-D4KLEWFm.js} +1 -1
  45. package/dist/assets/{index-DOM4CWCV.js → index-DUGQ4cKm.js} +1 -1
  46. package/dist/assets/{index-B2m3FSsr.js → index-DzRGp0If.js} +3 -3
  47. package/dist/assets/{index-C4yBWU5s.js → index-GAl9W53I.js} +4 -4
  48. package/dist/assets/{index-ZnxES9EB.js → index-YO79r625.js} +1 -1
  49. package/dist/assets/{index-D0mjW5YA.js → index-ha4GQCBu.js} +1 -1
  50. package/dist/assets/{index-Cza1eXOB.js → index-l5blEEs7.js} +1 -1
  51. package/dist/assets/{invitation-jsh1K30w.js → invitation-49Fgeotv.js} +1 -1
  52. package/dist/assets/{invite-DB6Gc2ZO.js → invite-DLJIQmdJ.js} +1 -1
  53. package/dist/assets/{issue-passport-BElK-FIZ.js → issue-passport-DDCqVv1N.js} +1 -1
  54. package/dist/assets/{item-D95t-at-.js → item-fK0vcLaQ.js} +1 -1
  55. package/dist/assets/{ja-zaAhH8mE.js → ja-DePe5vMS.js} +1 -1
  56. package/dist/assets/{ko-CoZQ7a7T.js → ko-BKnl7Jtq.js} +1 -1
  57. package/dist/assets/{layout-CCLJBPEI.js → layout-feohUWg7.js} +1 -1
  58. package/dist/assets/{list-Dk6LlvZw.js → list-C8TeMgEe.js} +1 -1
  59. package/dist/assets/{list-q5d_hBMT.js → list-DeTNTY_6.js} +2 -2
  60. package/dist/assets/{log-CYFcudFD.js → log-BiuahUh0.js} +1 -1
  61. package/dist/assets/{login-Bs3IhQdt.js → login-5jPX--4W.js} +1 -1
  62. package/dist/assets/{logo-uploader-BSR27hpo.js → logo-uploader-DC4SpQmr.js} +2 -2
  63. package/dist/assets/{lost-passport-CHgCTW2X.js → lost-passport-BNyxQig9.js} +1 -1
  64. package/dist/assets/{overview-BlZSVHbX.js → overview-DtickflS.js} +1 -1
  65. package/dist/assets/{passport-item-C1Pxlerj.js → passport-item-BTBWvJCh.js} +1 -1
  66. package/dist/assets/{pt-D4wJ-rZD.js → pt-BoWjQJrr.js} +1 -1
  67. package/dist/assets/{publish-resource-CjbA8eXl.js → publish-resource-DyUoB0-C.js} +1 -1
  68. package/dist/assets/{ru-CmWrzb7M.js → ru-C8y980Xl.js} +1 -1
  69. package/dist/assets/{runtime-BAC7Yn-4.js → runtime-Bta2wOnU.js} +1 -1
  70. package/dist/assets/{security-BdzQGoAm.js → security-Bs24V5aw.js} +1 -1
  71. package/dist/assets/{setup-mVNNI9iB.js → setup-DLQmZAqt.js} +3 -3
  72. package/dist/assets/{start-CGuvKy2s.js → start-CxjnQYOx.js} +1 -1
  73. package/dist/assets/{status-C6AnHonq.js → status-Cht9_8hC.js} +1 -1
  74. package/dist/assets/{step-actions-Bps0yIu_.js → step-actions-BaBVLHSP.js} +1 -1
  75. package/dist/assets/{th-DkqBkRH_.js → th-DfDBrUtW.js} +1 -1
  76. package/dist/assets/{traffic-BXZ-j7u7.js → traffic-BdpKUL58.js} +1 -1
  77. package/dist/assets/{transfer-DR2kNsMH.js → transfer-CyBsVivd.js} +1 -1
  78. package/dist/assets/{unsubscribe-CC4RgAWa.js → unsubscribe-DUaYCo9A.js} +1 -1
  79. package/dist/assets/{use-blocklet-logo-CWdlYyrq.js → use-blocklet-logo-fumCZVth.js} +1 -1
  80. package/dist/assets/{user-center-Cjgf_nB9.js → user-center-DxImDlwk.js} +1 -1
  81. package/dist/assets/{util-BeBq6bKh.js → util-BMWW9F7x.js} +1 -1
  82. package/dist/assets/{vi-D4Y0EZ10.js → vi-oQ5RKDUh.js} +1 -1
  83. package/dist/assets/wrap-locale-BQFJOrpH.js +1 -0
  84. package/dist/assets/{zh-CXbCDXZ8.js → zh-APHGpH_q.js} +1 -1
  85. package/dist/assets/{zh-tw-DaTNZcVC.js → zh-tw-BHBaATnw.js} +1 -1
  86. package/dist/index.html +1 -1
  87. package/dist/service-worker.js +1 -1
  88. package/package.json +23 -23
  89. package/dist/assets/wrap-locale-CIsMM5oS.js +0 -1
@@ -1 +1 @@
1
- import{e as Y,j as t,aa as u,v as q,ab as Z,a3 as ee,y as ne}from"./vendor-mui-core-Bq8gXTan.js";import{f as se,h as oe,r as S,L as te}from"./vendor-react-DEoibe3W.js";import{a as re,aY as ae,p as ce,b4 as ie,b5 as le,F as de,b6 as pe,b3 as me,k as ue,b7 as fe,a3 as k,a8 as ge}from"./vendor-ux-did-connect-pzpsrvqx.js";import{b as he,u as x,m as we,s as ke}from"./vendor-hooks-DqdmWCmo.js";import{u as xe}from"./use-passport-id-B-b-_oYF.js";import{H as U}from"./vendor-arcblock-CwufDgLV.js";import{c as ve,I as be,z as Ce,A as Te,J as _e,ab as Ie,af as ye}from"./vendor-utils-BfZ4tlod.js";import{g as E}from"./get-safe-url-D5KSEAKZ.js";import{u as Le,p as P}from"./index-CMYHZyLG.js";import{d as p}from"./logger-Dqm1UQym.js";import"./lottie-web-jYmAQWuC.js";const j="authorization_response",De=me(),Se="blocklet:onLogin",f=new BroadcastChannel(Se);function Fe(){const{getPassportId:R}=xe(),{session:M,connectApi:N}=Le(),{t:a,locale:O}=re(),A=se(),[l]=oe(),{encrypt:B}=ae(),H=Y(),v=ce();let c={};try{c=JSON.parse(decodeURIComponent(ie(l.get("params"))))}catch(s){console.error("parse connect params failed",s)}ve(l.get("popup"));const{action:m="login",passkeyBehavior:W="both",extraParams:d={},messages:F,...g}=c;S.useEffect(()=>{d.inviter&&window.localStorage.setItem("inviter",d.inviter)},[d.inviter]);const i=l.get("redirect"),b=l.get("opener"),h=l.get("_ek_");d.passportId=R(),m==="login"&&be(g.forceConnected)&&(g.forceConnected=!1);const w=s=>h?B(JSON.stringify(s),h):s,C=S.useMemo(()=>i||!window.opener?"redirect":"popup",[i]),T=async s=>{const e=await De.federated.getTrustedDomains();if(!b){e.forEach(n=>{window.opener.postMessage(s,Ie(n)),window.opener.postMessage(s,ye(n))});return}const o=new URL(b);if(!e.includes(o.hostname))throw k.error(a("login.invalidOpenerUrl")),new Error("Invalid login caller");window.opener.postMessage(s,o.origin)},_=({encrypted:s=!0,...e},o,n)=>{p("connect page onSuccess",{encrypted:s,result:e,options:n}),s&&(e.sessionToken&&(e.sessionToken=o(e.sessionToken)),e.refreshToken&&(e.refreshToken=o(e.refreshToken)),e.visitorId&&(e.visitorId=o(e.visitorId)),p("connect page onSuccess decrypt",{result:e})),e.visitorId&&localStorage.setItem("__visitor_id",e.visitorId);const L={type:j,response:e,options:n};({redirect:()=>{p("connect page onSuccess redirect",e),setTimeout(()=>{if(i){const D=decodeURIComponent(i),r=P(D);h&&r.searchParams.set("encrypted",!0),e.sessionToken&&r.searchParams.set("sessionToken",w(e.sessionToken)),e.refreshToken&&r.searchParams.set("refreshToken",w(e.refreshToken)),e.visitorId&&r.searchParams.set("visitorId",w(e.visitorId)),n!=null&&n.connected_did&&r.searchParams.set("connected_did",n.connected_did),n!=null&&n.connected_pk&&r.searchParams.set("connected_pk",n.connected_pk),n!=null&&n.connected_app&&r.searchParams.set("connected_app",n.connected_app),n!=null&&n.connected_wallet_os&&r.searchParams.set("connected_wallet_os",n.connected_wallet_os),n!=null&&n.saveConnect&&r.searchParams.set("saveConnect",n.saveConnect),f.postMessage({..._e(e,["sessionToken","refreshToken","visitorId"])}),ge(D)?window.location.replace(E(r.href,{allowDomains:null})):A(`${r.pathname}${r.search}`,{replace:!0})}else window.location.replace(window.env.pathPrefix||"/")},50)},popup:async()=>{p("connect page onSuccess popup",L),await T(L),setTimeout(()=>{window.open("about:blank","_self"),window.close()},2e3)}})[C]()},z=s=>{const e={type:j,error:s.message,errorDescription:s.message};p("connect page onError",{res:e}),{redirect:()=>{k.error(s.message)},popup:()=>{T(e)}}[C]()},K=he(()=>{var e;if(m!=="login")return null;const s=((e=window.blocklet)==null?void 0:e.trustedFactories)||[];return(s==null?void 0:s.length)>0?t.jsxs(u,{children:[a("exchangePassport.tooltip1"),t.jsx(u,{component:te,reloadDocument:!0,to:Ce(Te(ue.WELLKNOWN_SERVICE_PATH_PREFIX,"/exchange-passport"),{redirect:i||"/"}),sx:{color:le.primary.light,"&:hover":{textDecoration:"underline dashed"}},children:a("exchangePassport.tooltip2")},"exchange-passport"),t.jsx(u,{component:"ul",sx:{pl:1.5},children:s.map(o=>t.jsx(u,{component:"li",children:o},o))})]}):null},[m]),$=x(async()=>{if(!i)return!0;let s;try{s=new URL(i)}catch{return!1}let e;try{e=new URL(c==null?void 0:c.baseUrl)}catch{try{e=new URL(c==null?void 0:c.prefix)}catch(o){console.error("baseUrl and prefix are both invalid",o)}}if(e){let o=[];if(e.origin===window.location.origin)o=window.blocklet.domainAliases||[];else{const n=await fe(e.origin);o=(n==null?void 0:n.domainAliases)||[]}if(!o.includes(s.hostname))return k.error(a("login.invalidRedirectUrl")),!1}return!0}),I=x(()=>{const s=decodeURIComponent(i),e=P(s);window.location.replace(E(e.href,{allowDomains:null}))}),J=!0,Q=!0,G=q(s=>s.breakpoints.down("lg")),y=x(async()=>{await $()&&J&&(window.temporaryDIDConnectOnSuccess=(e,o)=>{_(e,o,{saveConnect:!0})},setTimeout(()=>{var e;N.open({locale:O,action:m,passkeyBehavior:W,extraParams:d,...g,className:"connect",popup:!0,messages:F||{title:a("login.connect.title"),scan:a("login.connect.scan"),confirm:a("login.connect.confirm"),success:a("login.connect.success")},extraContent:K,useSocket:!0,allowWallet:["1","true",void 0,null].includes((e=globalThis.blocklet)==null?void 0:e.DID_CONNECT_ALLOW_WALLET),onSuccess:_,onError:z,hideCloseButton:Q})}))});if(we(()=>{y(),f.addEventListener("message",I)}),ke(()=>{delete window.temporaryDIDConnectOnSuccess,f.removeEventListener("message",I),f.close()}),M.loading)return t.jsxs(t.Fragment,{children:[t.jsx(U,{children:t.jsx("title",{children:"DID Connect"})}),t.jsx(de,{children:t.jsx(Z,{})})]});const V=globalThis.blocklet.appName,X=globalThis.blocklet.appDescription;return t.jsxs(t.Fragment,{children:[t.jsx(U,{children:t.jsxs("title",{children:[globalThis.blocklet.appName," | DID Connect"]})}),G&&!v.arcSphere?t.jsx(ee,{styles:{"& .did-connect__container-dialog > .MuiBackdrop-root":{backgroundColor:`${H.palette.background.default} !important`}}}):t.jsx(pe,{did:globalThis.blocklet.appPid,title:V,description:X,actions:v.arcSphere?null:t.jsx(ne,{variant:"contained",disableElevation:!0,color:"primary",size:"large",onClick:y,children:a("login.login")})})]})}export{Fe as default};
1
+ import{e as Y,j as t,aa as u,v as q,ab as Z,a3 as ee,y as ne}from"./vendor-mui-core-Bq8gXTan.js";import{f as se,h as oe,r as S,L as te}from"./vendor-react-DEoibe3W.js";import{a as re,aY as ae,p as ce,b4 as ie,b5 as le,F as de,b6 as pe,b3 as me,k as ue,b7 as fe,a3 as k,a8 as ge}from"./vendor-ux-did-connect-pzpsrvqx.js";import{b as he,u as x,m as we,s as ke}from"./vendor-hooks-DqdmWCmo.js";import{u as xe}from"./use-passport-id-B-b-_oYF.js";import{H as U}from"./vendor-arcblock-CwufDgLV.js";import{c as ve,I as be,z as Ce,A as Te,J as _e,ab as Ie,af as ye}from"./vendor-utils-BfZ4tlod.js";import{g as E}from"./get-safe-url-D5KSEAKZ.js";import{u as Le,p as P}from"./index-C0kIXw5r.js";import{d as p}from"./logger-Dqm1UQym.js";import"./lottie-web-jYmAQWuC.js";const j="authorization_response",De=me(),Se="blocklet:onLogin",f=new BroadcastChannel(Se);function Fe(){const{getPassportId:R}=xe(),{session:M,connectApi:N}=Le(),{t:a,locale:O}=re(),A=se(),[l]=oe(),{encrypt:B}=ae(),H=Y(),v=ce();let c={};try{c=JSON.parse(decodeURIComponent(ie(l.get("params"))))}catch(s){console.error("parse connect params failed",s)}ve(l.get("popup"));const{action:m="login",passkeyBehavior:W="both",extraParams:d={},messages:F,...g}=c;S.useEffect(()=>{d.inviter&&window.localStorage.setItem("inviter",d.inviter)},[d.inviter]);const i=l.get("redirect"),b=l.get("opener"),h=l.get("_ek_");d.passportId=R(),m==="login"&&be(g.forceConnected)&&(g.forceConnected=!1);const w=s=>h?B(JSON.stringify(s),h):s,C=S.useMemo(()=>i||!window.opener?"redirect":"popup",[i]),T=async s=>{const e=await De.federated.getTrustedDomains();if(!b){e.forEach(n=>{window.opener.postMessage(s,Ie(n)),window.opener.postMessage(s,ye(n))});return}const o=new URL(b);if(!e.includes(o.hostname))throw k.error(a("login.invalidOpenerUrl")),new Error("Invalid login caller");window.opener.postMessage(s,o.origin)},_=({encrypted:s=!0,...e},o,n)=>{p("connect page onSuccess",{encrypted:s,result:e,options:n}),s&&(e.sessionToken&&(e.sessionToken=o(e.sessionToken)),e.refreshToken&&(e.refreshToken=o(e.refreshToken)),e.visitorId&&(e.visitorId=o(e.visitorId)),p("connect page onSuccess decrypt",{result:e})),e.visitorId&&localStorage.setItem("__visitor_id",e.visitorId);const L={type:j,response:e,options:n};({redirect:()=>{p("connect page onSuccess redirect",e),setTimeout(()=>{if(i){const D=decodeURIComponent(i),r=P(D);h&&r.searchParams.set("encrypted",!0),e.sessionToken&&r.searchParams.set("sessionToken",w(e.sessionToken)),e.refreshToken&&r.searchParams.set("refreshToken",w(e.refreshToken)),e.visitorId&&r.searchParams.set("visitorId",w(e.visitorId)),n!=null&&n.connected_did&&r.searchParams.set("connected_did",n.connected_did),n!=null&&n.connected_pk&&r.searchParams.set("connected_pk",n.connected_pk),n!=null&&n.connected_app&&r.searchParams.set("connected_app",n.connected_app),n!=null&&n.connected_wallet_os&&r.searchParams.set("connected_wallet_os",n.connected_wallet_os),n!=null&&n.saveConnect&&r.searchParams.set("saveConnect",n.saveConnect),f.postMessage({..._e(e,["sessionToken","refreshToken","visitorId"])}),ge(D)?window.location.replace(E(r.href,{allowDomains:null})):A(`${r.pathname}${r.search}`,{replace:!0})}else window.location.replace(window.env.pathPrefix||"/")},50)},popup:async()=>{p("connect page onSuccess popup",L),await T(L),setTimeout(()=>{window.open("about:blank","_self"),window.close()},2e3)}})[C]()},z=s=>{const e={type:j,error:s.message,errorDescription:s.message};p("connect page onError",{res:e}),{redirect:()=>{k.error(s.message)},popup:()=>{T(e)}}[C]()},K=he(()=>{var e;if(m!=="login")return null;const s=((e=window.blocklet)==null?void 0:e.trustedFactories)||[];return(s==null?void 0:s.length)>0?t.jsxs(u,{children:[a("exchangePassport.tooltip1"),t.jsx(u,{component:te,reloadDocument:!0,to:Ce(Te(ue.WELLKNOWN_SERVICE_PATH_PREFIX,"/exchange-passport"),{redirect:i||"/"}),sx:{color:le.primary.light,"&:hover":{textDecoration:"underline dashed"}},children:a("exchangePassport.tooltip2")},"exchange-passport"),t.jsx(u,{component:"ul",sx:{pl:1.5},children:s.map(o=>t.jsx(u,{component:"li",children:o},o))})]}):null},[m]),$=x(async()=>{if(!i)return!0;let s;try{s=new URL(i)}catch{return!1}let e;try{e=new URL(c==null?void 0:c.baseUrl)}catch{try{e=new URL(c==null?void 0:c.prefix)}catch(o){console.error("baseUrl and prefix are both invalid",o)}}if(e){let o=[];if(e.origin===window.location.origin)o=window.blocklet.domainAliases||[];else{const n=await fe(e.origin);o=(n==null?void 0:n.domainAliases)||[]}if(!o.includes(s.hostname))return k.error(a("login.invalidRedirectUrl")),!1}return!0}),I=x(()=>{const s=decodeURIComponent(i),e=P(s);window.location.replace(E(e.href,{allowDomains:null}))}),J=!0,Q=!0,G=q(s=>s.breakpoints.down("lg")),y=x(async()=>{await $()&&J&&(window.temporaryDIDConnectOnSuccess=(e,o)=>{_(e,o,{saveConnect:!0})},setTimeout(()=>{var e;N.open({locale:O,action:m,passkeyBehavior:W,extraParams:d,...g,className:"connect",popup:!0,messages:F||{title:a("login.connect.title"),scan:a("login.connect.scan"),confirm:a("login.connect.confirm"),success:a("login.connect.success")},extraContent:K,useSocket:!0,allowWallet:["1","true",void 0,null].includes((e=globalThis.blocklet)==null?void 0:e.DID_CONNECT_ALLOW_WALLET),onSuccess:_,onError:z,hideCloseButton:Q})}))});if(we(()=>{y(),f.addEventListener("message",I)}),ke(()=>{delete window.temporaryDIDConnectOnSuccess,f.removeEventListener("message",I),f.close()}),M.loading)return t.jsxs(t.Fragment,{children:[t.jsx(U,{children:t.jsx("title",{children:"DID Connect"})}),t.jsx(de,{children:t.jsx(Z,{})})]});const V=globalThis.blocklet.appName,X=globalThis.blocklet.appDescription;return t.jsxs(t.Fragment,{children:[t.jsx(U,{children:t.jsxs("title",{children:[globalThis.blocklet.appName," | DID Connect"]})}),G&&!v.arcSphere?t.jsx(ee,{styles:{"& .did-connect__container-dialog > .MuiBackdrop-root":{backgroundColor:`${H.palette.background.default} !important`}}}):t.jsx(pe,{did:globalThis.blocklet.appPid,title:V,description:X,actions:v.arcSphere?null:t.jsx(ne,{variant:"contained",disableElevation:!0,color:"primary",size:"large",onClick:y,children:a("login.login")})})]})}export{Fe as default};
@@ -1 +1 @@
1
- import{r as P}from"./vendor-react-DEoibe3W.js";import{a as D,bF as I,a3 as g}from"./vendor-ux-did-connect-pzpsrvqx.js";import{w as E,x as b,c as q,y as B}from"./vendor-arcblock-CwufDgLV.js";import{j as t,aa as x,T as h,H as c,I as F,b5 as U}from"./vendor-mui-core-Bq8gXTan.js";import{u as N}from"./config-space-CDOLSL71.js";import{f as y}from"./index-8eXqqyHQ.js";import{d as O}from"./DeleteOutline-BKSMNwfT.js";import{b as W,E as $,A as v}from"./vendor-utils-BfZ4tlod.js";import{f as T,G as L,D as z,a3 as H,af as _}from"./index-CMYHZyLG.js";import"./api-C1S8LUld.js";function Z(){const{t:e}=D();return t.jsx(x,{children:t.jsxs(x,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[t.jsx(E,{style:{width:250,height:250}}),t.jsx(h,{marginTop:"24px",children:e("storage.spaces.connect.providerForStorage")})]})})}Z.propTypes={};function j({spaceGateway:e,onDeleteSpace:l}){const{t:s}=D(),[a,o]=P.useState(!1),[r,d]=P.useState(!1),u=(n,i)=>{n==null||n.stopPropagation(),o(i)},f=async n=>{try{n==null||n.stopPropagation(),d(!0),await l(e),o(!1)}catch(i){console.error(i),g.error(`${s("storage.spaces.gateway.delete.failed")}: ${y(i)}`)}finally{d(!1)}};return t.jsxs(t.Fragment,{children:[t.jsx(F,{size:"small",onClick:n=>u(n,!0),children:t.jsx(O,{})}),t.jsx(I,{title:s("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:r}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined"}},onConfirm:f,onCancel:n=>u(n,!1),children:t.jsx(h,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForStorage",{name:`${e==null?void 0:e.name}`})})})]})}j.propTypes={onDeleteSpace:c.func,spaceGateway:c.shape({name:c.string.isRequired,url:c.string.isRequired,protected:c.bool}).isRequired};j.defaultProps={onDeleteSpace:()=>{}};function C({spaceGateway:e,onDisconnect:l}){const{t:s}=D(),a=async()=>{try{await l(),g.success(s("storage.spaces.gateway.delete.succeeded",{name:e.name?`(${e.name})`:""}))}catch(o){console.error(o),g.error(y(o))}};return t.jsx(j,{spaceGateway:e,onDeleteSpace:a})}C.propTypes={spaceGateway:c.shape({did:c.string.isRequired,name:c.string.isRequired,url:c.string.isRequired,endpoint:c.string.isRequired}).isRequired,onDisconnect:c.func};C.defaultProps={onDisconnect:()=>{}};function te(){const{t:e}=D(),{spaceGateway:l,settingStorageEndpoint:s}=N();return t.jsxs(x,{display:"flex",flexDirection:"column",children:[t.jsx(x,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:t.jsx(h,{fontSize:"1rem",fontWeight:"bold",children:e("storage.spaces.connected.title")})}),t.jsx(x,{children:t.jsx(b,{sx:{marginTop:2},endpoint:l.endpoint,selected:!0,action:a=>t.jsx(C,{...a,onDisconnect:()=>s(null)})})})]})}function J({blocklet:e}){var f,n,i;if(W(e))return{};const{appDid:l}=e,s=T.getAppName(e),a=T.getAppDescription(e),o=(i=(n=(f=e==null?void 0:e.site)==null?void 0:f.domainAliases)==null?void 0:n.sort((p,m)=>p.accessibility.accessible&&m.accessibility.accessible?+p.isProtected-+m.isProtected:+m.accessibility.accessible-+p.accessibility.accessible))==null?void 0:i.map(p=>{var S;const m=(S=p==null?void 0:p.domainStatus)!=null&&S.isHttps?"https://":"http://",R=p==null?void 0:p.value;return`${m}${R}`}).filter(Boolean),r=o==null?void 0:o[0],d=q.DID_SPACES.AUTHORIZE.DEFAULT_SCOPE,u=window.location.href;return{appDid:l,appName:s,appDescription:a,appUrl:r,scopes:d,referrer:u,isReady:!!r}}function w({onConnect:e,...l}){const{blocklet:s}=L(),{info:a}=z(),{t:o}=D(),r=J({blocklet:s}),d=H(a),u={checkFn:$.create({baseURL:v(window.location.origin,_())}).get,webWalletUrl:d,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:a.did}},f=async({spaceGateway:n})=>{try{await e(n),g.success(o("storage.spaces.connectedWithName",{name:n.name}))}catch(i){console.error(i),g.error(y(i))}};return t.jsx(B,{...l,options:u,onSuccess:f})}w.propTypes={onConnect:U.func};w.defaultProps={onConnect:()=>{}};export{te as C,Z as D,w as a,J as u};
1
+ import{r as P}from"./vendor-react-DEoibe3W.js";import{a as D,bF as I,a3 as g}from"./vendor-ux-did-connect-pzpsrvqx.js";import{w as E,x as b,c as q,y as B}from"./vendor-arcblock-CwufDgLV.js";import{j as t,aa as x,T as h,H as c,I as F,b5 as U}from"./vendor-mui-core-Bq8gXTan.js";import{u as N}from"./config-space-C_-wUm8x.js";import{f as y}from"./index-8eXqqyHQ.js";import{d as O}from"./DeleteOutline-BKSMNwfT.js";import{b as W,E as $,A as v}from"./vendor-utils-BfZ4tlod.js";import{f as T,G as L,D as z,a3 as H,af as _}from"./index-C0kIXw5r.js";import"./api-C1S8LUld.js";function Z(){const{t:e}=D();return t.jsx(x,{children:t.jsxs(x,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[t.jsx(E,{style:{width:250,height:250}}),t.jsx(h,{marginTop:"24px",children:e("storage.spaces.connect.providerForStorage")})]})})}Z.propTypes={};function j({spaceGateway:e,onDeleteSpace:l}){const{t:s}=D(),[a,o]=P.useState(!1),[r,d]=P.useState(!1),u=(n,i)=>{n==null||n.stopPropagation(),o(i)},f=async n=>{try{n==null||n.stopPropagation(),d(!0),await l(e),o(!1)}catch(i){console.error(i),g.error(`${s("storage.spaces.gateway.delete.failed")}: ${y(i)}`)}finally{d(!1)}};return t.jsxs(t.Fragment,{children:[t.jsx(F,{size:"small",onClick:n=>u(n,!0),children:t.jsx(O,{})}),t.jsx(I,{title:s("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:r}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined"}},onConfirm:f,onCancel:n=>u(n,!1),children:t.jsx(h,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForStorage",{name:`${e==null?void 0:e.name}`})})})]})}j.propTypes={onDeleteSpace:c.func,spaceGateway:c.shape({name:c.string.isRequired,url:c.string.isRequired,protected:c.bool}).isRequired};j.defaultProps={onDeleteSpace:()=>{}};function C({spaceGateway:e,onDisconnect:l}){const{t:s}=D(),a=async()=>{try{await l(),g.success(s("storage.spaces.gateway.delete.succeeded",{name:e.name?`(${e.name})`:""}))}catch(o){console.error(o),g.error(y(o))}};return t.jsx(j,{spaceGateway:e,onDeleteSpace:a})}C.propTypes={spaceGateway:c.shape({did:c.string.isRequired,name:c.string.isRequired,url:c.string.isRequired,endpoint:c.string.isRequired}).isRequired,onDisconnect:c.func};C.defaultProps={onDisconnect:()=>{}};function te(){const{t:e}=D(),{spaceGateway:l,settingStorageEndpoint:s}=N();return t.jsxs(x,{display:"flex",flexDirection:"column",children:[t.jsx(x,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:t.jsx(h,{fontSize:"1rem",fontWeight:"bold",children:e("storage.spaces.connected.title")})}),t.jsx(x,{children:t.jsx(b,{sx:{marginTop:2},endpoint:l.endpoint,selected:!0,action:a=>t.jsx(C,{...a,onDisconnect:()=>s(null)})})})]})}function J({blocklet:e}){var f,n,i;if(W(e))return{};const{appDid:l}=e,s=T.getAppName(e),a=T.getAppDescription(e),o=(i=(n=(f=e==null?void 0:e.site)==null?void 0:f.domainAliases)==null?void 0:n.sort((p,m)=>p.accessibility.accessible&&m.accessibility.accessible?+p.isProtected-+m.isProtected:+m.accessibility.accessible-+p.accessibility.accessible))==null?void 0:i.map(p=>{var S;const m=(S=p==null?void 0:p.domainStatus)!=null&&S.isHttps?"https://":"http://",R=p==null?void 0:p.value;return`${m}${R}`}).filter(Boolean),r=o==null?void 0:o[0],d=q.DID_SPACES.AUTHORIZE.DEFAULT_SCOPE,u=window.location.href;return{appDid:l,appName:s,appDescription:a,appUrl:r,scopes:d,referrer:u,isReady:!!r}}function w({onConnect:e,...l}){const{blocklet:s}=L(),{info:a}=z(),{t:o}=D(),r=J({blocklet:s}),d=H(a),u={checkFn:$.create({baseURL:v(window.location.origin,_())}).get,webWalletUrl:d,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:a.did}},f=async({spaceGateway:n})=>{try{await e(n),g.success(o("storage.spaces.connectedWithName",{name:n.name}))}catch(i){console.error(i),g.error(y(i))}};return t.jsx(B,{...l,options:u,onSuccess:f})}w.propTypes={onConnect:U.func};w.defaultProps={onConnect:()=>{}};export{te as C,Z as D,w as a,J as u};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log-CYFcudFD.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-react-DEoibe3W.js","assets/useLocalStorage-CaPDqrQ7.js","assets/vendor-ux-did-connect-pzpsrvqx.js","assets/vendor-utils-BfZ4tlod.js","assets/vendor-hooks-DqdmWCmo.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-CMYHZyLG.js","assets/vendor-arcblock-CwufDgLV.js","assets/index-DOq-_YXu.css","assets/Download-D4X39_9V.js","assets/bundle-avatar-o4aWU1WK.js","assets/log-D33dFtt_.css","assets/index-CssP44F_.js","assets/ViewList-BOGcbymi.js","assets/index-BLfUtUpB.js","assets/did-address-NnOD1W_A.js","assets/permission-DQvXGutX.js","assets/session-BGdAM8zS.js","assets/click-to-copy-By4fgGR7.js","assets/index-z4rrXifq.js","assets/vendor-mui-x-1nqAyytV.js","assets/AdapterDayjs-BRnJ9bMs.js","assets/index-8eXqqyHQ.js","assets/useAsync-C62uE2pS.js","assets/index-DPIWnhb5.js","assets/DeleteOutline-BKSMNwfT.js","assets/confirm-CYOuqhW9.js","assets/util-BQAJqeb4.js","assets/base32-DUSifB4M.js","assets/sdk-BmeKtHic.js","assets/actions-DnTVXQ_Z.js","assets/MoreHoriz-ChJ3K52h.js","assets/shorten-label-BQvbtscf.js","assets/PlayArrow-BqVYRyLK.js","assets/get-safe-url-B0-S5PGZ.js","assets/use-blocklet-logo-CWdlYyrq.js","assets/InfoOutlined-BVWbftGI.js","assets/dot-4jhL56kz.js","assets/useSetState-CWq0AVWn.js","assets/use-mobile-DwzRjjku.js","assets/index-DC-aJClV.js","assets/use-mobile-CtTQsfXN.js","assets/ExpandLess-CcLTbsdW.js","assets/table-tips-BzPqsKYQ.js","assets/index-C4yBWU5s.js","assets/Error-BAEKW7-e.js","assets/empty-spinner-BHwHZpq-.js","assets/list-header-C7gle0n0.js","assets/QuestionMarkCircle-jbhclAfX.js","assets/index-DVQCgvFb.js","assets/Launch-DFS3fgjy.js","assets/index-DEZojGsm.js","assets/api-C1S8LUld.js","assets/ChevronRight-BU9I7WD4.js","assets/react-beautiful-dnd.esm-02tdagHZ.js","assets/raf-schd.esm-B3j6BePR.js","assets/item-D95t-at-.js","assets/Done-ASNftAOL.js","assets/delete-confirm-DkwIz2kG.js","assets/ArrowDropDown-DBJPIOl4.js","assets/index-CTlzm-Mc.js","assets/index-C0Iiqot3.css","assets/index-Bv7OAPJU.js","assets/overview-BlZSVHbX.js","assets/keyboard-arrow-down-rounded-DadBVmpO.js","assets/status-C6AnHonq.js","assets/omit-Cao4GLS7.js","assets/spaces-DUkzPTBd.js","assets/domains-nIh9pvJN.js","assets/domain-action-card-BePK3J5E.js","assets/util-BeBq6bKh.js","assets/CheckCircle-DUJmWceY.js","assets/index-D0mjW5YA.js","assets/passport-item-C1Pxlerj.js","assets/Google-C28yeMZW.js","assets/cloneDeep-CDl5kZTY.js","assets/EditIcon-DfiDnAsm.js","assets/LockIcon-BEG59s5q.js","assets/appearance-D25Cy4CD.js","assets/audit-logs-DxpLWxIb.js","assets/index-CW1Uu8tM.js","assets/collapse-DAaiuAEY.js","assets/section-BDMQAX_r.js","assets/list-Dk6LlvZw.js","assets/traffic-BXZ-j7u7.js","assets/iframe-DFg8oeD0.js","assets/LaunchOutlined-C1x4Og4u.js","assets/ChevronLeft-BBJJJhVi.js","assets/index-B2NkqENf.js","assets/base-chart-CoApVzod.js","assets/index-w4f-mlFt.js","assets/config-navigation-Bc7wRQPN.js","assets/index-BxJZWVOT.js","assets/slicedToArray-DFQjSbCD.js","assets/simple-select-0cjVFuay.js","assets/index-YTd3fqJi.js","assets/connect-to-BNRP7uKc.js","assets/config-space-CDOLSL71.js","assets/switch-control-Brwb8ptk.js","assets/index-DOM4CWCV.js","assets/security-BdzQGoAm.js","assets/config-BZuiK8BP.js","assets/branding-0f-nlnTd.js","assets/sanitize-e0A8A-yt.js","assets/logo-uploader-BSR27hpo.js","assets/advanced-Dv4hgvDN.js","assets/runtime-BAC7Yn-4.js","assets/index-Cza1eXOB.js","assets/Edit-CiTb-w5P.js","assets/list-q5d_hBMT.js","assets/index-7mvFZreO.js","assets/component-ufgkgw5l.js","assets/TuneOutlined-CKzi_VZZ.js","assets/add-component-core-DsuA1aKD.js","assets/launch-result-message-AharZGq2.js","assets/page-header-DNvUdNpI.js","assets/index-DmckOkn6.js","assets/content-layout-BC2QkTYi.js","assets/search-4YYphs0l.js","assets/add-component-core-D-IRi6XF.css","assets/index-avNWKuLM.js"])))=>i.map(i=>d[i]);
2
- import{r as F,bd as fs,bb as Lt,be as ps,B as Dt,k as M,a8 as vn,a3 as Z,a as Y,at as ms,n as Hn,m as hs,d as gs,i as xs,aR as vs,D as Le,a1 as Pt,bf as ys,bg as bs,I as ws,F as Je,bh as js,_ as D,ax as Ss,a5 as _s}from"./vendor-ux-did-connect-pzpsrvqx.js";import{H as v,j as o,a9 as V,ah as G,I as Rt,at as Cs,ak as At,X as Mt,q as Is,b7 as Es,ab as re,b8 as ks,bw as Ts,T as H,bu as Ls,bs as yn,bv as bn,aa as _,bI as Ds,v as X,a7 as it,bJ as Ps,e as ee,ae as Rs,bf as As,ap as Se,bK as Bn,ad as Ee,bL as Ms,au as $s,ai as Os,bM as Fn,bN as Vn,bO as qn,E as ae,b6 as Wn,y as Ns,bh as Us}from"./vendor-mui-core-Bq8gXTan.js";import{r as x,L as Kn,f as Gn,g as zs,u as Hs,l as Bs}from"./vendor-react-DEoibe3W.js";import{D as at,f as N,E as ft,F as Fs,b as Vs,G as qs,H as Ws,I as Qn,y as me,J as Zn,K as Ks,k as ve,L as Gs,M as Qs,u as Zs,l as wn,Q as jn,g as Xs,j as Js,q as Ys,n as be,m as eo,o as to,P as no,O as ro,R as We,e as He,T as so,U as oo,V as io,N as ao,W as co,c as Sn}from"./index-CMYHZyLG.js";import{ag as lo,A as he,ah as uo,z as Xn,b as Ke,ai as fo}from"./vendor-utils-BfZ4tlod.js";import{_ as _n}from"./useLocalStorage-CaPDqrQ7.js";import{f as $t}from"./index-8eXqqyHQ.js";import{c as ce,u as Ye,p as po,h as et,f as Jn,e as mo,E as ho,g as go,H as xo,R as vo}from"./vendor-arcblock-CwufDgLV.js";import{C as Cn}from"./confirm-CYOuqhW9.js";import{d as yo}from"./PlayArrow-BqVYRyLK.js";import{g as In}from"./get-safe-url-B0-S5PGZ.js";import{u as Yn}from"./session-BGdAM8zS.js";import{b as ge,x as bo}from"./vendor-hooks-DqdmWCmo.js";import{i as wo,u as jo,M as So,c as ke,s as tt,H as _o,a as Co}from"./use-blocklet-logo-CWdlYyrq.js";import{d as Io}from"./InfoOutlined-BVWbftGI.js";import{_ as er,D as Eo}from"./dot-4jhL56kz.js";import{_ as tr}from"./useSetState-CWq0AVWn.js";import{u as ko}from"./use-mobile-DwzRjjku.js";const nr=x.createContext({});function Ot({children:e,type:t}){const[n,r]=x.useState([]),s=x.useRef([]),a=l=>{if(!s.current.includes(l)){const u=[...s.current,l];r(u),s.current=u}},i=l=>{if(s.current.includes(l)){const u=s.current.filter(d=>d!==l);r(u),s.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));lo(u,n).forEach(p=>i(p))};return o.jsx(nr.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:a,removeDeletingDid:i,matchDeletingDid:c},children:e})}Ot.propTypes={type:v.string,children:v.node.isRequired};Ot.defaultProps={type:"blocklets"};function Ll(){return x.useContext(nr)}var Nt={},To=V;Object.defineProperty(Nt,"__esModule",{value:!0});var rr=Nt.default=void 0,Lo=To(F()),Do=o;rr=Nt.default=(0,Lo.default)((0,Do.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");var Ut={},Po=V;Object.defineProperty(Ut,"__esModule",{value:!0});var sr=Ut.default=void 0,Ro=Po(F()),Ao=o;sr=Ut.default=(0,Ro.default)((0,Ao.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var zt={},Mo=V;Object.defineProperty(zt,"__esModule",{value:!0});var or=zt.default=void 0,$o=Mo(F()),Oo=o;or=zt.default=(0,$o.default)((0,Oo.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var Ht={},No=V;Object.defineProperty(Ht,"__esModule",{value:!0});var ir=Ht.default=void 0,Uo=No(F()),zo=o;ir=Ht.default=(0,Uo.default)((0,zo.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var Bt={},Ho=V;Object.defineProperty(Bt,"__esModule",{value:!0});var ar=Bt.default=void 0,Bo=Ho(F()),Fo=o;ar=Bt.default=(0,Bo.default)((0,Fo.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");var Ft={},Vo=V;Object.defineProperty(Ft,"__esModule",{value:!0});var cr=Ft.default=void 0,qo=Vo(F()),Wo=o;cr=Ft.default=(0,qo.default)((0,Wo.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group");var Vt={},Ko=V;Object.defineProperty(Vt,"__esModule",{value:!0});var lr=Vt.default=void 0,Go=Ko(F()),Qo=o;lr=Vt.default=(0,Go.default)((0,Qo.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"NotInterested");var qt=function(e){return o.jsx("svg",{...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})})};qt.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};qt.displayName="dashboard";var Wt={},Zo=V;Object.defineProperty(Wt,"__esModule",{value:!0});var ur=Wt.default=void 0,Xo=Zo(F()),Jo=o;ur=Wt.default=(0,Xo.default)((0,Jo.jsx)("path",{d:"m18.25 7.6-5.5-3.18c-.46-.27-1.04-.27-1.5 0L5.75 7.6c-.46.27-.75.76-.75 1.3v6.35c0 .54.29 1.03.75 1.3l5.5 3.18c.46.27 1.04.27 1.5 0l5.5-3.18c.46-.27.75-.76.75-1.3V8.9c0-.54-.29-1.03-.75-1.3M7 14.96v-4.62l4 2.32v4.61zm5-4.03L8 8.61l4-2.31 4 2.31zm1 6.34v-4.61l4-2.32v4.62zM7 2H3.5C2.67 2 2 2.67 2 3.5V7h2V4h3zm10 0h3.5c.83 0 1.5.67 1.5 1.5V7h-2V4h-3zM7 22H3.5c-.83 0-1.5-.67-1.5-1.5V17h2v3h3zm10 0h3.5c.83 0 1.5-.67 1.5-1.5V17h-2v3h-3z"}),"ViewInAr");const pe={Start:yo,Stop:rr,Restart:sr,Reload:or,Remove:fs,Config:ir,Log:ar,Group:cr,Cancel:lr,Dashboard:qt,Overview:ur},Yo=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),r=new URLSearchParams(n.searchParams),s=new URL(he(n.origin,t));return s.search=r.toString(),s.toString()},ei="internal",ti="external";function Kt({blocklet:e,onStart:t,onComplete:n,variant:r,hasPermission:s,getComponentUrl:a,useBlockletUrlEvaluation:i,...c}){const l=at(),[u,d]=x.useState(null),[p,f]=x.useState(null),[y,g]=x.useState(!1),[h,S]=x.useState(null),{t:m}=x.useContext(Lt),[C]=_n("skip-blocklet-setup",!1),{loading:w,recommendedUrl:L}=i(e),[R]=_n("blocklet-type-filter",ei),j=N.isInProgress(e.status),[k,E]=x.useState(!1);x.useEffect(()=>{var A,B;if(!(e!=null&&e.controller))return;E(((B=(A=e==null?void 0:e.controller)==null?void 0:A.status)==null?void 0:B.value)===ce.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{var q,te,oe;try{const W=await l.api.getLauncherSession({input:{launcherSessionId:(q=e==null?void 0:e.controller)==null?void 0:q.launcherSessionId,launcherUrl:(te=e==null?void 0:e.controller)==null?void 0:te.launcherUrl}});if(W!=null&&W.error){console.error("get launcher session failed",W.error);return}E([M.LAUNCH_SESSION_STATUS.overdue,M.LAUNCH_SESSION_STATUS.canceled,M.LAUNCH_SESSION_STATUS.terminated].includes((oe=W==null?void 0:W.launcherSession)==null?void 0:oe.status))}catch(W){console.error("call getLauncherSession error",W)}})()},[]);const{inService:T}=l,I=(b,A,B=!1)=>async()=>{const q=async Ne=>{var ze;t({action:b,blocklet:e}),g(!0),f(b);let Ue=!1;try{if(b==="remove")await A(Ne);else if(b==="start"){if(!N.hasRunnableComponent(e)){Z.error(m("blocklet.noComponent"));return}if(!T&&!C&&!((ze=e.settings)!=null&&ze.initialized)&&e.mode!==ce.BLOCKLET_MODES.DEVELOPMENT){if(!L||!vn(L)){Z.error(m("blocklet.gotoVisitError"));return}const Q=Fs(l.info),xn=new URL(L);xn.searchParams.set("serverUrl",Q),window.open(In(xn.href,{allowDomains:null})),n({action:b,blocklet:e});return}const ie=e.children.filter(Q=>!N.isInProgress(Q.status)&&Q.status!=="running").map(Q=>Q.meta.did),fe={did:e.meta.did,componentDids:ie};await A({input:fe})}else if(["stop","restart","reload"].includes(b)){const ie=e.children.filter(Q=>Q.status==="running").map(Q=>Q.meta.did),fe={did:e.meta.did,componentDids:ie};await A({input:fe})}else{const ie={did:e.meta.did};await A({input:ie})}b==="remove"?Ue=!0:await Vs(1e3),b==="reload"&&Z.success(m("blocklet.reloadSuccess")),S(null),n({action:b,blocklet:e})}catch(ie){const fe=`Blocklet ${b} failed: ${$t(ie)}`;throw n({action:b,blocklet:e,error:new Error(fe)}),new Error(fe)}finally{Ue||g(!1)}},te=()=>{g(!1),S(null)},oe=N.getDisplayName(e,!0),W=e.mode===ce.BLOCKLET_MODES.DEVELOPMENT?{description:()=>o.jsx(H,{component:"div",children:o.jsx(H,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Ne,Ue)=>o.jsxs(H,{component:"div",children:[o.jsx(H,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")}),o.jsxs(Ls,{name:"removeType",value:Ne.removeType,onChange:ze=>Ue({...Ne,removeType:ze.target.value}),children:[o.jsx(yn,{value:"backup",control:o.jsx(bn,{}),label:m("blocklet.action.removeApplicationAfterBackup")}),o.jsx(yn,{value:"complete",control:o.jsx(bn,{}),label:m("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},ds={stop:{title:`${m("common.stop")} ${oe}`,description:m("blocklet.action.stopDescription"),confirm:m("blocklet.action.confirmStop"),cancel:m("common.cancel"),onConfirm:q,onCancel:te},restart:{title:`${m("common.restart")} ${oe}`,description:m("blocklet.action.restartDescription"),confirm:m("blocklet.action.confirmRestart"),cancel:m("common.cancel"),onConfirm:q,onCancel:te},remove:{title:`${m("common.remove")} ${oe}`,confirm:m("blocklet.action.confirmRemove"),cancel:m("common.cancel"),onConfirm:q,onCancel:te,...W},cancelDownload:{title:`${m("common.cancel")}`,description:m("blocklet.action.cancelDownloadDescription",{name:oe}),confirm:m("common.confirm"),cancel:m("common.cancel"),onConfirm:q,onCancel:te}};B?S(ds[b]):await q()},U=!!u,$=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(b.currentTarget)},z=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(null)},$e=async(b,A)=>{try{A.stopPropagation(),A.preventDefault()}catch{}if(typeof b.handler=="function")try{g(!0),f(b.action),await b.handler()}catch(B){console.error(`Blocklet ${b.name} failed: `,B)}finally{g(!1),d(null)}else d(null)},as=!T&&N.isDeletableBlocklet(e)?{action:"remove",icon:pe.Remove,name:m("common.remove"),handler:I("remove",async({removeType:b})=>{b==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:j}:null,cs={action:"remove",icon:({sx:b,...A})=>o.jsx(pe.Cancel,{sx:{...b,paddingRight:"2px",zoom:.95},...A}),name:m("common.cancel"),handler:I("cancelDownload",l.api.cancelDownloadBlocklet,!0)},ls=N.getAppMissingConfigs(e),us=()=>{var q;const b=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),A=a==null?void 0:a({mountPoint:b,blocklet:e});if(!A||!vn(A)){Z.error(m("blocklet.gotoVisitError"));return}const B=(q=e==null?void 0:e.site)==null?void 0:q.domainAliases;window.open(In(Yo(A,`${M.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:B==null?void 0:B.map(te=>te.value)}))};let Oe=[{action:"start",icon:pe.Start,inExternal:!0,name:m("common.start"),handler:I("start",l.api.startBlocklet),disabled:k||e.children.every(b=>b.status==="running")||ft(e.status)||w||j},{action:"stop",icon:pe.Stop,inExternal:!0,name:m("common.stop"),handler:I("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:pe.Restart,name:m("common.restart"),handler:I("restart",l.api.restartBlocklet,!0),disabled:k||e.status!=="running"},ft(e.status)?cs:as,{separator:!0},T?null:{action:"dashboard",icon:({style:b,...A})=>o.jsx(pe.Dashboard,{...A,style:{...b,width:"26px",height:"26px",paddingRight:"3px"}}),name:m("sidebar.dashboard"),handler:us}].filter(Boolean);return R===ti&&(Oe=Oe.filter(b=>b.inExternal)),r==="menu"?o.jsxs(En,{"data-cy":"blocklet-actions",children:[o.jsx(Rt,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:$,size:"small",disabled:!s||!ft(e.status)&&y,children:o.jsx(ps,{})}),o.jsxs(Cs,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:U,onClose:z,PaperProps:{},children:[ls.length>0&&o.jsxs(At,{style:{maxWidth:"400px"},severity:"error",children:[m("blocklet.config.missingRequired"),o.jsx("br",{}),o.jsx(Kn,{to:`/blocklets/${e.meta.did}/components`,children:m("blocklet.config.gotoFix")})]}),Oe.map((b,A)=>b.separator?o.jsx(Mt,{},`separator-${A}`):o.jsxs(Is,{dense:!0,onClick:B=>$e(b,B),disabled:y||b.disabled,"data-cy":`${b.action}-blocklet`,children:[o.jsx(Es,{style:{minWidth:24},children:p===b.action&&y?o.jsx(re,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{fontSize:"small"})}),o.jsx(ks,{primary:b.name})]},b.name))]}),h&&o.jsx(Cn,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]}):o.jsxs(En,{"data-cy":"blocklet-actions",...c,children:[o.jsx(Ts,{children:Oe.filter(b=>!b.separator&&!b.onlyInMenu).map(b=>o.jsxs(Dt,{title:b.name,"data-cy":`${b.action}-blocklet`,onClick:()=>$e(b),disabled:!!b.disabled||y,children:[p===b.action&&y?o.jsx(re,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{}),o.jsx("span",{className:"blocklet-action-text",children:b.name})]},b.name))}),h&&o.jsx(Cn,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}Kt.propTypes={getComponentUrl:v.func,blocklet:v.object.isRequired,onStart:v.func.isRequired,onComplete:v.func.isRequired,variant:v.oneOf(["menu","group"]),hasPermission:v.bool,useBlockletUrlEvaluation:v.func};Kt.defaultProps={getComponentUrl:null,variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const En=G.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log-BiuahUh0.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-react-DEoibe3W.js","assets/useLocalStorage-CaPDqrQ7.js","assets/vendor-ux-did-connect-pzpsrvqx.js","assets/vendor-utils-BfZ4tlod.js","assets/vendor-hooks-DqdmWCmo.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-C0kIXw5r.js","assets/vendor-arcblock-CwufDgLV.js","assets/index-DOq-_YXu.css","assets/Download-D4X39_9V.js","assets/bundle-avatar-DAWssS61.js","assets/log-D33dFtt_.css","assets/index-B8h7EuKB.js","assets/ViewList-BOGcbymi.js","assets/index-BLfUtUpB.js","assets/did-address-NnOD1W_A.js","assets/permission-DQvXGutX.js","assets/session-BGdAM8zS.js","assets/click-to-copy-By4fgGR7.js","assets/index-D4KLEWFm.js","assets/vendor-mui-x-1nqAyytV.js","assets/AdapterDayjs-BRnJ9bMs.js","assets/index-8eXqqyHQ.js","assets/useAsync-C62uE2pS.js","assets/index-DPIWnhb5.js","assets/DeleteOutline-BKSMNwfT.js","assets/confirm-Cr4yXaP3.js","assets/util-BQAJqeb4.js","assets/base32-DUSifB4M.js","assets/sdk-BmeKtHic.js","assets/actions-DnTVXQ_Z.js","assets/MoreHoriz-ChJ3K52h.js","assets/shorten-label-BQvbtscf.js","assets/PlayArrow-BqVYRyLK.js","assets/get-safe-url-B0-S5PGZ.js","assets/use-blocklet-logo-fumCZVth.js","assets/InfoOutlined-BVWbftGI.js","assets/dot-4jhL56kz.js","assets/useSetState-CWq0AVWn.js","assets/use-mobile-DwzRjjku.js","assets/index-CYp1xoZ4.js","assets/use-mobile-CtTQsfXN.js","assets/ExpandLess-CcLTbsdW.js","assets/table-tips-BzPqsKYQ.js","assets/index-GAl9W53I.js","assets/Error-BAEKW7-e.js","assets/empty-spinner-BHwHZpq-.js","assets/list-header-C7gle0n0.js","assets/QuestionMarkCircle-jbhclAfX.js","assets/index-DVQCgvFb.js","assets/Launch-DFS3fgjy.js","assets/index-DEZojGsm.js","assets/api-C1S8LUld.js","assets/ChevronRight-BU9I7WD4.js","assets/react-beautiful-dnd.esm-02tdagHZ.js","assets/raf-schd.esm-B3j6BePR.js","assets/item-fK0vcLaQ.js","assets/Done-ASNftAOL.js","assets/delete-confirm-BTxOYOoY.js","assets/ArrowDropDown-DBJPIOl4.js","assets/index-CTlzm-Mc.js","assets/index-C0Iiqot3.css","assets/index-Bv7OAPJU.js","assets/overview-DtickflS.js","assets/keyboard-arrow-down-rounded-DadBVmpO.js","assets/status-Cht9_8hC.js","assets/omit-Cao4GLS7.js","assets/spaces-DUkzPTBd.js","assets/domains-DzDEWZRA.js","assets/domain-action-card-C9RDnMzS.js","assets/util-BMWW9F7x.js","assets/CheckCircle-DUJmWceY.js","assets/index-ha4GQCBu.js","assets/passport-item-BTBWvJCh.js","assets/Google-C28yeMZW.js","assets/cloneDeep-CDl5kZTY.js","assets/EditIcon-DfiDnAsm.js","assets/LockIcon-BEG59s5q.js","assets/appearance-CLcBa2If.js","assets/audit-logs-BpxjWxH9.js","assets/index-Bv_IEtVv.js","assets/collapse-DAaiuAEY.js","assets/section-BDMQAX_r.js","assets/list-C8TeMgEe.js","assets/traffic-BdpKUL58.js","assets/iframe-DFg8oeD0.js","assets/LaunchOutlined-C1x4Og4u.js","assets/ChevronLeft-BBJJJhVi.js","assets/index-B2NkqENf.js","assets/base-chart-CoApVzod.js","assets/index-w4f-mlFt.js","assets/config-navigation-Ba_9bXNB.js","assets/index-BxJZWVOT.js","assets/slicedToArray-DFQjSbCD.js","assets/simple-select-0cjVFuay.js","assets/index-B6novXpp.js","assets/connect-to-CcDyzDBC.js","assets/config-space-C_-wUm8x.js","assets/switch-control-Brwb8ptk.js","assets/index-DUGQ4cKm.js","assets/security-Bs24V5aw.js","assets/config-BZuiK8BP.js","assets/branding-BqmpdYqw.js","assets/sanitize-e0A8A-yt.js","assets/logo-uploader-DC4SpQmr.js","assets/advanced-DAKR9vq6.js","assets/runtime-Bta2wOnU.js","assets/index-l5blEEs7.js","assets/Edit-CiTb-w5P.js","assets/list-DeTNTY_6.js","assets/index-Br-eR92d.js","assets/component-D4dOU94T.js","assets/TuneOutlined-CKzi_VZZ.js","assets/add-component-core-DJ6wP3Fb.js","assets/launch-result-message-AharZGq2.js","assets/page-header-DNvUdNpI.js","assets/index-D-vHTvCV.js","assets/content-layout-BC2QkTYi.js","assets/search-4YYphs0l.js","assets/add-component-core-D-IRi6XF.css","assets/index-CCuD6_Rj.js"])))=>i.map(i=>d[i]);
2
+ import{r as F,bd as fs,bb as Lt,be as ps,B as Dt,k as M,a8 as vn,a3 as Z,a as Y,at as ms,n as Hn,m as hs,d as gs,i as xs,aR as vs,D as Le,a1 as Pt,bf as ys,bg as bs,I as ws,F as Je,bh as js,_ as D,ax as Ss,a5 as _s}from"./vendor-ux-did-connect-pzpsrvqx.js";import{H as v,j as o,a9 as V,ah as G,I as Rt,at as Cs,ak as At,X as Mt,q as Is,b7 as Es,ab as re,b8 as ks,bw as Ts,T as H,bu as Ls,bs as yn,bv as bn,aa as _,bI as Ds,v as X,a7 as it,bJ as Ps,e as ee,ae as Rs,bf as As,ap as Se,bK as Bn,ad as Ee,bL as Ms,au as $s,ai as Os,bM as Fn,bN as Vn,bO as qn,E as ae,b6 as Wn,y as Ns,bh as Us}from"./vendor-mui-core-Bq8gXTan.js";import{r as x,L as Kn,f as Gn,g as zs,u as Hs,l as Bs}from"./vendor-react-DEoibe3W.js";import{D as at,f as N,E as ft,F as Fs,b as Vs,G as qs,H as Ws,I as Qn,y as me,J as Zn,K as Ks,k as ve,L as Gs,M as Qs,u as Zs,l as wn,Q as jn,g as Xs,j as Js,q as Ys,n as be,m as eo,o as to,P as no,O as ro,R as We,e as He,T as so,U as oo,V as io,N as ao,W as co,c as Sn}from"./index-C0kIXw5r.js";import{ag as lo,A as he,ah as uo,z as Xn,b as Ke,ai as fo}from"./vendor-utils-BfZ4tlod.js";import{_ as _n}from"./useLocalStorage-CaPDqrQ7.js";import{f as $t}from"./index-8eXqqyHQ.js";import{c as ce,u as Ye,p as po,h as et,f as Jn,e as mo,E as ho,g as go,H as xo,R as vo}from"./vendor-arcblock-CwufDgLV.js";import{C as Cn}from"./confirm-Cr4yXaP3.js";import{d as yo}from"./PlayArrow-BqVYRyLK.js";import{g as In}from"./get-safe-url-B0-S5PGZ.js";import{u as Yn}from"./session-BGdAM8zS.js";import{b as ge,x as bo}from"./vendor-hooks-DqdmWCmo.js";import{i as wo,u as jo,M as So,c as ke,s as tt,H as _o,a as Co}from"./use-blocklet-logo-fumCZVth.js";import{d as Io}from"./InfoOutlined-BVWbftGI.js";import{_ as er,D as Eo}from"./dot-4jhL56kz.js";import{_ as tr}from"./useSetState-CWq0AVWn.js";import{u as ko}from"./use-mobile-DwzRjjku.js";const nr=x.createContext({});function Ot({children:e,type:t}){const[n,r]=x.useState([]),s=x.useRef([]),a=l=>{if(!s.current.includes(l)){const u=[...s.current,l];r(u),s.current=u}},i=l=>{if(s.current.includes(l)){const u=s.current.filter(d=>d!==l);r(u),s.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));lo(u,n).forEach(p=>i(p))};return o.jsx(nr.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:a,removeDeletingDid:i,matchDeletingDid:c},children:e})}Ot.propTypes={type:v.string,children:v.node.isRequired};Ot.defaultProps={type:"blocklets"};function Ll(){return x.useContext(nr)}var Nt={},To=V;Object.defineProperty(Nt,"__esModule",{value:!0});var rr=Nt.default=void 0,Lo=To(F()),Do=o;rr=Nt.default=(0,Lo.default)((0,Do.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");var Ut={},Po=V;Object.defineProperty(Ut,"__esModule",{value:!0});var sr=Ut.default=void 0,Ro=Po(F()),Ao=o;sr=Ut.default=(0,Ro.default)((0,Ao.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var zt={},Mo=V;Object.defineProperty(zt,"__esModule",{value:!0});var or=zt.default=void 0,$o=Mo(F()),Oo=o;or=zt.default=(0,$o.default)((0,Oo.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var Ht={},No=V;Object.defineProperty(Ht,"__esModule",{value:!0});var ir=Ht.default=void 0,Uo=No(F()),zo=o;ir=Ht.default=(0,Uo.default)((0,zo.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var Bt={},Ho=V;Object.defineProperty(Bt,"__esModule",{value:!0});var ar=Bt.default=void 0,Bo=Ho(F()),Fo=o;ar=Bt.default=(0,Bo.default)((0,Fo.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");var Ft={},Vo=V;Object.defineProperty(Ft,"__esModule",{value:!0});var cr=Ft.default=void 0,qo=Vo(F()),Wo=o;cr=Ft.default=(0,qo.default)((0,Wo.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group");var Vt={},Ko=V;Object.defineProperty(Vt,"__esModule",{value:!0});var lr=Vt.default=void 0,Go=Ko(F()),Qo=o;lr=Vt.default=(0,Go.default)((0,Qo.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"NotInterested");var qt=function(e){return o.jsx("svg",{...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})})};qt.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};qt.displayName="dashboard";var Wt={},Zo=V;Object.defineProperty(Wt,"__esModule",{value:!0});var ur=Wt.default=void 0,Xo=Zo(F()),Jo=o;ur=Wt.default=(0,Xo.default)((0,Jo.jsx)("path",{d:"m18.25 7.6-5.5-3.18c-.46-.27-1.04-.27-1.5 0L5.75 7.6c-.46.27-.75.76-.75 1.3v6.35c0 .54.29 1.03.75 1.3l5.5 3.18c.46.27 1.04.27 1.5 0l5.5-3.18c.46-.27.75-.76.75-1.3V8.9c0-.54-.29-1.03-.75-1.3M7 14.96v-4.62l4 2.32v4.61zm5-4.03L8 8.61l4-2.31 4 2.31zm1 6.34v-4.61l4-2.32v4.62zM7 2H3.5C2.67 2 2 2.67 2 3.5V7h2V4h3zm10 0h3.5c.83 0 1.5.67 1.5 1.5V7h-2V4h-3zM7 22H3.5c-.83 0-1.5-.67-1.5-1.5V17h2v3h3zm10 0h3.5c.83 0 1.5-.67 1.5-1.5V17h-2v3h-3z"}),"ViewInAr");const pe={Start:yo,Stop:rr,Restart:sr,Reload:or,Remove:fs,Config:ir,Log:ar,Group:cr,Cancel:lr,Dashboard:qt,Overview:ur},Yo=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),r=new URLSearchParams(n.searchParams),s=new URL(he(n.origin,t));return s.search=r.toString(),s.toString()},ei="internal",ti="external";function Kt({blocklet:e,onStart:t,onComplete:n,variant:r,hasPermission:s,getComponentUrl:a,useBlockletUrlEvaluation:i,...c}){const l=at(),[u,d]=x.useState(null),[p,f]=x.useState(null),[y,g]=x.useState(!1),[h,S]=x.useState(null),{t:m}=x.useContext(Lt),[C]=_n("skip-blocklet-setup",!1),{loading:w,recommendedUrl:L}=i(e),[R]=_n("blocklet-type-filter",ei),j=N.isInProgress(e.status),[k,E]=x.useState(!1);x.useEffect(()=>{var A,B;if(!(e!=null&&e.controller))return;E(((B=(A=e==null?void 0:e.controller)==null?void 0:A.status)==null?void 0:B.value)===ce.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{var q,te,oe;try{const W=await l.api.getLauncherSession({input:{launcherSessionId:(q=e==null?void 0:e.controller)==null?void 0:q.launcherSessionId,launcherUrl:(te=e==null?void 0:e.controller)==null?void 0:te.launcherUrl}});if(W!=null&&W.error){console.error("get launcher session failed",W.error);return}E([M.LAUNCH_SESSION_STATUS.overdue,M.LAUNCH_SESSION_STATUS.canceled,M.LAUNCH_SESSION_STATUS.terminated].includes((oe=W==null?void 0:W.launcherSession)==null?void 0:oe.status))}catch(W){console.error("call getLauncherSession error",W)}})()},[]);const{inService:T}=l,I=(b,A,B=!1)=>async()=>{const q=async Ne=>{var ze;t({action:b,blocklet:e}),g(!0),f(b);let Ue=!1;try{if(b==="remove")await A(Ne);else if(b==="start"){if(!N.hasRunnableComponent(e)){Z.error(m("blocklet.noComponent"));return}if(!T&&!C&&!((ze=e.settings)!=null&&ze.initialized)&&e.mode!==ce.BLOCKLET_MODES.DEVELOPMENT){if(!L||!vn(L)){Z.error(m("blocklet.gotoVisitError"));return}const Q=Fs(l.info),xn=new URL(L);xn.searchParams.set("serverUrl",Q),window.open(In(xn.href,{allowDomains:null})),n({action:b,blocklet:e});return}const ie=e.children.filter(Q=>!N.isInProgress(Q.status)&&Q.status!=="running").map(Q=>Q.meta.did),fe={did:e.meta.did,componentDids:ie};await A({input:fe})}else if(["stop","restart","reload"].includes(b)){const ie=e.children.filter(Q=>Q.status==="running").map(Q=>Q.meta.did),fe={did:e.meta.did,componentDids:ie};await A({input:fe})}else{const ie={did:e.meta.did};await A({input:ie})}b==="remove"?Ue=!0:await Vs(1e3),b==="reload"&&Z.success(m("blocklet.reloadSuccess")),S(null),n({action:b,blocklet:e})}catch(ie){const fe=`Blocklet ${b} failed: ${$t(ie)}`;throw n({action:b,blocklet:e,error:new Error(fe)}),new Error(fe)}finally{Ue||g(!1)}},te=()=>{g(!1),S(null)},oe=N.getDisplayName(e,!0),W=e.mode===ce.BLOCKLET_MODES.DEVELOPMENT?{description:()=>o.jsx(H,{component:"div",children:o.jsx(H,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Ne,Ue)=>o.jsxs(H,{component:"div",children:[o.jsx(H,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")}),o.jsxs(Ls,{name:"removeType",value:Ne.removeType,onChange:ze=>Ue({...Ne,removeType:ze.target.value}),children:[o.jsx(yn,{value:"backup",control:o.jsx(bn,{}),label:m("blocklet.action.removeApplicationAfterBackup")}),o.jsx(yn,{value:"complete",control:o.jsx(bn,{}),label:m("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},ds={stop:{title:`${m("common.stop")} ${oe}`,description:m("blocklet.action.stopDescription"),confirm:m("blocklet.action.confirmStop"),cancel:m("common.cancel"),onConfirm:q,onCancel:te},restart:{title:`${m("common.restart")} ${oe}`,description:m("blocklet.action.restartDescription"),confirm:m("blocklet.action.confirmRestart"),cancel:m("common.cancel"),onConfirm:q,onCancel:te},remove:{title:`${m("common.remove")} ${oe}`,confirm:m("blocklet.action.confirmRemove"),cancel:m("common.cancel"),onConfirm:q,onCancel:te,...W},cancelDownload:{title:`${m("common.cancel")}`,description:m("blocklet.action.cancelDownloadDescription",{name:oe}),confirm:m("common.confirm"),cancel:m("common.cancel"),onConfirm:q,onCancel:te}};B?S(ds[b]):await q()},U=!!u,$=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(b.currentTarget)},z=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(null)},$e=async(b,A)=>{try{A.stopPropagation(),A.preventDefault()}catch{}if(typeof b.handler=="function")try{g(!0),f(b.action),await b.handler()}catch(B){console.error(`Blocklet ${b.name} failed: `,B)}finally{g(!1),d(null)}else d(null)},as=!T&&N.isDeletableBlocklet(e)?{action:"remove",icon:pe.Remove,name:m("common.remove"),handler:I("remove",async({removeType:b})=>{b==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:j}:null,cs={action:"remove",icon:({sx:b,...A})=>o.jsx(pe.Cancel,{sx:{...b,paddingRight:"2px",zoom:.95},...A}),name:m("common.cancel"),handler:I("cancelDownload",l.api.cancelDownloadBlocklet,!0)},ls=N.getAppMissingConfigs(e),us=()=>{var q;const b=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),A=a==null?void 0:a({mountPoint:b,blocklet:e});if(!A||!vn(A)){Z.error(m("blocklet.gotoVisitError"));return}const B=(q=e==null?void 0:e.site)==null?void 0:q.domainAliases;window.open(In(Yo(A,`${M.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:B==null?void 0:B.map(te=>te.value)}))};let Oe=[{action:"start",icon:pe.Start,inExternal:!0,name:m("common.start"),handler:I("start",l.api.startBlocklet),disabled:k||e.children.every(b=>b.status==="running")||ft(e.status)||w||j},{action:"stop",icon:pe.Stop,inExternal:!0,name:m("common.stop"),handler:I("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:pe.Restart,name:m("common.restart"),handler:I("restart",l.api.restartBlocklet,!0),disabled:k||e.status!=="running"},ft(e.status)?cs:as,{separator:!0},T?null:{action:"dashboard",icon:({style:b,...A})=>o.jsx(pe.Dashboard,{...A,style:{...b,width:"26px",height:"26px",paddingRight:"3px"}}),name:m("sidebar.dashboard"),handler:us}].filter(Boolean);return R===ti&&(Oe=Oe.filter(b=>b.inExternal)),r==="menu"?o.jsxs(En,{"data-cy":"blocklet-actions",children:[o.jsx(Rt,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:$,size:"small",disabled:!s||!ft(e.status)&&y,children:o.jsx(ps,{})}),o.jsxs(Cs,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:U,onClose:z,PaperProps:{},children:[ls.length>0&&o.jsxs(At,{style:{maxWidth:"400px"},severity:"error",children:[m("blocklet.config.missingRequired"),o.jsx("br",{}),o.jsx(Kn,{to:`/blocklets/${e.meta.did}/components`,children:m("blocklet.config.gotoFix")})]}),Oe.map((b,A)=>b.separator?o.jsx(Mt,{},`separator-${A}`):o.jsxs(Is,{dense:!0,onClick:B=>$e(b,B),disabled:y||b.disabled,"data-cy":`${b.action}-blocklet`,children:[o.jsx(Es,{style:{minWidth:24},children:p===b.action&&y?o.jsx(re,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{fontSize:"small"})}),o.jsx(ks,{primary:b.name})]},b.name))]}),h&&o.jsx(Cn,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]}):o.jsxs(En,{"data-cy":"blocklet-actions",...c,children:[o.jsx(Ts,{children:Oe.filter(b=>!b.separator&&!b.onlyInMenu).map(b=>o.jsxs(Dt,{title:b.name,"data-cy":`${b.action}-blocklet`,onClick:()=>$e(b),disabled:!!b.disabled||y,children:[p===b.action&&y?o.jsx(re,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{}),o.jsx("span",{className:"blocklet-action-text",children:b.name})]},b.name))}),h&&o.jsx(Cn,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}Kt.propTypes={getComponentUrl:v.func,blocklet:v.object.isRequired,onStart:v.func.isRequired,onComplete:v.func.isRequired,variant:v.oneOf(["menu","group"]),hasPermission:v.bool,useBlockletUrlEvaluation:v.func};Kt.defaultProps={getComponentUrl:null,variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const En=G.div`
3
3
  display: flex;
4
4
  align-items: center;
5
5
 
@@ -194,7 +194,7 @@ ${r}
194
194
  .header-brand-addon {
195
195
  display: block;
196
196
  }
197
- `;function Rc(){var m,C,w;const{t:e,locale:t}=Y(),{blocklet:n,launcherSession:r,refreshSubscription:s}=ve(),{connectApi:a,session:i,api:c}=Zs(),[l,u]=x.useState(!1),[d,p]=x.useState(""),[f,y]=bo({subscriptionURL:"#"});if(x.useEffect(()=>{var L,R;(wn(n,r)||jn(r))&&Xs({launcherSessionId:(L=n==null?void 0:n.controller)==null?void 0:L.launcherSessionId,launcherUrl:(R=n==null?void 0:n.controller)==null?void 0:R.launcherUrl,locale:t}).then(j=>{y({subscriptionURL:j})}).catch(j=>{console.error("get subscription url error:",j)})},[n,r]),x.useEffect(()=>{var L;if((L=n.controller)!=null&&L.launcherUrl){const R=he(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(R).then(j=>j.json()).then(j=>{var T,I;const k=(I=(T=j.componentMountPoints)==null?void 0:T.find(U=>U.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk"))==null?void 0:I.mountPoint,E=he(n.controller.launcherUrl,k);p(E)})}},[(m=n.controller)==null?void 0:m.launcherUrl]),!n||!r)return"";let g=null,h="",S="error";return Js(r)?(g=Ys(r)?o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):o.jsx(Ns,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),h=e("blocklet.suspendedCausedByPastDue",{deadline:be(r==null?void 0:r.reservedUntil,t)})):jn(r)?(g=o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.willBeSuspendedSoon",{deadline:be((((C=r==null?void 0:r.subscription)==null?void 0:C.cancel_at)||0)*1e3,t)}),S="warning"):wn(n,r)?(g=o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.suspendedCausedByExpired",{deadline:be(r==null?void 0:r.reservedUntil,t),canceledAt:be((((w=r==null?void 0:r.subscription)==null?void 0:w.canceled_at)||0)*1e3,t)})):eo(n,r)&&(g=o.jsx(Kn,{to:he(M.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),h=e("blocklet.suspendedCausedByTerminated",{canceledAt:be(r==null?void 0:r.terminatedAt,t),deadline:to(r==null?void 0:r.terminatedAt,t)})),h?o.jsxs(o.Fragment,{children:[o.jsxs(At,{severity:S,sx:{mb:1},children:[h,o.jsx(H,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:g})]}),l&&d&&r&&o.jsx(no,{session:i,connect:a,baseUrl:d,authToken:r.subscription.authToken,children:o.jsx(ro,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),s(),u(!1)}})})]}):null}const os=x.createContext({});function Dl(){return x.useContext(os)}const{Provider:Ac,Consumer:Pl}=os,{did:K,appId:Mc}=window.env;function $c({children:e}){var j,k;const{t,locale:n}=Y(),{blocklet:r}=ve(),[s,a]=x.useState([]),[i,c]=x.useState([]),[l,u]=x.useState([]),d=N.getDisplayName(r),p=((j=((r==null?void 0:r.environments)||[]).find(E=>E.key===ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR))==null?void 0:j.value)||"auto",f=(r==null?void 0:r.trustedPassports)||[],y=(r==null?void 0:r.trustedFactories)||[],g=(r==null?void 0:r.enablePassportIssuance)!==!1,h=async()=>{try{const E=await He.doBatchQuery({getRoles:{input:{teamDid:K}},getPermissions:{input:{teamDid:K}},getInvitations:{input:{teamDid:K}}}),T=(E.getRoles.roles||[]).filter(I=>!M.RBAC_CONFIG.roles.some(U=>U.name===I.name&&(!U.passport||U.ci))).map(I=>(I.hasDescription=!!I.description,I.hasDescription||(I.description=t("team.passport.description",{teamName:d,title:I.title})),I));c(fo(T,[I=>so(I.name)],["desc"])),u(E.getPermissions.permissions||[]),a(E.getInvitations.invitations||[])}catch(E){Z.error(E.message)}},S=({did:E}={})=>{const T={teamDid:K,user:{did:E}};return He.getUser({input:T})},m=({query:E,paging:T}={})=>{const I={teamDid:K};return T&&(I.paging=T),E&&(I.query=E),I.sort={lastLoginAt:-1},He.getUsers({input:I})},C=()=>He.getUsersCountPerRole({input:{teamDid:K}}),w=()=>h();x.useEffect(()=>{var E;(E=r==null?void 0:r.meta)!=null&&E.did&&h()},[(k=r==null?void 0:r.meta)==null?void 0:k.did]),x.useEffect(()=>{c(E=>E.map(T=>(T.hasDescription||(T.description=t("team.passport.description",{teamName:d,title:T.title})),{...T})))},[t,n]);const L=E=>{E.teamDid===K&&h()};We(ce.TeamEvents.userAdded,L,[K]),We(ce.TeamEvents.userRemoved,L,[K]),We(ce.TeamEvents.userUpdated,L,[K]);const R={teamDid:K,teamIssuerDid:Mc,teamName:d,invitations:s,roles:i,permissions:l,trustedPassports:f,trustedFactories:y,isNodeTeam:!1,enablePassportIssuance:g,refresh:w,passportColor:p,endpoint:window.location.origin,blocklet:r,api:{getUser:S,getUsers:m,getUsersCountPerRole:C}};return o.jsx(Ac,{value:R,children:e})}const Oc=x.lazy(()=>D(()=>import("./log-CYFcudFD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),Nc=x.lazy(()=>D(()=>import("./index-CssP44F_.js"),__vite__mapDeps([15,2,1,5,4,6,7,8,10,16,9,11,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,3,36,37,38,39,40,41,42]))),Uc=x.lazy(()=>D(()=>import("./index-DC-aJClV.js"),__vite__mapDeps([43,4,2,5,1,6,7,8,39,10,9,11,44,45,29,25,33,34,46,3,36,37,20,38,40,26,41,42]))),zc=x.lazy(()=>D(()=>import("./index-C4yBWU5s.js"),__vite__mapDeps([47,2,1,9,4,5,6,7,8,10,11,48,29,25,20,18,49,13,35,50,12,21,51,41,52,53,54,55,56,23,28,57,58,59,60,61,37,62,63,64,65]))),Hc=x.lazy(()=>D(()=>import("./overview-BlZSVHbX.js"),__vite__mapDeps([66,1,2,4,5,6,7,8,10,39,67,9,11,27,40,26,18,68,69,70,55,3,25,29,36,37,20,38,41,42]))),Bc=x.lazy(()=>D(()=>import("./domains-nIh9pvJN.js"),__vite__mapDeps([71,2,4,5,1,6,7,8,9,10,11,72,45,19,20,40,26,29,25,33,34,61,21,73,41,39,27,74]))),Fc=x.lazy(()=>D(()=>import("./index-D0mjW5YA.js"),__vite__mapDeps([75,2,6,5,1,4,7,8,9,10,11,18,76,30,31,44,19,20,77,78,79,29,25,50,41,80,3,36,37,38,39,40,26,42]))),Vc=x.lazy(()=>D(()=>import("./appearance-D25Cy4CD.js"),__vite__mapDeps([81,5,2,4,1,6,7,8,9,10,11,44]))),qc=x.lazy(()=>D(()=>import("./audit-logs-DxpLWxIb.js"),__vite__mapDeps([82,4,2,5,1,6,7,8,30,31,3,9,10,11,63,64,39,35,65,25,29,36,37,20,38,40,26,41,42]))),Wc=x.lazy(()=>D(()=>import("./index-CW1Uu8tM.js"),__vite__mapDeps([83,2,1,5,4,6,7,8,9,10,11,38,20,84,85,35,27,86,54,13,39,74,30,31,18,87,40,26,88,89,90,56,91,25,92,93,23,24,44,3,29,36,37,41,42]))),Kc=x.lazy(()=>D(()=>import("./config-navigation-Bc7wRQPN.js"),__vite__mapDeps([94,2,4,5,1,6,7,8,69,78,10,95,9,11,96,97,62,55,38,20,57,58,88,25,3,29,36,37,39,40,26,41,42]))),Gc=x.lazy(()=>D(()=>import("./index-YTd3fqJi.js"),__vite__mapDeps([98,1,2,6,5,10,4,7,8,9,11,44,55,99,100,70,25,28,27,93,34,37,101,50,3,29,36,20,38,39,40,26,41,42]))),Qc=x.lazy(()=>D(()=>import("./index-DOM4CWCV.js"),__vite__mapDeps([102,4,2,5,1,6,7,8,10,9,11,101,85,67,27,31,44]))),Zc=x.lazy(()=>D(()=>import("./security-BdzQGoAm.js"),__vite__mapDeps([103,4,2,5,1,6,7,8,9,10,11,97,104,44,3,25,29,36,37,20,38,39,40,26,41,42]))),Xc=x.lazy(()=>D(()=>import("./branding-0f-nlnTd.js"),__vite__mapDeps([105,2,1,4,5,6,7,8,10,106,69,95,60,107,52,79,62,9,11,19,20,38,85]))),Jc=x.lazy(()=>D(()=>import("./advanced-Dv4hgvDN.js"),__vite__mapDeps([108,2,1,9,4,5,6,7,8,10,11,19,20,39,29,25,41,85,21,27,18,68,69,3,36,37,38,40,26,42]))),Yc=x.lazy(()=>D(()=>import("./traffic-BXZ-j7u7.js").then(e=>e.t),__vite__mapDeps([87,2,9,1,4,5,6,7,8,10,11,40,26,88,89,90,56,91,25,92,93,23,24]))),el=x.lazy(()=>D(()=>import("./runtime-BAC7Yn-4.js"),__vite__mapDeps([109,2,1,4,5,6,7,8,9,10,11,92,93,13,3,25,29,36,37,20,38,39,40,26,41,42]))),tl=x.lazy(()=>D(()=>import("./index-Cza1eXOB.js"),__vite__mapDeps([110,2,4,5,1,6,7,8,111,25,76,18,30,31,9,10,11,22,23,24,29,21,61,19,20,13,33,34,44,46,39,3,36,37,38,40,26,41,42]))),nl=x.lazy(()=>D(()=>import("./list-q5d_hBMT.js"),__vite__mapDeps([112,2,4,5,1,6,7,8,10,111,40,26,17,9,11,22,23,24,49,21,61,29,25,76,18,30,31,33,34,46,39,44,3,36,37,20,38,41,42]))),rl=x.lazy(()=>D(()=>import("./index-7mvFZreO.js"),__vite__mapDeps([113,2,4,5,1,6,7,8,53,55,46,39,44,9,10,11,3,25,29,36,37,20,38,40,26,41,42]))),sl=x.lazy(()=>D(()=>import("./component-ufgkgw5l.js"),__vite__mapDeps([114,1,2,5,4,6,7,8,10,9,11,25,115,101,19,20,111,96,91,58,106,69,95,21,56,90,62,116,59,53,60,28,61,29,37,18,117,118,100,70,55,107,52,119,84,77,78,63,64,3,27,73,44,120,99,121,122,80,39,88,13,36,33,34,38,40,26,41,42]))),ol=x.lazy(()=>D(()=>import("./index-avNWKuLM.js"),__vite__mapDeps([123,1,2,4,5,6,7,8,9,10,11]))),il=he(M.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),al=e=>{const{enqueueSnackbar:t}=Hn(),n=x.useCallback(r=>Xn(il,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);We(`${e}/${M.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const s=n(r),{severity:a,description:i}=r||{},c=["error","warning"].includes(a)||r.sticky;r.source==="system"&&t(i,{variant:a,autoHideDuration:c?null:5e3,content:l=>o.jsx(di,{viewAllUrl:s,keyId:l,notification:r,content:o.jsx(ki,{notification:r,minimal:!0,rows:0})})})},[],"user")};function is({blocklet:e,isAdmin:t}){return t?o.jsx(Wc,{blocklet:e}):o.jsx(vo,{status:403})}is.propTypes={blocklet:v.object.isRequired,isAdmin:v.bool.isRequired};const cl=e=>{var d,p;const{t}=Y(),{blocklet:n,actions:{refreshBlocklet:r},client:s,did:a}=ve(),i=(d=n==null?void 0:n.meta)==null?void 0:d.did,c=!n||co(n.status)?[]:N.getAppMissingConfigs(n),l={overview:[{label:t("common.overview"),value:"overview"},{label:o.jsx(Us,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!c.length,children:t("common.components")}),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},{label:t("team.member.passports"),value:"passports"},{label:t("common.setting"),value:"settings"},{label:t("common.security"),value:"security"},{label:t("oauth.client.tab"),value:"oauth"}],website:[{label:t("common.domains"),value:"domains"},{label:t("common.branding"),value:"branding"},{label:t("common.theming"),value:"theming"},{label:t("common.navigation"),value:"navigation"}],operations:[{label:t("common.notificationRecords"),value:"notifications",show:e},{label:t("common.analytics"),value:"analytics"},{label:t("common.auditLogs"),value:"audit-logs"},{label:t("common.advancedConfig"),value:"advanced"}],integrations:[{label:"Webhooks",value:"webhooks",show:e},{label:t("common.accessKeys"),value:"access-keys"},{label:t("common.mcpServers"),value:"mcp-servers"}],developers:[{label:t("common.logs"),value:"logs",show:((p=n==null?void 0:n.children)==null?void 0:p.length)&&n.structVersion===M.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},u={overview:Hc,components:sl,members:o.jsx(Nc,{type:"blocklet",createPassportSvg:Sn}),passports:o.jsx(Fc,{createPassportSvg:Sn}),settings:o.jsx(Qc,{orientation:"vertical"}),security:o.jsx(Zc,{}),"did-spaces":o.jsx(Gc,{navOrientation:"horizontal"}),domains:Bc,branding:o.jsx(Xc,{blocklet:n,onUpdate:r}),theming:o.jsx(Vc,{}),navigation:Kc,sitemap:o.jsx(_s,{children:t("common.comingSoon")}),notifications:o.jsx(is,{blocklet:n,isAdmin:e}),"audit-logs":o.jsx(qc,{scope:i,categories:["blocklet","team","security","certificates","gateway"]}),analytics:o.jsx(Yc,{client:s,did:a}),advanced:o.jsx(Jc,{blocklet:n,onUpdate:r}),webhooks:o.jsx(Uc,{}),"access-keys":o.jsx(tl,{}),"mcp-servers":o.jsx(rl,{}),logs:Oc,performance:o.jsx(el,{client:s,did:a}),docs:ol,publish:o.jsx(zc,{}),oauth:o.jsx(nl,{})};return{tabGroups:l,renders:u}};function ll(){var m,C;const e=Gn(),{tab:t="overview",subtab:n}=Bs(),{blocklet:r,refreshFlag:s}=ve(),{session:a}=Yn(),i=ge(()=>{var w;return(w=a==null?void 0:a.user)==null?void 0:w.did},[a]),c=ko(),l=ge(()=>{var w;return((w=a.user)==null?void 0:w.role)&&io.includes(a.user.role)},[a]);al(i);const{tabGroups:u,renders:d}=cl(l),p=w=>{e(`${M.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${w}`)},f=(u[t]||[]).filter(w=>w.show===void 0||w.show),y=((m=(f||[]).find(w=>w.value===n))==null?void 0:m.value)||((C=f==null?void 0:f[0])==null?void 0:C.value)||t,g=d[y]||d.overview,h=["overview"].includes(t),S=r?o.jsxs(Ot,{type:"components",children:[f.length>0&&o.jsxs(_,{mb:2,display:"flex",alignItems:"center",gap:2,children:[o.jsx(Ss,{tabs:f,current:y,onChange:p,scrollButtons:"auto"}),h&&!c&&o.jsx(_,{flex:1,display:"flex",justifyContent:"flex-end",children:o.jsx(_,{component:"div",className:"page-header",children:r?o.jsx(kn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:w}={})=>{w&&Z.error(w.message)},variant:"group"}):null})})]}),o.jsx(_,{className:"page-content",children:o.jsx(x.Suspense,{fallback:o.jsx(Je,{relative:"parent",children:o.jsx(re,{})}),children:x.isValidElement(g)?g:o.jsx(g,{blocklet:r})})})]}):o.jsx(Je,{relative:"parent",children:o.jsx(re,{})});return o.jsx(ao,{children:o.jsx($c,{children:o.jsx(gn,{children:o.jsxs(dl,{children:[c&&h&&o.jsx(_,{component:"div",className:"page-header",mb:2,children:r?o.jsx(kn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:w}={})=>{w&&Z.error(w.message)},variant:"group"}):null}),o.jsx(dr,{}),o.jsx(Rc,{}),S]})},`${s}`)})})}function ul(){var r;const{blocklet:e}=ve(),{t}=Y(),n=(r=e==null?void 0:e.meta)==null?void 0:r.did;return x.useEffect(()=>{const s=oo();return n&&s.connect(),()=>{n&&s.isConnected()&&s.disconnect()}},[n]),o.jsxs(o.Fragment,{children:[o.jsx(xo,{children:o.jsx("title",{children:t("pageTitle.dashboard")})}),o.jsx(ll,{})]})}const dl=G.main`
197
+ `;function Rc(){var m,C,w;const{t:e,locale:t}=Y(),{blocklet:n,launcherSession:r,refreshSubscription:s}=ve(),{connectApi:a,session:i,api:c}=Zs(),[l,u]=x.useState(!1),[d,p]=x.useState(""),[f,y]=bo({subscriptionURL:"#"});if(x.useEffect(()=>{var L,R;(wn(n,r)||jn(r))&&Xs({launcherSessionId:(L=n==null?void 0:n.controller)==null?void 0:L.launcherSessionId,launcherUrl:(R=n==null?void 0:n.controller)==null?void 0:R.launcherUrl,locale:t}).then(j=>{y({subscriptionURL:j})}).catch(j=>{console.error("get subscription url error:",j)})},[n,r]),x.useEffect(()=>{var L;if((L=n.controller)!=null&&L.launcherUrl){const R=he(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(R).then(j=>j.json()).then(j=>{var T,I;const k=(I=(T=j.componentMountPoints)==null?void 0:T.find(U=>U.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk"))==null?void 0:I.mountPoint,E=he(n.controller.launcherUrl,k);p(E)})}},[(m=n.controller)==null?void 0:m.launcherUrl]),!n||!r)return"";let g=null,h="",S="error";return Js(r)?(g=Ys(r)?o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):o.jsx(Ns,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),h=e("blocklet.suspendedCausedByPastDue",{deadline:be(r==null?void 0:r.reservedUntil,t)})):jn(r)?(g=o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.willBeSuspendedSoon",{deadline:be((((C=r==null?void 0:r.subscription)==null?void 0:C.cancel_at)||0)*1e3,t)}),S="warning"):wn(n,r)?(g=o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.suspendedCausedByExpired",{deadline:be(r==null?void 0:r.reservedUntil,t),canceledAt:be((((w=r==null?void 0:r.subscription)==null?void 0:w.canceled_at)||0)*1e3,t)})):eo(n,r)&&(g=o.jsx(Kn,{to:he(M.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),h=e("blocklet.suspendedCausedByTerminated",{canceledAt:be(r==null?void 0:r.terminatedAt,t),deadline:to(r==null?void 0:r.terminatedAt,t)})),h?o.jsxs(o.Fragment,{children:[o.jsxs(At,{severity:S,sx:{mb:1},children:[h,o.jsx(H,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:g})]}),l&&d&&r&&o.jsx(no,{session:i,connect:a,baseUrl:d,authToken:r.subscription.authToken,children:o.jsx(ro,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),s(),u(!1)}})})]}):null}const os=x.createContext({});function Dl(){return x.useContext(os)}const{Provider:Ac,Consumer:Pl}=os,{did:K,appId:Mc}=window.env;function $c({children:e}){var j,k;const{t,locale:n}=Y(),{blocklet:r}=ve(),[s,a]=x.useState([]),[i,c]=x.useState([]),[l,u]=x.useState([]),d=N.getDisplayName(r),p=((j=((r==null?void 0:r.environments)||[]).find(E=>E.key===ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR))==null?void 0:j.value)||"auto",f=(r==null?void 0:r.trustedPassports)||[],y=(r==null?void 0:r.trustedFactories)||[],g=(r==null?void 0:r.enablePassportIssuance)!==!1,h=async()=>{try{const E=await He.doBatchQuery({getRoles:{input:{teamDid:K}},getPermissions:{input:{teamDid:K}},getInvitations:{input:{teamDid:K}}}),T=(E.getRoles.roles||[]).filter(I=>!M.RBAC_CONFIG.roles.some(U=>U.name===I.name&&(!U.passport||U.ci))).map(I=>(I.hasDescription=!!I.description,I.hasDescription||(I.description=t("team.passport.description",{teamName:d,title:I.title})),I));c(fo(T,[I=>so(I.name)],["desc"])),u(E.getPermissions.permissions||[]),a(E.getInvitations.invitations||[])}catch(E){Z.error(E.message)}},S=({did:E}={})=>{const T={teamDid:K,user:{did:E}};return He.getUser({input:T})},m=({query:E,paging:T}={})=>{const I={teamDid:K};return T&&(I.paging=T),E&&(I.query=E),I.sort={lastLoginAt:-1},He.getUsers({input:I})},C=()=>He.getUsersCountPerRole({input:{teamDid:K}}),w=()=>h();x.useEffect(()=>{var E;(E=r==null?void 0:r.meta)!=null&&E.did&&h()},[(k=r==null?void 0:r.meta)==null?void 0:k.did]),x.useEffect(()=>{c(E=>E.map(T=>(T.hasDescription||(T.description=t("team.passport.description",{teamName:d,title:T.title})),{...T})))},[t,n]);const L=E=>{E.teamDid===K&&h()};We(ce.TeamEvents.userAdded,L,[K]),We(ce.TeamEvents.userRemoved,L,[K]),We(ce.TeamEvents.userUpdated,L,[K]);const R={teamDid:K,teamIssuerDid:Mc,teamName:d,invitations:s,roles:i,permissions:l,trustedPassports:f,trustedFactories:y,isNodeTeam:!1,enablePassportIssuance:g,refresh:w,passportColor:p,endpoint:window.location.origin,blocklet:r,api:{getUser:S,getUsers:m,getUsersCountPerRole:C}};return o.jsx(Ac,{value:R,children:e})}const Oc=x.lazy(()=>D(()=>import("./log-BiuahUh0.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),Nc=x.lazy(()=>D(()=>import("./index-B8h7EuKB.js"),__vite__mapDeps([15,2,1,5,4,6,7,8,10,16,9,11,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,3,36,37,38,39,40,41,42]))),Uc=x.lazy(()=>D(()=>import("./index-CYp1xoZ4.js"),__vite__mapDeps([43,4,2,5,1,6,7,8,39,10,9,11,44,45,29,25,33,34,46,3,36,37,20,38,40,26,41,42]))),zc=x.lazy(()=>D(()=>import("./index-GAl9W53I.js"),__vite__mapDeps([47,2,1,9,4,5,6,7,8,10,11,48,29,25,20,18,49,13,35,50,12,21,51,41,52,53,54,55,56,23,28,57,58,59,60,61,37,62,63,64,65]))),Hc=x.lazy(()=>D(()=>import("./overview-DtickflS.js"),__vite__mapDeps([66,1,2,4,5,6,7,8,10,39,67,9,11,27,40,26,18,68,69,70,55,3,25,29,36,37,20,38,41,42]))),Bc=x.lazy(()=>D(()=>import("./domains-DzDEWZRA.js"),__vite__mapDeps([71,2,4,5,1,6,7,8,9,10,11,72,45,19,20,40,26,29,25,33,34,61,21,73,41,39,27,74]))),Fc=x.lazy(()=>D(()=>import("./index-ha4GQCBu.js"),__vite__mapDeps([75,2,6,5,1,4,7,8,9,10,11,18,76,30,31,44,19,20,77,78,79,29,25,50,41,80,3,36,37,38,39,40,26,42]))),Vc=x.lazy(()=>D(()=>import("./appearance-CLcBa2If.js"),__vite__mapDeps([81,5,2,4,1,6,7,8,9,10,11,44]))),qc=x.lazy(()=>D(()=>import("./audit-logs-BpxjWxH9.js"),__vite__mapDeps([82,4,2,5,1,6,7,8,30,31,3,9,10,11,63,64,39,35,65,25,29,36,37,20,38,40,26,41,42]))),Wc=x.lazy(()=>D(()=>import("./index-Bv_IEtVv.js"),__vite__mapDeps([83,2,1,5,4,6,7,8,9,10,11,38,20,84,85,35,27,86,54,13,39,74,30,31,18,87,40,26,88,89,90,56,91,25,92,93,23,24,44,3,29,36,37,41,42]))),Kc=x.lazy(()=>D(()=>import("./config-navigation-Ba_9bXNB.js"),__vite__mapDeps([94,2,4,5,1,6,7,8,69,78,10,95,9,11,96,97,62,55,38,20,57,58,88,25,3,29,36,37,39,40,26,41,42]))),Gc=x.lazy(()=>D(()=>import("./index-B6novXpp.js"),__vite__mapDeps([98,1,2,6,5,10,4,7,8,9,11,44,55,99,100,70,25,28,27,93,34,37,101,50,3,29,36,20,38,39,40,26,41,42]))),Qc=x.lazy(()=>D(()=>import("./index-DUGQ4cKm.js"),__vite__mapDeps([102,4,2,5,1,6,7,8,10,9,11,101,85,67,27,31,44]))),Zc=x.lazy(()=>D(()=>import("./security-Bs24V5aw.js"),__vite__mapDeps([103,4,2,5,1,6,7,8,9,10,11,97,104,44,3,25,29,36,37,20,38,39,40,26,41,42]))),Xc=x.lazy(()=>D(()=>import("./branding-BqmpdYqw.js"),__vite__mapDeps([105,2,1,4,5,6,7,8,10,106,69,95,60,107,52,79,62,9,11,19,20,38,85]))),Jc=x.lazy(()=>D(()=>import("./advanced-DAKR9vq6.js"),__vite__mapDeps([108,2,1,9,4,5,6,7,8,10,11,19,20,39,29,25,41,85,21,27,18,68,69,3,36,37,38,40,26,42]))),Yc=x.lazy(()=>D(()=>import("./traffic-BdpKUL58.js").then(e=>e.t),__vite__mapDeps([87,2,9,1,4,5,6,7,8,10,11,40,26,88,89,90,56,91,25,92,93,23,24]))),el=x.lazy(()=>D(()=>import("./runtime-Bta2wOnU.js"),__vite__mapDeps([109,2,1,4,5,6,7,8,9,10,11,92,93,13,3,25,29,36,37,20,38,39,40,26,41,42]))),tl=x.lazy(()=>D(()=>import("./index-l5blEEs7.js"),__vite__mapDeps([110,2,4,5,1,6,7,8,111,25,76,18,30,31,9,10,11,22,23,24,29,21,61,19,20,13,33,34,44,46,39,3,36,37,38,40,26,41,42]))),nl=x.lazy(()=>D(()=>import("./list-DeTNTY_6.js"),__vite__mapDeps([112,2,4,5,1,6,7,8,10,111,40,26,17,9,11,22,23,24,49,21,61,29,25,76,18,30,31,33,34,46,39,44,3,36,37,20,38,41,42]))),rl=x.lazy(()=>D(()=>import("./index-Br-eR92d.js"),__vite__mapDeps([113,2,4,5,1,6,7,8,53,55,46,39,44,9,10,11,3,25,29,36,37,20,38,40,26,41,42]))),sl=x.lazy(()=>D(()=>import("./component-D4dOU94T.js"),__vite__mapDeps([114,1,2,5,4,6,7,8,10,9,11,25,115,101,19,20,111,96,91,58,106,69,95,21,56,90,62,116,59,53,60,28,61,29,37,18,117,118,100,70,55,107,52,119,84,77,78,63,64,3,27,73,44,120,99,121,122,80,39,88,13,36,33,34,38,40,26,41,42]))),ol=x.lazy(()=>D(()=>import("./index-CCuD6_Rj.js"),__vite__mapDeps([123,1,2,4,5,6,7,8,9,10,11]))),il=he(M.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),al=e=>{const{enqueueSnackbar:t}=Hn(),n=x.useCallback(r=>Xn(il,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);We(`${e}/${M.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const s=n(r),{severity:a,description:i}=r||{},c=["error","warning"].includes(a)||r.sticky;r.source==="system"&&t(i,{variant:a,autoHideDuration:c?null:5e3,content:l=>o.jsx(di,{viewAllUrl:s,keyId:l,notification:r,content:o.jsx(ki,{notification:r,minimal:!0,rows:0})})})},[],"user")};function is({blocklet:e,isAdmin:t}){return t?o.jsx(Wc,{blocklet:e}):o.jsx(vo,{status:403})}is.propTypes={blocklet:v.object.isRequired,isAdmin:v.bool.isRequired};const cl=e=>{var d,p;const{t}=Y(),{blocklet:n,actions:{refreshBlocklet:r},client:s,did:a}=ve(),i=(d=n==null?void 0:n.meta)==null?void 0:d.did,c=!n||co(n.status)?[]:N.getAppMissingConfigs(n),l={overview:[{label:t("common.overview"),value:"overview"},{label:o.jsx(Us,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!c.length,children:t("common.components")}),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},{label:t("team.member.passports"),value:"passports"},{label:t("common.setting"),value:"settings"},{label:t("common.security"),value:"security"},{label:t("oauth.client.tab"),value:"oauth"}],website:[{label:t("common.domains"),value:"domains"},{label:t("common.branding"),value:"branding"},{label:t("common.theming"),value:"theming"},{label:t("common.navigation"),value:"navigation"}],operations:[{label:t("common.notificationRecords"),value:"notifications",show:e},{label:t("common.analytics"),value:"analytics"},{label:t("common.auditLogs"),value:"audit-logs"},{label:t("common.advancedConfig"),value:"advanced"}],integrations:[{label:"Webhooks",value:"webhooks",show:e},{label:t("common.accessKeys"),value:"access-keys"},{label:t("common.mcpServers"),value:"mcp-servers"}],developers:[{label:t("common.logs"),value:"logs",show:((p=n==null?void 0:n.children)==null?void 0:p.length)&&n.structVersion===M.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},u={overview:Hc,components:sl,members:o.jsx(Nc,{type:"blocklet",createPassportSvg:Sn}),passports:o.jsx(Fc,{createPassportSvg:Sn}),settings:o.jsx(Qc,{orientation:"vertical"}),security:o.jsx(Zc,{}),"did-spaces":o.jsx(Gc,{navOrientation:"horizontal"}),domains:Bc,branding:o.jsx(Xc,{blocklet:n,onUpdate:r}),theming:o.jsx(Vc,{}),navigation:Kc,sitemap:o.jsx(_s,{children:t("common.comingSoon")}),notifications:o.jsx(is,{blocklet:n,isAdmin:e}),"audit-logs":o.jsx(qc,{scope:i,categories:["blocklet","team","security","certificates","gateway"]}),analytics:o.jsx(Yc,{client:s,did:a}),advanced:o.jsx(Jc,{blocklet:n,onUpdate:r}),webhooks:o.jsx(Uc,{}),"access-keys":o.jsx(tl,{}),"mcp-servers":o.jsx(rl,{}),logs:Oc,performance:o.jsx(el,{client:s,did:a}),docs:ol,publish:o.jsx(zc,{}),oauth:o.jsx(nl,{})};return{tabGroups:l,renders:u}};function ll(){var m,C;const e=Gn(),{tab:t="overview",subtab:n}=Bs(),{blocklet:r,refreshFlag:s}=ve(),{session:a}=Yn(),i=ge(()=>{var w;return(w=a==null?void 0:a.user)==null?void 0:w.did},[a]),c=ko(),l=ge(()=>{var w;return((w=a.user)==null?void 0:w.role)&&io.includes(a.user.role)},[a]);al(i);const{tabGroups:u,renders:d}=cl(l),p=w=>{e(`${M.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${w}`)},f=(u[t]||[]).filter(w=>w.show===void 0||w.show),y=((m=(f||[]).find(w=>w.value===n))==null?void 0:m.value)||((C=f==null?void 0:f[0])==null?void 0:C.value)||t,g=d[y]||d.overview,h=["overview"].includes(t),S=r?o.jsxs(Ot,{type:"components",children:[f.length>0&&o.jsxs(_,{mb:2,display:"flex",alignItems:"center",gap:2,children:[o.jsx(Ss,{tabs:f,current:y,onChange:p,scrollButtons:"auto"}),h&&!c&&o.jsx(_,{flex:1,display:"flex",justifyContent:"flex-end",children:o.jsx(_,{component:"div",className:"page-header",children:r?o.jsx(kn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:w}={})=>{w&&Z.error(w.message)},variant:"group"}):null})})]}),o.jsx(_,{className:"page-content",children:o.jsx(x.Suspense,{fallback:o.jsx(Je,{relative:"parent",children:o.jsx(re,{})}),children:x.isValidElement(g)?g:o.jsx(g,{blocklet:r})})})]}):o.jsx(Je,{relative:"parent",children:o.jsx(re,{})});return o.jsx(ao,{children:o.jsx($c,{children:o.jsx(gn,{children:o.jsxs(dl,{children:[c&&h&&o.jsx(_,{component:"div",className:"page-header",mb:2,children:r?o.jsx(kn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:w}={})=>{w&&Z.error(w.message)},variant:"group"}):null}),o.jsx(dr,{}),o.jsx(Rc,{}),S]})},`${s}`)})})}function ul(){var r;const{blocklet:e}=ve(),{t}=Y(),n=(r=e==null?void 0:e.meta)==null?void 0:r.did;return x.useEffect(()=>{const s=oo();return n&&s.connect(),()=>{n&&s.isConnected()&&s.disconnect()}},[n]),o.jsxs(o.Fragment,{children:[o.jsx(xo,{children:o.jsx("title",{children:t("pageTitle.dashboard")})}),o.jsx(ll,{})]})}const dl=G.main`
198
198
  .page-header {
199
199
  display: flex;
200
200
  justify-content: space-between;