@abtnode/blocklet-services 1.17.5-beta-20251208-123021-e8c53f96 → 1.17.5-beta-20251209-090953-3a59e7ac
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.js +4 -3
- package/dist/assets/{access-control-uMgSmVtl.js → access-control-BQ-IG3_x.js} +1 -1
- package/dist/assets/{add-component-core-Dc36lTWq.js → add-component-core-Cb9Jf9pu.js} +1 -1
- package/dist/assets/{add-resource-CNyb02oE.js → add-resource-BmEJTiqi.js} +1 -1
- package/dist/assets/{addon-BrD52yP8.js → addon-CzieGOEG.js} +1 -1
- package/dist/assets/{advanced-BTz3ZBM_.js → advanced-B94516o4.js} +1 -1
- package/dist/assets/{aigne-CKJhF6YF.js → aigne-CYChXVP3.js} +1 -1
- package/dist/assets/{appearance-BJ1pZ5mv.js → appearance-C1uh29fy.js} +1 -1
- package/dist/assets/{arrow-down.svg-C_9IZZzE.js → arrow-down.svg-DCPm0wfX.js} +1 -1
- package/dist/assets/{audit-logs-Cv97rr17.js → audit-logs-Dcdyar51.js} +1 -1
- package/dist/assets/{authorize-B7P46IV2.js → authorize-QHj4ueFL.js} +1 -1
- package/dist/assets/{bind-account-jReeH6gL.js → bind-account-BX-KG0Qr.js} +1 -1
- package/dist/assets/{branding-DTiVyAwp.js → branding-Ce0jZMDd.js} +1 -1
- package/dist/assets/{branding-Dw7bAXb5.js → branding-CqhvExJP.js} +4 -4
- package/dist/assets/{branding-DDbf7iKd.js → branding-Dnj3tYIM.js} +1 -1
- package/dist/assets/{bundle-avatar-CKp8Upr1.js → bundle-avatar--xYBq9Gb.js} +1 -1
- package/dist/assets/{complete-I86fdk2J.js → complete-CF2ewVuD.js} +1 -1
- package/dist/assets/{component-BxDPcxLA.js → component-u6OazrP-.js} +3 -3
- package/dist/assets/{config-3y5DLQbx.js → config-BdGGivQg.js} +1 -1
- package/dist/assets/{config-CmTXD9uy.js → config-Cj_KRqwi.js} +1 -1
- package/dist/assets/{config-uqOLSuI1.js → config-DwBbQRLw.js} +1 -1
- package/dist/assets/{config-navigation-IlBVGJJp.js → config-navigation-2cI6Tcgp.js} +2 -2
- package/dist/assets/{config-space-CMOK4l4q.js → config-space-DI_Aw2fC.js} +1 -1
- package/dist/assets/{confirm-DQ4M1D6U.js → confirm-F2_i30bc.js} +1 -1
- package/dist/assets/{connect-N6Jlg0kg.js → connect-4HW3qKz4.js} +1 -1
- package/dist/assets/{connect-Bt_sH-vn.js → connect-BeA4k1eX.js} +1 -1
- package/dist/assets/{connect-to-CTgmFTT0.js → connect-to-BBcrmPHg.js} +1 -1
- package/dist/assets/dashboard-BDag6cuN.js +106 -0
- package/dist/assets/{delete-confirm-CkOWa6dE.js → delete-confirm-DBhiUq1r.js} +1 -1
- package/dist/assets/{domain-CNgcPSuz.js → domain-CM8EYUUH.js} +1 -1
- package/dist/assets/{domain-action-card-DglaZM09.js → domain-action-card-BdWmmq7M.js} +1 -1
- package/dist/assets/{domains-xkwgfn_I.js → domains-C_hsR6kY.js} +1 -1
- package/dist/assets/{email-B0VF90tU.js → email-CbHnzIjr.js} +1 -1
- package/dist/assets/engine-C3zb9k-C.js +1 -0
- package/dist/assets/{exchange-passport-CrW7dVAg.js → exchange-passport-3WK7243a.js} +1 -1
- package/dist/assets/{form-BqVjSzP6.js → form-CCmYt5yy.js} +1 -1
- package/dist/assets/{fuel-Cgu54jtO.js → fuel-BG9pjC0w.js} +1 -1
- package/dist/assets/{gen-access-key-D4Zopy1D.js → gen-access-key-BPsrFRZB.js} +1 -1
- package/dist/assets/{gen-simple-access-key-BOkAbBHA.js → gen-simple-access-key-CZGyIc9a.js} +1 -1
- package/dist/assets/{get-safe-url-DKPL0sDC.js → get-safe-url-BrPSNpgv.js} +1 -1
- package/dist/assets/{home-CAGJ1uyT.js → home-CQklhtpC.js} +1 -1
- package/dist/assets/{iframe-DvPZuyhb.js → iframe-CKjr768a.js} +1 -1
- package/dist/assets/{index-DKeCxW4D.js → index-0tKuoOtp.js} +1 -1
- package/dist/assets/{index-Bka-tTFw.js → index-21gjg2tv.js} +1 -1
- package/dist/assets/{index-DhsOorTb.js → index-2T0bIXYn.js} +1 -1
- package/dist/assets/{index-CLtIjagu.js → index-B-xwjRHD.js} +1 -1
- package/dist/assets/{index-BTBqUQm1.js → index-BjYRoSYo.js} +1 -1
- package/dist/assets/{index-C3fi8Y-l.js → index-BmnHj012.js} +1 -1
- package/dist/assets/{index-C9dtkWmq.js → index-BnLnviXD.js} +1 -1
- package/dist/assets/{index-Dj0nGRrj.js → index-C6JbpwU_.js} +1 -1
- package/dist/assets/{index-BSf_vZgi.js → index-CQbGIqeS.js} +1 -1
- package/dist/assets/{index-Dq0Srq3h.js → index-CVED_BmV.js} +1 -1
- package/dist/assets/{index-B6tDB9NM.js → index-CVVhDiqm.js} +1 -1
- package/dist/assets/{index-nDxxcSRU.js → index-CX38UUlR.js} +1 -1
- package/dist/assets/{index-eMvzC3RF.js → index-C_xi8Qiz.js} +1 -1
- package/dist/assets/{index-DTXEQVwg.js → index-CdOL_gmG.js} +1 -1
- package/dist/assets/{index-8pWloMM4.js → index-CnWOeW7L.js} +2 -2
- package/dist/assets/{index-BU1h5ax2.js → index-CpF08yLs.js} +1 -1
- package/dist/assets/{index-DXScybaX.js → index-DQt_6j3C.js} +53 -53
- package/dist/assets/{index-PD6zy1bY.js → index-D_0Kti8n.js} +1 -1
- package/dist/assets/{index-B-FsPHvJ.js → index-Dke96m3s.js} +1 -1
- package/dist/assets/{index-vB1fWp5c.js → index-DlXYHnCm.js} +1 -1
- package/dist/assets/{index-CbziauTS.js → index-DqGlhvi9.js} +1 -1
- package/dist/assets/{index-x4RKBi5w.js → index-Dw7qYst2.js} +1 -1
- package/dist/assets/{index-BvTGUpv5.js → index-NecLGEW0.js} +1 -1
- package/dist/assets/{index-C6xsUkOM.js → index-SZPelu8V.js} +3 -3
- package/dist/assets/{index-B6WvmZFK.js → index-cDc_AEjv.js} +1 -1
- package/dist/assets/{index-BmQjG3jd.js → index-rDCB37wy.js} +1 -1
- package/dist/assets/{invitation-D95v3XVN.js → invitation-DquuV8dW.js} +1 -1
- package/dist/assets/{invitations-DMcpv_mD.js → invitations-CTnzBAUW.js} +1 -1
- package/dist/assets/{invite-DnfMFz38.js → invite-Cqtkz9TE.js} +1 -1
- package/dist/assets/{isURL-CFycC-gz.js → isURL-BHeH7II4.js} +1 -1
- package/dist/assets/{issue-passport-BaMEOyaL.js → issue-passport-O1f1uJyL.js} +1 -1
- package/dist/assets/{item-BmeJ8uZM.js → item-Gzu2HZ93.js} +1 -1
- package/dist/assets/{landing-page-BQv8Dm_n.js → landing-page-BJPl6ZR-.js} +1 -1
- package/dist/assets/{layout-TOJ7kEb4.js → layout-CbkYBUG0.js} +1 -1
- package/dist/assets/{list-Dxgf_FJ5.js → list-BC0XcUGx.js} +1 -1
- package/dist/assets/{list-Citro58J.js → list-CA3FRf5d.js} +1 -1
- package/dist/assets/{localization-CfvvNuIZ.js → localization-CHT9qqQu.js} +1 -1
- package/dist/assets/{log-BL7saUR-.js → log-ljlYVvKz.js} +1 -1
- package/dist/assets/{login-CfPEbOMU.js → login-e_NJksFx.js} +1 -1
- package/dist/assets/{login-oauth-callback-CbHNtlhV.js → login-oauth-callback-6FC8idn6.js} +1 -1
- package/dist/assets/{logo-uploader-CXV5koKw.js → logo-uploader-BghZxaXm.js} +1 -1
- package/dist/assets/{lost-passport-DJ2zK8hy.js → lost-passport-sW8DA7d5.js} +1 -1
- package/dist/assets/{open-window-qEAgomZG.js → open-window-CXEIuhm-.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-D5hqgkBT.js → over-due-invoice-payment-CcPBU5m-.js} +1 -1
- package/dist/assets/{overview-C_lm4_df.js → overview-D4mRghWV.js} +1 -1
- package/dist/assets/{passport-DM5SPbHM.js → passport-InAw8ts3.js} +1 -1
- package/dist/assets/{passport-item-3DI7pGBf.js → passport-item-7G49I01A.js} +1 -1
- package/dist/assets/{permission-s1vfZfOB.js → permission-DVlrf60Y.js} +1 -1
- package/dist/assets/{preferences-_yaCJj1p.js → preferences-DDCeejgD.js} +1 -1
- package/dist/assets/{profile-embed-C9mA_S9A.js → profile-embed-BLiDn2ls.js} +1 -1
- package/dist/assets/{publish-resource-Q3Sg4NhQ.js → publish-resource-ztAbEOYJ.js} +1 -1
- package/dist/assets/{runtime-DJ07buOB.js → runtime-DI-5yi3_.js} +1 -1
- package/dist/assets/sdk-BbyMeQrc.js +1 -0
- package/dist/assets/{security-BB8LkO1d.js → security-BFYfTqZs.js} +1 -1
- package/dist/assets/{session-BYUJUwt5.js → session-SqadLMEY.js} +1 -1
- package/dist/assets/{setup-D_uNhYL1.js → setup-DSHYh-k3.js} +1 -1
- package/dist/assets/{simple-select-Bh-KqIzp.js → simple-select-Bif1RlSz.js} +1 -1
- package/dist/assets/{spaces-CAh777pB.js → spaces-CLjWPJSv.js} +1 -1
- package/dist/assets/{start-BXVj6K34.js → start-RseKdDAg.js} +1 -1
- package/dist/assets/{starting-progress-Cr7Dhtc0.js → starting-progress-BdHDbZA8.js} +1 -1
- package/dist/assets/{status-C1igPCAc.js → status-B02rE3OJ.js} +1 -1
- package/dist/assets/{step-actions-CzQHsGG8.js → step-actions-gJEftNli.js} +1 -1
- package/dist/assets/{studio-NLZNkTb4.js → studio-VRwDw2v1.js} +1 -1
- package/dist/assets/{team-_EogfHX7.js → team-D29LjHNf.js} +1 -1
- package/dist/assets/{traffic-BbiwlHWj.js → traffic-DGDO-5_X.js} +1 -1
- package/dist/assets/{transfer-gc1GZBIx.js → transfer-CzsMxoja.js} +1 -1
- package/dist/assets/{unsubscribe-DuwSXkBI.js → unsubscribe-BPqvl0Qq.js} +1 -1
- package/dist/assets/{use-app-logo-iwMRCv-t.js → use-app-logo-D768RYSo.js} +1 -1
- package/dist/assets/{user-center-DfwrnXim.js → user-center-B6mso4VA.js} +2 -2
- package/dist/assets/{user-follower-BLRS0VYS.js → user-follower-Bx_h5g8K.js} +1 -1
- package/dist/assets/{util-DPYbSMU0.js → util-BQmjsgsT.js} +1 -1
- package/dist/assets/{util-IJIaP2Ju.js → util-CW4LiHT7.js} +1 -1
- package/dist/assets/{wait-connect-iNFEi-e2.js → wait-connect-DOCM-L84.js} +1 -1
- package/dist/assets/{wizard-DGVZKhvx.js → wizard-BsZNkmTe.js} +1 -1
- package/dist/assets/{wizard-components-DAyQuqLW.js → wizard-components-Bhn-EsyA.js} +1 -1
- package/dist/assets/{wrap-locale-BHrzeI1j.js → wrap-locale-BovKZCTj.js} +1 -1
- package/dist/assets/{zh-CVVdRn45.js → zh-DhM7svnr.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +2 -2
- package/package.json +30 -29
- package/dist/assets/dashboard-DRyb1sbI.js +0 -106
- package/dist/assets/engine-DHTRYPdG.js +0 -1
- package/dist/assets/sdk-Bomrk-jh.js +0 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-gnjjKJuC.css"),window.__toCdnUrl("assets/add-component-core-G0iZE90Q.css")])))=>i.map(i=>d[i]);
|
|
2
|
+
import{U as wt,p as ln,n as St,H as G,V as U,aI as un,aJ as Lo,Q as To,M as dn,E as Pt,w as Do,j as Ao,_ as L}from"./vendor-ux-r9bApERu.js";import{j as i,W as x,aZ as Po,cN as Ro,d9 as Mo,bb as Oo,dg as No,dh as Uo,cP as Bo,di as zo,dc as $o,dj as Fo,I as Be,aQ as Vo,aR as Ho,aX as ze,a3 as Wo,M as qo,aO as Ko,a6 as H,aP as Go,bi as Qo,at as $e,T as Q,bq as Zo,b6 as Rt,br as Mt,ak as _,D as ge,J as oe,ah as Fe,ao as Xo,dk as Jo,aj as Yo,dl as fn,dm as pn,dn as mn,am as me,a$ as Te,dp as Ot,U as ee,aN as hn,Y as gn,b_ as er,dq as tr,dr as nr,Q as ct,ds as or}from"./vendor-mui-core-BPQ6AEW_.js";import{r as h,L as bn,i as xn,g as rr,k as sr,j as ir}from"./vendor-react-CUXIiAnY.js";import{_ as Ve,e as R,Y as Ge,an as Qe,c as A,Z as Nt,bC as ar,a2 as cr,ac as lr,v as ur,bD as dr,bE as yn,a1 as ie,bF as vn,aS as fr,bG as pr,X as mr,b1 as hr,b2 as gr,bH as br,b3 as xr,bI as yr,bJ as vr,am as wr,bK as Ze,bL as Sr,bM as jr,b0 as Cr,a as wn,B as Sn,l as be,aa as kr,k as Ir,ae as Er,m as Ut,bN as Bt,h as _r,j as Lr,q as Tr,o as le,n as Dr,p as Ar,P as Pr,I as Rr,N as Mr,by as Or,a0 as Nr,t as Ur}from"./index-DQt_6j3C.js";import{ac as Br,C as X,J as jn,Q as zr,e as $r,i as Fr}from"./vendor-utils-BgSaqjGx.js";import{o as Re}from"./vendor-arcblock-D8WYBDYe.js";import{u as zt}from"./useLocalStorage-6wbaKET6.js";import{f as jt}from"./index-DBs9Ljax.js";import{C as $t}from"./confirm-F2_i30bc.js";import{g as Xe}from"./get-safe-url-BrPSNpgv.js";import{u as Cn}from"./session-SqadLMEY.js";import{a as $,l as Vr}from"./vendor-hooks-PN9SWiQm.js";import{j as Hr,b as Wr,M as qr,a as Kr,T as Gr,N as Qr}from"./team-D29LjHNf.js";import{c as Ft}from"./passport-InAw8ts3.js";import{D as Zr,u as kn}from"./useAsyncRetry-LJm0Fhbe.js";import{u as In}from"./useSetState-cWrp7qoX.js";import{x as Xr,d as Jr}from"./index-21gjg2tv.js";import{O as Yr}from"./over-due-invoice-payment-CcPBU5m-.js";const En=h.createContext({});function _n({children:e,type:t="blocklets"}){const[n,r]=h.useState([]),o=h.useRef([]),s=l=>{if(!o.current.includes(l)){const u=[...o.current,l];r(u),o.current=u}},a=l=>{if(o.current.includes(l)){const u=o.current.filter(d=>d!==l);r(u),o.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));Br(u,n).forEach(p=>a(p))};return i.jsx(En.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:s,removeDeletingDid:a,matchDeletingDid:c},children:e})}_n.propTypes={type:x.string,children:x.node.isRequired};function rc(){return h.useContext(En)}const es=e=>h.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("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"})),Ln={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 9l3 3l-3 3m5 0h3"/><path d="M3 6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></g>'},ts={display:"inline-flex",width:"26px",height:"26px",paddingRight:"3px"};function ns(e){return i.jsx("span",{style:ts,children:i.jsx(wt,{icon:Ln,width:"100%",height:"100%",...e})})}const Y={Start:Po,Stop:Ro,Restart:Mo,Reload:Fo,Remove:Oo,Config:$o,Log:zo,Group:Bo,Cancel:No,Dashboard:es,Overview:Uo,LogIcon:ns,TerminalIcon:Ln},Vt=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),r=new URLSearchParams(n.searchParams),o=new URL(X(n.origin,t));return o.search=r.toString(),o.toString()},os="internal",rs="external";function Tn({blocklet:e,onStart:t,onComplete:n,variant:r="menu",source:o="blocklet-list",hasPermission:s=!1,getComponentUrl:a=null,useBlockletUrlEvaluation:c=()=>({loading:!1,recommendedUrl:window?.location?.href}),...l}){const u=Ve(),[d,p]=h.useState(null),[f,y]=h.useState(null),[b,j]=h.useState(!1),[S,E]=h.useState(null),{t:g}=h.useContext(ln),[v]=zt("skip-blocklet-setup",!1),{loading:I,recommendedUrl:C}=c(e),[m]=zt("blocklet-type-filter",os),k=R.isInProgress(e.status),[O,B]=h.useState(!1);h.useEffect(()=>{if(!e?.controller)return;B(e?.controller?.status?.value===Ge.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{try{const D=await u.api.getLauncherSession({input:{launcherSessionId:e?.controller?.launcherSessionId,launcherUrl:e?.controller?.launcherUrl}});if(D?.error){console.error("get launcher session failed",D.error);return}B([A.LAUNCH_SESSION_STATUS.overdue,A.LAUNCH_SESSION_STATUS.canceled,A.LAUNCH_SESSION_STATUS.terminated].includes(D?.launcherSession?.status))}catch(D){console.error("call getLauncherSession error",D)}})()},[]);const{inService:M}=u,W=o==="blocklet-detail",re=(w,D,z=!1)=>async()=>{const q=async Ce=>{t({action:w,blocklet:e}),j(!0),y(w);let ke=!1;try{if(w==="remove")await D(Ce);else if(w==="start"){if(!R.hasRunnableComponent(e)){G.error(g("blocklet.noComponent"));return}if(!M&&!v&&!e.settings?.initialized&&e.mode!==Ge.BLOCKLET_MODES.DEVELOPMENT){if(!C||!Nt(C)){G.error(g("blocklet.gotoVisitError"));return}const N=ar(u.info),At=new URL(C);At.searchParams.set("serverUrl",N),window.open(Xe(At.href,{allowDomains:null})),n({action:w,blocklet:e});return}const V=e.children.filter(N=>!R.isInProgress(N.status)&&N.status!=="running"&&!R.isInProgress(N.greenStatus)&&N.greenStatus!=="running").map(N=>N.meta.did),se={did:e.meta.did,componentDids:V};await D({input:se})}else if(["stop","restart","reload"].includes(w)){const V=e.children.filter(N=>R.isBlockletRunning(N)).map(N=>N.meta.did),se={did:e.meta.did,componentDids:V};await D({input:se})}else{const V={did:e.meta.did};await D({input:V})}w==="remove"?ke=!0:await cr(1e3),w==="reload"&&G.success(g("blocklet.reloadSuccess")),E(null),n({action:w,blocklet:e})}catch(V){const se=`Blocklet ${w} failed: ${jt(V)}`;throw n({action:w,blocklet:e,error:new Error(se)}),new Error(se)}finally{ke||j(!1)}},K=()=>{j(!1),E(null)},je=R.getDisplayName(e,!0),Eo=e.mode===Ge.BLOCKLET_MODES.DEVELOPMENT?{description:()=>i.jsx(Q,{component:"div",children:i.jsx(Q,{gutterBottom:!0,children:g("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Ce,ke)=>i.jsxs(Q,{component:"div",children:[i.jsx(Q,{gutterBottom:!0,children:g("blocklet.action.removeApplicationDescription")}),i.jsxs(Zo,{name:"removeType",value:Ce.removeType,onChange:V=>ke({...Ce,removeType:V.target.value}),children:[i.jsx(Rt,{value:"backup",control:i.jsx(Mt,{}),label:g("blocklet.action.removeApplicationAfterBackup")}),i.jsx(Rt,{value:"complete",control:i.jsx(Mt,{}),label:g("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},_o={stop:{title:`${g("common.stop")} ${je}`,description:g("blocklet.action.stopDescription"),confirm:g("blocklet.action.confirmStop"),cancel:g("common.cancel"),onConfirm:q,onCancel:K},restart:{title:`${g("common.restart")} ${je}`,description:g("blocklet.action.restartDescription"),confirm:g("blocklet.action.confirmRestart"),cancel:g("common.cancel"),onConfirm:q,onCancel:K},remove:{title:`${g("common.remove")} ${je}`,confirm:g("blocklet.action.confirmRemove"),cancel:g("common.cancel"),onConfirm:q,onCancel:K,...Eo},cancelDownload:{title:`${g("common.cancel")}`,description:g("blocklet.action.cancelDownloadDescription",{name:je}),confirm:g("common.confirm"),cancel:g("common.cancel"),onConfirm:q,onCancel:K}};z?E(_o[w]):await q()},wo=!!d,So=w=>{try{w.stopPropagation(),w.preventDefault()}catch{}p(w.currentTarget)},jo=w=>{try{w.stopPropagation(),w.preventDefault()}catch{}p(null)},Tt=async(w,D)=>{try{D.stopPropagation(),D.preventDefault()}catch{}if(typeof w.handler=="function")try{j(!0),y(w.action),await w.handler()}catch(z){console.error(`Blocklet ${w.name} failed: `,z)}finally{j(!1),p(null)}else p(null)},Co=!M&&R.isDeletableBlocklet(e)?{action:"remove",icon:Y.Remove,name:g("common.remove"),handler:re("remove",async({removeType:w})=>{w==="backup"&&await u.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await u.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:k}:null,ko={action:"remove",icon:({sx:w,...D})=>i.jsx(Y.Cancel,{sx:{...w,paddingRight:"2px",zoom:.95},...D}),name:g("common.cancel"),handler:re("cancelDownload",u.api.cancelDownloadBlocklet,!0)},Io=R.getAppMissingConfigs(e),Dt=(w="dashboard")=>{const D=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),z=a?.({mountPoint:D,blocklet:e});if(!z||!Nt(z)){G.error(g("blocklet.gotoVisitError"));return}const q=e?.site?.domainAliases;w==="logs"?window.open(Xe(Vt(z,`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/developers/logs`),{allowDomains:q?.map(K=>K.value)})):window.open(Xe(Vt(z,`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:q?.map(K=>K.value)}))};let Se=[{action:"start",icon:Y.Start,inExternal:!0,name:g("common.start"),handler:re("start",u.api.startBlocklet),disabled:O||e.children.every(w=>R.isBlockletRunning(w))||Qe(e.status)||I||k},{action:"stop",icon:Y.Stop,inExternal:!0,name:g("common.stop"),handler:re("stop",u.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:Y.Restart,name:g("common.restart"),handler:re("restart",u.api.restartBlocklet,!0),disabled:O||e.status!=="running"},Qe(e.status)?ko:Co,{separator:!0},M?null:{action:"dashboard",icon:({style:w,...D})=>i.jsx(Y.Dashboard,{...D,style:{...w,width:"26px",height:"26px",paddingRight:"3px"}}),name:g("sidebar.dashboard"),handler:Dt},!M&&!W?{action:"logs",icon:Y.LogIcon,name:g("common.logs"),handler:()=>Dt("logs")}:null].filter(Boolean);return m===rs&&(Se=Se.filter(w=>w.inExternal)),r==="menu"?i.jsxs(Ht,{"data-cy":"blocklet-actions",children:[i.jsx(Be,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:So,size:"small",disabled:!s||!Qe(e.status)&&b,children:i.jsx(Vo,{})}),i.jsxs(Ho,{id:"actions-menu",anchorEl:d,keepMounted:!0,open:wo,onClose:jo,PaperProps:{},children:[Io.length>0&&i.jsxs(ze,{style:{maxWidth:"400px"},severity:"error",children:[g("blocklet.config.missingRequired"),i.jsx("br",{}),i.jsx(bn,{to:`/blocklets/${e.meta.did}/components`,children:g("blocklet.config.gotoFix")})]}),Se.map((w,D)=>w.separator?i.jsx(Wo,{},`separator-${D}`):i.jsxs(qo,{dense:!0,onClick:z=>Tt(w,z),disabled:b||w.disabled,"data-cy":`${w.action}-blocklet`,children:[i.jsx(Ko,{style:{minWidth:24},children:f===w.action&&b?i.jsx(H,{size:16,sx:{marginRight:1}}):i.jsx(w.icon,{fontSize:"small"})}),i.jsx(Go,{primary:w.name})]},w.name))]}),S&&i.jsx($t,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]}):i.jsxs(Ht,{"data-cy":"blocklet-actions",...l,children:[i.jsx(Qo,{children:Se.filter(w=>!w.separator&&!w.onlyInMenu).map(w=>i.jsxs(St,{title:w.name,"data-cy":`${w.action}-blocklet`,onClick:()=>Tt(w),disabled:!!w.disabled||b,children:[f===w.action&&b?i.jsx(H,{size:16,sx:{marginRight:1}}):i.jsx(w.icon,{}),i.jsx("span",{className:"blocklet-action-text",children:w.name})]},w.name))}),S&&i.jsx($t,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]})}Tn.propTypes={getComponentUrl:x.func,blocklet:x.object.isRequired,onStart:x.func.isRequired,onComplete:x.func.isRequired,variant:x.oneOf(["menu","group"]),source:x.oneOf(["blocklet-list","blocklet-detail"]),hasPermission:x.bool,useBlockletUrlEvaluation:x.func};const Ht=$e.div`
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
|
|
6
|
+
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
7
|
+
.MuiButton-root {
|
|
8
|
+
padding: 4px;
|
|
9
|
+
font-size: 10px;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`,ss=h.memo(Tn),is=e=>{const t={};let n=null;return R.forEachBlockletSync(e,r=>{t[r.meta.bundleDid]?n=R.getDisplayName(r,!0):r.meta.bundleDid&&(t[r.meta.bundleDid]=!0)}),n},as=(e,t,n)=>{const{hostname:r,href:o}=e;if(!t)return o;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!a)return o;const c=a[0],u=((t.site?.domainAliases||[]).map(d=>d.value).filter(Boolean).find(d=>d.endsWith(A.DEFAULT_DID_DOMAIN))||"").replace(`.${A.DEFAULT_DID_DOMAIN}`,"");return u?o.replace(r,`${u}-${c}.${A.DEFAULT_IP_DOMAIN_SUFFIX}`):o}return o.replace(t.meta.bundleDid,t.appPid)};function cs(){const{t:e}=U(),{api:t}=Cn(),{blocklet:n}=lr(),{inService:r}=Ve(),[o,s]=h.useState(!1),[a,c]=h.useState(5),l=n&&n.structVersion!==A.APP_STRUCT_VERSION,u=()=>{try{if(R.isBlockletRunning(n)){G.error(e("blocklet.migrate.tip.running"));return}const f=is(n);if(f){G.error(e("blocklet.migrate.tip.duplicate",{name:f}));return}s(!0)}catch(f){G.error(jt(f))}},d=()=>{const f=as(window.location,n,r);setTimeout(()=>{window.location.href=f},5e3),c(5),setInterval(()=>{c(y=>y-1)},1e3)},p=()=>s(!1);return[l&&i.jsxs(ze,{severity:"warning",style:{margin:"12px 0"},children:[i.jsxs(_,{sx:{display:"flex",alignItems:"center"},children:[i.jsx(St,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),i.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(f=>i.jsx(_,{sx:{display:"flex",alignItems:"center"},children:e(`blocklet.migrate.intro.${f}`)},f))]},"alert"),n&&i.jsx(ur,{popup:!0,open:o,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:5*60*1e3,onSuccess:d,extraParams:{appDid:n.appDid,did:n.meta.did,wt:dr(n,!0),title:R.getDisplayName(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:a>=0?e("blocklet.migrate.success",{sec:a}):"Redirecting..."},onClose:p},"connect")]}function ls(){const e=ge();return[...e.breakpoints.keys].reverse().reduce((n,r)=>{const o=oe(e.breakpoints.up(r));return!n&&o?r:n},null)||"xs"}function us(e){return i.jsx(Fe,{...e,children:i.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"})})}function ds(e){return i.jsx(Fe,{...e,children:i.jsx("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"})})}function fs(e){return i.jsx(Fe,{...e,children:i.jsx("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2, 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12, 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"})})}function ps(e){return i.jsx(Fe,{...e,children:i.jsx("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12A10,10 0 0,0 12,2Z"})})}const Ie={fontSize:20,marginInlineEnd:8},ms={success:i.jsx(us,{style:Ie}),warning:i.jsx(ds,{style:Ie}),error:i.jsx(fs,{style:Ie}),info:i.jsx(ps,{style:Ie})},hs={xl:"400px",lg:"400px",md:"400px",sm:"300px"};function Dn({keyId:e,notification:t={},viewAllUrl:n,content:r=null},o){const s=ge(),a=ms[t.severity],{closeSnackbar:c}=un(),l=()=>c(e),u=xn(),d=()=>{c(e),u(n)},p=$(()=>Hr(t),[t]),f=$(()=>t?.activity,[t]),y=Wr({activity:f,users:[t?.actorInfo],actors:[t?.activity?.actor],extra:{linkColor:s.palette.primary.main,userDid:t?.receivers?.[0]?.did}}),b=ls();return i.jsxs(_,{component:Lo,ref:o,sx:[{...s.typography.body2,display:"flex",backgroundColor:s.palette.background.default,color:"#fff",alignItems:"center",pl:2.5,pr:2,py:.75,borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)",width:hs[b]},t.severity==="success"?{backgroundColor:`${Xo[600]} !important`}:{},t.severity==="error"?{backgroundColor:`${s.palette.error.dark} !important`}:{},t.severity==="info"?{backgroundColor:`${s.palette.primary.main} !important`}:{},t.severity==="warning"?{backgroundColor:`${Jo[700]} !important`}:{}],children:[i.jsxs(_,{sx:{display:"flex",alignItems:"center",py:1,flex:1},children:[a,i.jsx(bs,{onClick:d,sx:{flex:1},children:i.jsx(_,{children:p?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:y}),f.meta?i.jsx(qr,{meta:f.meta,type:f.type,sx:{display:"-webkit-box",overflow:"hidden",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",color:"#fff"}}):null]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:t.title}),r||i.jsx("span",{className:"desc",children:t.description})]})})})]}),i.jsx(_,{sx:{display:"flex",alignItems:"center",ml:"auto",mr:-1,width:44},children:i.jsx(Be,{"aria-label":"close",color:"inherit",onClick:l,size:"large",children:i.jsx(_,{component:Yo,sx:{fontSize:20}})},"close")})]})}const gs=h.forwardRef(Dn);Dn.propTypes={viewAllUrl:x.string.isRequired,keyId:x.number.isRequired,notification:x.object.isRequired,content:x.node};const bs=$e.div`
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
.title {
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
text-overflow: ellipsis;
|
|
19
|
+
display: -webkit-box;
|
|
20
|
+
-webkit-line-clamp: 1;
|
|
21
|
+
-webkit-box-orient: vertical;
|
|
22
|
+
font-weight: bold;
|
|
23
|
+
}
|
|
24
|
+
.desc {
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
display: -webkit-box;
|
|
28
|
+
-webkit-line-clamp: 3;
|
|
29
|
+
-webkit-box-orient: vertical;
|
|
30
|
+
word-break: break-word;
|
|
31
|
+
}
|
|
32
|
+
`;var T=function(t,n,r){return fn.call(n,"css")?i.jsx(pn,mn(t,n),r):i.jsx(t,n,r)},Ee=function(t,n,r){return fn.call(n,"css")?i.jsxs(pn,mn(t,n),r):i.jsxs(t,n,r)};/**
|
|
33
|
+
* (c) Iconify
|
|
34
|
+
*
|
|
35
|
+
* For the full copyright and license information, please view the license.txt or license.gpl.txt
|
|
36
|
+
* files at https://github.com/iconify/iconify
|
|
37
|
+
*
|
|
38
|
+
* Licensed under MIT.
|
|
39
|
+
*
|
|
40
|
+
* @license MIT
|
|
41
|
+
* @version 3.1.1
|
|
42
|
+
*/const An=Object.freeze({left:0,top:0,width:16,height:16}),Me=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),xe=Object.freeze({...An,...Me}),lt=Object.freeze({...xe,body:"",hidden:!1});function xs(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Wt(e,t){const n=xs(e,t);for(const r in lt)r in Me?r in e&&!(r in n)&&(n[r]=Me[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ys(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(n[a])return o[a]=[];if(!(a in o)){o[a]=null;const c=r[a]&&r[a].parent,l=c&&s(c);l&&(o[a]=[c].concat(l))}return o[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),o}function vs(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function a(c){s=Wt(r[c]||o[c],s)}return a(t),n.forEach(a),Wt(e,s)}function ws(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=ys(e);for(const o in r){const s=r[o];s&&(t(o,vs(e,o,s)),n.push(o))}return n}const de=/^[a-z0-9]+(-[a-z0-9]+)*$/,ce=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const c=o.pop(),l=o.pop(),u={provider:o.length>0?o[0]:r,prefix:l,name:c};return t&&!De(u)?null:u}const s=o[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!De(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!De(c,n)?null:c}return null},De=(e,t)=>e?!!((e.provider===""||e.provider.match(de))&&(t&&e.prefix===""||e.prefix.match(de))&&e.name.match(de)):!1,Ss={provider:"",aliases:{},not_found:{},...An};function Je(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function js(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Je(e,Ss))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(de)||typeof s.body!="string"||!Je(s,lt))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],a=s.parent;if(!o.match(de)||typeof a!="string"||!n[a]&&!r[a]||!Je(s,lt))return null}return t}const Oe=Object.create(null);function Cs(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function F(e,t){const n=Oe[e]||(Oe[e]=Object.create(null));return n[t]||(n[t]=Cs(e,t))}function Ct(e,t){return js(t)?ws(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function ks(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function Is(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Oe)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(Oe[o]||{})).forEach(a=>{const c=F(o,a);n=n.concat(Object.keys(c.icons).map(l=>(o!==""?"@"+o+":":"")+a+":"+l))})}),n}let kt=!1;function Es(e){return kt}function ye(e){const t=typeof e=="string"?ce(e,!0,kt):e;if(t){const n=F(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function _s(e,t){const n=ce(e,!0,kt);if(!n)return!1;const r=F(n.provider,n.prefix);return ks(r,n.name,t)}function Pn(e,t){if(typeof e!="object")return!1;typeof t!="string"&&(t=e.provider||"");const n=e.prefix;if(!De({provider:t,prefix:n,name:"a"}))return!1;const r=F(t,n);return!!Ct(r,e)}function Ls(e){return!!ye(e)}function Ts(e){const t=ye(e);return t?{...xe,...t}:null}const Rn=Object.freeze({width:null,height:null}),Mn=Object.freeze({...Rn,...Me}),Ds=/(-?[0-9.]*[0-9]+[0-9.]*)/g,As=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ut(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Ds);if(r===null||!r.length)return e;const o=[];let s=r.shift(),a=As.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?o.push(s):o.push(Math.ceil(c*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");a=!a}}const Ps=e=>e==="unset"||e==="undefined"||e==="none";function He(e,t){const n={...xe,...e},r={...Mn,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(b=>{const j=[],S=b.hFlip,E=b.vFlip;let g=b.rotate;S?E?g+=2:(j.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),j.push("scale(-1 1)"),o.top=o.left=0):E&&(j.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),j.push("scale(1 -1)"),o.top=o.left=0);let v;switch(g<0&&(g-=Math.floor(g/4)*4),g=g%4,g){case 1:v=o.height/2+o.top,j.unshift("rotate(90 "+v.toString()+" "+v.toString()+")");break;case 2:j.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:v=o.width/2+o.left,j.unshift("rotate(-90 "+v.toString()+" "+v.toString()+")");break}g%2===1&&(o.left!==o.top&&(v=o.left,o.left=o.top,o.top=v),o.width!==o.height&&(v=o.width,o.width=o.height,o.height=v)),j.length&&(s='<g transform="'+j.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,l=o.width,u=o.height;let d,p;a===null?(p=c===null?"1em":c==="auto"?u:c,d=ut(p,l/u)):(d=a==="auto"?l:a,p=c===null?ut(d,u/l):c==="auto"?u:c);const f={},y=(b,j)=>{Ps(j)||(f[b]=j.toString())};return y("width",d),y("height",p),f.viewBox=o.left.toString()+" "+o.top.toString()+" "+l.toString()+" "+u.toString(),{attributes:f,body:s}}const Rs=/\sid="(\S+)"/g,Ms="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Os=0;function On(e,t=Ms){const n=[];let r;for(;r=Rs.exec(e);)n.push(r[1]);if(!n.length)return e;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(Os++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+o+"$3")}),e=e.replace(new RegExp(o,"g"),""),e}const te={local:!0,session:!0},Nn={local:new Set,session:new Set};let It=!1;function Ns(e){It=e}const qt="iconify2",he="iconify",Un=he+"-count",Kt=he+"-version",Bn=36e5,Us=168;function dt(e,t){try{return e.getItem(t)}catch{}}function Et(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Gt(e,t){try{e.removeItem(t)}catch{}}function ft(e,t){return Et(e,Un,t.toString())}function pt(e){return parseInt(dt(e,Un))||0}let _e=typeof window>"u"?{}:window;function zn(e){const t=e+"Storage";try{if(_e&&_e[t]&&typeof _e[t].length=="number")return _e[t]}catch{}te[e]=!1}function $n(e,t){const n=zn(e);if(!n)return;const r=dt(n,Kt);if(r!==qt){if(r){const c=pt(n);for(let l=0;l<c;l++)Gt(n,he+l.toString())}Et(n,Kt,qt),ft(n,0);return}const o=Math.floor(Date.now()/Bn)-Us,s=c=>{const l=he+c.toString(),u=dt(n,l);if(typeof u=="string"){try{const d=JSON.parse(u);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>o&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,c))return!0}catch{}Gt(n,l)}};let a=pt(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,ft(n,a)):Nn[e].add(c))}function Fn(){if(!It){Ns(!0);for(const e in te)$n(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=F(r,o);if(!Ct(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function Vn(e,t){switch(e){case"local":case"session":te[e]=t;break;case"all":for(const n in te)te[n]=t;break}}const mt=Object.create(null);function Hn(e,t){mt[e]=t}function ht(e){return mt[e]||mt[""]}function _t(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const We=Object.create(null),ue=["https://api.simplesvg.com","https://api.unisvg.com"],Ae=[];for(;ue.length>0;)ue.length===1||Math.random()>.5?Ae.push(ue.shift()):Ae.push(ue.pop());We[""]=_t({resources:["https://api.iconify.design"].concat(Ae)});function Wn(e,t){const n=_t(t);return n===null?!1:(We[e]=n,!0)}function qe(e){return We[e]}function Bs(){return Object.keys(We)}const zs=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Ne=zs();function $s(e){Ne=e}function Fs(){return Ne}function Vs(e,t){const n=qe(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(a=>{o=Math.max(o,a.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function Hs(e){return e===404}const Ws=(e,t,n)=>{const r=[],o=Vs(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((l,u)=>{c+=l.length+1,c>=o&&u>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=l.length),a.icons.push(l)}),r.push(a),r};function qs(e){if(typeof e=="string"){const t=qe(e);if(t)return t.path}return"/"}const Ks=(e,t,n)=>{if(!Ne){n("abort",424);return}let r=qs(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),l=new URLSearchParams({icons:c});r+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;Ne(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Hs(a)?"abort":"next",a)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},Gs={prepare:Ws,send:Ks};function Qs(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,a=o.prefix,c=o.name,l=n[s]||(n[s]=Object.create(null)),u=l[a]||(l[a]=F(s,a));let d;c in u.icons?d=t.loaded:a===""||u.missing.has(c)?d=t.missing:d=t.pending;const p={provider:s,prefix:a,name:c};d.push(p)}),t}function qn(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function Zs(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(l=>{if(l.prefix!==o)return!0;const u=l.name;if(e.icons[u])a.loaded.push({provider:r,prefix:o,name:u});else if(e.missing.has(u))a.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||qn([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Xs=0;function Js(e,t,n){const r=Xs++,o=qn.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),o}function Ys(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?ce(o,t,n):o;s&&r.push(s)}),r}var ei={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ti(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let a;if(e.random){let m=e.resources.slice(0);for(a=[];m.length>1;){const k=Math.floor(Math.random()*m.length);a.push(m[k]),m=m.slice(0,k).concat(m.slice(k+1))}a=a.concat(m)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let l="pending",u=0,d,p=null,f=[],y=[];typeof r=="function"&&y.push(r);function b(){p&&(clearTimeout(p),p=null)}function j(){l==="pending"&&(l="aborted"),b(),f.forEach(m=>{m.status==="pending"&&(m.status="aborted")}),f=[]}function S(m,k){k&&(y=[]),typeof m=="function"&&y.push(m)}function E(){return{startTime:c,payload:t,status:l,queriesSent:u,queriesPending:f.length,subscribe:S,abort:j}}function g(){l="failed",y.forEach(m=>{m(void 0,d)})}function v(){f.forEach(m=>{m.status==="pending"&&(m.status="aborted")}),f=[]}function I(m,k,O){const B=k!=="success";switch(f=f.filter(M=>M!==m),l){case"pending":break;case"failed":if(B||!e.dataAfterTimeout)return;break;default:return}if(k==="abort"){d=O,g();return}if(B){d=O,f.length||(a.length?C():g());return}if(b(),v(),!e.random){const M=e.resources.indexOf(m.resource);M!==-1&&M!==e.index&&(e.index=M)}l="completed",y.forEach(M=>{M(O)})}function C(){if(l!=="pending")return;b();const m=a.shift();if(m===void 0){if(f.length){p=setTimeout(()=>{b(),l==="pending"&&(v(),g())},e.timeout);return}g();return}const k={status:"pending",resource:m,callback:(O,B)=>{I(k,O,B)}};f.push(k),u++,p=setTimeout(C,e.rotate),n(m,t,k.callback)}return setTimeout(C),E}function Kn(e){const t={...ei,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function o(c,l,u){const d=ti(t,c,l,(p,f)=>{r(),u&&u(p,f)});return n.push(d),d}function s(c){return n.find(l=>c(l))||null}return{query:o,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function Qt(){}const Ye=Object.create(null);function ni(e){if(!Ye[e]){const t=qe(e);if(!t)return;const n=Kn(t),r={config:t,redundancy:n};Ye[e]=r}return Ye[e]}function Gn(e,t,n){let r,o;if(typeof e=="string"){const s=ht(e);if(!s)return n(void 0,424),Qt;o=s.send;const a=ni(e);a&&(r=a.redundancy)}else{const s=_t(e);if(s){r=Kn(s);const a=e.resources?e.resources[0]:"",c=ht(a);c&&(o=c.send)}}return!r||!o?(n(void 0,424),Qt):r.query(t,o,n)().abort}function oi(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in te)$n(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function ri(e,t){It||Fn();function n(r){let o;if(!te[r]||!(o=zn(r)))return;const s=Nn[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=pt(o),!ft(o,a+1))return;const c={cached:Math.floor(Date.now()/Bn),provider:e.provider,data:t};return Et(o,he+a.toString(),JSON.stringify(c))}t.lastModified&&!oi(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Zt(){}function si(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Zs(e)}))}function ii(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=ht(n)))return;s.prepare(n,r,o).forEach(c=>{Gn(n,c,l=>{if(typeof l!="object")c.icons.forEach(u=>{e.missing.add(u)});else try{const u=Ct(e,l);if(!u.length)return;const d=e.pendingIcons;d&&u.forEach(p=>{d.delete(p)}),ri(e,l)}catch(u){console.error(u)}si(e)})})}))}const ai=e=>{const n=F(e.provider,e.prefix).pendingIcons;return!!(n&&n.has(e.name))},Lt=(e,t)=>{const n=Ys(e,!0,Es()),r=Qs(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,Zt)}),()=>{l=!1}}const o=Object.create(null),s=[];let a,c;return r.pending.forEach(l=>{const{provider:u,prefix:d}=l;if(d===c&&u===a)return;a=u,c=d,s.push(F(u,d));const p=o[u]||(o[u]=Object.create(null));p[d]||(p[d]=[])}),r.pending.forEach(l=>{const{provider:u,prefix:d,name:p}=l,f=F(u,d),y=f.pendingIcons||(f.pendingIcons=new Set);y.has(p)||(y.add(p),o[u][d].push(p))}),s.forEach(l=>{const{provider:u,prefix:d}=l;o[u][d].length&&ii(l,o[u][d])}),t?Js(t,r,s):Zt},ci=e=>new Promise((t,n)=>{const r=typeof e=="string"?ce(e,!0):e;if(!r){n(e);return}Lt([r||e],o=>{if(o.length&&r){const s=ye(r);if(s){t({...xe,...s});return}}n(e)})});function Qn(e,t){const n={...e};for(const r in t){const o=t[r],s=typeof o;r in Rn?(o===null||o&&(s==="string"||s==="number"))&&(n[r]=o):s===typeof n[r]&&(n[r]=r==="rotate"?o%4:o)}return n}const Ke={...Mn,inline:!1},et="iconify",gt="iconify-inline",J="iconifyData"+Date.now();let ne=[];function ve(e){for(let t=0;t<ne.length;t++){const n=ne[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function Zn(e,t=!1){let n=ve(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},ne.push(n),n)}function li(){if(document.documentElement)return Zn(document.documentElement);ne.push({node:()=>document.documentElement})}function ui(e){ne=ne.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function we(){return ne}function di(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let fe=null;const fi={childList:!0,subtree:!0,attributes:!0};function Xn(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,fe&&fe(e)}))}function pi(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let r=0;r<t.length;r++){const o=t[r];if(o.addedNodes&&o.addedNodes.length>0||o.type==="attributes"&&o.target[J]!==void 0){n.paused||Xn(e);return}}}function Jn(e,t){e.observer.instance.observe(t,fi)}function Ue(e){let t=e.observer;if(t&&t.instance)return;const n=typeof e.node=="function"?e.node():e.node;!n||!window||(t||(t={paused:0},e.observer=t),t.instance=new window.MutationObserver(pi.bind(null,e)),Jn(e,n),t.paused||Xn(e))}function Xt(){we().forEach(Ue)}function Yn(e){if(!e.observer)return;const t=e.observer;t.pendingScan&&(clearTimeout(t.pendingScan),delete t.pendingScan),t.instance&&(t.instance.disconnect(),delete t.instance)}function mi(e){const t=fe!==null;if(fe!==e&&(fe=e,t&&we().forEach(Yn)),t){Xt();return}di(Xt)}function bt(e){(e?[e]:we()).forEach(t=>{if(!t.observer){t.observer={paused:1};return}const n=t.observer;if(n.paused++,n.paused>1||!n.instance)return;n.instance.disconnect()})}function hi(e){if(e){const t=ve(e);t&&bt(t)}else bt()}function xt(e){(e?[e]:we()).forEach(t=>{if(!t.observer){Ue(t);return}const n=t.observer;if(n.paused&&(n.paused--,!n.paused)){const r=typeof t.node=="function"?t.node():t.node;if(r)n.instance?Jn(t,r):Ue(t);else return}})}function gi(e){if(e){const t=ve(e);t&&xt(t)}else xt()}function eo(e,t=!1){const n=Zn(e,t);return Ue(n),n}function to(e){const t=ve(e);t&&(Yn(t),ui(e))}function bi(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const n=e.customisations,r=t.customisations;for(const o in Ke)if(n[o]!==r[o])return!0;return!1}function xi(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const yi=/[\s,]+/;function vi(e,t){t.split(yi).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const wi=["width","height"],Si=["inline","hFlip","vFlip"];function ji(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function Ci(e){const t=e.getAttribute("data-icon"),n=typeof t=="string"&&ce(t,!0);if(!n)return null;const r={...Ke,inline:e.classList&&e.classList.contains(gt)};wi.forEach(c=>{const l=e.getAttribute("data-"+c);l&&(r[c]=l)});const o=e.getAttribute("data-rotate");typeof o=="string"&&(r.rotate=xi(o));const s=e.getAttribute("data-flip");typeof s=="string"&&vi(r,s),Si.forEach(c=>{const l="data-"+c,u=ji(e.getAttribute(l),l);typeof u=="boolean"&&(r[c]=u)});const a=e.getAttribute("data-mode");return{name:t,icon:n,customisations:r,mode:a}}const ki="svg."+et+", i."+et+", span."+et+", i."+gt+", span."+gt;function Ii(e){const t=[];return e.querySelectorAll(ki).forEach(n=>{const r=n[J]||n.tagName.toLowerCase()!=="svg"?Ci(n):null;r&&t.push({node:n,props:r})}),t}function no(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}let pe;function Ei(){try{pe=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{pe=null}}function _i(e){return pe===void 0&&Ei(),pe?pe.createHTML(e):e}function oo(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(n=>{e[n]&&t.add("iconify--"+e[n])}),t}function ro(e,t,n,r){const o=e.classList;if(r){const a=r.classList;Array.from(a).forEach(c=>{o.add(c)})}const s=[];return t.forEach(a=>{o.contains(a)?n.has(a)&&s.push(a):(o.add(a),s.push(a))}),n.forEach(a=>{t.has(a)||o.remove(a)}),s}function so(e,t,n){const r=e.style;(n||[]).forEach(s=>{r.removeProperty(s)});const o=[];for(const s in t)r.getPropertyValue(s)||(o.push(s),r.setProperty(s,t[s]));return o}function io(e,t,n){let r;try{r=document.createElement("span")}catch{return e}const o=t.customisations,s=He(n,o),a=e[J],c=no(On(s.body),{"aria-hidden":"true",role:"img",...s.attributes});r.innerHTML=_i(c);const l=r.childNodes[0],u=e.attributes;for(let b=0;b<u.length;b++){const j=u.item(b),S=j.name;S!=="class"&&!l.hasAttribute(S)&&l.setAttribute(S,j.value)}const d=oo(t.icon),p=ro(l,d,new Set(a&&a.addedClasses),e),f=so(l,o.inline?{"vertical-align":"-0.125em"}:{},a&&a.addedStyles),y={...t,status:"loaded",addedClasses:p,addedStyles:f};return l[J]=y,e.parentNode&&e.parentNode.replaceChild(l,e),l}function Li(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Ti(e){return"data:image/svg+xml,"+Li(e)}function Di(e){return'url("'+Ti(e)+'")'}const Ai={display:"inline-block"},yt={"background-color":"currentColor"},ao={"background-color":"transparent"},Jt={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Yt={"-webkit-mask":yt,mask:yt,background:ao};for(const e in Yt){const t=Yt[e];for(const n in Jt)t[e+"-"+n]=Jt[n]}function en(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function Pi(e,t,n,r){const o=t.customisations,s=He(n,o),a=s.attributes,c=e[J],l=no(s.body,{...a,width:n.width+"",height:n.height+""}),u=oo(t.icon),d=ro(e,u,new Set(c&&c.addedClasses)),f={"--svg":Di(l),width:en(a.width),height:en(a.height),...Ai,...r?yt:ao};o.inline&&(f["vertical-align"]="-0.125em");const y=so(e,f,c&&c.addedStyles),b={...t,status:"loaded",addedClasses:d,addedStyles:y};return e[J]=b,e}let Le=!1;function Ri(){Le||(Le=!0,setTimeout(()=>{Le&&(Le=!1,ae())}))}function ae(e,t=!1){const n=Object.create(null);function r(o,s){const{provider:a,prefix:c,name:l}=o,u=F(a,c),d=u.icons[l];if(d)return{status:"loaded",icon:d};if(u.missing.has(l))return{status:"missing"};if(s&&!ai(o)){const p=n[a]||(n[a]=Object.create(null));(p[c]||(p[c]=new Set)).add(l)}return{status:"loading"}}(e?[e]:we()).forEach(o=>{const s=typeof o.node=="function"?o.node():o.node;if(!s||!s.querySelectorAll)return;let a=!1,c=!1;function l(u,d,p){if(c||(c=!0,bt(o)),u.tagName.toUpperCase()!=="SVG"){const f=d.mode,y=f==="mask"||(f==="bg"?!1:f==="style"?p.body.indexOf("currentColor")!==-1:null);if(typeof y=="boolean"){Pi(u,d,{...xe,...p},y);return}}io(u,d,p)}Ii(s).forEach(({node:u,props:d})=>{const p=u[J];if(!p){const{status:y,icon:b}=r(d.icon,!0);if(b){l(u,d,b);return}a=a||y==="loading",u[J]={...d,status:y};return}let f;if(bi(p,d)){if(f=r(d.icon,p.name!==d.name),!f.icon){a=a||f.status==="loading",Object.assign(p,{...d,status:f.status});return}}else{if(p.status!=="loading")return;if(f=r(d.icon,!1),!f.icon){p.status=f.status;return}}l(u,d,f.icon)}),o.temporary&&!a?to(s):t&&a?eo(s,!0):c&&o.observer&&xt(o)});for(const o in n){const s=n[o];for(const a in s){const c=s[a];Lt(Array.from(c).map(l=>({provider:o,prefix:a,name:l})),Ri)}}}function Mi(e){const t=ve(e);t?ae(t):ae({node:e,temporary:!0},!0)}function co(e,t,n=!1){const r=ye(e);if(!r)return null;const o=ce(e),s=Qn(Ke,t||{}),a=io(document.createElement("span"),{name:e,icon:o,customisations:s},r);return n?a.outerHTML:a}function Oi(){return"3.1.1"}function Ni(e,t){return co(e,t,!1)}function Ui(e,t){return co(e,t,!0)}function Bi(e,t){const n=ye(e);if(!n)return null;const r=Qn(Ke,t||{});return He(n,r)}function zi(e){e?Mi(e):ae()}if(typeof document<"u"&&typeof window<"u"){li();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Pn(r))&&console.error(n)}catch{console.error(n)}})}setTimeout(()=>{mi(ae),ae()})}function $i(e,t){Vn(e,t!==!1)}function Fi(e){Vn(e,!0)}Hn("",Gs);if(typeof document<"u"&&typeof window<"u"){Fn();const e=window;if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const n in t){const r="IconifyProviders["+n+"] is invalid.";try{const o=t[n];if(typeof o!="object"||!o||o.resources===void 0)continue;Wn(n,o)||console.error(r)}catch{console.error(r)}}}}const Vi={getAPIConfig:qe,setAPIModule:Hn,sendAPIQuery:Gn,setFetch:$s,getFetch:Fs,listAPIProviders:Bs},Hi={_api:Vi,addAPIProvider:Wn,loadIcons:Lt,loadIcon:ci,iconExists:Ls,getIcon:Ts,listIcons:Is,addIcon:_s,addCollection:Pn,replaceIDs:On,calculateSize:ut,buildIcon:He,getVersion:Oi,renderSVG:Ni,renderHTML:Ui,renderIcon:Bi,scan:zi,observe:eo,stopObserving:to,pauseObserver:hi,resumeObserver:gi,enableCache:$i,disableCache:Fi};try{self.Iconify===void 0&&(self.Iconify=Hi)}catch{}function lo({children:e,style:t={},...n}){return i.jsx(To,{style:t,...n,children:e})}lo.propTypes={children:x.any.isRequired,style:x.object};const P={yellow:"#FFCF71",grey:"#aaaaaa",reverse:"#444",running:"#34BE74",error:"#D0021B",primary:"#1DC1C7"},Pe={added:P.grey,waiting:P.yellow,downloading:P.yellow,extracting:P.yellow,downloaded:P.grey,installing:P.yellow,installed:P.grey,starting:P.yellow,running:P.running,stopping:P.yellow,stopped:P.reverse,error:P.error,upgrading:P.yellow,restarting:P.yellow,corrupted:P.error,deleting:P.yellow,resource:P.primary},tn={added:"primary",waiting:"info",downloading:"info",extracting:"info",downloaded:"primary",installing:"info",installed:"primary",starting:"info",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"info",restarting:"info",corrupted:"error",deleting:"warning",resource:"primary"};function Wi({isResource:e=!1,status:t,variant:n="tag",progress:r=0,tip:o="",...s}){const{t:a}=h.useContext(ln),c=R.isInProgress(t);let l=e&&t==="stopped"?"resource":t;tn[l]||(l="installed");const u=a(`blocklet.status.${l}`);return n==="pin"?i.jsx(me,{title:a("blocklet.statusTip",{status:u}),children:i.jsxs(_,{...s,sx:[{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(s.sx)?s.sx:[s.sx]],children:[i.jsx(_,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Pe[l]}}),i.jsx(_,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Pe[l]}})]})}):n==="dot"?i.jsx(me,{title:a("blocklet.statusTip",{status:u}),children:i.jsx(Zr,{color:Pe[l],...s})}):i.jsxs(lo,{type:tn[l],...s,children:[c&&i.jsx(H,{size:12,color:"inherit",style:{marginRight:5}}),u,o&&i.jsx("span",{style:{marginLeft:5},children:o}),l==="downloading"&&r?i.jsx("div",{style:{marginLeft:5},children:`${r} %`}):null]})}Wi.propTypes={status:x.string.isRequired,variant:x.oneOf(["dot","tag","pin"]),source:x.string,progress:x.number,isResource:x.bool,tip:x.string};function uo({infos:e=[]}){const{t}=U(),n=new URL("https://community.arcblock.io/discussions/add");e.forEach(o=>{n.searchParams.set(o.label,o.value)});const r=e.map(o=>`* ${o.label}: ${o.value}`).join(`
|
|
43
|
+
`);return n.searchParams.set("report","server"),n.searchParams.set("context",`[Enter feedback here]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
<!--
|
|
48
|
+
[Server Info]
|
|
49
|
+
${r}
|
|
50
|
+
* Page: ${window.location.href}
|
|
51
|
+
-->
|
|
52
|
+
`),T(_,{sx:{mx:{xs:0,md:2}},children:T(Te,{sx:{color:"text.primary"},target:"_blank",href:n.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}uo.propTypes={infos:x.arrayOf(x.shape({label:x.string,value:x.string}))};var tt,nn;function qi(){return nn||(nn=1,tt={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}}),tt}var nt,on;function Ki(){return on||(on=1,nt={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}}),nt}var ot,rn;function fo(){if(rn)return ot;rn=1;const e=new Map;return ot={registerLang:(r,o)=>{e.set(r,o)},getLang:(r="en_US")=>e.get(r)||e.get("en_US")},ot}var rt,sn;function Gi(){return sn||(sn=1,rt=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}}),rt}var st,an;function Qi(){if(an)return st;an=1;const e=Gi(),{getLang:t}=fo(),n=(o,s)=>s===1?o:`${o}s`,r=1e-7;return st=(o,s={})=>{if(!Number.isFinite(o))throw new TypeError("Expected a finite number");s.colonNotation&&(s.compact=!1,s.formatSubMilliseconds=!1,s.separateMilliseconds=!1,s.verbose=!1),s.compact&&(s.secondsDecimalDigits=0,s.millisecondsDecimalDigits=0);const a=t(s.locale),c=[],l=(p,f)=>{const y=Math.floor(p*10**f+r);return(Math.round(y)/10**f).toFixed(f)},u=(p,f,y)=>{if((c.length===0||!s.colonNotation)&&p===0&&!(s.colonNotation&&f==="minute"))return;const{long:b}=a[f]||t("en_US")[f],{short:j}=a[f]||t("en_US")[f];let S=(y||p||"0").toString(),E,g;if(s.colonNotation){E=c.length>0?":":"",g="";const v=S.includes(".")?S.split(".")[0].length:S.length,I=c.length>0?2:1;S="0".repeat(Math.max(0,I-v))+S}else E="",s.locale==="zh_CN"?Object.values(d).filter(v=>v>0).length>1?!d.days&&!d.hours&&d.minutes&&s.compact?g=b:g=j:d.minutes?g=b:g=j:g=s.verbose?` ${n(b,p)}`:j;c.push(E+S+g)},d=e(o);if(u(Math.trunc(d.days/365),"year"),u(d.days%365,"day"),u(d.hours,"hour"),u(d.minutes,"minute"),s.separateMilliseconds||s.formatSubMilliseconds||!s.colonNotation&&o<1e3)if(u(d.seconds,"second"),s.formatSubMilliseconds)u(d.milliseconds,"millisecond"),u(d.microseconds,"microsecond"),u(d.nanoseconds,"nanosecond");else{const p=d.milliseconds+d.microseconds/1e3+d.nanoseconds/1e6,f=typeof s.millisecondsDecimalDigits=="number"?s.millisecondsDecimalDigits:0,y=p>=1?Math.round(p):Math.ceil(p),b=f?p.toFixed(f):y;u(Number.parseFloat(b,10),"millisecond",b)}else{const p=o/1e3%60,f=typeof s.secondsDecimalDigits=="number"?s.secondsDecimalDigits:1,y=l(p,f),b=s.keepDecimalsOnWholeSeconds?y:y.replace(/\.0+$/,"");u(Number.parseFloat(b,10),"second",b)}if(c.length===0){const p=(a.millisecond||t("en_US").millisecond).long,f=(a.millisecond||t("en_US").millisecond).short;return s.locale==="zh_CN"?`0${s.verbose?`${p}`:f}`:`0${s.verbose?` ${p}s`:f}`}if(s.compact)return c[0];if(typeof s.unitCount=="number"){const p=s.colonNotation?"":" ";return c.slice(0,Math.max(s.unitCount,1)).join(p)}return s.colonNotation?c.join(""):c.join(" ")},st}var it,cn;function Zi(){if(cn)return it;cn=1;const e=qi(),t=Ki(),{registerLang:n}=fo(),r=Qi();return n("en_US",e),n("zh_CN",t),r.registerLang=n,it=r,it}var Xi=Zi();const po=rr(Xi);function Z({children:e}){return oe(n=>n.breakpoints.down("md"))?i.jsx(me,{enterDelay:500,leaveDelay:2e3,title:typeof e=="string"?e:"",children:i.jsx(_,{sx:{display:"flex",alignItems:"center",gap:1},children:i.jsx(Ot,{fontSize:"small"})})}):i.jsxs(_,{sx:{display:"flex",alignItems:"center",gap:1},children:[i.jsx(Ot,{fontSize:"small"}),e]})}Z.propTypes={children:x.node.isRequired};const Ji="https://launcher.arcblock.io/",Yi=30*24*60*60*1e3;function mo({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:r="",retention:o=0,sx:s={},...a}){const{t:c,locale:l}=U(),u=Ve(),[d,p]=In({safeIframeRef:null,popoverAnchorEl:null}),f=h.useRef(null),y=ge(),b=oe(m=>m.breakpoints.down("md")),j=b?"mobile":"desktop",S=kn(async()=>{const[m,k]=await Promise.all([u.api.getLauncherSession({input:{launcherSessionId:r,launcherUrl:e}}),yn({launcherUrl:e||Ji,nftDid:n,launcherSessionId:r,locale:l,theme:y.palette.mode})]);if(m?.error)throw new Error(m.error);return{launcherSession:m.launcherSession,subscriptionURL:k}},[l]);if(S.loading)return i.jsx(ee,{label:i.jsxs(Z,{children:[!b&&c("expiration.desktop.loading"),i.jsx(H,{size:16})]}),variant:"success",sx:{cursor:"pointer",...s},...a,retention:o});if(S.error)return console.error(S.error),i.jsx(ee,{label:i.jsx(Z,{children:c(`expiration.${j}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...s},...a,retention:o,onClick:()=>S.retry()});const E=m=>{p({popoverAnchorEl:m.currentTarget})},g=()=>{p({popoverAnchorEl:null})},v=S.value?.launcherSession;let I="success";[A.LAUNCH_SESSION_STATUS.overdue,A.LAUNCH_SESSION_STATUS.canceled,A.LAUNCH_SESSION_STATUS.terminated].includes(S.value?.launcherSession?.status)&&(I="error");let C=null;if(v.expirationDate&&!v.subscription){const m=ie(v.expirationDate).diff(ie(),"ms");C=c(`expiration.${j}.tips.${I}`,{validity:po(m,{locale:vn(l),compact:!0,verbose:!0})}),m>0&&m<=Yi&&(I="warning")}return i.jsxs(i.Fragment,{children:[i.jsx(ee,{label:i.jsx(Z,{children:C||v?.subscription?.product?.name||c("common.subscription")}),color:I,variant:I!=="success"?"contained":"outlined",sx:{cursor:"pointer",...s},...a,retention:o,onClick:E}),i.jsx(hn,{id:"popover-info",open:!!d.popoverAnchorEl,anchorEl:d.popoverAnchorEl,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},sx:{"& .MuiPopover-paper":{minHeight:0}},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(_,{sx:{width:{xs:"360px",md:"450px"},display:"flex",flexDirection:"column"},children:i.jsx("iframe",{ref:f,title:c("common.subscription"),width:"100%",height:"600px",style:{border:0,maxHeight:"800px"},src:S.value?.subscriptionURL})})})]})}mo.propTypes={chainHost:x.string.isRequired,nftId:x.string,launcherSessionId:x.string,sx:x.object,retention:x.number,launcherUrl:x.string.isRequired};const ea=30*24*60*60*1e3,ta="https://launcher.arcblock.io/";function ho({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:r="",sx:o={},retention:s=0,...a}){const{t:c,locale:l}=U(),[u,d]=In({safeIframeRef:null,popoverAnchorEl:null}),p=h.useRef(null),f=oe(m=>m.breakpoints.down("md")),y=Ve(),b=f?"mobile":"desktop",j=kn(async()=>{const[m,k]=await Promise.all([y.api.getLauncherSession({input:{launcherSessionId:r||n,launcherUrl:e}}),yn({launcherUrl:e||ta,nftDid:n,launcherSessionId:r,locale:l})]);if(m?.error)throw new Error(m.error);return{launcherSession:m.launcherSession,subscriptionURL:k}},[l]);if(j.loading)return i.jsx(ee,{label:i.jsxs(Z,{children:[!f&&c("expiration.desktop.loading"),i.jsx(H,{size:16})]}),variant:"success",sx:{cursor:"pointer",...o},...a,retention:s});if(j.error)return console.error(j.error),i.jsx(ee,{label:i.jsx(Z,{children:c(`expiration.${b}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...o},...a,retention:s,onClick:()=>j.retry()});const S=j.value?.launcherSession?.expirationDate,E=ie(S).isBefore(ie()),g=ie(S).diff(ie(),"ms");let v="success";g<=ea&&(v="warning"),E&&(v="error");const I=m=>{d({popoverAnchorEl:m.currentTarget})},C=()=>{d({popoverAnchorEl:null})};return i.jsxs(i.Fragment,{children:[j.value?.launcherSession?.subscription&&i.jsx(ee,{label:i.jsx(Z,{children:c("expiration.desktop.nextInvoice",{date:fr(S,l)})}),color:"success",variant:"outlined",sx:{cursor:"pointer",...o},...a,retention:s,onClick:I}),!j.value?.launcherSession?.subscription&&i.jsx(ee,{label:i.jsx(Z,{children:c(`expiration.${b}.tips.${v}`,{validity:po(g,{locale:vn(l),compact:!0,verbose:!0})})}),color:v,variant:v!=="success"?"contained":"outlined",sx:{cursor:"pointer",...o},...a,retention:s,onClick:I}),i.jsx(hn,{id:"popover-info",open:!!u.popoverAnchorEl,anchorEl:u.popoverAnchorEl,onClose:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(_,{sx:{width:{xs:"360px",md:"450px"}},children:i.jsx("iframe",{ref:p,title:c("common.subscription"),width:"100%",height:"600px",style:{border:0},src:j.value?.subscriptionURL})})})]})}ho.propTypes={chainHost:x.string.isRequired,nftId:x.string,launcherSessionId:x.string,sx:x.object,retention:x.number,launcherUrl:x.string.isRequired};function go({meta:e={},fallbackUrl:t=Ze,invalidPathFallback:n=null,headerAddons:r=void 0,sessionManagerProps:o={showRole:!0,onLogout:()=>{window.location.href=Ze}},links:s=[],showDomainWarningDialog:a=!0,...c}){pr();const l=h.use(mr)?.session?.user,u=l?.role,{locale:d,defaultLocale:p}=U()||{},f=h.useMemo(()=>{const v=Object.assign({},window.blocklet,e);try{return hr(v)}catch(I){return console.error("Failed to format blocklet info",I,v),v}},[e]),{localizedNav:y,flattened:b,matchedIndex:j}=h.useMemo(()=>{let v=gr({navigation:f?.navigation?.dashboard,locale:d,defaultLocale:p})||[];v=br(v,u),v=xr(v,m=>{let k=null;return m.icon&&(m.icon.startsWith("http")||m.icon.startsWith("data:")?k=i.jsx(dn,{src:m.icon}):k=i.jsx("iconify-icon",{height:"100%",width:"100%",icon:m.icon})),{id:m.id,title:m.title,url:m.link,icon:k,external:!0,children:m.items}},"items");const I=yr(v).filter(m=>!!m.url),C=vr(I.map(m=>m.url));return C!==-1&&(I[C].active=!0),{localizedNav:v,flattened:I,matchedIndex:C}},[f,d,p,u]),S=typeof s=="function"?s(y):[...y,...s],E=wr({meta:e});if(h.useLayoutEffect(()=>{l&&!b?.length&&t&&(window.location.href=t)},[t]),h.useLayoutEffect(()=>{l&&b?.length&&j===-1&&n&&n()},[n,b,j]),!f.appName)return null;const{appName:g}=f;return i.jsx(Xr,{title:g,fullWidth:!0,sidebarWidth:128,legacy:!1,links:S,...c,headerProps:{homeLink:Ze,logo:i.jsx("img",{src:E,alt:"logo"}),addons:i.jsx(Sr,{formattedBlocklet:f,addons:r,sessionManagerProps:o,showDomainWarningDialog:a}),...c.headerProps}})}go.propTypes={meta:Cr,fallbackUrl:x.string,invalidPathFallback:x.func,headerAddons:x.oneOfType([x.func,x.node]),sessionManagerProps:jr,links:x.oneOfType([x.array,x.func]),showDomainWarningDialog:x.bool};const na={width:24,height:24,body:'<path fill="currentColor" d="M6.4 18L5 16.6L14.6 7H6V5h12v12h-2V8.4L6.4 18Z"/>'},oa="/.well-known/service/onboard/bind-account";function bo({onFinished:e=()=>{},show:t=!1,onChangeVisible:n=()=>{},loadingText:r="",defaultPath:o=oa,...s}){const[a,c]=h.useState(t),[l,u]=h.useState(!1),[d,p]=h.useState(()=>{const v=localStorage.getItem("wizard-current-url");return v?.includes("/.well-known/service/onboard")?v:o}),f=h.useRef(e),y=h.useRef(),b=h.useRef(null),{locale:j}=U(),S=ge(),E=oe(S.breakpoints.down("sm"));if(f.current=e,y.current=()=>{if(b.current?.contentWindow)try{const v=new URL(b.current.contentWindow.location.href).pathname;localStorage.setItem("wizard-current-url",v),p(v)}catch(v){p(o),console.warn("Failed to save wizard URL:",v)}localStorage.setItem("wizard-completed","true"),c(!1),n(!1)},h.useEffect(()=>{t!==a&&c(t)},[t]),h.useEffect(()=>{!a&&l&&u(!1)},[a]),h.useEffect(()=>{const v=I=>{if(I.origin!==window.location.origin)return;const{type:C,data:m}=I.data||{};switch(C){case"wizard.loaded":u(!0);break;case"wizard.finished":{c(!1),p(o),localStorage.removeItem("wizard-current-url"),localStorage.setItem("wizard-completed","true"),f.current?.(m);break}case"wizard.close":{y.current();break}}};return window.addEventListener("message",v),()=>{window.removeEventListener("message",v)}},[]),h.useEffect(()=>{localStorage.getItem("wizard-completed")||c(!0)},[]),!a)return null;const g=jn(X(window.location.origin,d),{locale:j});return i.jsxs(gn,{id:"wizard-dialog",open:a,onClose:()=>y.current(),fullWidth:!0,maxWidth:E?!1:"md",fullScreen:E,...s,slotProps:zr({},{paper:{sx:{margin:0,borderRadius:0,position:"relative",overflow:"hidden",...E?{borderRadius:0}:{borderRadius:1,height:"720px"}}}},s.slotProps),sx:{"& .MuiBackdrop-root":{backgroundColor:"rgba(0, 0, 0, 0.5)"},...s.sx},children:[i.jsx("iframe",{ref:b,id:"wizard-iframe",src:g,title:"Setup Wizard",style:{width:"100%",height:"100%",border:0,padding:0,margin:0,opacity:l?1:0,transition:"opacity 0.3s ease-in-out"},onLoad:()=>u(!0)}),l?null:i.jsx(_,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",bgcolor:"background.paper"},children:i.jsxs(_,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:1},children:[i.jsx(H,{}),typeof r=="string"?i.jsx(Q,{variant:"body1",children:r}):r]})})]})}bo.propTypes={onFinished:x.func,show:x.bool,onChangeVisible:x.func,loadingText:x.node,defaultPath:x.string,...gn.propTypes};const ra={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 21L21 6l-3-3L3 18l3 3m9-15l3 3M9 3a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2m10 10a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2"/>'};function sa(){const{session:e}=wn(),[t,n]=h.useState(!1),[r,o]=h.useState(!1),{t:s}=U(),a=h.useMemo(()=>!!localStorage.getItem("wizard-finished"),[]);return h.useMemo(()=>e.user?.role&&Sn.includes(e.user.role),[e])?i.jsxs(i.Fragment,{children:[i.jsx(me,{title:s("setup.wizardTooltip"),open:t,placement:"bottom",arrow:!0,children:i.jsx(Be,{size:"small",onClick:()=>{o(!0),n(!1)},sx:{display:{xs:"none",md:"flex"},color:"text.secondary",...t&&{backgroundColor:"action.hover","@keyframes pulse":{"0%":{opacity:.8},"50%":{opacity:.5},"100%":{opacity:.8}},animation:"pulse 2s infinite"}},children:i.jsx(wt,{icon:ra,height:20})})},`wizard-toggle-${t}`),i.jsx(bo,{show:r,loadingText:i.jsxs(_,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1,mt:2,maxWidth:"80vw"},children:[i.jsx(Pt,{variant:"h4",sx:{fontWeight:"bold"},children:s("setup.wizardLoading")}),!a&&i.jsx(Pt,{variant:"body2",sx:{textAlign:"center"},children:s("setup.wizardSubTitle")})]}),slotProps:{paper:{sx:{height:{xs:"100vh",md:"750px"}}}},onChangeVisible:l=>{o(l),!l&&r&&n(!0)},onClose:void 0,onFinished:()=>{o(!1),n(!1)}},"wizard-modal")]}):null}function ia(){const{inFullPage:e,toggleFullPage:t}=Jr();return T(Be,{onClick:t,children:e?T(tr,{sx:{transform:"scale(1.3)"}}):T(nr,{sx:{transform:"scale(1.3)"}})})}function xo({children:e=null,title:t=""}){const{t:n}=U(),{loading:r,error:o,actions:{refreshBlocklet:s},env:a,blocklet:c}=be(),{info:l,imgPrefix:u}=kr(),d=sr(),p=oe(I=>I.breakpoints.down("md")),f=ge(),{appId:y,version:b}=a,j=[{label:"App ID",value:y},{label:"App Version",value:b},{label:"App Bundle Name",value:c?.meta?.bundleName},{label:"Server Id",value:l.did},{label:"Server Version",value:l.version}],S=I=>{const C=Array.isArray(I)?I:[I];if(C.unshift(T(sa,{})),p||C.unshift(T(ia,{})),c){const m={cursor:"pointer",marginRight:{xs:"8px",md:"48px"}};Er(c)?C.unshift(T(mo,{chainHost:c?.controller?.chainHost,nftId:c?.controller?.nftId,launcherSessionId:c?.controller?.launcherSessionId,launcherUrl:c?.controller?.launcherUrl,sx:m})):l.ownerNft&&l.launcher&&C.unshift(T(ho,{chainHost:l.launcher.chainHost,launcherUrl:l.launcher.url,nftId:l.ownerNft.did,launcherSessionId:l.ownerNft.launcherSessionId,sx:m}))}return C},E=Kr({blocklet:c}),g={logo:E?T("img",{src:E,alt:"logo"}):null,brandAddon:T(_,{children:c&&Ee(_,{component:"a",target:"_blank",href:window.blocklet.appUrl,rel:"noopener noreferrer",title:window.blocklet.appName,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,py:.5,px:2,border:"1px solid",borderColor:"text.disabled",borderRadius:"30px",cursor:"pointer"},children:[T(me,{title:R.isRunning(c?.status)?void 0:n(`blocklet.status.${c?.status}`),children:T(_,{sx:{bgcolor:Pe[c?.status],width:8,height:8,borderRadius:"50%"}})}),T(_,{sx:{color:"text.secondary",maxWidth:p?66:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R.getDisplayName(c)}),T(_,{component:wt,icon:na,sx:{color:"text.secondary"}})]})})};return Ee(aa,{legacy:!1,fullWidth:!0,headerAddons:S,headerProps:g,links:I=>I?.map(m=>(m.children=m.children?.map(k=>{if(k.id==="/team/aigne"){const O=u?X(u,"/aigne-hub.png"):"/aigne-hub.pg";return{...k,icon:T(dn,{src:O,alt:"AIGNE Hub",style:f.palette.mode==="dark"?{filter:"invert(1)"}:{},fallback:k.icon})}}return k}),m)),title:t,footerProps:{addon:T(uo,{infos:j})},children:[!c&&r&&T(Re,{relative:"parent",children:T(H,{})}),!c&&o&&Ee(Re,{relative:"parent",children:[Ee(_,{sx:{display:"flex",alignItems:"center"},children:[T(er,{color:"error",sx:{marginRight:1}}),jt(o)]}),T(St,{onClick:()=>s(),children:T("span",{style:{textDecoration:"underline"},children:n("common.retry")})})]}),!!c&&T(_,{sx:{flex:1,padding:p?2:3,display:"flex",flexDirection:"column"},children:T(Do,{FallbackComponent:Ir,resetKeys:[d.pathname],children:e})})]})}xo.propTypes={children:x.any,title:x.string};const aa=$e(go)`
|
|
53
|
+
div.dashboard-content {
|
|
54
|
+
padding: 0;
|
|
55
|
+
}
|
|
56
|
+
.header-addons .locales {
|
|
57
|
+
max-height: 400px;
|
|
58
|
+
overflow-y: auto;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.header-brand-addon {
|
|
62
|
+
display: block;
|
|
63
|
+
}
|
|
64
|
+
`;function ca(){const{t:e,locale:t}=U(),{blocklet:n,launcherSession:r,refreshSubscription:o}=be(),{connectApi:s,session:a,api:c}=wn(),[l,u]=h.useState(!1),[d,p]=h.useState(""),[f,y]=Vr({subscriptionURL:"#"});if(h.useEffect(()=>{(Ut(n,r)||Bt(r))&&_r({launcherSessionId:n?.controller?.launcherSessionId,launcherUrl:n?.controller?.launcherUrl,locale:t}).then(E=>{y({subscriptionURL:E})}).catch(E=>{console.error("get subscription url error:",E)})},[n,r]),h.useEffect(()=>{if(n.controller?.launcherUrl){const E=X(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(E).then(g=>g.json()).then(g=>{const v=g.componentMountPoints?.find(C=>C.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint,I=X(n.controller.launcherUrl,v);p(I)})}},[n.controller?.launcherUrl]),!n||!r)return"";let b=null,j="",S="error";return Lr(r)?(b=Tr(r)?i.jsx(Te,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):i.jsx(ct,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),j=e("blocklet.suspendedCausedByPastDue",{deadline:le(r?.reservedUntil,t)})):Bt(r)?(b=i.jsx(Te,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),j=e("blocklet.willBeSuspendedSoon",{deadline:le((r?.subscription?.cancel_at||0)*1e3,t)}),S="warning"):Ut(n,r)?(b=i.jsx(Te,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),j=e("blocklet.suspendedCausedByExpired",{deadline:le(r?.reservedUntil,t),canceledAt:le((r?.subscription?.canceled_at||0)*1e3,t)})):Dr(n,r)&&(b=i.jsx(bn,{to:X(A.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),j=e("blocklet.suspendedCausedByTerminated",{canceledAt:le(r?.terminatedAt,t),deadline:Ar(r?.terminatedAt,t)})),j?i.jsxs(i.Fragment,{children:[i.jsxs(ze,{severity:S,sx:{mb:1},children:[j,i.jsx(Q,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:b})]}),l&&d&&r&&i.jsx(Pr,{session:a,connect:s,baseUrl:d,authToken:r.subscription.authToken,children:i.jsx(Yr,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),o(),u(!1)}})})]}):null}function vt({sx:e={}}){const t=oe(n=>n.breakpoints.down("md"));return i.jsx(_,{sx:{mx:t?-2:-3,borderBottom:"1px solid",borderColor:"divider",mt:1.5,mb:1,...e}})}vt.propTypes={sx:x.object};function yo({name:e="",description:t=void 0,actions:n=void 0,tabs:r=[],currentTab:o="",onTabChange:s=()=>{}}){return i.jsxs(_,{sx:{mb:3},children:[i.jsxs(_,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[i.jsx(Q,{variant:"h2",children:e}),n&&i.jsx(_,{children:n})]}),t&&i.jsx(Q,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6,"& a":{color:"primary.main"},maxWidth:980},children:t}),r.length<=1&&i.jsx(vt,{}),r.length>1&&i.jsxs(i.Fragment,{children:[i.jsx(Ao,{tabs:r,current:o,onChange:s,scrollButtons:"auto",sx:{mt:.5}}),i.jsx(vt,{sx:{mt:0}})]})]})}yo.propTypes={name:x.string.isRequired,description:x.node,actions:x.node,tabs:x.array,currentTab:x.string,onTabChange:x.func};const la=h.lazy(()=>L(()=>import("./log-ljlYVvKz.js"),__vite__mapDeps([0,1]),import.meta.url)),ua=h.lazy(()=>L(()=>import("./index-CVVhDiqm.js"),__vite__mapDeps([0,1]),import.meta.url)),da=h.lazy(()=>L(()=>import("./index-BnLnviXD.js"),__vite__mapDeps([0,1]),import.meta.url)),fa=h.lazy(()=>L(()=>import("./index-SZPelu8V.js"),__vite__mapDeps([0,1,2]),import.meta.url)),pa=h.lazy(()=>L(()=>import("./overview-D4mRghWV.js"),__vite__mapDeps([0,1]),import.meta.url)),ma=h.lazy(()=>L(()=>import("./domains-C_hsR6kY.js"),__vite__mapDeps([0,1]),import.meta.url)),ha=h.lazy(()=>L(()=>import("./index-CVED_BmV.js"),__vite__mapDeps([0,1]),import.meta.url)),ga=h.lazy(()=>L(()=>import("./appearance-C1uh29fy.js"),__vite__mapDeps([0,1]),import.meta.url)),ba=h.lazy(()=>L(()=>import("./audit-logs-Dcdyar51.js"),__vite__mapDeps([0,1,2]),import.meta.url)),xa=h.lazy(()=>L(()=>import("./index-2T0bIXYn.js"),__vite__mapDeps([0,1]),import.meta.url)),ya=h.lazy(()=>L(()=>import("./config-navigation-2cI6Tcgp.js"),__vite__mapDeps([0,1]),import.meta.url)),va=h.lazy(()=>L(()=>import("./index-C_xi8Qiz.js"),__vite__mapDeps([0,1]),import.meta.url)),wa=h.lazy(()=>L(()=>import("./index-NecLGEW0.js"),__vite__mapDeps([0,1]),import.meta.url)),Sa=h.lazy(()=>L(()=>import("./security-BFYfTqZs.js"),__vite__mapDeps([0,1]),import.meta.url)),ja=h.lazy(()=>L(()=>import("./branding-CqhvExJP.js"),__vite__mapDeps([0,1]),import.meta.url)),Ca=h.lazy(()=>L(()=>import("./advanced-B94516o4.js"),__vite__mapDeps([0,1]),import.meta.url)),ka=h.lazy(()=>L(()=>import("./traffic-DGDO-5_X.js").then(e=>e.t),__vite__mapDeps([0,1]),import.meta.url)),Ia=h.lazy(()=>L(()=>import("./runtime-DI-5yi3_.js"),__vite__mapDeps([0,1]),import.meta.url)),Ea=h.lazy(()=>L(()=>import("./index-DlXYHnCm.js"),__vite__mapDeps([0,1]),import.meta.url)),_a=h.lazy(()=>L(()=>import("./list-BC0XcUGx.js"),__vite__mapDeps([0,1]),import.meta.url)),La=h.lazy(()=>L(()=>import("./index-DqGlhvi9.js"),__vite__mapDeps([0,1]),import.meta.url)),Ta=h.lazy(()=>L(()=>import("./config-Cj_KRqwi.js").then(e=>e.c),__vite__mapDeps([0,1]),import.meta.url)),Da=h.lazy(()=>L(()=>import("./index-Dke96m3s.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url)),Aa=h.lazy(()=>L(()=>import("./component-u6OazrP-.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),Pa=h.lazy(()=>L(()=>import("./index-D_0Kti8n.js"),__vite__mapDeps([0,1]),import.meta.url)),Ra=X(A.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),at=(e,t,n="en")=>{const r=e?.[t];return Fr(r)?r[n]||r.en:r},Ma=e=>{const{enqueueSnackbar:t}=un(),n=h.useCallback(r=>jn(Ra,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);Or(`${e}/${A.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const o=n(r),{severity:s,description:a}=r||{},c=["error","warning"].includes(s)||r.sticky;r.source==="system"&&t(a,{variant:s,autoHideDuration:c?null:5e3,anchorOrigin:{vertical:"top",horizontal:"center"},content:l=>i.jsx(gs,{viewAllUrl:o,keyId:l,notification:r,content:i.jsx(Qr,{notification:r,minimal:!0,rows:0})})})},[],"user")};function vo({blocklet:e,isAdmin:t}){return t?i.jsx(xa,{blocklet:e}):i.jsx(Ur,{status:403})}vo.propTypes={blocklet:x.object.isRequired,isAdmin:x.bool.isRequired};const Oa=e=>{const{t}=U(),{blocklet:n,actions:{refreshBlocklet:r},client:o,did:s}=be(),a=$(()=>$r(n,"settings.org.enabled",!1),[n]),c=n?.meta?.did,l=!n||Nr(n.status)?[]:R.getAppMissingConfigs(n);return{appConfigs:$(()=>({overview:{description:t("navigation.serviceApp.overview.description"),actions:n?i.jsx(ss,{className:"page-actions",hasPermission:!0,blocklet:n,onStart:()=>{},onComplete:({error:d}={})=>{d&&G.error(d.message)},variant:"group"}):null,tabs:[{label:t("common.overview"),value:"overview",render:pa},{label:i.jsx(or,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!l.length,children:t("common.components")}),labelText:t("common.components"),value:"components",render:Aa}]},"did-connect":{description:t("navigation.serviceApp.didConnect.description"),tabs:[{label:t("common.members"),value:"members",render:i.jsx(ua,{type:"blocklet",createPassportSvg:Ft})},a&&{label:t("common.orgs"),value:"orgs",render:i.jsx(Da,{editable:!1,mode:"dashboard",layout:"table"})},{label:t("team.member.passports"),value:"passports",render:i.jsx(ha,{createPassportSvg:Ft})},{label:t("common.setting"),value:"settings",render:i.jsx(wa,{orientation:"vertical"})},{label:t("common.security"),value:"security",render:i.jsx(Sa,{})},{label:t("oauth.client.tab"),value:"oauth",render:i.jsx(_a,{})}].filter(Boolean)},aigne:{description:i.jsx(_,{dangerouslySetInnerHTML:{__html:t("navigation.serviceApp.aigne.description",{url:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ"})}}),tabs:[{label:t("setup.aigne.config"),value:"aigne-config",render:i.jsx(_,{sx:{maxWidth:1536},children:i.jsx(Ta,{})})}]},website:{description:t("navigation.serviceApp.website.description"),tabs:[{label:t("common.domains"),value:"domains",render:ma},{label:t("common.branding"),value:"branding",render:i.jsx(ja,{blocklet:n,onUpdate:r})},{label:t("common.theming"),value:"theming",render:i.jsx(ga,{})},{label:t("common.navigation"),value:"navigation",render:ya}]},operations:{description:t("navigation.serviceApp.operations.description"),tabs:[e&&{label:t("common.notificationRecords"),value:"notifications",render:i.jsx(vo,{blocklet:n,isAdmin:e})},{label:t("common.analytics"),value:"analytics",render:i.jsx(ka,{client:o,did:s})},{label:t("common.auditLogs"),value:"audit-logs",render:i.jsx(ba,{scope:c,categories:["blocklet","team","security","certificates","gateway"]})},{label:t("common.advancedConfig"),value:"advanced",render:i.jsx(Ca,{blocklet:n,onUpdate:r})}].filter(Boolean)},integrations:{description:t("navigation.serviceApp.integrations.description"),tabs:[e&&{label:"Webhooks",value:"webhooks",render:i.jsx(da,{})},{label:t("common.accessKeys"),value:"access-keys",render:i.jsx(Ea,{})},{label:t("common.mcpServers"),value:"mcp-servers",render:i.jsx(La,{})}].filter(Boolean)},developers:{description:t("navigation.serviceApp.developers.description"),tabs:[n?.children?.length&&n.structVersion===A.APP_STRUCT_VERSION&&{label:t("common.logs"),value:"logs",render:la},{label:t("common.performance"),value:"performance",render:i.jsx(Ia,{client:o,did:s})},{label:t("common.docs"),value:"docs",render:Pa}].filter(Boolean)},"did-spaces":{description:t("navigation.serviceApp.didSpaces.description"),tabs:[{label:t("common.backup"),value:"did-spaces",render:i.jsx(va,{navOrientation:"horizontal"})}]},publish:{description:t("navigation.serviceApp.publish.description"),tabs:[{label:t("common.blocklets"),value:"publish",render:i.jsx(fa,{})}]}}),[e,n,t,o,s,r])}};function Na(){const{t:e}=U(),t=xn(),{app:n="overview",tab:r}=ir(),{locale:o}=U(),{blocklet:s,refreshFlag:a}=be(),{session:c}=Cn(),l=$(()=>c?.user?.did,[c]),u=$(()=>c.user?.role&&Sn.includes(c.user.role),[c]);Ma(l);const{appConfigs:d}=Oa(u),p=C=>{t(`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${n}/${C}`)},f=$(()=>{const C=window.blocklet?.navigation?.find(W=>W.id==="/team"&&(Array.isArray(W.section)?W.section.includes("dashboard"):W.section==="dashboard")),m=X(A.WELLKNOWN_BLOCKLET_ADMIN_PATH,n==="overview"?"":n),k=C?.items?.find(W=>(at(W,"link",o)||"").startsWith(m)),O=at(k,"title",o)||"",B=at(k,"description",o)||"",M=d[n];return{name:O,description:B,...M}},[n,s,o,d]),{tabs:y=[]}=f,b=(y||[]).find(C=>C.value===r)?.value||y?.[0]?.value||n,S=y.find(C=>C.value===b)?.render||null,E=s?i.jsxs(_n,{type:"components",children:[f.name&&i.jsx(yo,{name:f.name,description:f.description,actions:f.actions,tabs:y,currentTab:b,onTabChange:p}),i.jsx(_,{className:"page-content",children:i.jsx(h.Suspense,{fallback:i.jsx(Re,{relative:"parent",children:i.jsx(H,{})}),children:h.isValidElement(S)?S:i.jsx(S,{blocklet:s})})})]}):i.jsx(Re,{relative:"parent",children:i.jsx(H,{})}),g=$(()=>{const C=y.find(B=>B.value===r),m=C?.labelText||C?.label||y?.[0]?.labelText||y?.[0]?.label||"",k=f.name||"";return[m,k].filter(Boolean).join(" - ")||""},[r,y,f]),v=$(()=>(s?.site?.domainAliases||[]).map(C=>C.value),[s]),I=$(()=>{if(!s)return!0;try{const C=s.configs?.find(k=>k.key==="BLOCKLET_APP_URL")?.value;if(!C||!v.length)return!0;const{host:m}=new URL(C);return v.some(k=>k===m)}catch{return!1}},[s,v]);return i.jsx(Mr,{children:i.jsx(Gr,{children:i.jsx(xo,{title:g,children:i.jsxs(Ba,{children:[!I&&i.jsx(ze,{severity:"warning",sx:{mb:2,py:2},action:i.jsxs(_,{sx:{display:"flex",gap:1,alignItems:"center"},children:[i.jsx(ct,{size:"small",onClick:()=>{t(`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/website/branding`)},children:e("invalidAppUrl.viewConfig")}),i.jsx(ct,{variant:"contained",size:"small",onClick:()=>{t(`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/website/domains`)},children:e("invalidAppUrl.viewDomains")})]}),children:e("invalidAppUrl.desc")}),i.jsx(cs,{}),i.jsx(ca,{}),E]})},`${a}`)})})}function Ua(){const{blocklet:e}=be(),t=e?.meta?.did;return h.useEffect(()=>{const n=Rr();return t&&n.connect(),()=>{t&&n.isConnected()&&n.disconnect()}},[t]),i.jsx(Na,{})}const Ba=$e.main`
|
|
65
|
+
.page-header {
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
align-items: center;
|
|
69
|
+
flex-wrap: wrap;
|
|
70
|
+
gap: 16px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.page-title {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
|
|
77
|
+
.page-link {
|
|
78
|
+
font-size: 15px;
|
|
79
|
+
margin-top: 8px;
|
|
80
|
+
margin-left: 8px;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
|
|
85
|
+
.page-header {
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
align-items: flex-start;
|
|
88
|
+
.page-actions,
|
|
89
|
+
.MuiButtonGroup-root {
|
|
90
|
+
width: 100%;
|
|
91
|
+
}
|
|
92
|
+
.MuiButtonGroup-root {
|
|
93
|
+
.MuiButtonBase-root {
|
|
94
|
+
flex: 1;
|
|
95
|
+
}
|
|
96
|
+
.blocklet-action-text {
|
|
97
|
+
display: none;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.page-title {
|
|
103
|
+
margin-bottom: 15px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`,sc=Object.freeze(Object.defineProperty({__proto__:null,default:Ua},Symbol.toStringTag,{value:"Module"}));export{Wi as B,go as G,lo as W,Y as b,sc as d,tn as m,po as p,rc as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,ak as o,aX as h,T as j,z as g,W as i}from"./vendor-mui-core-BPQ6AEW_.js";import{V as _}from"./vendor-ux-r9bApERu.js";import{C as b}from"./click-to-copy-BuSTGPjJ.js";import{C as k}from"./confirm-
|
|
1
|
+
import{j as e,ak as o,aX as h,T as j,z as g,W as i}from"./vendor-mui-core-BPQ6AEW_.js";import{V as _}from"./vendor-ux-r9bApERu.js";import{C as b}from"./click-to-copy-BuSTGPjJ.js";import{C as k}from"./confirm-F2_i30bc.js";function R({title:c,description:l,confirmPlaceholder:m,cancel:d="",confirm:u="Confirm",params:p={},onCancel:f=()=>{},onConfirm:C,keyName:t}){const{t:a}=_(),n={title:()=>e.jsx(o,{children:c}),description:(s,y)=>{const x=r=>{y({...r,__disableConfirm:r.__disableConfirm})};return e.jsxs(o,{children:[e.jsx(h,{severity:"warning",style:{width:"100%"},children:a("common.notice")}),e.jsx(o,{sx:{my:3,b:{wordBreak:"break-word"}},dangerouslySetInnerHTML:{__html:l}}),e.jsxs(o,{style:{marginBottom:24},children:[a("common.click"),":",e.jsx(b,{"data-cy":"click-copy",children:t})]}),e.jsx(j,{component:"div",children:e.jsx(g,{label:m,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:s.inputVal,onChange:r=>{x({...s,inputVal:r.target.value,__disableConfirm:t!==r.target.value})}})})]})},confirm:u,cancel:d,onConfirm:C,onCancel:f,params:{inputVal:"",__disableConfirm:!0,...p}};return e.jsx(k,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})}R.propTypes={title:i.any.isRequired,keyName:i.any.isRequired,description:i.any.isRequired,confirmPlaceholder:i.any.isRequired,cancel:i.string,confirm:i.string,params:i.object,onCancel:i.func,onConfirm:i.func.isRequired};export{R as D};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o,ak as i,at as g,W as u}from"./vendor-mui-core-BPQ6AEW_.js";import{l as v,e as C,ad as b,d as B}from"./index-
|
|
1
|
+
import{j as o,ak as i,at as g,W as u}from"./vendor-mui-core-BPQ6AEW_.js";import{l as v,e as C,ad as b,d as B}from"./index-DQt_6j3C.js";import{D as E,a as I,b as w}from"./domain-action-card-BdWmmq7M.js";import{p as T}from"./vendor-ux-r9bApERu.js";import{a as W}from"./page-header-BkgoSN-0.js";import{r,u as A}from"./vendor-react-CUXIiAnY.js";import{u as L}from"./useSetState-cWrp7qoX.js";import{S as x}from"./button-DqhIB3De.js";import{S as $}from"./layout-CbkYBUG0.js";import{S as z}from"./step-actions-gJEftNli.js";import"./vendor-arcblock-D8WYBDYe.js";import"./vendor-utils-BgSaqjGx.js";import"./vendor-hooks-PN9SWiQm.js";import"./permission-DVlrf60Y.js";import"./session-SqadLMEY.js";import"./useAsyncRetry-LJm0Fhbe.js";import"./useAsync-BCC9JxQR.js";import"./confirm-F2_i30bc.js";import"./index-DBs9Ljax.js";import"./actions-DhSvOHy-.js";import"./delete-confirm-DBhiUq1r.js";import"./click-to-copy-BuSTGPjJ.js";import"./useAsync-P_Velqz1.js";import"./index-ySP_m_Ux.js";import"./util-BQmjsgsT.js";import"./engine-C3zb9k-C.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-B-2tfq3i.js";import"./use-mobile-C5RjvO7g.js";function h({onNext:a=()=>{},onPrevious:f=()=>{}}){const{t:n}=r.useContext(T),[D,d]=r.useState(!1),{blocklet:e}=v(),[p,S]=r.useState(""),j=((e?.site||{}).domainAliases||[]).map(t=>C.replaceSlotToIp(t.value,p)),[s,m]=L({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),c=e.environments?.find(t=>t.key==="BLOCKLET_APP_PK")?.value,y=j.find(t=>b.isDidDomain(t)),[l,P]=A();return r.useEffect(()=>{B.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{S(t.address||"")}).catch(t=>{console.error(t.message)})},[]),o.jsxs(H,{children:[o.jsx(i,{className:"header",children:o.jsx(W,{title:n("setup.domain.title"),subTitle:n("setup.domain.subTitle"),onClickBack:f})}),o.jsxs(i,{className:"form form-container",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[o.jsxs(i,{children:[o.jsx(i,{sx:{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem"},children:o.jsx(i,{sx:{display:"inline"},children:`${n("setup.domain.buyOrConnect")} (${n("common.optional")})`})}),o.jsx(i,{sx:{mt:1},children:o.jsx(I,{blocklet:e,bugDidDomainProps:{appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,inBlockletSetup:!0},connectDomainProps:{autoFocus:!1,appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,cnameDomain:y,currentIp:p,inBlockletSetup:!0,shouldCheckDomain:!0,onInputDomain:t=>{m({domain:t.domain,type:t.type}),d(t.error)},onStateChange:t=>m({addDomainState:t}),onSuccess:t=>{const k={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};l.set("redirect",t.domain),P(l,{replace:!0}),m(k),a()},onError:d}})})]}),o.jsx(i,{children:o.jsx(w,{inSetup:!0,showAllDomains:!0,systemTips:o.jsx(i,{sx:{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",mb:1},children:o.jsx(i,{sx:{display:"inline"},children:n("setup.domain.skipDescription")})})})})]}),o.jsx(z,{mt:8,disabled:!!s.addDomainState.text,blocklet:e,onStartNow:()=>a("complete"),children:s.domain?o.jsx(x,{variant:"contained",loading:!!s.addDomainState.text,disabled:D||!!s.addDomainState.text||!s.domain,onClick:()=>a(),children:s.addDomainState.text||n("setup.continue")}):o.jsx(x,{variant:"contained",disabled:!!s.addDomainState.text,onClick:()=>a(),children:n("setup.continue")})})]})}function ht(a){return o.jsx(E,{children:o.jsx(h,{...a})})}h.propTypes={onNext:u.func,onPrevious:u.func};const H=g($)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: hidden;
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aC as bn,T as vn,V as A,b as Cn,H as E,n as te,i as wn,S as ze}from"./vendor-ux-r9bApERu.js";import{j as e,cX as Ne,cY as Sn,ak as h,a6 as z,b0 as Rn,T as R,aX as ye,D as H,J as ie,am as L,aN as $e,W as t,bb as _e,M as Oe,aO as An,aP as kn,cZ as Tn,b7 as In,b9 as Pn,c_ as qn,c$ as En,b1 as W,P as We,cj as Ln,bh as Fn,at as Mn,a$ as Bn,cW as Un,d0 as zn,d1 as Nn,d2 as $n,d3 as Te,d4 as _,d5 as _n,z as On,n as Wn,bf as Hn,d6 as Vn,cb as Gn}from"./vendor-mui-core-BPQ6AEW_.js";import{C as ee,J as Xn,a as Yn,e as Zn,H as je,a5 as Jn,a6 as Kn,n as Y}from"./vendor-utils-BgSaqjGx.js";import{r as j,e as He,g as Qn}from"./vendor-react-CUXIiAnY.js";import{u as se}from"./useSetState-cWrp7qoX.js";import{l as et,k as nt,b as Z,m as tt,w as it}from"./vendor-hooks-PN9SWiQm.js";import{bj as Ve,V as Ge,bk as st,bl as Xe,_ as F,ac as oe,Y as Ie,a2 as ot,aS as Pe,bm as rt,B as at,ae as lt,bn as Ye,ad as fe,bo as Ze,bp as ct,bq as dt,br as mt,aX as ut,e as xe,bs as pt,bt as ft}from"./index-DXScybaX.js";import{w as Je}from"./permission-s1vfZfOB.js";import{u as xt,D as qe}from"./useAsyncRetry-LJm0Fhbe.js";import{C as re}from"./confirm-DQ4M1D6U.js";import{A as ht}from"./actions-DhSvOHy-.js";import{D as gt}from"./delete-confirm-CkOWa6dE.js";import{o as Ee}from"./vendor-arcblock-D8WYBDYe.js";import{u as Dt}from"./useAsync-P_Velqz1.js";import{f as N}from"./index-DBs9Ljax.js";import{v as yt}from"./index-ySP_m_Ux.js";import{g as jt,p as Le}from"./util-DPYbSMU0.js";import{C as bt}from"./click-to-copy-BuSTGPjJ.js";const vt=Ve({});vt.interceptors.request.use(n=>{const i=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=i||"",n.url=ee("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=bn()),n},n=>Promise.reject(n));const Ke=(...n)=>Ve(...n),Ct=(n,i)=>i?n?[n,...Array.isArray(i)?i:[i]]:i:n,wt=(n,{width:i=600,height:o=700,name:a="did-domain:popup"}={})=>{const s=window.screenX+(window.innerWidth-i)/2,r=window.screenY+(window.innerHeight-o)/2,u=[`left=${s}`,`top=${r}`,`width=${i}`,`height=${o}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",a,u.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Xn(n,{opener:window.location.origin}),l},St="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Qe=async n=>{if(!n||!n?.trim())return null;const i=Ke(),o=new URL(n);o.pathname="__blocklet__.js",o.searchParams.set("type","json");const{data:a}=await i.get(o.toString()),s=a?.componentMountPoints?.find(m=>m.did===St),r=new URL(n);r.pathname=s?.mountPoint;const u=r.toString(),l=ee(u,"/api");return{base:u,api:l}},Rt=Ge({embed:{iconTip:"Click to view subscription details"},buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),At=Ge({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),kt={zh:At,en:Rt},Tt=async({didDomainURL:n,delegatee:i,delegateePk:o})=>{const a=await Qe(n);if(!a)return null;const s=Ke({baseURL:a.api}),{data:r}=await s.post("/payment/session",{delegatee:i,delegateePk:o});return{sessionId:r.sessionId,baseURL:a.base}};function It({delegatee:n,delegateePk:i,didDomainURL:o,locale:a,title:s="",onSuccess:r=()=>{},...u}){const{t:l}=A(),[m,p]=et({currentState:1}),f=j.useRef(null),c=nt(async()=>{const d=await Tt({didDomainURL:o,delegatee:n,delegateePk:i});return d},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(d){console.error(d)}}),g=Z(d=>{d.data.type==="didDomain.success"&&(r?.({nftDid:d.data?.nftDid,domain:d.data?.domain,chainHost:d.data?.chainHost}),f.current?.close(),f.current=null,p({currentState:4}),setTimeout(()=>{p({currentState:8})},2e3))});tt(()=>{try{window.removeEventListener("message",g),f.current?.close(),f.current=null}catch(d){console.warn("Failed to close popup",d)}});const y=Z(()=>{p({currentState:1})}),x=Z(()=>{if(p({currentState:2}),!c.data){console.error("Failed to create session");return}b({sessionId:c.data.sessionId,baseURL:c.data.baseURL})}),b=Z(({sessionId:d,baseURL:w})=>{window.addEventListener("message",g);const C=new URL(w);C.searchParams.set("sessionId",d),C.searchParams.set("locale",a),C.searchParams.set("embed","1"),f.current=wt(C.toString());const q=setInterval(()=>{f.current?.closed&&(clearInterval(q),y())},1e3);return()=>clearInterval(q)});return e.jsxs(e.Fragment,{children:[e.jsx(Ne,{loading:c.loading,onClick:x,variant:"contained",startIcon:e.jsx(Sn,{}),...u,children:s||l("buy.button.title")}),e.jsxs(Cn,{fullWidth:!0,maxWidth:"xs",open:m.currentState>1&&m.currentState<8,onClose:y,children:[!c.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[m.currentState===2&&e.jsx(z,{size:50}),m.currentState===4&&e.jsx(Rn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(R,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(R,{children:l("buy.status.success")})]}),c.error&&e.jsx(ye,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}function Pt(n){return e.jsx(vn,{locale:n.locale,translations:kt,children:e.jsx(It,{...n})})}function qt({nftDid:n,didDomainURL:i,locale:o,sx:a={}}){const{t:s}=A(),[r,u]=se({safeIframeRef:null,popoverAnchorEl:null}),l=j.useRef(null),m=H(),p=ie(m.breakpoints.down("md")),f=x=>{u({popoverAnchorEl:x.currentTarget})},c=()=>{u({popoverAnchorEl:null})},g=it(async()=>{const x=await Qe(i);return x?x.base:null});if(!g.value)return null;if(g.loading)return e.jsx(z,{});const y=ee(g.value,`/embed/domain?nft-did=${n}&locale=${o}`);return e.jsxs(e.Fragment,{children:[e.jsx(L,{title:s("embed.iconTip"),children:e.jsx(h,{component:"img",src:ee(i,"/.well-known/service/blocklet/logo"),alt:"logo",onClick:f,sx:[{width:16,height:16},Ct({cursor:"pointer"},a)]})}),e.jsx($e,{id:"popover-info",open:!!r.popoverAnchorEl,anchorEl:r.popoverAnchorEl,onClose:c,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:s("common.subscription"),width:p?"320px":"400px",height:"350px",style:{border:0,display:"block"},src:y})})]})}const Et=n=>["waiting","creating","renewaling"].includes(n);function en({siteId:n,domain:i,onAdd:o=()=>{},children:a=null,did:s,issuing:r=!1,setIssuing:u=()=>{}}){const{t:l}=A(),[m,p]=j.useState(!1),{inService:f}=F(),[c,g]=j.useState(null),{api:y,ws:{useSubscription:x}}=F(),{mode:b,actions:{refreshDomainStatus:d}}=oe(),w=xt(async()=>{const{cert:T}=await y.findCertificateByDomain({input:{domain:i,did:s}});return T}),C=(T,S)=>{T.domain===i&&(u(!1),p(!1),f&&b!=="setup"&&(S==="success"?E.success(l("setup.domain.genCertSuccess",{domain:T.domain})):S==="error"&&E.error(l("setup.domain.genCertFailed",{domain:T.domain,message:T.message}))))};if(j.useEffect(()=>{w.loading||u(Et(w.value?.status))},[w.loading,w.value?.status,u]),x(Ie.BlockletEvents.certError,T=>C(T,"error")),x(Ie.BlockletEvents.certIssued,T=>{w.retry(),d(T.domain),C(T,"success")}),w.loading||w.value?.status==="normal")return"";const q=()=>{p(!1),g(null)},B=async()=>{p(!0);try{await y.issueLetsEncryptCert({input:{siteId:n,domain:i,did:s,inBlockletSetup:b==="setup"}}),o(),u(!0)}catch(T){console.error(T),u(!1)}finally{p(!1),g(null)}},M={title:l("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ye,{severity:"success",children:l("router.cert.genLetsEncryptCert.dnsTip")}),l("router.cert.genLetsEncryptCert.description")]}),confirm:l("common.confirm"),onConfirm:B,onCancel:q},U=T=>{T.stopPropagation(),g(M)};return e.jsxs(e.Fragment,{children:[r?e.jsx(L,{title:l("router.cert.issuing"),children:e.jsx(z,{size:13,style:{fontSize:"13px"}})}):a({loading:m,open:U}),c&&e.jsx(re,{color:"primary",title:c.title,description:c.description,confirm:c.confirm,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}en.propTypes={domain:t.string.isRequired,did:t.string.isRequired,siteId:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function nn({domain:n,domainStatus:i,did:o,onAdd:a=()=>{},children:s=null,issuing:r=!1,setIssuing:u=()=>{},...l}){return st(n)||!Xe(n)||Yn(i)||i?.isHttps?"":e.jsx(en,{...l,domain:n,did:o,onAdd:a,issuing:r,setIssuing:u,children:s})}nn.propTypes={domain:t.string.isRequired,domainStatus:t.shape({isHttps:t.bool}).isRequired,did:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function tn({id:n,domain:i,children:o=null,teamDid:a="",onDelete:s=null}){const{t:r}=A(),[u,l]=j.useState(!1),[m,p]=j.useState(null),{api:f}=F(),c=()=>{l(!1),p(null)},g=async()=>{l(!0);try{await f.deleteDomainAlias({input:{id:n,domainAlias:i,teamDid:a}}),s?.(),await ot(2e3)}catch(b){E.error(b.message)}finally{p(null),l(!1)}},y={keyName:i,title:r("router.domainAlias.delete.title"),description:r("router.domainAlias.delete.description",{domain:i}),confirmPlaceholder:r("router.domainAlias.delete.confirmPlaceholder",{domain:i}),confirm:r("common.delete"),onConfirm:g,onCancel:c},x=b=>{b.stopPropagation(),p(y)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({loading:u,open:x}):e.jsxs(te,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[u?e.jsx(z,{size:16}):e.jsx(_e,{style:{fontSize:16}}),r("common.delete")]}),m&&e.jsx(gt,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}tn.propTypes={id:t.string.isRequired,domain:t.string.isRequired,children:t.any,teamDid:t.string,onDelete:t.func};function sn({site:n,domain:i,blocklet:o,onDelete:a=()=>{}}){const{t:s}=A(),r=i.value===window.location.hostname;return e.jsx(ht,{"data-cy":"domain-actions",size:"large",actions:[({close:u})=>e.jsx(tn,{id:n.id,domain:i.value,teamDid:o?.meta?.did,onDelete:a,children:({open:l})=>e.jsx(L,{title:r?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Oe,{disabled:i.isProtected||r,dense:!0,onClick:m=>{u(),l(m)},"data-cy":"action-toggle-block",children:[e.jsx(An,{style:{minWidth:24,marginRight:8},children:e.jsx(_e,{})}),e.jsx(kn,{primary:s("common.delete")})]},"remove")})})})]})}sn.propTypes={site:t.object.isRequired,domain:t.object.isRequired,blocklet:t.object.isRequired,onDelete:t.func};const ae=t.shape({href:t.string,accessibility:t.shape({loading:t.bool,accessible:t.bool}),domainStatus:t.shape({isHttps:t.bool,matchedCert:t.object}),dns:t.shape({resolved:t.bool,ip:t.string})});function on({certificate:n={}}){const[i,o]=j.useState(null),a=F(),{t:s,locale:r}=A(),u=p=>{o(p.currentTarget)},l=()=>{o(null)},m=!!i;return e.jsxs(e.Fragment,{children:[e.jsx(Tn,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:u,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx($e,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(In,{children:e.jsxs(Pn,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${a.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(R,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(R,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(R,{component:"div",children:`${s("common.issuer")}: ${Zn(n,"issuer.commonName","")}`}),e.jsx(R,{component:"div",children:`${s("router.cert.issuedOn")}: ${Pe(n.validFrom,r)}`}),e.jsx(R,{component:"div",children:`${s("router.cert.expiryOn")}: ${Pe(n.validTo,r)}`})]})]})})})]})}on.propTypes={certificate:t.object};function ne({domain:n,filters:i=["domain","http"]}){const{t:o}=A(),{value:a,domainStatus:s}=n;if(!Xe(a))return null;let r=null,u=null;const{isHttps:l,matchedCert:m}=s,{dns:{ip:p,isDnsResolved:f,isCnameMatch:c}={}}=s,g=f&&c;rt(a)||(g||p==="127.0.0.1"?r=e.jsx(L,{title:o("router.domain.verify.ok"),children:e.jsx(qe,{color:"success"})}):r=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(qe,{color:"error"})})),g?l?u=e.jsx(on,{certificate:m}):u=e.jsx(L,{title:o("router.domain.https.bad"),children:e.jsx(qn,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})}):u=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(En,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const y=i.map(x=>x==="domain"?r:x==="http"?u:null);return j.createElement(j.Fragment,null,...y)}ne.propTypes={domain:ae.isRequired,filters:t.array};const Lt=Je(be,"mutate_blocklets"),Ft=Je(be,"",at);function pi(n){const{inService:i}=F(),{blocklet:o,loadingRuntimeInfo:a}=oe();let s=Lt;return i&&(s=Ft),e.jsx(s,{...n,blocklet:o,inService:i,loadingRuntimeInfo:a})}const Fe="nft-domain";function be({hasPermission:n=!1,blocklet:i,loadingRuntimeInfo:o=!1,inService:a=!1,showAllDomains:s=!1,updateBlockletDomainAliases:r=()=>{},systemTips:u=null}){const{t:l}=A(),m=ie(d=>d.breakpoints.down("md")),p=j.useMemo(()=>{let d=n;return lt(i)&&(d=d&&a),d},[n,a,i]),{site:f}=i,c=j.useMemo(()=>Ye(i.site?.domainAliases),[i.site?.domainAliases]),g=j.useMemo(()=>c.filter(d=>!fe.isCustomDomain(d.value)),[c]),y=j.useMemo(()=>c.filter(d=>fe.isCustomDomain(d.value)),[c]),x=j.useMemo(()=>y.filter(d=>d.type!==Fe),[y]),b=j.useMemo(()=>y.filter(d=>d.type===Fe),[y]);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{sx:{gap:3},children:[!!b.length&&e.jsx(Q,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:b,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!x.length&&e.jsx(Q,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:x,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!g.length&&e.jsxs(h,{children:[u,e.jsx(Q,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:g,hasMutatePermission:p,blocklet:i,site:f,mobile:m,updateBlockletDomainAliases:r})]})]}),!c.length&&(o?e.jsx(z,{size:16}):e.jsx(wn,{children:l("common.empty")}))]})}be.propTypes={hasPermission:t.bool,blocklet:t.object.isRequired,loadingRuntimeInfo:t.bool,inService:t.bool.isRequired,showAllDomains:t.bool,updateBlockletDomainAliases:t.func,systemTips:t.node};function J({children:n=null}){return e.jsx(h,{component:"span",sx:{verticalAlign:"bottom"},children:n})}J.propTypes={children:t.node};function he({domain:n,children:i,suffix:o=null,...a}){const{t:s,locale:r}=A(),u=H(),{href:l,accessibility:m,value:p}=n,f=j.useCallback(()=>e.jsx(ze,{content:je(p),locale:r,style:{marginLeft:"4px",color:u.palette.text.secondary,fontSize:"0.8em"}}),[p,r,u]);return!m||m.loading?e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),f(),e.jsx(J,{children:o}),e.jsx(L,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(z,{size:13,style:{fontSize:"13px"}})})})]}):m.accessible?e.jsxs(me,{component:"span",...a,children:[e.jsx(h,{component:"a",href:l,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})})}),f(),e.jsx(J,{children:o})]}):e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),!n.loading&&f(),e.jsx(J,{children:o})]})}he.propTypes={domain:ae.isRequired,children:t.any.isRequired,suffix:t.node};const me=Mn(h)`
|
|
1
|
+
import{aC as bn,T as vn,V as A,b as Cn,H as E,n as te,i as wn,S as ze}from"./vendor-ux-r9bApERu.js";import{j as e,cX as Ne,cY as Sn,ak as h,a6 as z,b0 as Rn,T as R,aX as ye,D as H,J as ie,am as L,aN as $e,W as t,bb as _e,M as Oe,aO as An,aP as kn,cZ as Tn,b7 as In,b9 as Pn,c_ as qn,c$ as En,b1 as W,P as We,cj as Ln,bh as Fn,at as Mn,a$ as Bn,cW as Un,d0 as zn,d1 as Nn,d2 as $n,d3 as Te,d4 as _,d5 as _n,z as On,n as Wn,bf as Hn,d6 as Vn,cb as Gn}from"./vendor-mui-core-BPQ6AEW_.js";import{C as ee,J as Xn,a as Yn,e as Zn,H as je,a5 as Jn,a6 as Kn,n as Y}from"./vendor-utils-BgSaqjGx.js";import{r as j,e as He,g as Qn}from"./vendor-react-CUXIiAnY.js";import{u as se}from"./useSetState-cWrp7qoX.js";import{l as et,k as nt,b as Z,m as tt,w as it}from"./vendor-hooks-PN9SWiQm.js";import{bj as Ve,V as Ge,bk as st,bl as Xe,_ as F,ac as oe,Y as Ie,a2 as ot,aS as Pe,bm as rt,B as at,ae as lt,bn as Ye,ad as fe,bo as Ze,bp as ct,bq as dt,br as mt,aX as ut,e as xe,bs as pt,bt as ft}from"./index-DQt_6j3C.js";import{w as Je}from"./permission-DVlrf60Y.js";import{u as xt,D as qe}from"./useAsyncRetry-LJm0Fhbe.js";import{C as re}from"./confirm-F2_i30bc.js";import{A as ht}from"./actions-DhSvOHy-.js";import{D as gt}from"./delete-confirm-DBhiUq1r.js";import{o as Ee}from"./vendor-arcblock-D8WYBDYe.js";import{u as Dt}from"./useAsync-P_Velqz1.js";import{f as N}from"./index-DBs9Ljax.js";import{v as yt}from"./index-ySP_m_Ux.js";import{g as jt,p as Le}from"./util-BQmjsgsT.js";import{C as bt}from"./click-to-copy-BuSTGPjJ.js";const vt=Ve({});vt.interceptors.request.use(n=>{const i=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=i||"",n.url=ee("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=bn()),n},n=>Promise.reject(n));const Ke=(...n)=>Ve(...n),Ct=(n,i)=>i?n?[n,...Array.isArray(i)?i:[i]]:i:n,wt=(n,{width:i=600,height:o=700,name:a="did-domain:popup"}={})=>{const s=window.screenX+(window.innerWidth-i)/2,r=window.screenY+(window.innerHeight-o)/2,u=[`left=${s}`,`top=${r}`,`width=${i}`,`height=${o}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",a,u.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Xn(n,{opener:window.location.origin}),l},St="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Qe=async n=>{if(!n||!n?.trim())return null;const i=Ke(),o=new URL(n);o.pathname="__blocklet__.js",o.searchParams.set("type","json");const{data:a}=await i.get(o.toString()),s=a?.componentMountPoints?.find(m=>m.did===St),r=new URL(n);r.pathname=s?.mountPoint;const u=r.toString(),l=ee(u,"/api");return{base:u,api:l}},Rt=Ge({embed:{iconTip:"Click to view subscription details"},buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),At=Ge({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),kt={zh:At,en:Rt},Tt=async({didDomainURL:n,delegatee:i,delegateePk:o})=>{const a=await Qe(n);if(!a)return null;const s=Ke({baseURL:a.api}),{data:r}=await s.post("/payment/session",{delegatee:i,delegateePk:o});return{sessionId:r.sessionId,baseURL:a.base}};function It({delegatee:n,delegateePk:i,didDomainURL:o,locale:a,title:s="",onSuccess:r=()=>{},...u}){const{t:l}=A(),[m,p]=et({currentState:1}),f=j.useRef(null),c=nt(async()=>{const d=await Tt({didDomainURL:o,delegatee:n,delegateePk:i});return d},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(d){console.error(d)}}),g=Z(d=>{d.data.type==="didDomain.success"&&(r?.({nftDid:d.data?.nftDid,domain:d.data?.domain,chainHost:d.data?.chainHost}),f.current?.close(),f.current=null,p({currentState:4}),setTimeout(()=>{p({currentState:8})},2e3))});tt(()=>{try{window.removeEventListener("message",g),f.current?.close(),f.current=null}catch(d){console.warn("Failed to close popup",d)}});const y=Z(()=>{p({currentState:1})}),x=Z(()=>{if(p({currentState:2}),!c.data){console.error("Failed to create session");return}b({sessionId:c.data.sessionId,baseURL:c.data.baseURL})}),b=Z(({sessionId:d,baseURL:w})=>{window.addEventListener("message",g);const C=new URL(w);C.searchParams.set("sessionId",d),C.searchParams.set("locale",a),C.searchParams.set("embed","1"),f.current=wt(C.toString());const q=setInterval(()=>{f.current?.closed&&(clearInterval(q),y())},1e3);return()=>clearInterval(q)});return e.jsxs(e.Fragment,{children:[e.jsx(Ne,{loading:c.loading,onClick:x,variant:"contained",startIcon:e.jsx(Sn,{}),...u,children:s||l("buy.button.title")}),e.jsxs(Cn,{fullWidth:!0,maxWidth:"xs",open:m.currentState>1&&m.currentState<8,onClose:y,children:[!c.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[m.currentState===2&&e.jsx(z,{size:50}),m.currentState===4&&e.jsx(Rn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(R,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(R,{children:l("buy.status.success")})]}),c.error&&e.jsx(ye,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}function Pt(n){return e.jsx(vn,{locale:n.locale,translations:kt,children:e.jsx(It,{...n})})}function qt({nftDid:n,didDomainURL:i,locale:o,sx:a={}}){const{t:s}=A(),[r,u]=se({safeIframeRef:null,popoverAnchorEl:null}),l=j.useRef(null),m=H(),p=ie(m.breakpoints.down("md")),f=x=>{u({popoverAnchorEl:x.currentTarget})},c=()=>{u({popoverAnchorEl:null})},g=it(async()=>{const x=await Qe(i);return x?x.base:null});if(!g.value)return null;if(g.loading)return e.jsx(z,{});const y=ee(g.value,`/embed/domain?nft-did=${n}&locale=${o}`);return e.jsxs(e.Fragment,{children:[e.jsx(L,{title:s("embed.iconTip"),children:e.jsx(h,{component:"img",src:ee(i,"/.well-known/service/blocklet/logo"),alt:"logo",onClick:f,sx:[{width:16,height:16},Ct({cursor:"pointer"},a)]})}),e.jsx($e,{id:"popover-info",open:!!r.popoverAnchorEl,anchorEl:r.popoverAnchorEl,onClose:c,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:s("common.subscription"),width:p?"320px":"400px",height:"350px",style:{border:0,display:"block"},src:y})})]})}const Et=n=>["waiting","creating","renewaling"].includes(n);function en({siteId:n,domain:i,onAdd:o=()=>{},children:a=null,did:s,issuing:r=!1,setIssuing:u=()=>{}}){const{t:l}=A(),[m,p]=j.useState(!1),{inService:f}=F(),[c,g]=j.useState(null),{api:y,ws:{useSubscription:x}}=F(),{mode:b,actions:{refreshDomainStatus:d}}=oe(),w=xt(async()=>{const{cert:T}=await y.findCertificateByDomain({input:{domain:i,did:s}});return T}),C=(T,S)=>{T.domain===i&&(u(!1),p(!1),f&&b!=="setup"&&(S==="success"?E.success(l("setup.domain.genCertSuccess",{domain:T.domain})):S==="error"&&E.error(l("setup.domain.genCertFailed",{domain:T.domain,message:T.message}))))};if(j.useEffect(()=>{w.loading||u(Et(w.value?.status))},[w.loading,w.value?.status,u]),x(Ie.BlockletEvents.certError,T=>C(T,"error")),x(Ie.BlockletEvents.certIssued,T=>{w.retry(),d(T.domain),C(T,"success")}),w.loading||w.value?.status==="normal")return"";const q=()=>{p(!1),g(null)},B=async()=>{p(!0);try{await y.issueLetsEncryptCert({input:{siteId:n,domain:i,did:s,inBlockletSetup:b==="setup"}}),o(),u(!0)}catch(T){console.error(T),u(!1)}finally{p(!1),g(null)}},M={title:l("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ye,{severity:"success",children:l("router.cert.genLetsEncryptCert.dnsTip")}),l("router.cert.genLetsEncryptCert.description")]}),confirm:l("common.confirm"),onConfirm:B,onCancel:q},U=T=>{T.stopPropagation(),g(M)};return e.jsxs(e.Fragment,{children:[r?e.jsx(L,{title:l("router.cert.issuing"),children:e.jsx(z,{size:13,style:{fontSize:"13px"}})}):a({loading:m,open:U}),c&&e.jsx(re,{color:"primary",title:c.title,description:c.description,confirm:c.confirm,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}en.propTypes={domain:t.string.isRequired,did:t.string.isRequired,siteId:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function nn({domain:n,domainStatus:i,did:o,onAdd:a=()=>{},children:s=null,issuing:r=!1,setIssuing:u=()=>{},...l}){return st(n)||!Xe(n)||Yn(i)||i?.isHttps?"":e.jsx(en,{...l,domain:n,did:o,onAdd:a,issuing:r,setIssuing:u,children:s})}nn.propTypes={domain:t.string.isRequired,domainStatus:t.shape({isHttps:t.bool}).isRequired,did:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function tn({id:n,domain:i,children:o=null,teamDid:a="",onDelete:s=null}){const{t:r}=A(),[u,l]=j.useState(!1),[m,p]=j.useState(null),{api:f}=F(),c=()=>{l(!1),p(null)},g=async()=>{l(!0);try{await f.deleteDomainAlias({input:{id:n,domainAlias:i,teamDid:a}}),s?.(),await ot(2e3)}catch(b){E.error(b.message)}finally{p(null),l(!1)}},y={keyName:i,title:r("router.domainAlias.delete.title"),description:r("router.domainAlias.delete.description",{domain:i}),confirmPlaceholder:r("router.domainAlias.delete.confirmPlaceholder",{domain:i}),confirm:r("common.delete"),onConfirm:g,onCancel:c},x=b=>{b.stopPropagation(),p(y)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({loading:u,open:x}):e.jsxs(te,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[u?e.jsx(z,{size:16}):e.jsx(_e,{style:{fontSize:16}}),r("common.delete")]}),m&&e.jsx(gt,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}tn.propTypes={id:t.string.isRequired,domain:t.string.isRequired,children:t.any,teamDid:t.string,onDelete:t.func};function sn({site:n,domain:i,blocklet:o,onDelete:a=()=>{}}){const{t:s}=A(),r=i.value===window.location.hostname;return e.jsx(ht,{"data-cy":"domain-actions",size:"large",actions:[({close:u})=>e.jsx(tn,{id:n.id,domain:i.value,teamDid:o?.meta?.did,onDelete:a,children:({open:l})=>e.jsx(L,{title:r?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Oe,{disabled:i.isProtected||r,dense:!0,onClick:m=>{u(),l(m)},"data-cy":"action-toggle-block",children:[e.jsx(An,{style:{minWidth:24,marginRight:8},children:e.jsx(_e,{})}),e.jsx(kn,{primary:s("common.delete")})]},"remove")})})})]})}sn.propTypes={site:t.object.isRequired,domain:t.object.isRequired,blocklet:t.object.isRequired,onDelete:t.func};const ae=t.shape({href:t.string,accessibility:t.shape({loading:t.bool,accessible:t.bool}),domainStatus:t.shape({isHttps:t.bool,matchedCert:t.object}),dns:t.shape({resolved:t.bool,ip:t.string})});function on({certificate:n={}}){const[i,o]=j.useState(null),a=F(),{t:s,locale:r}=A(),u=p=>{o(p.currentTarget)},l=()=>{o(null)},m=!!i;return e.jsxs(e.Fragment,{children:[e.jsx(Tn,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:u,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx($e,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(In,{children:e.jsxs(Pn,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${a.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(R,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(R,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(R,{component:"div",children:`${s("common.issuer")}: ${Zn(n,"issuer.commonName","")}`}),e.jsx(R,{component:"div",children:`${s("router.cert.issuedOn")}: ${Pe(n.validFrom,r)}`}),e.jsx(R,{component:"div",children:`${s("router.cert.expiryOn")}: ${Pe(n.validTo,r)}`})]})]})})})]})}on.propTypes={certificate:t.object};function ne({domain:n,filters:i=["domain","http"]}){const{t:o}=A(),{value:a,domainStatus:s}=n;if(!Xe(a))return null;let r=null,u=null;const{isHttps:l,matchedCert:m}=s,{dns:{ip:p,isDnsResolved:f,isCnameMatch:c}={}}=s,g=f&&c;rt(a)||(g||p==="127.0.0.1"?r=e.jsx(L,{title:o("router.domain.verify.ok"),children:e.jsx(qe,{color:"success"})}):r=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(qe,{color:"error"})})),g?l?u=e.jsx(on,{certificate:m}):u=e.jsx(L,{title:o("router.domain.https.bad"),children:e.jsx(qn,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})}):u=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(En,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const y=i.map(x=>x==="domain"?r:x==="http"?u:null);return j.createElement(j.Fragment,null,...y)}ne.propTypes={domain:ae.isRequired,filters:t.array};const Lt=Je(be,"mutate_blocklets"),Ft=Je(be,"",at);function pi(n){const{inService:i}=F(),{blocklet:o,loadingRuntimeInfo:a}=oe();let s=Lt;return i&&(s=Ft),e.jsx(s,{...n,blocklet:o,inService:i,loadingRuntimeInfo:a})}const Fe="nft-domain";function be({hasPermission:n=!1,blocklet:i,loadingRuntimeInfo:o=!1,inService:a=!1,showAllDomains:s=!1,updateBlockletDomainAliases:r=()=>{},systemTips:u=null}){const{t:l}=A(),m=ie(d=>d.breakpoints.down("md")),p=j.useMemo(()=>{let d=n;return lt(i)&&(d=d&&a),d},[n,a,i]),{site:f}=i,c=j.useMemo(()=>Ye(i.site?.domainAliases),[i.site?.domainAliases]),g=j.useMemo(()=>c.filter(d=>!fe.isCustomDomain(d.value)),[c]),y=j.useMemo(()=>c.filter(d=>fe.isCustomDomain(d.value)),[c]),x=j.useMemo(()=>y.filter(d=>d.type!==Fe),[y]),b=j.useMemo(()=>y.filter(d=>d.type===Fe),[y]);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{sx:{gap:3},children:[!!b.length&&e.jsx(Q,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:b,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!x.length&&e.jsx(Q,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:x,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!g.length&&e.jsxs(h,{children:[u,e.jsx(Q,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:g,hasMutatePermission:p,blocklet:i,site:f,mobile:m,updateBlockletDomainAliases:r})]})]}),!c.length&&(o?e.jsx(z,{size:16}):e.jsx(wn,{children:l("common.empty")}))]})}be.propTypes={hasPermission:t.bool,blocklet:t.object.isRequired,loadingRuntimeInfo:t.bool,inService:t.bool.isRequired,showAllDomains:t.bool,updateBlockletDomainAliases:t.func,systemTips:t.node};function J({children:n=null}){return e.jsx(h,{component:"span",sx:{verticalAlign:"bottom"},children:n})}J.propTypes={children:t.node};function he({domain:n,children:i,suffix:o=null,...a}){const{t:s,locale:r}=A(),u=H(),{href:l,accessibility:m,value:p}=n,f=j.useCallback(()=>e.jsx(ze,{content:je(p),locale:r,style:{marginLeft:"4px",color:u.palette.text.secondary,fontSize:"0.8em"}}),[p,r,u]);return!m||m.loading?e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),f(),e.jsx(J,{children:o}),e.jsx(L,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(z,{size:13,style:{fontSize:"13px"}})})})]}):m.accessible?e.jsxs(me,{component:"span",...a,children:[e.jsx(h,{component:"a",href:l,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})})}),f(),e.jsx(J,{children:o})]}):e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),!n.loading&&f(),e.jsx(J,{children:o})]})}he.propTypes={domain:ae.isRequired,children:t.any.isRequired,suffix:t.node};const me=Mn(h)`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
vertical-align: middle;
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m}from"./vendor-react-CUXIiAnY.js";import{V as n}from"./vendor-ux-r9bApERu.js";import{ac as p,_ as l,ae as c,e as u}from"./index-
|
|
1
|
+
import{r as m}from"./vendor-react-CUXIiAnY.js";import{V as n}from"./vendor-ux-r9bApERu.js";import{ac as p,_ as l,ae as c,e as u}from"./index-DQt_6j3C.js";import{a as x,b as d}from"./domain-action-card-BdWmmq7M.js";import{j as t,ak as k,b1 as f,aX as h}from"./vendor-mui-core-BPQ6AEW_.js";import"./vendor-utils-BgSaqjGx.js";import"./vendor-hooks-PN9SWiQm.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D8WYBDYe.js";import"./useSetState-cWrp7qoX.js";import"./permission-DVlrf60Y.js";import"./session-SqadLMEY.js";import"./useAsyncRetry-LJm0Fhbe.js";import"./useAsync-BCC9JxQR.js";import"./confirm-F2_i30bc.js";import"./index-DBs9Ljax.js";import"./actions-DhSvOHy-.js";import"./delete-confirm-DBhiUq1r.js";import"./click-to-copy-BuSTGPjJ.js";import"./useAsync-P_Velqz1.js";import"./index-ySP_m_Ux.js";import"./util-BQmjsgsT.js";import"./engine-C3zb9k-C.js";function z(){const{blocklet:o,actions:{updateBlockletDomainAliases:i}}=p(),{inService:r}=l(),{t:e}=n(),a=m.useMemo(()=>{let s=!0;return c(o)&&(s=s&&r),s},[r,o]);return t.jsxs(k,{component:f,sx:{gap:3,maxWidth:820},children:[t.jsxs(t.Fragment,{children:[u.isAccessible(o.status)===!1&&t.jsx(h,{severity:"warning",children:e("blocklet.router.noRunning")}),a&&t.jsx(x,{blocklet:o,updateBlockletDomainAliases:i,connectDomainProps:{shouldCheckDomain:!0}})]}),t.jsx(d,{showAllDomains:!0,updateBlockletDomainAliases:i})]})}export{z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{V as M,d as q,_ as w,H as C,e as Q,f as J}from"./vendor-ux-r9bApERu.js";import{j as t,b1 as f,b0 as X,b2 as Z,T as b,Q as T,a$ as ee,ak as B,z as $,a6 as te,at as se}from"./vendor-mui-core-BPQ6AEW_.js";import{r as n,u as ie}from"./vendor-react-CUXIiAnY.js";import{H as g}from"./vendor-utils-BgSaqjGx.js";import{a as ne,J as h,d as O,c as j,H as oe,K as re}from"./index-
|
|
1
|
+
import{V as M,d as q,_ as w,H as C,e as Q,f as J}from"./vendor-ux-r9bApERu.js";import{j as t,b1 as f,b0 as X,b2 as Z,T as b,Q as T,a$ as ee,ak as B,z as $,a6 as te,at as se}from"./vendor-mui-core-BPQ6AEW_.js";import{r as n,u as ie}from"./vendor-react-CUXIiAnY.js";import{H as g}from"./vendor-utils-BgSaqjGx.js";import{a as ne,J as h,d as O,c as j,H as oe,K as re}from"./index-DQt_6j3C.js";import{l as ae}from"./vendor-arcblock-D8WYBDYe.js";import{K as ce}from"./landing-page-BJPl6ZR-.js";import{f as _}from"./index-DBs9Ljax.js";import{g as D}from"./get-safe-url-BrPSNpgv.js";import"./vendor-hooks-PN9SWiQm.js";import"./lottie-web-4koyQiv_.js";const le=se.form`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: center;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a5 as e}from"./index-DQt_6j3C.js";var a=e();export{a as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,a6 as P,ak as E}from"./vendor-mui-core-BPQ6AEW_.js";import{r as k,i as T}from"./vendor-react-CUXIiAnY.js";import{o as j}from"./vendor-arcblock-D8WYBDYe.js";import{V as C,H as d,s as S}from"./vendor-ux-r9bApERu.js";import{v as W,c as v,S as I,s as R,b as U}from"./index-
|
|
1
|
+
import{j as e,a6 as P,ak as E}from"./vendor-mui-core-BPQ6AEW_.js";import{r as k,i as T}from"./vendor-react-CUXIiAnY.js";import{o as j}from"./vendor-arcblock-D8WYBDYe.js";import{V as C,H as d,s as S}from"./vendor-ux-r9bApERu.js";import{v as W,c as v,S as I,s as R,b as U}from"./index-DQt_6j3C.js";import{K as b}from"./landing-page-BJPl6ZR-.js";import{w as L}from"./wrap-locale-BovKZCTj.js";import{g as N}from"./get-safe-url-BrPSNpgv.js";import"./vendor-utils-BgSaqjGx.js";import"./vendor-hooks-PN9SWiQm.js";import"./lottie-web-4koyQiv_.js";import"./index-C6JbpwU_.js";function _({SessionContext:n,webWalletUrl:r,onSuccess:o}){const{api:t,session:i}=k.useContext(n),{t:s,locale:h}=C(),f=T(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),g=async(a,w)=>{o(a,w),await i.refresh(),d.success(s("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(v.WELLKNOWN_SERVICE_PATH_PREFIX)?f(c,{replace:!0}):window.location.href=N(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},u=a=>{d.error(a.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(j,{children:e.jsx(P,{})}):e.jsx(b,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(E,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(W,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:g,onError:u,locale:h,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:m,extraContent:null,hideCloseButton:!0})})})}const B=L(_);function G(){const n=S(),r=(o,t)=>{o.sessionToken&&(R(t(o.sessionToken)),U(t(o.refreshToken)))};return e.jsx(B,{SessionContext:I,webWalletUrl:n,onSuccess:r})}export{G as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as S,j as o,a6 as B,T,bp as k}from"./vendor-mui-core-BPQ6AEW_.js";import{o as M}from"./vendor-arcblock-D8WYBDYe.js";import{V as P,b as F}from"./vendor-ux-r9bApERu.js";import{r as w}from"./vendor-react-CUXIiAnY.js";import{l as E}from"./vendor-hooks-PN9SWiQm.js";import{a7 as D,L as I}from"./index-
|
|
1
|
+
import{D as S,j as o,a6 as B,T,bp as k}from"./vendor-mui-core-BPQ6AEW_.js";import{o as M}from"./vendor-arcblock-D8WYBDYe.js";import{V as P,b as F}from"./vendor-ux-r9bApERu.js";import{r as w}from"./vendor-react-CUXIiAnY.js";import{l as E}from"./vendor-hooks-PN9SWiQm.js";import{a7 as D,L as I}from"./index-DQt_6j3C.js";import"./vendor-utils-BgSaqjGx.js";import"./lottie-web-4koyQiv_.js";const{Elements:R,PaymentElement:z,useElements:N,useStripe:L,loadStripe:O,LinkAuthenticationElement:V}=globalThis.__STRIPE_COMPONENTS__,W=k("div")`
|
|
2
2
|
width: 100%;
|
|
3
3
|
opacity: 0;
|
|
4
4
|
transition: opacity 300ms ease;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,ak as s,a6 as w,a$ as B,bd as N,at as v,W as d}from"./vendor-mui-core-BPQ6AEW_.js";import{r as l}from"./vendor-react-CUXIiAnY.js";import{C as I}from"./vendor-utils-BgSaqjGx.js";import{p as $}from"./vendor-ux-r9bApERu.js";import{l as L,a as E,v as z}from"./index-
|
|
1
|
+
import{j as e,ak as s,a6 as w,a$ as B,bd as N,at as v,W as d}from"./vendor-mui-core-BPQ6AEW_.js";import{r as l}from"./vendor-react-CUXIiAnY.js";import{C as I}from"./vendor-utils-BgSaqjGx.js";import{p as $}from"./vendor-ux-r9bApERu.js";import{l as L,a as E,v as z}from"./index-DQt_6j3C.js";import{W as A}from"./did-address-j4poFq12.js";import{a as D}from"./page-header-BkgoSN-0.js";import{S as F}from"./layout-CbkYBUG0.js";import{S as P}from"./step-actions-gJEftNli.js";import{S as m}from"./button-DqhIB3De.js";import"./vendor-hooks-PN9SWiQm.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D8WYBDYe.js";import"./content-layout-B-2tfq3i.js";import"./use-mobile-C5RjvO7g.js";function R({onNext:n=()=>{},onPrevious:x=()=>{}}){const{locale:u,t}=l.useContext($),{blocklet:a,gas:c,tokenInfo:f,actions:h}=L(),{api:j}=E(),[y,o]=l.useState(!1),{need:p="",current:g="",owe:r=99999,deficiency:k,symbol:b="",endpoint:i}=c||{},{origin:C="/"}=i?new URL(i):{};l.useEffect(()=>{const W=setInterval(()=>{h.refreshFuel()},2e3);return()=>{clearInterval(W)}},[]);const S=()=>{o(!1)};return c?e.jsxs(T,{children:[e.jsx("div",{className:"header",children:e.jsx(D,{title:t("setup.fuel.title"),onClickBack:x})}),e.jsxs(s,{className:"qr-body",children:[e.jsxs(s,{className:"tip",sx:{mb:6},children:[t("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${p} ${b}`}),t("setup.fuel.tipEnd")]}),e.jsx(s,{sx:{fontSize:16,fontWeight:"fontWeightBold",mb:.5},children:t("setup.fuel.addressTitle")}),e.jsxs(s,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(A,{className:"address",did:a.appDid}),e.jsx(B,{style:{lineHeight:1},target:"_blank",href:I(C,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(N,{className:"icon-launch"})})]}),e.jsx(s,{sx:{my:2},children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:t("setup.fuel.fuelApp")})}),e.jsx(z,{popup:!0,open:y,action:"fuel",checkFn:j.get,checkTimeout:10*60*1e3,onSuccess:S,onClose:()=>o(!1),locale:u,messages:{title:t("setup.connect.title"),scan:t("setup.connect.scan"),confirm:t("setup.connect.confirm"),success:t("setup.connect.success")},extraParams:{amount:k,...f,endpoint:i}}),e.jsxs(s,{sx:{display:"flex",color:"text.secondary"},children:[e.jsxs(s,{sx:{display:"flex"},children:[e.jsxs(s,{children:[t("setup.fuel.need"),":"]}),e.jsx(s,{sx:{ml:.5,color:"primary.main",fontWeight:"fontWeightBold"},children:p})]}),e.jsxs(s,{sx:{display:"flex",ml:3},children:[e.jsxs(s,{children:[t("setup.fuel.current"),":"]}),e.jsx(s,{sx:{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold"},children:g})]})]})]}),e.jsx(P,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:t("setup.next")})})]}):e.jsx(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},children:e.jsx(w,{})})}R.propTypes={onNext:d.func,onPrevious:d.func};const T=v(F)`
|
|
2
2
|
.qr-body {
|
|
3
3
|
width: 580px;
|
|
4
4
|
${n=>n.theme.breakpoints.down("md")} {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as E,j as e,Q as S,b3 as P,b0 as R,ak as r,T as c,a6 as _}from"./vendor-mui-core-BPQ6AEW_.js";import{a as I,R as L,c as N,t as p,T,U}from"./index-
|
|
1
|
+
import{D as E,j as e,Q as S,b3 as P,b0 as R,ak as r,T as c,a6 as _}from"./vendor-mui-core-BPQ6AEW_.js";import{a as I,R as L,c as N,t as p,T,U}from"./index-DQt_6j3C.js";import{o as W}from"./vendor-arcblock-D8WYBDYe.js";import{p as A}from"./vendor-ux-r9bApERu.js";import{g as D,b as w}from"./vendor-hooks-PN9SWiQm.js";import{i as z,r as i,u as F}from"./vendor-react-CUXIiAnY.js";import{K as a}from"./landing-page-BJPl6ZR-.js";import{C as K}from"./vendor-utils-BgSaqjGx.js";import{u as M}from"./use-window-close-CgevJhno.js";import"./lottie-web-4koyQiv_.js";function Z(){const m=z(),l=i.useRef(null),{t:s,locale:d}=i.useContext(A),{api:x,connectApi:f}=I(),[h]=F(),j=E(),k=M(),n=D({ready:!1,success:!1,error:null,invalidSession:!1}),b=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const u=t.searchParams.get("__connect_url__"),v=T(u);if(!U(v))throw new Error("No token");n.ready=!0}catch{n.invalidSession=!0,m("#invalid",{replace:!0})}};i.useLayoutEffect(()=>b(),[]);const C=w(t=>{n.error=t.message,window.opener?.postMessage({type:"connect-endpoint-message",error:n.error},"*"),m("#invalid",{replace:!0})}),g=w(()=>{window.opener?.postMessage({type:"connect-endpoint-message",success:!0},"*"),n.success=!0}),o=h.get("source")||"Generate Access Key";i.useEffect(()=>{l.current&&n.ready&&f.open({locale:d,containerEl:l.current,action:"gen-access-key",extraParams:{remark:o},checkFn:x.get,saveConnect:!1,forceConnected:!1,className:"connect",popup:!1,baseUrl:window.location.origin,prefix:K(window.location.origin,N.WELLKNOWN_SERVICE_PATH_PREFIX,L),messages:{title:s("connectCli.title"),scan:s("connectCli.scan"),confirm:s("auth.confirm"),success:s("connectCli.success")},onSuccess:g,onError:C},{locale:d})},[f,n.ready,x,C,g,d,s,o]);const y=e.jsx(S,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(P,{}),href:"/",style:{borderRadius:4},children:s("connectCli.home")});if(n.invalidSession)return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.invalidSession"),description:s("connectCli.invalidSessionDesc"),extra:y})},"invalid");if(n.error){const t=n.error,u=y;return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.connectionError"),description:t,extra:u})},"error")}return n.success?(h.has("closeOnSuccess")&&k(),e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(R,{style:{color:j.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:o}),description:`${s("connectCli.successDesc",{source:o})} ${s("connectCli.upload")}`})},"success")):n.ready?e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsxs(r,{sx:{maxWidth:"100%",height:"100%"},children:[e.jsxs(r,{sx:{mb:5},children:[e.jsx(c,{variant:"h4",component:"h1",sx:{mb:1,fontWeight:"bold",textAlign:"center"},children:s("connectCli.tips.title")}),e.jsxs(r,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"center"},children:[e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item1")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item2")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item3")})]})]}),e.jsx(r,{sx:{display:"inline-block"},ref:l})]})},"ready"):e.jsx(W,{children:e.jsx(_,{})})}export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,ak as a,T as y,a6 as M,b1 as X,Q as O,a$ as Y,D as Z,aX as F,bU as K,b0 as ee}from"./vendor-mui-core-BPQ6AEW_.js";import{r as d,i as se,u as ne}from"./vendor-react-CUXIiAnY.js";import{M as te,ar as oe,as as re,at as ie,ay as ae,a as ce,d as le,T as $,t as ue,az as de,c as pe}from"./index-
|
|
1
|
+
import{j as e,ak as a,T as y,a6 as M,b1 as X,Q as O,a$ as Y,D as Z,aX as F,bU as K,b0 as ee}from"./vendor-mui-core-BPQ6AEW_.js";import{r as d,i as se,u as ne}from"./vendor-react-CUXIiAnY.js";import{M as te,ar as oe,as as re,at as ie,ay as ae,a as ce,d as le,T as $,t as ue,az as de,c as pe}from"./index-DQt_6j3C.js";import{n as v,U as he,C as W}from"./vendor-utils-BgSaqjGx.js";import{g as J,b as p,n as xe,o as fe}from"./vendor-hooks-PN9SWiQm.js";import{M as H,V as Q,I as ge,o as G,D as me}from"./vendor-ux-r9bApERu.js";import{o as je}from"./vendor-arcblock-D8WYBDYe.js";import{K as ye}from"./landing-page-BJPl6ZR-.js";import{u as we}from"./use-window-close-CgevJhno.js";import"./lottie-web-4koyQiv_.js";function Ce({requestAppInfo:l,currentAppInfo:w}){return e.jsxs(a,{sx:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(H,{src:w.appLogo,alt:"Server",width:48,height:48,useProxyFallback:!0}),e.jsxs(a,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"grey.500",mx:.5}},children:[e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"})]}),e.jsx(H,{src:l.appLogo,alt:l.appName,width:48,height:48,useProxyFallback:!0})]}),e.jsxs(y,{sx:{mb:1,fontSize:"1.2rem"},children:["Authorize"," ",e.jsx(a,{component:"span",sx:{color:"primary.main"},children:l.appName})]})]})}const Ae={en:{notThis:"Not you?",useAnother:"Use another account",authorize:"Authorize",connect:"Connect",cancel:"Cancel"},zh:{notThis:"不是这个?",useAnother:"使用其他账户",authorize:"授权",connect:"Connect",cancel:"取消"}};function Se({session:l,requestAppInfo:w,currentAppInfo:b,children:k=null,userInfo:s=void 0,hideSwitchConnect:N=!1,hideAuthorize:t=!1,hideCancel:L=!1,hideButton:T=!1,notThisText:I=void 0,authorizeText:o=void 0,connectText:c=void 0,cancelText:P=void 0,useAnotherText:C=void 0,slotProps:h=void 0,onConnect:R=v,onAuthorize:f=v,onSwitchConnect:_=v,onSwitchPassport:A=v,onCancel:U=v,ref:D,disableAuthorizeButton:z=!1}){const r=J({loading:!1}),{locale:S="en"}=Q()||{},g=p((B,j={})=>ge(Ae,B,S,"en",j)),x=p(()=>{r.loading=!1}),E=p(()=>{r.loading=!0,R?.(x)}),q=p(()=>{r.loading=!0,_?.(x)}),n=p(()=>{r.loading=!0,f?.(x)}),i=p(()=>{r.loading=!0,A?.(x)}),u=p(()=>{U?.()});if(d.useImperativeHandle(D,()=>({closeLoading:x})),l.loading||!l.initialized)return e.jsx(je,{children:e.jsx(M,{})});const m=s??l?.user;return e.jsx(ye,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(a,{...h?.root,sx:G({width:420,maxWidth:"100%"},h?.root?.sx),children:e.jsx(te,{hideCloseButton:!0,...h?.didConnectContainer,children:e.jsxs(a,{...h?.contentContainer,sx:G({display:"flex",flexDirection:"column",gap:1.5,p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},h?.contentContainer?.sx),children:[e.jsx(Ce,{requestAppInfo:w,currentAppInfo:b}),m?e.jsxs(e.Fragment,{children:[e.jsx(oe,{user:m,showDid:!0,cardType:ie.Detailed,infoType:re.Minimal,renderTopRightContent:()=>e.jsx(ae,{user:m,switchPassport:i})}),e.jsx(a,{})]}):null,k,T?null:e.jsxs(e.Fragment,{children:[e.jsx(a,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden",my:1}}),e.jsxs(X,{direction:"row",spacing:2,children:[L?null:e.jsx(O,{color:"inherit",variant:"outlined",size:"large",fullWidth:!0,onClick:u,sx:{color:"grey.500"},children:P||g("cancel")}),m&&!t?e.jsxs(O,{variant:"contained",size:"large",fullWidth:!0,onClick:n,disabled:r.loading||z,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,o||g("authorize")]}):e.jsxs(O,{variant:"contained",size:"large",fullWidth:!0,disabled:r.loading||z,onClick:E,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,c||g("connect")]})]})]}),N||!m?null:e.jsx(a,{sx:{textAlign:"center"},children:e.jsxs(y,{variant:"body2",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[I||g("notThis")," ",e.jsx(Y,{underline:"hover",onClick:q,sx:{cursor:"pointer"},children:C||g("useAnother")})]})})]})})})})}const ve=W(window.location.origin,pe.WELLKNOWN_BLOCKLET_USER_PATH,"settings#user-center-access-key-setting"),V=3e3;function Ue(){const l=d.useRef(null),[w,b]=d.useState(),[k]=xe({targetDate:w}),{session:s}=ce(),N=Z(),t=J({ready:!1,success:!1,error:null,invalidSession:!1,token:null}),[L,T]=fe("currentUserInfo",{defaultValue:null}),I=se(),{t:o}=Q(),[c]=ne(),P=we(),[,C]=d.useState(!0),[h,R]=d.useState({appName:c.get("cli")?c.get("appName")??o("aigne.cli"):"",appLogo:c.get("cli")?c.get("appLogo"):""}),f=c.get("required_roles")||"",_=d.useMemo(()=>{const n=f.split(",")||[];if(n.length===0)return n;const i=he([s.user?.role,(s.user?.passports||[]).map(u=>u.role)].flat().filter(Boolean));return i.length===0?i:n.filter(u=>i.includes(u.toLocaleLowerCase().trim()))},[s.user,f]),A=_.join(","),U=s.user&&f?_.length>0:!0,D=async()=>{C(!0);try{const n=c.get("__url__"),i=n?$(n):null;if(!i){C(!1);return}const u="__blocklet__.js?type=json",B=new URL(i).origin,{data:j}=await de.get(W(B,u));R({appName:j?.appName,appUrl:j?.appUrl,appLogo:W(j?.appUrl,j?.appLogo)})}catch(n){console.error(n)}finally{C(!1)}};d.useEffect(()=>{s.user&&T(s.user)},[s.user]);const z=()=>{D(),s.user&&T(s.user);try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){t.invalidSession=!0;return}const i=n.searchParams.get("__token__"),u=i?$(i):null;if(!u)throw new Error("No token");t.token=u,t.ready=!0}catch(n){t.invalidSession=!0,t.error=n.message,window.opener?.postMessage({type:"connect-aigne-message",error:n.message},"*"),I("#invalid",{replace:!0})}};d.useLayoutEffect(()=>z(),[]);const r=window.blocklet,S=c.get("source")||"Generate Access Key",g=p(async n=>{try{await le.post("/access-key/authorize",{source:S,sid:t.token,requiredRoles:A}),t.success=!0,window.opener?.postMessage({type:"connect-aigne-message",success:!0},"*"),c.has("closeOnSuccess")&&(b(Date.now()+V),setTimeout(()=>P(),V))}catch(i){console.error(i)}finally{n()}}),x=p(()=>{s.login()}),E=p(()=>{window.close()});d.useEffect(()=>{s.initialized&&!s.user&&(me()||x())},[s?.user,s?.initialized,x]),d.useEffect(()=>{s.open||l.current?.closeLoading?.()},[s.open]);const q=()=>t.error?e.jsxs(F,{severity:"error",children:[e.jsx(K,{children:o("aigne.notAuthorized")}),t.error]}):t.success?e.jsx(ue,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(ee,{style:{color:N.palette.success.main,fontSize:72}}),title:o("connectCli.success",{source:S}),description:`${o("connectCli.successDesc",{source:S})} ${c.has("closeOnSuccess")?o("connectCli.closeDelay",{seconds:Math.ceil(k/1e3)}):""}`}):e.jsxs(F,{severity:"info",children:[e.jsx(K,{children:o("aigne.connectTo",{appName:r.appName})}),f&&e.jsx(y,{component:"li",variant:"body2",children:A?o("aigne.accessTips.switchPassport",{required_roles:A}):o("aigne.accessTips.switchPassportRequired",{required_roles:f})}),e.jsx(y,{component:"li",variant:"body2",children:o("aigne.accessTips.tips1",{appName:h.appName,accessAppName:r.appName})}),e.jsx(y,{component:"li",variant:"body2",children:o("aigne.accessTips.tips2",{appName:h.appName})}),e.jsx(y,{component:"li",variant:"body2",sx:{"& a":{color:"inherit",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:o("aigne.accessTips.tips3",{url:ve,accessAppName:r.appName})}})]});return e.jsx(Se,{ref:l,session:s,requestAppInfo:h,currentAppInfo:r,userInfo:L,onAuthorize:g,onConnect:x,onSwitchConnect:s.switchDid,onCancel:E,hideAuthorize:!!t.error,hideSwitchConnect:t.success,hideButton:t.success,authorizeText:o("common.approve"),onSwitchPassport:s.switchDid,slotProps:{root:{sx:{width:500}}},disableAuthorizeButton:!U,children:q()})}export{Ue as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as t}from"./index-
|
|
1
|
+
import{Q as t}from"./index-DQt_6j3C.js";import{H as e}from"./vendor-ux-r9bApERu.js";function c(...o){try{return t(...o)}catch(r){throw e.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,b1 as n}from"./vendor-mui-core-BPQ6AEW_.js";import{L as r}from"./vendor-react-CUXIiAnY.js";import{n as i}from"./vendor-ux-r9bApERu.js";import{c as t}from"./index-
|
|
1
|
+
import{j as o,b1 as n}from"./vendor-mui-core-BPQ6AEW_.js";import{L as r}from"./vendor-react-CUXIiAnY.js";import{n as i}from"./vendor-ux-r9bApERu.js";import{c as t}from"./index-DQt_6j3C.js";import{S as e}from"./studio-VRwDw2v1.js";import"./vendor-utils-BgSaqjGx.js";import"./vendor-hooks-PN9SWiQm.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D8WYBDYe.js";import"./index-21gjg2tv.js";function L(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",spacing:2,sx:{m:4},children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./vendor-react-CUXIiAnY.js";import{a4 as L}from"./index-
|
|
1
|
+
import{a as E}from"./vendor-react-CUXIiAnY.js";import{a4 as L}from"./index-DQt_6j3C.js";const $=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:m,onMouseOut:w,scrolling:b,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:P,name:v,target:A,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const t=L({src:q||r,target:A||null,style:{position:a||null,display:i||"initial",overflow:c||null},scrolling:b||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:v||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":P||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:u||null,onLoad:p||null,onMouseOver:m||null,onMouseOut:w||null,key:x||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))};export{$ as I};
|