@abtnode/blocklet-services 1.16.42-beta-20250412-074212-ef879757 → 1.16.42-beta-20250412-083409-53f46a85
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/dist/assets/{access-control-CkJaSWqQ.js → access-control-wqGz9JCo.js} +1 -1
- package/dist/assets/{add-component-core-CcE5hcL-.js → add-component-core-DqvSoT6a.js} +1 -1
- package/dist/assets/{add-resource-CWB03UX7.js → add-resource-DmN1IY_o.js} +1 -1
- package/dist/assets/{advanced-xfBXRmMb.js → advanced-CzJgEcda.js} +1 -1
- package/dist/assets/{appearance-CSHu4pbk.js → appearance-Bn0kYJHu.js} +1 -1
- package/dist/assets/{audit-logs-JU-7pKhW.js → audit-logs-DU66CSpw.js} +1 -1
- package/dist/assets/{branding-BWmZMyhk.js → branding-C5rNAfwW.js} +1 -1
- package/dist/assets/{branding-CcjXuXBu.js → branding-CiE421Dn.js} +2 -2
- package/dist/assets/{bundle-avatar-DW07bLBG.js → bundle-avatar-vSofRY4G.js} +1 -1
- package/dist/assets/{complete-DJafaAbP.js → complete-BeWyfTmK.js} +1 -1
- package/dist/assets/{component-Dixh8MiE.js → component-CZ948vh4.js} +1 -1
- package/dist/assets/{config-DnWRl-e4.js → config-CFbM7U_5.js} +1 -1
- package/dist/assets/{config-navigation-Dy2e3bWx.js → config-navigation-hrdLDyFZ.js} +3 -3
- package/dist/assets/{config-space-D9XSZ43O.js → config-space-Drp9NI7a.js} +1 -1
- package/dist/assets/{confirm-D36_98HC.js → confirm-B9OqaJpT.js} +1 -1
- package/dist/assets/connect-0zFqdTRm.js +5 -0
- package/dist/assets/{connect-DfFQY1g3.js → connect-CpUC5BAX.js} +1 -1
- package/dist/assets/{connect-to-nV6QlEXH.js → connect-to-BasQxweP.js} +1 -1
- package/dist/assets/{dashboard-BX25tvc1.js → dashboard-BYUKOMAe.js} +3 -3
- package/dist/assets/{delete-confirm-DXKGHbZ0.js → delete-confirm-CM4f-ajO.js} +1 -1
- package/dist/assets/domain-D0xqhxvZ.js +9 -0
- package/dist/assets/{domain-action-card-CE5RoGLV.js → domain-action-card-pHkmKFE3.js} +2 -2
- package/dist/assets/domains-BrNRyjCn.js +1 -0
- package/dist/assets/{email-Blo2BcBK.js → email-C5iUsSjP.js} +1 -1
- package/dist/assets/{exchange-passport-C2ib3_Sn.js → exchange-passport-CyGvLDal.js} +1 -1
- package/dist/assets/{fuel-Dy1g5bbZ.js → fuel-C5H_z1Ay.js} +1 -1
- package/dist/assets/{index-DF8FqhFx.js → index-B8FtPEFx.js} +1 -1
- package/dist/assets/{index-FiEfCjCd.js → index-Bee_YcJC.js} +1 -1
- package/dist/assets/{index-CwaFNZTA.js → index-BjYech25.js} +2 -2
- package/dist/assets/{index-rMaglH7e.js → index-C5lvlGzp.js} +3 -3
- package/dist/assets/{index-CAftUN2f.js → index-CVIeQOoE.js} +1 -1
- package/dist/assets/{index-CH6NslvK.js → index-CYAgDp3G.js} +1 -1
- package/dist/assets/{index-9fAsRy5T.js → index-CjmXl7jW.js} +1 -1
- package/dist/assets/{index-uyugLR5M.js → index-Cp_gD4ZQ.js} +1 -1
- package/dist/assets/{index-lIOjK585.js → index-Ctl8J5Z5.js} +1 -1
- package/dist/assets/{index-DW20Eg1X.js → index-D3YZfNxX.js} +1 -1
- package/dist/assets/{index-B0eRJvP0.js → index-DFoYVoMG.js} +1 -1
- package/dist/assets/{index-BFJrqJbJ.js → index-DUU3hQpo.js} +1 -1
- package/dist/assets/{index-BqFOxrIh.js → index-Dzvf3kMf.js} +4 -4
- package/dist/assets/{index-_bdib4_X.js → index-Kaq7tC6c.js} +1 -1
- package/dist/assets/{index-C_bxIWi7.js → index-d34Q6nXR.js} +1 -1
- package/dist/assets/{invitation-BhpO2wrv.js → invitation-C9hFp_wD.js} +1 -1
- package/dist/assets/{invite-Dho4ZotB.js → invite-CzfqL5Tx.js} +1 -1
- package/dist/assets/{issue-passport-ChG1IKWf.js → issue-passport-D3F63x7z.js} +1 -1
- package/dist/assets/{item-CuaUMkzc.js → item-C_TigVeC.js} +1 -1
- package/dist/assets/{layout-DMTV9CZD.js → layout-D5ALyxXA.js} +1 -1
- package/dist/assets/{list-BpDs72YC.js → list-DuzdV0Wa.js} +1 -1
- package/dist/assets/{log-BHx8x694.js → log-Dg8IZoeo.js} +1 -1
- package/dist/assets/{login-C8IgtQHG.js → login-B9XiO8eS.js} +1 -1
- package/dist/assets/{logo-uploader-COdhJAZk.js → logo-uploader-ChABQ_cS.js} +2 -2
- package/dist/assets/{lost-passport-D7rMK1P8.js → lost-passport-gGzRW--h.js} +1 -1
- package/dist/assets/{overview-d6gDgxnh.js → overview-ClfPLbRa.js} +1 -1
- package/dist/assets/{publish-resource-KUiHUSOS.js → publish-resource-C6TOyrHC.js} +1 -1
- package/dist/assets/{relative-time-B-K8BXmq.js → relative-time-CE47D6s7.js} +1 -1
- package/dist/assets/{runtime-BLeEmHaM.js → runtime-CdKbOwQM.js} +1 -1
- package/dist/assets/{security-4VIghIsi.js → security-DmjkCoJ_.js} +1 -1
- package/dist/assets/setup-DLCw2h80.js +19 -0
- package/dist/assets/{start-D0qy1O4h.js → start-CwSXw9Xs.js} +1 -1
- package/dist/assets/{status-B9rkBROD.js → status-CgfGREVl.js} +1 -1
- package/dist/assets/{step-actions-BxdcbLc6.js → step-actions-BNW8I1sI.js} +1 -1
- package/dist/assets/{traffic-Diahv-s-.js → traffic-ChJb5Oyl.js} +1 -1
- package/dist/assets/{transfer-DIxD0NHy.js → transfer-BHifjdxl.js} +1 -1
- package/dist/assets/{unsubscribe-C3uPy6Yj.js → unsubscribe-CcyOqX8E.js} +1 -1
- package/dist/assets/useAsync-BENTIUEf.js +1 -0
- package/dist/assets/{useAsyncRetry-W2lp7mi1.js → useAsyncRetry-DSYkC9r5.js} +2 -2
- package/dist/assets/{user-center-CcFqKY18.js → user-center-DfDG_giT.js} +1 -1
- package/dist/assets/{util-B_UMdXQ8.js → util-BmbbisPE.js} +1 -1
- package/dist/assets/{wrap-locale-D2zd2sgL.js → wrap-locale-5LSB6OAr.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +21 -22
- package/dist/assets/connect-XFyjVd39.js +0 -5
- package/dist/assets/domain-BwDvbkr6.js +0 -9
- package/dist/assets/domains-D7bzAvx0.js +0 -1
- package/dist/assets/setup-Bbl0UvNZ.js +0 -19
- package/dist/assets/useAsync-BxB2TpDl.js +0 -1
- package/dist/assets/useAsync-L7_fHBH5.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{r as m,f as gt,l as tt,L as me,u as js,i as ks,j as ct}from"./vendor-react-DEoibe3W.js";import{a2 as ke,j as e,t as Le,a4 as c,bk as vo,E as r,a5 as xe,I as ce,T as N,b$ as Co,D as ot,aa as ge,at as ys,bN as Je,ad as wo,br as Xe,bt as ht,x as se,a3 as Ye,P as So,G as Io,v as jt,a0 as Do,an as To,ak as fe,al as Rs,ac as _o,r as Po,bQ as vs,K as Ve,y as qo,M as oe,ae as Se,au as Cs,L as ws,z as Ss,b4 as Is,as as $o,ar as Qe,by as Ds,bz as Ts,c0 as _s,c1 as Ps,bm as ft,bn as qs,bp as $s,bC as Ls,bD as at}from"./vendor-mui-core-1jJmAutq.js";import{z as ye,C as ze,a2 as Ns,f as lo,aa as ro}from"./index-CwaFNZTA.js";import{r as Re,p as G,u as te,l as As,B as Me,b3 as Lo,V as No,b1 as Ao,am as zs,bq as Bs,a5 as kt,Y as M,a1 as Es,h as ae,br as Ws,b6 as Os,g as $e,ak as yt,aq as Ms}from"./vendor-ux-did-connect-DEbq97Xz.js";import{z as Rt,c as ue,l as Vs,F as Us,_ as zo,G as De,p as Fs}from"./vendor-arcblock-V3HYELzG.js";import{d as Hs}from"./Error-CK4gTMoT.js";import{C as vt}from"./confirm-D36_98HC.js";import{u as Ue}from"./session-0rF5SuCk.js";import{W as io}from"./did-address-B_VfxEC5.js";import{E as Fe}from"./empty-spinner-Cia24BVr.js";import{B as Ct}from"./bundle-avatar-DW07bLBG.js";import{S as je}from"./shorten-label-DDBwv81M.js";import{L as wt}from"./list-header-BibBP5t1.js";import{Z as Gs,y as be,I as St,D as Bo}from"./vendor-utils-C3FZIS9A.js";import{d as Js}from"./Download-BQiSNQBP.js";import{C as Eo}from"./click-to-copy-C9iEVQIO.js";import{Q as Xs}from"./QuestionMarkCircle-5K6WR8Pc.js";import{u as Ys}from"./vendor-hooks-DN4nZ7TU.js";import{_ as Ie}from"./useSetState-CWq0AVWn.js";import{c as It}from"./index-DVQCgvFb.js";import{E as Dt}from"./index-Cuoxr9xB.js";import{p as Ze}from"./index-DW20Eg1X.js";import"./api-kwOW9mRz.js";import{d as Qs}from"./ChevronRight-foZmiP4J.js";import{T as Zs,a as Ks}from"./vendor-mui-x-CPwlD3uT.js";import{d as co}from"./DeleteOutline-CKVA3PXs.js";import{D as ao,C as uo,P as po}from"./react-beautiful-dnd.esm-B3HYEQUw.js";import{c as en,A as Wo,u as tn,S as on,U as sn,a as dt,b as Oo,n as nn,e as ln,f as ho,g as rn,h as cn}from"./item-CuaUMkzc.js";import{d as an}from"./ArrowDropDown-C_E3qkPd.js";import{f as Ne}from"./format-error-BrmqJs5a.js";import{d as dn}from"./Launch-DX76v5dw.js";import{M as un}from"./index-BTOIZL6e.js";import{r as pn}from"./index-BYsXlcQC.js";import{d as hn}from"./Done-BDrYSkZM.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";import"./delete-confirm-DXKGHbZ0.js";import"./get-safe-url-D_Puq_oh.js";var Tt={},fn=ke;Object.defineProperty(Tt,"__esModule",{value:!0});var Mo=Tt.default=void 0,bn=fn(Re()),mn=e;Mo=Tt.default=(0,bn.default)((0,mn.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var _t={},xn=ke;Object.defineProperty(_t,"__esModule",{value:!0});var Vo=_t.default=void 0,gn=xn(Re()),jn=e;Vo=_t.default=(0,gn.default)((0,jn.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var Pt={},kn=ke;Object.defineProperty(Pt,"__esModule",{value:!0});var Uo=Pt.default=void 0,yn=kn(Re()),Rn=e;Uo=Pt.default=(0,yn.default)((0,Rn.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function qt({did:t,projectId:o,title:s,logo:i,describe:l}){const n=`${`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${i}`,[u,a]=m.useState(!1),h=Le(x=>x.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),children:[e.jsx(vo,{sx:{borderRadius:1},src:n}),e.jsxs(c,{children:[e.jsx(je,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:h?"primary.main":""},children:s||"/"}),e.jsx(je,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:h||u?"primary.main":"grey.700"},children:l||"/"})]})]})}qt.propTypes={projectId:r.string.isRequired,did:r.string.isRequired,title:r.string.isRequired,logo:r.string.isRequired,describe:r.string.isRequired};function $t({initUrl:t}){const o=gt(),s=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:i,locale:l}=te(),{api:d}=ye(),{api:n}=Ue(),[u,a]=m.useState(!0),{blocklet:h}=ze(),[x,S]=m.useState(null),[y,p]=m.useState(!1),f=Le(g=>g.breakpoints.down("xl")),R=Le(g=>g.breakpoints.down("md")),{componentDid:I=""}=tt(),[j,D]=m.useState(null),[k,T]=m.useState(""),L=()=>{d.getProjects({input:{did:h.meta.did,componentDid:I,tenantScope:s}}).then(g=>{const _=(g==null?void 0:g.projects)||[];a(!1),D(_)}).catch(g=>{a(!1),M.error(g.message)})},z=()=>{o(`${G.UNOWNED_DID}/create/none`,{replace:!0})},B=g=>{S(g)},v=()=>{a(!1),p(!0)},C=()=>{p(!1),S(null)},H=g=>{M.error(g.message),p(!1),S(null)},W=g=>{if(!(g!=null&&g.deleted)){M.error("Delete project failed");return}L(),p(!1),S(null)};m.useEffect(()=>{L()},[]);const b=m.useMemo(()=>{if(!k)return j;let g=k==null?void 0:k.trim();return g?(g=As.toAddress(g).toLocaleLowerCase(),j.filter(_=>_.blockletTitle.toLowerCase().includes(g)||_.blockletDid.toLowerCase().includes(g))):j},[j,k]);if(!j&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Fe,{})});if(!j)return null;if(!j.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:i("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:i("blocklet.publish.createBlockletTip")}),e.jsx(Me,{onClick:z,variant:"contained",children:i("blocklet.publish.createBlocklet")})]});const w=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:g=>{const _=j[g];return e.jsx(me,{to:`${_.id}`,children:e.jsx(qt,{did:h.meta.did,projectId:_.id,logo:_.blockletLogo,title:_.blockletTitle,describe:_.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:g=>g?e.jsx(Lo,{type:"success",children:g}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:g=>g?e.jsx(io,{size:14,compact:!0,responsive:!1,did:g}):null}},f||I?null:{label:i("common.createdBy"),name:"createdBy",options:{customBodyRender:g=>g?e.jsx(io,{onClick:()=>{o(`/.well-known/service/admin/members?did=${g}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:g}):null}},f||I?null:{label:i("common.scope"),name:"componentDid",options:{customBodyRender:g=>{const _=(h.children||[]).find(J=>J.meta.did===g);return _?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Ct,{size:14,blocklet:_,ancestors:[h]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:_.meta.title})]},g):""}}},f||s?null:{label:i("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:g=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(je,{children:g})})}},{label:i("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:g=>e.jsx(No,{value:Number(g),locale:l})}},{label:i("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:g=>{const _=j[g];return e.jsxs(c,{display:"flex",children:[e.jsx(me,{to:`${_.id}/new-release/${_.lastReleaseId}`,children:e.jsx(xe,{title:i("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(Mo,{style:{fontSize:18}})})})}),!!_.lastReleaseId&&e.jsx(xe,{title:i("blocklet.publish.viewLastRelease",{name:_.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(me,{style:{display:"flex"},to:`${_.id}/view/${_.lastReleaseId}`,children:e.jsx(Vo,{sx:{fontSize:18}})})})}),e.jsx(xe,{title:i("blocklet.publish.delete",{name:_.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>B(_),children:e.jsx(Ao,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),q=y?e.jsx(zs,{open:!0,popup:!0,onClose:C,action:"check-has-project-id",locale:l,checkFn:n.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:W,onError:H,extraParams:{projectId:x.id,did:h.meta.did,name:x.blockletTitle},messages:{title:i("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:i("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:i("blocklet.publish.deleteProject.confirm"),success:i("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(c,{children:[e.jsx(wt,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:i("common.blockletStudio")}),e.jsx(xe,{title:i("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(Uo,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Bs,{options:{searchPlaceholder:i("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:R},search:k,searchText:k,searchTextUpdate:T,searchClose:()=>T(""),onSearchOpen:()=>{}}),e.jsxs(Me,{onClick:z,variant:"contained",children:[e.jsx(Rt,{style:{fontSize:"1.3em",marginRight:4}}),i("blocklet.publish.createBlocklet")]})]})}),e.jsx(kt,{className:"main-table",locale:l,data:b,columns:w,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]}}),x&&e.jsx(vt,{title:`${i("common.delete")} ${x.blockletTitle}`,description:i("blocklet.publish.deleteProject.description"),confirm:i("common.confirm"),onConfirm:v,onCancel:()=>S(null),children:e.jsx(c,{sx:{marginTop:2},children:[i("blocklet.publish.deleteProject.tip1"),i("blocklet.publish.deleteProject.tip2"),i("blocklet.publish.deleteProject.tip3")].map(g=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Hs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(N,{component:"span",variant:"inherit",color:"text.secondary",children:g})]}))})}),q]})}$t.propTypes={initUrl:r.object};$t.defaultProps={initUrl:null};var Lt={},vn=ke;Object.defineProperty(Lt,"__esModule",{value:!0});var Fo=Lt.default=void 0,Cn=vn(Re()),fo=e;Fo=Lt.default=(0,Cn.default)([(0,fo.jsx)("path",{d:"M20 17H4V5h8V3H4c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h4v2h8v-2h4c1.1 0 2-.9 2-2v-3h-2z"},"0"),(0,fo.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");const wn=(t,o)=>{if(!t)return"";try{return o?JSON.parse(t)[o]:JSON.parse(t)}catch{}return t},Ho=wn;function Sn(){var B;const{t,locale:o}=te(),{projectId:s}=tt(),{api:i}=ye(),[l,d]=m.useState(!0),{blocklet:n}=ze(),u=Le(v=>v.breakpoints.down("md")),[a,h]=m.useState(null),[x,S]=m.useState(null),[y,p]=m.useState(null),f=(B=window.env)==null?void 0:B.serverEndpoint,R=()=>{i.getReleases({input:{did:n.meta.did,projectId:s}}).then(v=>{const C=(v==null?void 0:v.releases)||[];d(!1),h(C)}).catch(v=>{d(!1),M.error(v.message)})},I=()=>{i.doBatchQuery({getProject:{input:{did:n.meta.did,projectId:s}},getReleases:{input:{did:n.meta.did,projectId:s}}}).then(v=>{S(v.getProject.project||{}),h(v.getReleases.releases||[]),d(!1)}).catch(v=>{d(!1),M.error(v.message)})};m.useEffect(()=>{I()},[]);const[j,D]=m.useState(""),k=()=>{d(!1);const v=y.id;i.deleteRelease({input:{did:n.meta.did,projectId:s,releaseId:v}}).then(()=>{d(!1),R(),M.success(t("common.removeSuccess")),p(null)}).catch(C=>{d(!1),M.error(C.message)})},T=v=>{p(v)};if(!a&&l)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Fe,{})});if(!a)return null;const L=e.jsxs(Co,{className:"breadcrumbs","aria-label":"breadcrumb",children:[e.jsx(me,{to:"..",children:t("common.blockletStudio")}),e.jsx(N,{color:"text.primary",children:e.jsx(je,{maxLength:u?6:30,children:x.blockletTitle})})]});if(!a.length)return e.jsxs(e.Fragment,{children:[L,e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:t("blocklet.publish.releaseEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:t("blocklet.publish.createReleaseTip")}),e.jsx(me,{to:"create/none",children:e.jsx(Me,{variant:"contained",children:t("blocklet.publish.createRelease")})})]})]});const z=[{label:t("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:v=>{const C=a[v];return e.jsx(me,{to:`view/${C.id}`,children:e.jsx(qt,{did:n.meta.did,projectId:x.id,logo:C.blockletLogo,title:C.blockletVersion,describe:C.blockletTitle})})}}},{label:t("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:v=>{const C=a[v];return e.jsx(N,{className:"note",children:Ho(C.note,"note")})}}},{label:t("common.status"),name:"status",options:{customBodyRender:v=>e.jsx(Lo,{type:v==="published"?"success":"warning",children:v==="published"?"Released":Gs(v)})}},{label:t("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:v=>{const C=a[v];return C.status!==ue.PROJECT.RELEASE_STATUS.published?"":e.jsx(No,{value:Number(C.updatedAt),locale:o})}}},{label:t("common.actions"),name:"actions",options:{customBodyRenderLite:v=>{var q;const C=a[v];let H="",W="";const b=C.status==="published";if(b){const g=be(f,`/api/project/${n.meta.did}/${x.id}/${x.lastReleaseId}/release/blocklet.json`),_=new URL(f);_.pathname=be(_.pathname,"/launch-blocklet/agreement"),_.searchParams.set("blocklet_meta_url",g),H=_.href,W=be(`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${x.id}/${x.lastReleaseId}/download/${(x.lastReleaseFiles||[])[0]}`)}const w=(q=x.blockletComponents)!=null&&q.some(g=>g.included)||C.uploadedResource?"pack":"resource";return e.jsxs(c,{display:"flex",alignItems:"center",children:[b&&w==="pack"&&e.jsx(xe,{title:t("blocklet.publish.install",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx("a",{style:{display:"flex"},href:H,target:"_blank",rel:"noreferrer",children:e.jsx(Fo,{sx:{fontSize:18}})})})}),b&&e.jsx(xe,{title:t("blocklet.publish.download",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"download",children:e.jsx("a",{style:{display:"flex"},href:W,children:e.jsx(Js,{sx:{fontSize:18}})})})}),e.jsx(xe,{title:t("blocklet.publish.delete",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>T(C),children:e.jsx(Ao,{sx:{fontSize:18}})})})]})}}}];return e.jsxs(In,{children:[e.jsx(wt,{sx:{mb:2},left:L,actions:e.jsxs(e.Fragment,{children:[e.jsx(Me,{variant:"outlined",onClick:()=>{const v=be(f,`/api/project/${n.meta.did}/${s}/blocklet.json`);D(v)},children:t("blocklet.publish.copyInstallUrl")}),e.jsx(me,{to:"new-release/none",children:e.jsxs(Me,{variant:"contained",children:[e.jsx(Rt,{style:{fontSize:"1.3em",marginRight:4}}),t("blocklet.publish.createRelease")]})})]})}),e.jsx(ot,{fullWidth:!0,maxWidth:"sm",open:j,onClose:()=>D(""),children:e.jsxs(c,{sx:{py:5,px:4,wordBreak:"break-all"},children:[e.jsx(N,{variant:"h6",sx:{mb:2},children:t("blocklet.publish.installResourceTip")}),e.jsx(Eo,{children:j}),e.jsxs(N,{sx:{mt:2},children:[t("blocklet.publish.installResourceTip2"),e.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/how-to-use-install-url",target:"_blank",rel:"noreferrer",children:t("blocklet.publish.installResourceHelp")})]})]})}),e.jsx(kt,{className:"main-table",verticalKeyWidth:100,locale:o,data:a,columns:z,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),y&&e.jsx(vt,{title:t(`${t("common.delete")} ${y.blockletVersion}`),description:t("blocklet.publish.deleteReleaseTip"),confirm:t("common.confirm"),onConfirm:k,onCancel:()=>p(null)})]})}const In=ge(c)`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C5lvlGzp.js","assets/vendor-ux-did-connect-DEbq97Xz.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-C3FZIS9A.js","assets/vendor-mui-core-1jJmAutq.js","assets/vendor-hooks-DN4nZ7TU.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-BDmhBveY.css","assets/vendor-arcblock-V3HYELzG.js","assets/index-C1nvgBfF.js","assets/index-BjYech25.js","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as m,f as gt,l as tt,L as me,u as js,i as ks,j as ct}from"./vendor-react-DEoibe3W.js";import{a2 as ke,j as e,t as Le,a4 as c,bk as vo,E as r,a5 as xe,I as ce,T as N,b$ as Co,D as ot,aa as ge,at as ys,bN as Je,ad as wo,br as Xe,bt as ht,x as se,a3 as Ye,P as So,G as Io,v as jt,a0 as Do,an as To,ak as fe,al as Rs,ac as _o,r as Po,bQ as vs,K as Ve,y as qo,M as oe,ae as Se,au as Cs,L as ws,z as Ss,b4 as Is,as as $o,ar as Qe,by as Ds,bz as Ts,c0 as _s,c1 as Ps,bm as ft,bn as qs,bp as $s,bC as Ls,bD as at}from"./vendor-mui-core-1jJmAutq.js";import{z as ye,C as ze,a2 as Ns,f as lo,aa as ro}from"./index-BjYech25.js";import{r as Re,p as G,u as te,l as As,B as Me,b3 as Lo,V as No,b1 as Ao,am as zs,bq as Bs,a5 as kt,Y as M,a1 as Es,h as ae,br as Ws,b6 as Os,g as $e,ak as yt,aq as Ms}from"./vendor-ux-did-connect-DEbq97Xz.js";import{z as Rt,c as ue,l as Vs,F as Us,_ as zo,G as De,p as Fs}from"./vendor-arcblock-V3HYELzG.js";import{d as Hs}from"./Error-CK4gTMoT.js";import{C as vt}from"./confirm-B9OqaJpT.js";import{u as Ue}from"./session-0rF5SuCk.js";import{W as io}from"./did-address-B_VfxEC5.js";import{E as Fe}from"./empty-spinner-Cia24BVr.js";import{B as Ct}from"./bundle-avatar-vSofRY4G.js";import{S as je}from"./shorten-label-DDBwv81M.js";import{L as wt}from"./list-header-BibBP5t1.js";import{Z as Gs,y as be,I as St,D as Bo}from"./vendor-utils-C3FZIS9A.js";import{d as Js}from"./Download-BQiSNQBP.js";import{C as Eo}from"./click-to-copy-C9iEVQIO.js";import{Q as Xs}from"./QuestionMarkCircle-5K6WR8Pc.js";import{u as Ys}from"./vendor-hooks-DN4nZ7TU.js";import{_ as Ie}from"./useSetState-CWq0AVWn.js";import{c as It}from"./index-DVQCgvFb.js";import{E as Dt}from"./index-Cuoxr9xB.js";import{p as Ze}from"./index-D3YZfNxX.js";import"./api-kwOW9mRz.js";import{d as Qs}from"./ChevronRight-foZmiP4J.js";import{T as Zs,a as Ks}from"./vendor-mui-x-CPwlD3uT.js";import{d as co}from"./DeleteOutline-CKVA3PXs.js";import{D as ao,C as uo,P as po}from"./react-beautiful-dnd.esm-B3HYEQUw.js";import{c as en,A as Wo,u as tn,S as on,U as sn,a as dt,b as Oo,n as nn,e as ln,f as ho,g as rn,h as cn}from"./item-C_TigVeC.js";import{d as an}from"./ArrowDropDown-C_E3qkPd.js";import{f as Ne}from"./format-error-BrmqJs5a.js";import{d as dn}from"./Launch-DX76v5dw.js";import{M as un}from"./index-BTOIZL6e.js";import{r as pn}from"./index-BYsXlcQC.js";import{d as hn}from"./Done-BDrYSkZM.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";import"./delete-confirm-CM4f-ajO.js";import"./get-safe-url-D_Puq_oh.js";var Tt={},fn=ke;Object.defineProperty(Tt,"__esModule",{value:!0});var Mo=Tt.default=void 0,bn=fn(Re()),mn=e;Mo=Tt.default=(0,bn.default)((0,mn.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var _t={},xn=ke;Object.defineProperty(_t,"__esModule",{value:!0});var Vo=_t.default=void 0,gn=xn(Re()),jn=e;Vo=_t.default=(0,gn.default)((0,jn.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var Pt={},kn=ke;Object.defineProperty(Pt,"__esModule",{value:!0});var Uo=Pt.default=void 0,yn=kn(Re()),Rn=e;Uo=Pt.default=(0,yn.default)((0,Rn.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function qt({did:t,projectId:o,title:s,logo:i,describe:l}){const n=`${`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${i}`,[u,a]=m.useState(!1),h=Le(x=>x.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),children:[e.jsx(vo,{sx:{borderRadius:1},src:n}),e.jsxs(c,{children:[e.jsx(je,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:h?"primary.main":""},children:s||"/"}),e.jsx(je,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:h||u?"primary.main":"grey.700"},children:l||"/"})]})]})}qt.propTypes={projectId:r.string.isRequired,did:r.string.isRequired,title:r.string.isRequired,logo:r.string.isRequired,describe:r.string.isRequired};function $t({initUrl:t}){const o=gt(),s=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:i,locale:l}=te(),{api:d}=ye(),{api:n}=Ue(),[u,a]=m.useState(!0),{blocklet:h}=ze(),[x,S]=m.useState(null),[y,p]=m.useState(!1),f=Le(g=>g.breakpoints.down("xl")),R=Le(g=>g.breakpoints.down("md")),{componentDid:I=""}=tt(),[j,D]=m.useState(null),[k,T]=m.useState(""),L=()=>{d.getProjects({input:{did:h.meta.did,componentDid:I,tenantScope:s}}).then(g=>{const _=(g==null?void 0:g.projects)||[];a(!1),D(_)}).catch(g=>{a(!1),M.error(g.message)})},z=()=>{o(`${G.UNOWNED_DID}/create/none`,{replace:!0})},B=g=>{S(g)},v=()=>{a(!1),p(!0)},C=()=>{p(!1),S(null)},H=g=>{M.error(g.message),p(!1),S(null)},W=g=>{if(!(g!=null&&g.deleted)){M.error("Delete project failed");return}L(),p(!1),S(null)};m.useEffect(()=>{L()},[]);const b=m.useMemo(()=>{if(!k)return j;let g=k==null?void 0:k.trim();return g?(g=As.toAddress(g).toLocaleLowerCase(),j.filter(_=>_.blockletTitle.toLowerCase().includes(g)||_.blockletDid.toLowerCase().includes(g))):j},[j,k]);if(!j&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Fe,{})});if(!j)return null;if(!j.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:i("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:i("blocklet.publish.createBlockletTip")}),e.jsx(Me,{onClick:z,variant:"contained",children:i("blocklet.publish.createBlocklet")})]});const w=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:g=>{const _=j[g];return e.jsx(me,{to:`${_.id}`,children:e.jsx(qt,{did:h.meta.did,projectId:_.id,logo:_.blockletLogo,title:_.blockletTitle,describe:_.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:g=>g?e.jsx(Lo,{type:"success",children:g}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:g=>g?e.jsx(io,{size:14,compact:!0,responsive:!1,did:g}):null}},f||I?null:{label:i("common.createdBy"),name:"createdBy",options:{customBodyRender:g=>g?e.jsx(io,{onClick:()=>{o(`/.well-known/service/admin/members?did=${g}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:g}):null}},f||I?null:{label:i("common.scope"),name:"componentDid",options:{customBodyRender:g=>{const _=(h.children||[]).find(J=>J.meta.did===g);return _?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Ct,{size:14,blocklet:_,ancestors:[h]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:_.meta.title})]},g):""}}},f||s?null:{label:i("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:g=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(je,{children:g})})}},{label:i("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:g=>e.jsx(No,{value:Number(g),locale:l})}},{label:i("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:g=>{const _=j[g];return e.jsxs(c,{display:"flex",children:[e.jsx(me,{to:`${_.id}/new-release/${_.lastReleaseId}`,children:e.jsx(xe,{title:i("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(Mo,{style:{fontSize:18}})})})}),!!_.lastReleaseId&&e.jsx(xe,{title:i("blocklet.publish.viewLastRelease",{name:_.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(me,{style:{display:"flex"},to:`${_.id}/view/${_.lastReleaseId}`,children:e.jsx(Vo,{sx:{fontSize:18}})})})}),e.jsx(xe,{title:i("blocklet.publish.delete",{name:_.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>B(_),children:e.jsx(Ao,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),q=y?e.jsx(zs,{open:!0,popup:!0,onClose:C,action:"check-has-project-id",locale:l,checkFn:n.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:W,onError:H,extraParams:{projectId:x.id,did:h.meta.did,name:x.blockletTitle},messages:{title:i("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:i("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:i("blocklet.publish.deleteProject.confirm"),success:i("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(c,{children:[e.jsx(wt,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:i("common.blockletStudio")}),e.jsx(xe,{title:i("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(Uo,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(Bs,{options:{searchPlaceholder:i("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:R},search:k,searchText:k,searchTextUpdate:T,searchClose:()=>T(""),onSearchOpen:()=>{}}),e.jsxs(Me,{onClick:z,variant:"contained",children:[e.jsx(Rt,{style:{fontSize:"1.3em",marginRight:4}}),i("blocklet.publish.createBlocklet")]})]})}),e.jsx(kt,{className:"main-table",locale:l,data:b,columns:w,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]}}),x&&e.jsx(vt,{title:`${i("common.delete")} ${x.blockletTitle}`,description:i("blocklet.publish.deleteProject.description"),confirm:i("common.confirm"),onConfirm:v,onCancel:()=>S(null),children:e.jsx(c,{sx:{marginTop:2},children:[i("blocklet.publish.deleteProject.tip1"),i("blocklet.publish.deleteProject.tip2"),i("blocklet.publish.deleteProject.tip3")].map(g=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Hs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(N,{component:"span",variant:"inherit",color:"text.secondary",children:g})]}))})}),q]})}$t.propTypes={initUrl:r.object};$t.defaultProps={initUrl:null};var Lt={},vn=ke;Object.defineProperty(Lt,"__esModule",{value:!0});var Fo=Lt.default=void 0,Cn=vn(Re()),fo=e;Fo=Lt.default=(0,Cn.default)([(0,fo.jsx)("path",{d:"M20 17H4V5h8V3H4c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h4v2h8v-2h4c1.1 0 2-.9 2-2v-3h-2z"},"0"),(0,fo.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");const wn=(t,o)=>{if(!t)return"";try{return o?JSON.parse(t)[o]:JSON.parse(t)}catch{}return t},Ho=wn;function Sn(){var B;const{t,locale:o}=te(),{projectId:s}=tt(),{api:i}=ye(),[l,d]=m.useState(!0),{blocklet:n}=ze(),u=Le(v=>v.breakpoints.down("md")),[a,h]=m.useState(null),[x,S]=m.useState(null),[y,p]=m.useState(null),f=(B=window.env)==null?void 0:B.serverEndpoint,R=()=>{i.getReleases({input:{did:n.meta.did,projectId:s}}).then(v=>{const C=(v==null?void 0:v.releases)||[];d(!1),h(C)}).catch(v=>{d(!1),M.error(v.message)})},I=()=>{i.doBatchQuery({getProject:{input:{did:n.meta.did,projectId:s}},getReleases:{input:{did:n.meta.did,projectId:s}}}).then(v=>{S(v.getProject.project||{}),h(v.getReleases.releases||[]),d(!1)}).catch(v=>{d(!1),M.error(v.message)})};m.useEffect(()=>{I()},[]);const[j,D]=m.useState(""),k=()=>{d(!1);const v=y.id;i.deleteRelease({input:{did:n.meta.did,projectId:s,releaseId:v}}).then(()=>{d(!1),R(),M.success(t("common.removeSuccess")),p(null)}).catch(C=>{d(!1),M.error(C.message)})},T=v=>{p(v)};if(!a&&l)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Fe,{})});if(!a)return null;const L=e.jsxs(Co,{className:"breadcrumbs","aria-label":"breadcrumb",children:[e.jsx(me,{to:"..",children:t("common.blockletStudio")}),e.jsx(N,{color:"text.primary",children:e.jsx(je,{maxLength:u?6:30,children:x.blockletTitle})})]});if(!a.length)return e.jsxs(e.Fragment,{children:[L,e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:t("blocklet.publish.releaseEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:t("blocklet.publish.createReleaseTip")}),e.jsx(me,{to:"create/none",children:e.jsx(Me,{variant:"contained",children:t("blocklet.publish.createRelease")})})]})]});const z=[{label:t("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:v=>{const C=a[v];return e.jsx(me,{to:`view/${C.id}`,children:e.jsx(qt,{did:n.meta.did,projectId:x.id,logo:C.blockletLogo,title:C.blockletVersion,describe:C.blockletTitle})})}}},{label:t("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:v=>{const C=a[v];return e.jsx(N,{className:"note",children:Ho(C.note,"note")})}}},{label:t("common.status"),name:"status",options:{customBodyRender:v=>e.jsx(Lo,{type:v==="published"?"success":"warning",children:v==="published"?"Released":Gs(v)})}},{label:t("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:v=>{const C=a[v];return C.status!==ue.PROJECT.RELEASE_STATUS.published?"":e.jsx(No,{value:Number(C.updatedAt),locale:o})}}},{label:t("common.actions"),name:"actions",options:{customBodyRenderLite:v=>{var q;const C=a[v];let H="",W="";const b=C.status==="published";if(b){const g=be(f,`/api/project/${n.meta.did}/${x.id}/${x.lastReleaseId}/release/blocklet.json`),_=new URL(f);_.pathname=be(_.pathname,"/launch-blocklet/agreement"),_.searchParams.set("blocklet_meta_url",g),H=_.href,W=be(`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${x.id}/${x.lastReleaseId}/download/${(x.lastReleaseFiles||[])[0]}`)}const w=(q=x.blockletComponents)!=null&&q.some(g=>g.included)||C.uploadedResource?"pack":"resource";return e.jsxs(c,{display:"flex",alignItems:"center",children:[b&&w==="pack"&&e.jsx(xe,{title:t("blocklet.publish.install",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx("a",{style:{display:"flex"},href:H,target:"_blank",rel:"noreferrer",children:e.jsx(Fo,{sx:{fontSize:18}})})})}),b&&e.jsx(xe,{title:t("blocklet.publish.download",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"download",children:e.jsx("a",{style:{display:"flex"},href:W,children:e.jsx(Js,{sx:{fontSize:18}})})})}),e.jsx(xe,{title:t("blocklet.publish.delete",{name:x.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>T(C),children:e.jsx(Ao,{sx:{fontSize:18}})})})]})}}}];return e.jsxs(In,{children:[e.jsx(wt,{sx:{mb:2},left:L,actions:e.jsxs(e.Fragment,{children:[e.jsx(Me,{variant:"outlined",onClick:()=>{const v=be(f,`/api/project/${n.meta.did}/${s}/blocklet.json`);D(v)},children:t("blocklet.publish.copyInstallUrl")}),e.jsx(me,{to:"new-release/none",children:e.jsxs(Me,{variant:"contained",children:[e.jsx(Rt,{style:{fontSize:"1.3em",marginRight:4}}),t("blocklet.publish.createRelease")]})})]})}),e.jsx(ot,{fullWidth:!0,maxWidth:"sm",open:j,onClose:()=>D(""),children:e.jsxs(c,{sx:{py:5,px:4,wordBreak:"break-all"},children:[e.jsx(N,{variant:"h6",sx:{mb:2},children:t("blocklet.publish.installResourceTip")}),e.jsx(Eo,{children:j}),e.jsxs(N,{sx:{mt:2},children:[t("blocklet.publish.installResourceTip2"),e.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/how-to-use-install-url",target:"_blank",rel:"noreferrer",children:t("blocklet.publish.installResourceHelp")})]})]})}),e.jsx(kt,{className:"main-table",verticalKeyWidth:100,locale:o,data:a,columns:z,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),y&&e.jsx(vt,{title:t(`${t("common.delete")} ${y.blockletVersion}`),description:t("blocklet.publish.deleteReleaseTip"),confirm:t("common.confirm"),onConfirm:k,onCancel:()=>p(null)})]})}const In=ge(c)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
@@ -121,7 +121,7 @@ import{r as m,f as gt,l as tt,L as me,u as js,i as ks,j as ct}from"./vendor-reac
|
|
|
121
121
|
background: #fff;
|
|
122
122
|
z-index: 10;
|
|
123
123
|
}
|
|
124
|
-
`;var Mt={},En=ke;Object.defineProperty(Mt,"__esModule",{value:!0});var bt=Mt.default=void 0,Wn=En(Re()),On=e;bt=Mt.default=(0,Wn.default)((0,On.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");const mo="lastWantToConnectStoreId";function Mn(t){var u,a;const[o,s]=m.useState(null),{session:i}=Ue(),l=m.useCallback(h=>{s(h),localStorage.setItem(mo,h==null?void 0:h.id)},[s]),d=m.useMemo(()=>{var y,p,f,R;const h=localStorage.getItem(mo),x=h?(((y=t==null?void 0:t.settings)==null?void 0:y.storeList)||[]).find(I=>I.id===h):null;if(x)return x;let S=(((p=t==null?void 0:t.settings)==null?void 0:p.storeList)||[]).find(I=>{var j;return!(I.id!==G.BLOCKLET_STORE.id||I.scope&&I.scope!=="studio"&&I.scope!==((j=i==null?void 0:i.user)==null?void 0:j.did))});return S||(S=(R=(f=t==null?void 0:t.settings)==null?void 0:f.storeList)==null?void 0:R[0]),S},[(u=t==null?void 0:t.settings)==null?void 0:u.storeList,(a=i==null?void 0:i.user)==null?void 0:a.did]);return[o||d||{},l]}const pt={};async function Qo(t,{interval:o=1e3,maxDuration:s=120*1e3,intervalFirst:i=4e3,timerKey:l=""}){pt[l]&&clearTimeout(pt[l]),await new Promise(u=>setTimeout(u,i));const d=Date.now(),n=async(u,a)=>{try{const h=await t();u(h)}catch(h){Date.now()-d>s?a(h):l?pt[l]=setTimeout(()=>n(u,a),o):setTimeout(()=>n(u,a),o)}};return new Promise(n)}function Vn(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Un(t,{did:o,projectId:s,messageId:i}){return Qo(async()=>{var d;const l=await t.getProject({input:{did:o,projectId:s,messageId:i}});if(!((d=l==null?void 0:l.project)!=null&&d.blockletDid))throw new Error("Connected store not found");return l.project.blockletDid},{timerKey:"connect-studio"})}function Fn(t,{did:o,projectId:s,storeId:i}){return Qo(async()=>{var n,u;const l=await t.getProject({input:{did:o,projectId:s,messageId:""}});if(!((u=(n=l==null?void 0:l.project)==null?void 0:n.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!l.project.connectedStores.find(a=>a.storeId===i))throw new Error("Connected store not found")},{timerKey:`connect-store-${i}`})}const Hn=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:i})=>{var n,u;const l=t?(n=s==null?void 0:s.meta)==null?void 0:n.did:o==null?void 0:o.did;let d=t?((u=s==null?void 0:s.settings)==null?void 0:u.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(d)||(d=[]),d=d.filter(a=>a.protected||!a.scope||a.scope==="studio"||a.scope===i),{teamDid:l,storeList:d}},Vt=Hn;function Ut({blocklet:t,store:o={},onChangeStore:s,onClick:i,disabled:l,loading:d,componentDid:n}){var b,w,q;const{t:u}=te(),{session:a}=Ue(),{api:h,info:x,inService:S}=ye(),y=ze(),[p,f]=m.useState(!1),R=m.useRef(null),[I,j]=m.useState(!1),[D,k]=m.useState(null),T=g=>{s(g),f(!1)},L=()=>{f(!p)},z=g=>{R.current&&R.current.contains(g.target)||f(!1)},B=()=>{j(!0)},v=()=>{j(!1)},C=async()=>{var g;if(D)try{await h.deleteBlockletStore({input:{teamDid:t.meta.did,url:D.url,projectId:"",scope:D.scope||"studio"}}),await((g=y==null?void 0:y.actions)==null?void 0:g.refreshBlocklet())}catch(_){M.error(`Remove Blocklet Store Error: ${Ne(_)}`)}finally{k(null)}},{storeList:H}=Vt({fromBlocklet:S,blocklet:t,nodeInfo:x,componentDid:n,userDid:(b=a==null?void 0:a.user)==null?void 0:b.did}),W=(w=t==null?void 0:t.meta)==null?void 0:w.did;return e.jsxs(e.Fragment,{children:[e.jsxs(ht,{disabled:l,ref:R,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(se,{onClick:i,children:[d&&e.jsx(Ye,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${o.name||""}`]}),e.jsx(se,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:L,children:e.jsx(an,{})})]}),e.jsx(So,{sx:{zIndex:10},open:p,anchorEl:R.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:g})=>e.jsx(Io,{...g,style:{transformOrigin:"center top"},children:e.jsx(jt,{children:e.jsx(Do,{onClickAway:z,children:e.jsxs(To,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[H==null?void 0:H.map(_=>{var J;return e.jsxs(fe,{selected:_.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>T(_),children:[e.jsxs(c,{children:[e.jsx(je,{sx:{fontSize:"16px"},maxLength:24,children:_.name}),e.jsx(je,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:_.url})]}),en({store:_,userDid:(J=a==null?void 0:a.user)==null?void 0:J.did})&&e.jsx(ce,{sx:{ml:1},onClick:U=>{U.preventDefault(),U.stopPropagation(),k(_)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},_.url)}),e.jsx(Rs,{}),e.jsxs(fe,{onClick:B,children:[e.jsx(Rt,{font:!0}),e.jsx(N,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),I&&e.jsx(Wo,{hiddenChildren:!0,open:!0,onClose:v,teamDid:W,storeList:H,scope:"studio",onAdd:(q=y==null?void 0:y.actions)==null?void 0:q.refreshBlocklet}),D&&e.jsx(vt,{displayError:!0,title:`${u("common.delete")} ${D.name}`,description:u("blocklet.publish.deleteStoreTip",{name:D.name}),confirm:u("common.confirm"),onConfirm:C,onCancel:()=>k(null)})]})}Ut.propTypes={store:r.object,blocklet:r.object,onChangeStore:r.func.isRequired,onClick:r.func.isRequired,loading:r.bool.isRequired,disabled:r.bool.isRequired,componentDid:r.string.isRequired,projectType:r.string.isRequired,getData:r.func.isRequired};Ut.defaultProps={store:null,blocklet:null};const Gn=(t,o,s)=>{const i=`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/logo/upload`,l=`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/screenshot/upload`,d=t!=null&&t.blockletLogo?`${i}/${t.blockletLogo}`:`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,n=((t==null?void 0:t.blockletScreenshots)||[]).filter(Boolean).map(u=>`${l}/${u}`);return{logoUrl:d,screenshotUrls:n,uploadLogoPrefix:i,uploadScreenshotPrefix:l}},Zo=Gn,Jn=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function st({url:t,style:o,controls:s,modestbranding:i}){var u;const{t:l}=te(),d=t.includes("youtube.com")||t.includes("youtu.be"),n=t.includes("vimeo.com");if(d){const a=((u=t.split("v=")[1])==null?void 0:u.split("&")[0])||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${a}?modestbranding=${i}&controls=${s}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(n){const a=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${a}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(c,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(c,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(N,{variant:"body1",sx:{opacity:.5},children:l("studio.videoDialogNoSrc")})]})})}st.propTypes={url:r.string.isRequired,style:r.object,controls:r.number,modestbranding:r.number};st.defaultProps={style:{},controls:1,modestbranding:1};function Ko({setParams:t,onClose:o,params:s}){const{t:i}=te(),[l,d]=m.useState(""),n=l&&s.blockletVideos.includes(l),u=Jn(l),a=()=>{t(h=>{const x=[...h.blockletVideos];return x.push(l),{...h,blockletVideos:x}}),o()};return e.jsxs(ot,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(_o,{children:i("studio.videoDialogTitle")}),e.jsxs(Po,{children:[e.jsx(vs,{fullWidth:!0,value:l,onChange:h=>d(h.target.value),placeholder:i("studio.videoInputLabel"),endAdornment:l?e.jsx(Ve,{position:"end",children:e.jsx(ce,{onClick:()=>d(""),children:e.jsx(Os,{})})}):null,error:n}),n&&e.jsx(N,{variant:"body2",color:"error",children:i("studio.duplicateVideo")}),e.jsx(st,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(qo,{children:[e.jsx(se,{onClick:()=>o(),children:i("studio.cancel")}),e.jsx(se,{disabled:!u||n,onClick:a,children:i("studio.confirm")})]})]})}Ko.propTypes={onClose:r.func.isRequired,params:r.object.isRequired,setParams:r.func.isRequired};function mt({errors:t,storeList:o,...s}){const{t:i}=te();return e.jsxs(c,{...s,color:"warning.main",fontSize:"14px",sx:{border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},children:[e.jsx(N,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:i("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([l,d])=>{const n=Object.values(d),u=o.find(a=>a.url===l);return n.length>0&&e.jsxs(c,{children:[e.jsx(xe,{title:l,children:e.jsx(c,{component:"span",sx:{cursor:"pointer"},children:u.name})}),n.map(a=>e.jsx(c,{component:"li",ml:2,breakWords:!0,children:a},a))]},l)})]})}mt.propTypes={errors:r.object.isRequired,storeList:r.array.isRequired};const xo=m.lazy(()=>zo(()=>import("./index-rMaglH7e.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(t=>({default:t.Uploader})));function es({projectId:t,readOnly:o,loading:s,blocklet:i,params:l,setParams:d,paramsErrTip:n,setParamsErrTip:u,warning:a,setLoading:h,initUrl:x,initLogoUrl:S,setInitLogoUrl:y,componentDid:p}){const{t:f,locale:R}=te(),{api:I}=ye(),j=gt(),D=m.useRef(null),k=m.useRef(null),[T,L]=Mn(i),[z,B]=m.useState(!1),v=tn({messageType:"connect-store-message",onOpen:()=>h(!0),onClose:()=>h(!1)}),C=async $=>{const V=setTimeout(()=>{h(!1)},2e4),F=await Un(I,$);h(!1),clearTimeout(V),window.parent.postMessage({event:"studioDialog.connected",componentDid:p},"*"),j(window.location.pathname.replace(`${G.UNOWNED_DID}/create`,`${F}/create`),{replace:!0})},H=()=>{if(!l.blockletTitle){M.error(f("blocklet.publish.errorTip.noTitle"));return}if(!(T!=null&&T.url)){M.error(f("blocklet.publish.noStoreSelected"));return}const $=Vn();v(async(V,F)=>{var Q,X,ie;try{const Y=await I.connectByStudio({input:{did:(Q=i==null?void 0:i.meta)==null?void 0:Q.did,blockletTitle:l==null?void 0:l.blockletTitle,storeUrl:T.url,storeId:T.id,storeName:T.name,type:((X=l==null?void 0:l.blockletComponents)==null?void 0:X.length)>0?"pack":"resource",componentDid:p,messageId:$,tenantScope:(x==null?void 0:x.searchParams.get("tenantScope"))||""}});if(!(Y!=null&&Y.url)){M.error("failed to connect to store");return}F(Y.url),C({did:(ie=i==null?void 0:i.meta)==null?void 0:ie.did,projectId:"",messageId:$})}catch(Y){const de=Ne(Y);M.error(de),h(!1)}})},{logoUrl:W,screenshotUrls:b,uploadLogoPrefix:w,uploadScreenshotPrefix:q}=Zo(l,i,t),{logoErrors:g,screenshotErrors:_,storeList:J,hasLogoWarning:U,hasScreenshotWarning:re}=a,K=()=>o?!1:!t||t===G.UNOWNED_DID?(M.error(f("blocklet.publish.errorTip.noFirstDid")),!1):!0,ee=$=>{if(!$.destination)return;const V=Array.from(l.blockletScreenshots),[F]=V.splice($.source.index,1);V.splice($.destination.index,0,F),d(Q=>({...Q,blockletScreenshots:V}))},Be=$=>{if(!$.destination)return;const V=Array.from(l.blockletVideos),[F]=V.splice($.source.index,1);V.splice($.destination.index,0,F),d(Q=>({...Q,blockletVideos:V}))};return e.jsxs(Xn,{children:[e.jsx(c,{display:"flex",className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.title")}`,placeholder:`Blocklet ${f("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:l.blockletTitle||"",onChange:$=>{u({blockletTitle:""}),d({blockletTitle:$.target.value})},error:!!n.blockletTitle,helperText:n.blockletTitle||""}),e.jsx(oe,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:t===G.UNOWNED_DID&&e.jsx(Ve,{position:"end",children:e.jsx(Ut,{blocklet:i,store:T,componentDid:p,onChangeStore:L,disabled:!l.blockletTitle||o||s,loading:s,onClick:H})})},error:!!n.projectId,helperText:n.projectId||"",value:t===G.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3}}),e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.description")}`,placeholder:`Blocklet ${f("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:o},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletDescription||"",onChange:$=>{u({blockletDescription:""}),d({blockletDescription:$.target.value})},error:!!n.blockletDescription,helperText:n.blockletDescription||"",sx:{mt:3}}),e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.homepageTip")}`,placeholder:`Blocklet ${f("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletHomepage||"",onChange:$=>{$.target.value&&!/^(http|https):\/\//.test($.target.value)?u({blockletHomepage:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletHomepage:""}),d({blockletHomepage:$.target.value})},error:!!n.blockletHomepage,helperText:n.blockletHomepage||"",sx:{mt:3}}),e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.community")}`,placeholder:`Blocklet ${f("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletCommunity||"",onChange:$=>{$.target.value&&!/^(http|https):\/\//.test($.target.value)?u({blockletCommunity:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletCommunity:""}),d({blockletCommunity:$.target.value})},error:!!n.blockletCommunity,helperText:n.blockletCommunity||"",sx:{mt:3}}),e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.support")}`,placeholder:`Blocklet ${f("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletSupport||"",onChange:$=>{$.target.value&&!/^(http|https):\/\//.test($.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test($.target.value)?u({blockletSupport:f("blocklet.publish.errorTip.invalidUrlOrEmail")}):u({blockletSupport:""}),d({blockletSupport:$.target.value})},error:!!n.blockletSupport,helperText:n.blockletSupport||"",sx:{mt:3}}),e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.repository")}`,placeholder:`Blocklet ${f("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletRepository||"",onChange:$=>{$.target.value&&!/^(git|https|svn)/.test($.target.value)?u({blockletRepository:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletRepository:""}),d({blockletRepository:$.target.value})},error:!!n.blockletRepository,helperText:n.blockletRepository||"",sx:{mt:3}})]})}),e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsxs(c,{flex:1,overflow:"hidden",children:[e.jsxs(c,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(N,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("common.logo")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.type"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"png, jpg, webp, svg"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),e.jsx(c,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(vo,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:S||W,onClick:()=>{var $;K()&&(($=D.current)==null||$.open())}})})]}),U&&e.jsx(mt,{errors:g,storeList:J,mt:3}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(N,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("common.screenshot")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:f("studio.orderTip")})]})})]})]}),e.jsx(ao,{onDragEnd:o?void 0:ee,children:e.jsx(uo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:($,V)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:$.innerRef,...$.droppableProps,children:[b.map((F,Q)=>e.jsx(po,{draggableId:F,index:Q,isDragDisabled:o,children:(X,ie)=>e.jsxs(c,{ref:X.innerRef,...X.draggableProps,className:"screenshot",sx:{transform:ie.isDragging?"scale(1.05)":"none",boxShadow:ie.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:F}),!o&&e.jsx(ce,{...X.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(bt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{d(Y=>{const de=[...Y.blockletScreenshots];return de.splice(Q,1),{...Y,blockletScreenshots:de}})},children:e.jsx(co,{})})]})},F)),$.placeholder,b.length<5&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var F;K()&&((F=k.current)==null||F.open())},children:"+"})]})})})]}),re&&e.jsx(mt,{errors:_,storeList:J}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(N,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("studio.video")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.videoType"),":"," "]}),e.jsxs(c,{component:"span",sx:{color:"#007ec6"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"1~3"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:f("studio.orderTip")})]})})]})]}),e.jsx(ao,{onDragEnd:o?void 0:Be,children:e.jsx(uo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:($,V)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:$.innerRef,...$.droppableProps,children:[l.blockletVideos.map((F,Q)=>e.jsx(po,{draggableId:F,index:Q,isDragDisabled:o,children:(X,ie)=>e.jsxs(c,{ref:X.innerRef,...X.draggableProps,className:"screenshot",sx:{transform:ie.isDragging?"scale(1.05)":"none",boxShadow:ie.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(st,{url:F,style:{pointerEvents:ie.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...X.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(bt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{d(Y=>{const de=[...Y.blockletVideos];return de.splice(Q,1),{...Y,blockletVideos:de}})},children:e.jsx(co,{})})]})},F)),$.placeholder,l.blockletVideos.length<3&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{K()&&B(!0)},children:"+"})]})})})]})]})}),e.jsxs(m.Suspense,{fallback:e.jsx(Fe,{}),children:[e.jsx(xo,{ref:D,locale:R,popup:!0,onUploadFinish:$=>{var V;d({blockletLogo:$.data.filename}),y(""),(V=D.current)==null||V.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:w,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),z&&e.jsx(Ko,{onClose:()=>B(!1),params:l,setParams:d}),e.jsx(xo,{ref:k,popup:!0,onUploadFinish:$=>{var V;d(F=>{var X;const Q=F.blockletScreenshots||[];return Q.push((X=$.data)==null?void 0:X.filename),{...F,blockletScreenshots:Q}}),(V=k.current)==null||V.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:q,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-b.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}es.propTypes={projectId:r.string.isRequired,readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,warning:r.object.isRequired,loading:r.bool.isRequired,blocklet:r.object.isRequired,setLoading:r.func.isRequired,initUrl:r.object.isRequired,componentDid:r.isRequired,initLogoUrl:r.string.isRequired,setInitLogoUrl:r.func.isRequired};const Xn=ge.div`
|
|
124
|
+
`;var Mt={},En=ke;Object.defineProperty(Mt,"__esModule",{value:!0});var bt=Mt.default=void 0,Wn=En(Re()),On=e;bt=Mt.default=(0,Wn.default)((0,On.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");const mo="lastWantToConnectStoreId";function Mn(t){var u,a;const[o,s]=m.useState(null),{session:i}=Ue(),l=m.useCallback(h=>{s(h),localStorage.setItem(mo,h==null?void 0:h.id)},[s]),d=m.useMemo(()=>{var y,p,f,R;const h=localStorage.getItem(mo),x=h?(((y=t==null?void 0:t.settings)==null?void 0:y.storeList)||[]).find(I=>I.id===h):null;if(x)return x;let S=(((p=t==null?void 0:t.settings)==null?void 0:p.storeList)||[]).find(I=>{var j;return!(I.id!==G.BLOCKLET_STORE.id||I.scope&&I.scope!=="studio"&&I.scope!==((j=i==null?void 0:i.user)==null?void 0:j.did))});return S||(S=(R=(f=t==null?void 0:t.settings)==null?void 0:f.storeList)==null?void 0:R[0]),S},[(u=t==null?void 0:t.settings)==null?void 0:u.storeList,(a=i==null?void 0:i.user)==null?void 0:a.did]);return[o||d||{},l]}const pt={};async function Qo(t,{interval:o=1e3,maxDuration:s=120*1e3,intervalFirst:i=4e3,timerKey:l=""}){pt[l]&&clearTimeout(pt[l]),await new Promise(u=>setTimeout(u,i));const d=Date.now(),n=async(u,a)=>{try{const h=await t();u(h)}catch(h){Date.now()-d>s?a(h):l?pt[l]=setTimeout(()=>n(u,a),o):setTimeout(()=>n(u,a),o)}};return new Promise(n)}function Vn(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Un(t,{did:o,projectId:s,messageId:i}){return Qo(async()=>{var d;const l=await t.getProject({input:{did:o,projectId:s,messageId:i}});if(!((d=l==null?void 0:l.project)!=null&&d.blockletDid))throw new Error("Connected store not found");return l.project.blockletDid},{timerKey:"connect-studio"})}function Fn(t,{did:o,projectId:s,storeId:i}){return Qo(async()=>{var n,u;const l=await t.getProject({input:{did:o,projectId:s,messageId:""}});if(!((u=(n=l==null?void 0:l.project)==null?void 0:n.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!l.project.connectedStores.find(a=>a.storeId===i))throw new Error("Connected store not found")},{timerKey:`connect-store-${i}`})}const Hn=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:i})=>{var n,u;const l=t?(n=s==null?void 0:s.meta)==null?void 0:n.did:o==null?void 0:o.did;let d=t?((u=s==null?void 0:s.settings)==null?void 0:u.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(d)||(d=[]),d=d.filter(a=>a.protected||!a.scope||a.scope==="studio"||a.scope===i),{teamDid:l,storeList:d}},Vt=Hn;function Ut({blocklet:t,store:o={},onChangeStore:s,onClick:i,disabled:l,loading:d,componentDid:n}){var b,w,q;const{t:u}=te(),{session:a}=Ue(),{api:h,info:x,inService:S}=ye(),y=ze(),[p,f]=m.useState(!1),R=m.useRef(null),[I,j]=m.useState(!1),[D,k]=m.useState(null),T=g=>{s(g),f(!1)},L=()=>{f(!p)},z=g=>{R.current&&R.current.contains(g.target)||f(!1)},B=()=>{j(!0)},v=()=>{j(!1)},C=async()=>{var g;if(D)try{await h.deleteBlockletStore({input:{teamDid:t.meta.did,url:D.url,projectId:"",scope:D.scope||"studio"}}),await((g=y==null?void 0:y.actions)==null?void 0:g.refreshBlocklet())}catch(_){M.error(`Remove Blocklet Store Error: ${Ne(_)}`)}finally{k(null)}},{storeList:H}=Vt({fromBlocklet:S,blocklet:t,nodeInfo:x,componentDid:n,userDid:(b=a==null?void 0:a.user)==null?void 0:b.did}),W=(w=t==null?void 0:t.meta)==null?void 0:w.did;return e.jsxs(e.Fragment,{children:[e.jsxs(ht,{disabled:l,ref:R,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(se,{onClick:i,children:[d&&e.jsx(Ye,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${o.name||""}`]}),e.jsx(se,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:L,children:e.jsx(an,{})})]}),e.jsx(So,{sx:{zIndex:10},open:p,anchorEl:R.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:g})=>e.jsx(Io,{...g,style:{transformOrigin:"center top"},children:e.jsx(jt,{children:e.jsx(Do,{onClickAway:z,children:e.jsxs(To,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[H==null?void 0:H.map(_=>{var J;return e.jsxs(fe,{selected:_.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>T(_),children:[e.jsxs(c,{children:[e.jsx(je,{sx:{fontSize:"16px"},maxLength:24,children:_.name}),e.jsx(je,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:_.url})]}),en({store:_,userDid:(J=a==null?void 0:a.user)==null?void 0:J.did})&&e.jsx(ce,{sx:{ml:1},onClick:U=>{U.preventDefault(),U.stopPropagation(),k(_)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},_.url)}),e.jsx(Rs,{}),e.jsxs(fe,{onClick:B,children:[e.jsx(Rt,{font:!0}),e.jsx(N,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),I&&e.jsx(Wo,{hiddenChildren:!0,open:!0,onClose:v,teamDid:W,storeList:H,scope:"studio",onAdd:(q=y==null?void 0:y.actions)==null?void 0:q.refreshBlocklet}),D&&e.jsx(vt,{displayError:!0,title:`${u("common.delete")} ${D.name}`,description:u("blocklet.publish.deleteStoreTip",{name:D.name}),confirm:u("common.confirm"),onConfirm:C,onCancel:()=>k(null)})]})}Ut.propTypes={store:r.object,blocklet:r.object,onChangeStore:r.func.isRequired,onClick:r.func.isRequired,loading:r.bool.isRequired,disabled:r.bool.isRequired,componentDid:r.string.isRequired,projectType:r.string.isRequired,getData:r.func.isRequired};Ut.defaultProps={store:null,blocklet:null};const Gn=(t,o,s)=>{const i=`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/logo/upload`,l=`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/screenshot/upload`,d=t!=null&&t.blockletLogo?`${i}/${t.blockletLogo}`:`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,n=((t==null?void 0:t.blockletScreenshots)||[]).filter(Boolean).map(u=>`${l}/${u}`);return{logoUrl:d,screenshotUrls:n,uploadLogoPrefix:i,uploadScreenshotPrefix:l}},Zo=Gn,Jn=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function st({url:t,style:o,controls:s,modestbranding:i}){var u;const{t:l}=te(),d=t.includes("youtube.com")||t.includes("youtu.be"),n=t.includes("vimeo.com");if(d){const a=((u=t.split("v=")[1])==null?void 0:u.split("&")[0])||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${a}?modestbranding=${i}&controls=${s}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(n){const a=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${a}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(c,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(c,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(N,{variant:"body1",sx:{opacity:.5},children:l("studio.videoDialogNoSrc")})]})})}st.propTypes={url:r.string.isRequired,style:r.object,controls:r.number,modestbranding:r.number};st.defaultProps={style:{},controls:1,modestbranding:1};function Ko({setParams:t,onClose:o,params:s}){const{t:i}=te(),[l,d]=m.useState(""),n=l&&s.blockletVideos.includes(l),u=Jn(l),a=()=>{t(h=>{const x=[...h.blockletVideos];return x.push(l),{...h,blockletVideos:x}}),o()};return e.jsxs(ot,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(_o,{children:i("studio.videoDialogTitle")}),e.jsxs(Po,{children:[e.jsx(vs,{fullWidth:!0,value:l,onChange:h=>d(h.target.value),placeholder:i("studio.videoInputLabel"),endAdornment:l?e.jsx(Ve,{position:"end",children:e.jsx(ce,{onClick:()=>d(""),children:e.jsx(Os,{})})}):null,error:n}),n&&e.jsx(N,{variant:"body2",color:"error",children:i("studio.duplicateVideo")}),e.jsx(st,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(qo,{children:[e.jsx(se,{onClick:()=>o(),children:i("studio.cancel")}),e.jsx(se,{disabled:!u||n,onClick:a,children:i("studio.confirm")})]})]})}Ko.propTypes={onClose:r.func.isRequired,params:r.object.isRequired,setParams:r.func.isRequired};function mt({errors:t,storeList:o,...s}){const{t:i}=te();return e.jsxs(c,{...s,color:"warning.main",fontSize:"14px",sx:{border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},children:[e.jsx(N,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:i("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([l,d])=>{const n=Object.values(d),u=o.find(a=>a.url===l);return n.length>0&&e.jsxs(c,{children:[e.jsx(xe,{title:l,children:e.jsx(c,{component:"span",sx:{cursor:"pointer"},children:u.name})}),n.map(a=>e.jsx(c,{component:"li",ml:2,breakWords:!0,children:a},a))]},l)})]})}mt.propTypes={errors:r.object.isRequired,storeList:r.array.isRequired};const xo=m.lazy(()=>zo(()=>import("./index-C5lvlGzp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(t=>({default:t.Uploader})));function es({projectId:t,readOnly:o,loading:s,blocklet:i,params:l,setParams:d,paramsErrTip:n,setParamsErrTip:u,warning:a,setLoading:h,initUrl:x,initLogoUrl:S,setInitLogoUrl:y,componentDid:p}){const{t:f,locale:R}=te(),{api:I}=ye(),j=gt(),D=m.useRef(null),k=m.useRef(null),[T,L]=Mn(i),[z,B]=m.useState(!1),v=tn({messageType:"connect-store-message",onOpen:()=>h(!0),onClose:()=>h(!1)}),C=async $=>{const V=setTimeout(()=>{h(!1)},2e4),F=await Un(I,$);h(!1),clearTimeout(V),window.parent.postMessage({event:"studioDialog.connected",componentDid:p},"*"),j(window.location.pathname.replace(`${G.UNOWNED_DID}/create`,`${F}/create`),{replace:!0})},H=()=>{if(!l.blockletTitle){M.error(f("blocklet.publish.errorTip.noTitle"));return}if(!(T!=null&&T.url)){M.error(f("blocklet.publish.noStoreSelected"));return}const $=Vn();v(async(V,F)=>{var Q,X,ie;try{const Y=await I.connectByStudio({input:{did:(Q=i==null?void 0:i.meta)==null?void 0:Q.did,blockletTitle:l==null?void 0:l.blockletTitle,storeUrl:T.url,storeId:T.id,storeName:T.name,type:((X=l==null?void 0:l.blockletComponents)==null?void 0:X.length)>0?"pack":"resource",componentDid:p,messageId:$,tenantScope:(x==null?void 0:x.searchParams.get("tenantScope"))||""}});if(!(Y!=null&&Y.url)){M.error("failed to connect to store");return}F(Y.url),C({did:(ie=i==null?void 0:i.meta)==null?void 0:ie.did,projectId:"",messageId:$})}catch(Y){const de=Ne(Y);M.error(de),h(!1)}})},{logoUrl:W,screenshotUrls:b,uploadLogoPrefix:w,uploadScreenshotPrefix:q}=Zo(l,i,t),{logoErrors:g,screenshotErrors:_,storeList:J,hasLogoWarning:U,hasScreenshotWarning:re}=a,K=()=>o?!1:!t||t===G.UNOWNED_DID?(M.error(f("blocklet.publish.errorTip.noFirstDid")),!1):!0,ee=$=>{if(!$.destination)return;const V=Array.from(l.blockletScreenshots),[F]=V.splice($.source.index,1);V.splice($.destination.index,0,F),d(Q=>({...Q,blockletScreenshots:V}))},Be=$=>{if(!$.destination)return;const V=Array.from(l.blockletVideos),[F]=V.splice($.source.index,1);V.splice($.destination.index,0,F),d(Q=>({...Q,blockletVideos:V}))};return e.jsxs(Xn,{children:[e.jsx(c,{display:"flex",className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.title")}`,placeholder:`Blocklet ${f("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:l.blockletTitle||"",onChange:$=>{u({blockletTitle:""}),d({blockletTitle:$.target.value})},error:!!n.blockletTitle,helperText:n.blockletTitle||""}),e.jsx(oe,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:t===G.UNOWNED_DID&&e.jsx(Ve,{position:"end",children:e.jsx(Ut,{blocklet:i,store:T,componentDid:p,onChangeStore:L,disabled:!l.blockletTitle||o||s,loading:s,onClick:H})})},error:!!n.projectId,helperText:n.projectId||"",value:t===G.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3}}),e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.description")}`,placeholder:`Blocklet ${f("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:o},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletDescription||"",onChange:$=>{u({blockletDescription:""}),d({blockletDescription:$.target.value})},error:!!n.blockletDescription,helperText:n.blockletDescription||"",sx:{mt:3}}),e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.homepageTip")}`,placeholder:`Blocklet ${f("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletHomepage||"",onChange:$=>{$.target.value&&!/^(http|https):\/\//.test($.target.value)?u({blockletHomepage:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletHomepage:""}),d({blockletHomepage:$.target.value})},error:!!n.blockletHomepage,helperText:n.blockletHomepage||"",sx:{mt:3}}),e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.community")}`,placeholder:`Blocklet ${f("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletCommunity||"",onChange:$=>{$.target.value&&!/^(http|https):\/\//.test($.target.value)?u({blockletCommunity:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletCommunity:""}),d({blockletCommunity:$.target.value})},error:!!n.blockletCommunity,helperText:n.blockletCommunity||"",sx:{mt:3}}),e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.support")}`,placeholder:`Blocklet ${f("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletSupport||"",onChange:$=>{$.target.value&&!/^(http|https):\/\//.test($.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test($.target.value)?u({blockletSupport:f("blocklet.publish.errorTip.invalidUrlOrEmail")}):u({blockletSupport:""}),d({blockletSupport:$.target.value})},error:!!n.blockletSupport,helperText:n.blockletSupport||"",sx:{mt:3}}),e.jsx(oe,{disabled:s||o,label:`Blocklet ${f("common.repository")}`,placeholder:`Blocklet ${f("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletRepository||"",onChange:$=>{$.target.value&&!/^(git|https|svn)/.test($.target.value)?u({blockletRepository:f("blocklet.publish.errorTip.invalidUrl")}):u({blockletRepository:""}),d({blockletRepository:$.target.value})},error:!!n.blockletRepository,helperText:n.blockletRepository||"",sx:{mt:3}})]})}),e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsxs(c,{flex:1,overflow:"hidden",children:[e.jsxs(c,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(N,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("common.logo")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.type"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"png, jpg, webp, svg"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),e.jsx(c,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(vo,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:S||W,onClick:()=>{var $;K()&&(($=D.current)==null||$.open())}})})]}),U&&e.jsx(mt,{errors:g,storeList:J,mt:3}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(N,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("common.screenshot")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:f("studio.orderTip")})]})})]})]}),e.jsx(ao,{onDragEnd:o?void 0:ee,children:e.jsx(uo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:($,V)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:$.innerRef,...$.droppableProps,children:[b.map((F,Q)=>e.jsx(po,{draggableId:F,index:Q,isDragDisabled:o,children:(X,ie)=>e.jsxs(c,{ref:X.innerRef,...X.draggableProps,className:"screenshot",sx:{transform:ie.isDragging?"scale(1.05)":"none",boxShadow:ie.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:F}),!o&&e.jsx(ce,{...X.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(bt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{d(Y=>{const de=[...Y.blockletScreenshots];return de.splice(Q,1),{...Y,blockletScreenshots:de}})},children:e.jsx(co,{})})]})},F)),$.placeholder,b.length<5&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var F;K()&&((F=k.current)==null||F.open())},children:"+"})]})})})]}),re&&e.jsx(mt,{errors:_,storeList:J}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Se,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(N,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("studio.video")}),e.jsxs(Se,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.videoType"),":"," "]}),e.jsxs(c,{component:"span",sx:{color:"#007ec6"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:"1~3"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"#555"},children:[f("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"#007ec6"},children:f("studio.orderTip")})]})})]})]}),e.jsx(ao,{onDragEnd:o?void 0:Be,children:e.jsx(uo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:($,V)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:$.innerRef,...$.droppableProps,children:[l.blockletVideos.map((F,Q)=>e.jsx(po,{draggableId:F,index:Q,isDragDisabled:o,children:(X,ie)=>e.jsxs(c,{ref:X.innerRef,...X.draggableProps,className:"screenshot",sx:{transform:ie.isDragging?"scale(1.05)":"none",boxShadow:ie.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(st,{url:F,style:{pointerEvents:ie.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...X.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(bt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{d(Y=>{const de=[...Y.blockletVideos];return de.splice(Q,1),{...Y,blockletVideos:de}})},children:e.jsx(co,{})})]})},F)),$.placeholder,l.blockletVideos.length<3&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{K()&&B(!0)},children:"+"})]})})})]})]})}),e.jsxs(m.Suspense,{fallback:e.jsx(Fe,{}),children:[e.jsx(xo,{ref:D,locale:R,popup:!0,onUploadFinish:$=>{var V;d({blockletLogo:$.data.filename}),y(""),(V=D.current)==null||V.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:w,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),z&&e.jsx(Ko,{onClose:()=>B(!1),params:l,setParams:d}),e.jsx(xo,{ref:k,popup:!0,onUploadFinish:$=>{var V;d(F=>{var X;const Q=F.blockletScreenshots||[];return Q.push((X=$.data)==null?void 0:X.filename),{...F,blockletScreenshots:Q}}),(V=k.current)==null||V.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:q,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-b.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}es.propTypes={projectId:r.string.isRequired,readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,warning:r.object.isRequired,loading:r.bool.isRequired,blocklet:r.object.isRequired,setLoading:r.func.isRequired,initUrl:r.object.isRequired,componentDid:r.isRequired,initLogoUrl:r.string.isRequired,setInitLogoUrl:r.func.isRequired};const Xn=ge.div`
|
|
125
125
|
margin-top: 24px;
|
|
126
126
|
.screenshot {
|
|
127
127
|
margin-bottom: 16px;
|
|
@@ -169,7 +169,7 @@ import{r as m,f as gt,l as tt,L as me,u as js,i as ks,j as ct}from"./vendor-reac
|
|
|
169
169
|
padding-bottom: 12px;
|
|
170
170
|
border-bottom: ${({theme:t})=>`1px solid ${t.palette.divider}`};
|
|
171
171
|
}
|
|
172
|
-
`;function rs({text:t}){return t?e.jsx(un,{wrapperElement:{"data-color-mode":"light"},source:Fs.sanitize(t),rehypePlugins:[[pn,{target:"_blank"}]]}):e.jsx(Ae,{Icon:Dt})}rs.propTypes={text:r.string.isRequired};function is({params:t,setParams:o,paramsErrTip:s,loading:i,setParamsErrTip:l,readOnly:d}){var x;const{t:n}=te(),[u,a]=m.useState(d?"preview":"write"),h=(S,y)=>{a(y)};return e.jsxs(c,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[e.jsxs(c,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(N,{variant:"h6",fontWeight:"bold",sx:{},children:n("common.introduction")}),e.jsxs($o,{value:u,onChange:h,"aria-label":"wrapped label tabs example",children:[e.jsx(Qe,{value:"write",label:"Write"}),e.jsx(Qe,{value:"preview",label:"Preview"})]})]}),e.jsx(c,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:e.jsx(oe,{disabled:i||d,sx:{border:"none"},placeholder:`Blocklet ${n("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:d,endAdornment:e.jsxs(Ve,{position:"end",children:[((x=t==null?void 0:t.blockletIntroduction)==null?void 0:x.length)||0," / ",ue.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:S=>{l({blockletIntroduction:""}),o({blockletIntroduction:S.target.value.slice(0,ue.PROJECT.MAX_INTRO_LENGTH)})},error:!!s.blockletIntroduction,helperText:s.blockletIntroduction||""})}),e.jsx(c,{display:u==="preview"?"block":"none",mt:3,children:e.jsx(rs,{text:t.blockletIntroduction||""})})]})}is.propTypes={params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,readOnly:r.bool.isRequired,loading:r.bool.isRequired};var Gt={},ll=ke;Object.defineProperty(Gt,"__esModule",{value:!0});var xt=Gt.default=void 0,rl=ll(Re()),jo=e;xt=Gt.default=(0,rl.default)([(0,jo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,jo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function Jt({step:t,ok:o,active:s,error:i,warning:l}){let d="grey.500",n=t+1;return o&&(n=e.jsx(hn,{sx:{fontSize:18,margin:0},color:"white"})),i||!o&&s>t?(d="error.main",n=e.jsx(xt,{sx:{fontSize:18,margin:0},color:"white"})):l?(d="warning.main",n=e.jsx(xt,{sx:{fontSize:18,margin:0},color:"white"})):s>=t&&(d="primary.main"),e.jsx(c,{width:24,height:24,bgcolor:d,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:n})}Jt.propTypes={step:r.number,ok:r.bool,active:r.number,error:r.string,warning:r.bool};Jt.defaultProps={step:0,ok:!1,active:0,error:"",warning:!1};function cs({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:i,params:l,loading:d,paramsErrTip:n,warning:u,viewMode:a,projectId:h}){const{t:x}=te(),S=()=>{s(R=>R+1)},y=()=>{s(R=>R-1)},p=R=>R===0?(n==null?void 0:n.blockletTitle)||(n==null?void 0:n.projectId)||(n==null?void 0:n.blockletDescription)||(n==null?void 0:n.blockletHomepage)||(n==null?void 0:n.blockletSupport)||(n==null?void 0:n.blockletCommunity)||(n==null?void 0:n.blockletRepository):R===2?(n==null?void 0:n.blockletResource)||(n==null?void 0:n.blockletDocker)||(n==null?void 0:n.dockerImageName):R>=4?(n==null?void 0:n.blockletVersion)||(n==null?void 0:n.note):"",f=a||os({hasSelectedResources:i,params:l,projectId:h,t:x})===null;return e.jsxs(c,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[e.jsx(Ds,{activeStep:o,orientation:"vertical",children:t.map((R,I)=>{const j={},D=d||!sl({hasSelectedResources:i,params:l,projectId:h,step:I,t:x}),k=d?"":p(I);return k&&(j.optional=e.jsx(N,{variant:"caption",color:"error",children:k}),j.error=!0),e.jsxs(Ts,{children:[e.jsx(_s,{icon:e.jsx(Jt,{error:k,warning:I===0?u.hasWarning:!1,active:f?99:o,step:I,ok:D}),sx:{cursor:"pointer",color:k?"error.main":"inherit"},disabled:!1,onClick:()=>s(I),...j,children:e.jsx(N,{fontSize:"14px",fontWeight:"500",color:k||!D&&o>I?"error.main":"inherit",children:R.label})}),e.jsxs(Ps,{children:[e.jsx(N,{fontSize:12,children:R.description}),!f&&e.jsx(c,{sx:{mb:2},children:e.jsxs("div",{children:[I<t.length-1&&e.jsx(se,{variant:"contained",onClick:S,sx:{mt:1,mr:1},disabled:k||!D,children:x("common.continue")}),I>0&&e.jsx(se,{disabled:I===0,onClick:y,sx:{mt:1,mr:1},children:x("common.back")})]})})]})]},R.label)})}),o>=t.length-1&&e.jsx(jt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(N,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}cs.propTypes={steps:r.array.isRequired,activeStep:r.number.isRequired,setActiveStep:r.func.isRequired,params:r.object.isRequired,viewMode:r.string.isRequired,loading:r.bool.isRequired,projectId:r.string.isRequired,hasSelectedResources:r.bool.isRequired,warning:r.object.isRequired,paramsErrTip:r.shape({projectId:r.string,blockletVersion:r.string,blockletTitle:r.string,blockletDescription:r.string,note:r.string,blockletResource:r.string,blockletHomepage:r.string,blockletSupport:r.string,blockletCommunity:r.string,blockletRepository:r.string,blockletDocker:r.object,dockerImageName:r.string}).isRequired};const il=[".zip",".gz"],cl=1024*1024*100,al=m.lazy(()=>zo(()=>import("./index-rMaglH7e.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(t=>({default:t.Uploader})));function Xt({app:t,projectId:o,readOnly:s,params:i,setParams:l,setParamsErrTip:d,error:n}){const{t:u,locale:a}=te(),h=m.useRef(null),x=()=>s?!1:!o||o===G.UNOWNED_DID?(M.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,S=`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(c,{sx:{mt:3},children:[e.jsx(N,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),e.jsxs(Se,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:s?"default":"pointer"},children:[!!i.uploadedResource&&e.jsx(N,{component:"a",href:`${S}/params.uploadedResource`,children:i.uploadedResource}),!s&&e.jsx(se,{variant:"outlined",size:"small",onClick:()=>{var y;x()&&((y=h.current)==null||y.open())},children:i.uploadedResource?u("common.change"):u("common.upload")})]}),e.jsx(m.Suspense,{fallback:e.jsx(Fe,{}),children:e.jsx(al,{ref:h,locale:a,popup:!0,onUploadFinish:y=>{var p;l({uploadedResource:y.data.filename}),d({blockletResource:""}),(p=h.current)==null||p.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:il,maxFileSize:cl,maxNumberOfFiles:1}}},"uploader-resource")}),!!n&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:n})]})}Xt.propTypes={app:r.object.isRequired,projectId:r.string.isRequired,readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,error:r.string.isRequired,setParamsErrTip:r.func.isRequired};Xt.defaultProps={};function Ke({readOnly:t,params:o,setParams:s,paramsErrTip:i,setParamsErrTip:l,loading:d}){var u;const{t:n}=te();return e.jsx(c,{display:"flex",mt:3,className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(oe,{required:!0,disabled:d||t,label:`Blocklet ${n("common.version")}`,placeholder:`Blocklet ${n("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:a=>{l({blockletVersion:""}),s({blockletVersion:a.target.value})},error:!!i.blockletVersion,helperText:i.blockletVersion||""}),e.jsx(oe,{label:n("blocklet.publish.releaseNote"),autoComplete:"off",disabled:d||t,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Ve,{position:"end",children:[((u=o==null?void 0:o.note)==null?void 0:u.length)||0," / ",ue.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:a=>{l({note:""}),s({note:a.target.value.slice(0,ue.PROJECT.MAX_NOTE_LENGTH)})},error:!!i.note,helperText:i.note||"",sx:{mt:3}})]})})}Ke.propTypes={readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,loading:r.bool.isRequired};Ke.defaultProps={};function as(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&as(t[o]);return t}function et({index:t,item:o,dockerParams:s,setDockerParams:i,dataKey:l,t:d,readOnly:n}){const u=(o==null?void 0:o.value)||"",[a,h]=m.useState(!1),x=()=>{var W;(W=s[l])==null||W.splice(t,1),i({...s,[l]:[...s[l]]})},S=(W,b)=>{var w;(w=s[l])!=null&&w[t]&&(b?(s[l][t].custom=s[l][t].value,s[l][t].value=`$${dt(o.key)}`):(s[l][t].value=s[l][t].custom||"",s[l][t].custom="")),i({...s,[l]:[...s[l]]})},y=(W,b)=>{var q;const w=((q=s[l][t])==null?void 0:q.value)||"";s[l][t]={...s[l][t],secure:b,value:b&&w===ue.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},i({...s,[l]:[...s[l]]})},p=(W,b)=>{s[l][t]={...s[l][t],shared:b},i({...s,[l]:[...s[l]]})},f=(W,b)=>{var q;const w=((q=s[l][t])==null?void 0:q.value)||"";s[l][t]={...s[l][t],required:b,value:b&&w===ue.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},i({...s,[l]:[...s[l]]})},R=(W,b)=>{s[l][t]={...s[l][t],value:b?ue.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},i({...s,[l]:[...s[l]]})},I=W=>{s[l][t]={...s[l][t],description:W.target.value},i({...s,[l]:[...s[l]]})},j=W=>{const b=W.target.value==="web"?"web":"docker";b==="web"&&s.dockerArgs.forEach(g=>{g.type="docker"});const q=`/${s.dockerImage.replace(/\W/g,"-")}-${t}`;s.dockerArgs[t]={...s.dockerArgs[t],type:b,path:b==="docker"?q:"/",protocol:"http",prefix:b==="docker"?q:"/",name:"publicUrl",port:"BLOCKLET_PORT"},i({...s,dockerArgs:[...s.dockerArgs]})},D=W=>{s.dockerArgs[t]={...s.dockerArgs[t],proxyBehavior:W.target.value==="direct"?"direct":"service"},i({...s,dockerArgs:[...s.dockerArgs]})},k=W=>{const b=W.target.value;s[l][t]={...s[l][t],prefix:b,path:b==="*"?"/":b},i({...s,[l]:[...s[l]]})},T=W=>{var b;(b=s[l])!=null&&b[t]&&(s[l][t].value=W.target.value),i({...s,[l]:[...s[l]]})},L=u===`$${dt(o.key)}`||o.custom,z=l==="dockerArgs"&&!Oo[o.key],B=nn[o.key],v=l==="dockerEnvs",C=o.key==="--publish";let H=o.key;return C&&o.type==="web"?H="--publish (Web)":v&&(H=`--env ${o.key}`),e.jsxs(c,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(c,{sx:{width:250},children:e.jsx(N,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:H})}),e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(oe,{disabled:n||L||z||o.value===ue.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:L?`$${dt(o.key)}`:u,sx:{flex:1},InputProps:{endAdornment:e.jsxs(Ve,{position:"end",sx:{zoom:.9},children:[(!(B||z)||v||C)&&e.jsx(ce,{onClick:()=>h(!0),children:e.jsx(ae,{icon:"icon-park-outline:setting-config"})}),!n&&e.jsx(ce,{onClick:x,color:z?"error":"default",children:e.jsx(ae,{icon:"ic:round-delete"})})]})},error:z,onChange:T}),z&&e.jsx(N,{variant:"caption",color:"error",children:d("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(N,{variant:"caption",color:"text.secondary",children:d("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&ln[o.key](u)&&e.jsx(N,{variant:"caption",color:"error",children:d("blocklet.publish.docker.volumeTips")})]}),a&&e.jsx(yt,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:d(v?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>h(!1),children:e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[B||z||v?null:e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{children:d("blocklet.publish.docker.needCustomInput")}),e.jsx(De,{disabled:n,checked:L,onChange:S,sx:{zoom:.9}})]}),v&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{children:d("blocklet.publish.docker.shared")}),e.jsx(De,{disabled:n,checked:o.shared,onChange:p,sx:{zoom:.9}})]}),v&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{children:d("blocklet.publish.docker.required")}),e.jsx(De,{disabled:n,checked:o.required,onChange:f,sx:{zoom:.9}})]}),v&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{children:d("blocklet.publish.docker.secure")}),e.jsx(De,{disabled:n,checked:o.secure,onChange:y,sx:{zoom:.9}})]}),v&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{children:d("blocklet.publish.docker.autoGenerated")}),e.jsx(De,{disabled:n,checked:o.value===ue.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:R,sx:{zoom:.9}})]}),v&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{sx:{flex:1},children:d("blocklet.publish.docker.description")}),e.jsx(oe,{disabled:n,value:o.description,onChange:I,sx:{flex:1},label:d("blocklet.publish.docker.description")})]}),C&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{sx:{flex:1},children:d("blocklet.publish.docker.portType")}),e.jsxs(ft,{value:o.type||"docker",onChange:j,children:[e.jsx(fe,{value:"docker",children:"Docker"}),e.jsx(fe,{value:"web",children:"Web"})]})]}),C&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{sx:{flex:1},children:d("blocklet.publish.docker.proxyBehavior")}),e.jsxs(ft,{value:o.proxyBehavior||"service",onChange:D,children:[e.jsx(fe,{value:"service",children:d("blocklet.publish.docker.serviceProxy")}),e.jsx(fe,{value:"direct",children:d("blocklet.publish.docker.directProxy")})]})]}),C&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{sx:{flex:1},children:d("blocklet.publish.docker.prefix")}),e.jsx(oe,{disabled:n,value:o.prefix,onChange:k,sx:{flex:1},label:d("blocklet.publish.docker.prefix")})]})]})})]})}et.propTypes={dockerParams:r.object.isRequired,setDockerParams:r.func.isRequired,dataKey:r.string.isRequired,item:r.object.isRequired,t:r.func.isRequired,readOnly:r.bool.isRequired,index:r.number.isRequired};et.defaultProps={};const dl=`
|
|
172
|
+
`;function rs({text:t}){return t?e.jsx(un,{wrapperElement:{"data-color-mode":"light"},source:Fs.sanitize(t),rehypePlugins:[[pn,{target:"_blank"}]]}):e.jsx(Ae,{Icon:Dt})}rs.propTypes={text:r.string.isRequired};function is({params:t,setParams:o,paramsErrTip:s,loading:i,setParamsErrTip:l,readOnly:d}){var x;const{t:n}=te(),[u,a]=m.useState(d?"preview":"write"),h=(S,y)=>{a(y)};return e.jsxs(c,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[e.jsxs(c,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(N,{variant:"h6",fontWeight:"bold",sx:{},children:n("common.introduction")}),e.jsxs($o,{value:u,onChange:h,"aria-label":"wrapped label tabs example",children:[e.jsx(Qe,{value:"write",label:"Write"}),e.jsx(Qe,{value:"preview",label:"Preview"})]})]}),e.jsx(c,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:e.jsx(oe,{disabled:i||d,sx:{border:"none"},placeholder:`Blocklet ${n("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:d,endAdornment:e.jsxs(Ve,{position:"end",children:[((x=t==null?void 0:t.blockletIntroduction)==null?void 0:x.length)||0," / ",ue.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:S=>{l({blockletIntroduction:""}),o({blockletIntroduction:S.target.value.slice(0,ue.PROJECT.MAX_INTRO_LENGTH)})},error:!!s.blockletIntroduction,helperText:s.blockletIntroduction||""})}),e.jsx(c,{display:u==="preview"?"block":"none",mt:3,children:e.jsx(rs,{text:t.blockletIntroduction||""})})]})}is.propTypes={params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,readOnly:r.bool.isRequired,loading:r.bool.isRequired};var Gt={},ll=ke;Object.defineProperty(Gt,"__esModule",{value:!0});var xt=Gt.default=void 0,rl=ll(Re()),jo=e;xt=Gt.default=(0,rl.default)([(0,jo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,jo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function Jt({step:t,ok:o,active:s,error:i,warning:l}){let d="grey.500",n=t+1;return o&&(n=e.jsx(hn,{sx:{fontSize:18,margin:0},color:"white"})),i||!o&&s>t?(d="error.main",n=e.jsx(xt,{sx:{fontSize:18,margin:0},color:"white"})):l?(d="warning.main",n=e.jsx(xt,{sx:{fontSize:18,margin:0},color:"white"})):s>=t&&(d="primary.main"),e.jsx(c,{width:24,height:24,bgcolor:d,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:n})}Jt.propTypes={step:r.number,ok:r.bool,active:r.number,error:r.string,warning:r.bool};Jt.defaultProps={step:0,ok:!1,active:0,error:"",warning:!1};function cs({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:i,params:l,loading:d,paramsErrTip:n,warning:u,viewMode:a,projectId:h}){const{t:x}=te(),S=()=>{s(R=>R+1)},y=()=>{s(R=>R-1)},p=R=>R===0?(n==null?void 0:n.blockletTitle)||(n==null?void 0:n.projectId)||(n==null?void 0:n.blockletDescription)||(n==null?void 0:n.blockletHomepage)||(n==null?void 0:n.blockletSupport)||(n==null?void 0:n.blockletCommunity)||(n==null?void 0:n.blockletRepository):R===2?(n==null?void 0:n.blockletResource)||(n==null?void 0:n.blockletDocker)||(n==null?void 0:n.dockerImageName):R>=4?(n==null?void 0:n.blockletVersion)||(n==null?void 0:n.note):"",f=a||os({hasSelectedResources:i,params:l,projectId:h,t:x})===null;return e.jsxs(c,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[e.jsx(Ds,{activeStep:o,orientation:"vertical",children:t.map((R,I)=>{const j={},D=d||!sl({hasSelectedResources:i,params:l,projectId:h,step:I,t:x}),k=d?"":p(I);return k&&(j.optional=e.jsx(N,{variant:"caption",color:"error",children:k}),j.error=!0),e.jsxs(Ts,{children:[e.jsx(_s,{icon:e.jsx(Jt,{error:k,warning:I===0?u.hasWarning:!1,active:f?99:o,step:I,ok:D}),sx:{cursor:"pointer",color:k?"error.main":"inherit"},disabled:!1,onClick:()=>s(I),...j,children:e.jsx(N,{fontSize:"14px",fontWeight:"500",color:k||!D&&o>I?"error.main":"inherit",children:R.label})}),e.jsxs(Ps,{children:[e.jsx(N,{fontSize:12,children:R.description}),!f&&e.jsx(c,{sx:{mb:2},children:e.jsxs("div",{children:[I<t.length-1&&e.jsx(se,{variant:"contained",onClick:S,sx:{mt:1,mr:1},disabled:k||!D,children:x("common.continue")}),I>0&&e.jsx(se,{disabled:I===0,onClick:y,sx:{mt:1,mr:1},children:x("common.back")})]})})]})]},R.label)})}),o>=t.length-1&&e.jsx(jt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(N,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}cs.propTypes={steps:r.array.isRequired,activeStep:r.number.isRequired,setActiveStep:r.func.isRequired,params:r.object.isRequired,viewMode:r.string.isRequired,loading:r.bool.isRequired,projectId:r.string.isRequired,hasSelectedResources:r.bool.isRequired,warning:r.object.isRequired,paramsErrTip:r.shape({projectId:r.string,blockletVersion:r.string,blockletTitle:r.string,blockletDescription:r.string,note:r.string,blockletResource:r.string,blockletHomepage:r.string,blockletSupport:r.string,blockletCommunity:r.string,blockletRepository:r.string,blockletDocker:r.object,dockerImageName:r.string}).isRequired};const il=[".zip",".gz"],cl=1024*1024*100,al=m.lazy(()=>zo(()=>import("./index-C5lvlGzp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(t=>({default:t.Uploader})));function Xt({app:t,projectId:o,readOnly:s,params:i,setParams:l,setParamsErrTip:d,error:n}){const{t:u,locale:a}=te(),h=m.useRef(null),x=()=>s?!1:!o||o===G.UNOWNED_DID?(M.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,S=`${G.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(c,{sx:{mt:3},children:[e.jsx(N,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),e.jsxs(Se,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:s?"default":"pointer"},children:[!!i.uploadedResource&&e.jsx(N,{component:"a",href:`${S}/params.uploadedResource`,children:i.uploadedResource}),!s&&e.jsx(se,{variant:"outlined",size:"small",onClick:()=>{var y;x()&&((y=h.current)==null||y.open())},children:i.uploadedResource?u("common.change"):u("common.upload")})]}),e.jsx(m.Suspense,{fallback:e.jsx(Fe,{}),children:e.jsx(al,{ref:h,locale:a,popup:!0,onUploadFinish:y=>{var p;l({uploadedResource:y.data.filename}),d({blockletResource:""}),(p=h.current)==null||p.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:il,maxFileSize:cl,maxNumberOfFiles:1}}},"uploader-resource")}),!!n&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:n})]})}Xt.propTypes={app:r.object.isRequired,projectId:r.string.isRequired,readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,error:r.string.isRequired,setParamsErrTip:r.func.isRequired};Xt.defaultProps={};function Ke({readOnly:t,params:o,setParams:s,paramsErrTip:i,setParamsErrTip:l,loading:d}){var u;const{t:n}=te();return e.jsx(c,{display:"flex",mt:3,className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(oe,{required:!0,disabled:d||t,label:`Blocklet ${n("common.version")}`,placeholder:`Blocklet ${n("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:a=>{l({blockletVersion:""}),s({blockletVersion:a.target.value})},error:!!i.blockletVersion,helperText:i.blockletVersion||""}),e.jsx(oe,{label:n("blocklet.publish.releaseNote"),autoComplete:"off",disabled:d||t,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Ve,{position:"end",children:[((u=o==null?void 0:o.note)==null?void 0:u.length)||0," / ",ue.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:a=>{l({note:""}),s({note:a.target.value.slice(0,ue.PROJECT.MAX_NOTE_LENGTH)})},error:!!i.note,helperText:i.note||"",sx:{mt:3}})]})})}Ke.propTypes={readOnly:r.bool.isRequired,params:r.object.isRequired,setParams:r.func.isRequired,paramsErrTip:r.object.isRequired,setParamsErrTip:r.func.isRequired,loading:r.bool.isRequired};Ke.defaultProps={};function as(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&as(t[o]);return t}function et({index:t,item:o,dockerParams:s,setDockerParams:i,dataKey:l,t:d,readOnly:n}){const u=(o==null?void 0:o.value)||"",[a,h]=m.useState(!1),x=()=>{var W;(W=s[l])==null||W.splice(t,1),i({...s,[l]:[...s[l]]})},S=(W,b)=>{var w;(w=s[l])!=null&&w[t]&&(b?(s[l][t].custom=s[l][t].value,s[l][t].value=`$${dt(o.key)}`):(s[l][t].value=s[l][t].custom||"",s[l][t].custom="")),i({...s,[l]:[...s[l]]})},y=(W,b)=>{var q;const w=((q=s[l][t])==null?void 0:q.value)||"";s[l][t]={...s[l][t],secure:b,value:b&&w===ue.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},i({...s,[l]:[...s[l]]})},p=(W,b)=>{s[l][t]={...s[l][t],shared:b},i({...s,[l]:[...s[l]]})},f=(W,b)=>{var q;const w=((q=s[l][t])==null?void 0:q.value)||"";s[l][t]={...s[l][t],required:b,value:b&&w===ue.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},i({...s,[l]:[...s[l]]})},R=(W,b)=>{s[l][t]={...s[l][t],value:b?ue.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},i({...s,[l]:[...s[l]]})},I=W=>{s[l][t]={...s[l][t],description:W.target.value},i({...s,[l]:[...s[l]]})},j=W=>{const b=W.target.value==="web"?"web":"docker";b==="web"&&s.dockerArgs.forEach(g=>{g.type="docker"});const q=`/${s.dockerImage.replace(/\W/g,"-")}-${t}`;s.dockerArgs[t]={...s.dockerArgs[t],type:b,path:b==="docker"?q:"/",protocol:"http",prefix:b==="docker"?q:"/",name:"publicUrl",port:"BLOCKLET_PORT"},i({...s,dockerArgs:[...s.dockerArgs]})},D=W=>{s.dockerArgs[t]={...s.dockerArgs[t],proxyBehavior:W.target.value==="direct"?"direct":"service"},i({...s,dockerArgs:[...s.dockerArgs]})},k=W=>{const b=W.target.value;s[l][t]={...s[l][t],prefix:b,path:b==="*"?"/":b},i({...s,[l]:[...s[l]]})},T=W=>{var b;(b=s[l])!=null&&b[t]&&(s[l][t].value=W.target.value),i({...s,[l]:[...s[l]]})},L=u===`$${dt(o.key)}`||o.custom,z=l==="dockerArgs"&&!Oo[o.key],B=nn[o.key],v=l==="dockerEnvs",C=o.key==="--publish";let H=o.key;return C&&o.type==="web"?H="--publish (Web)":v&&(H=`--env ${o.key}`),e.jsxs(c,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(c,{sx:{width:250},children:e.jsx(N,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:H})}),e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(oe,{disabled:n||L||z||o.value===ue.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:L?`$${dt(o.key)}`:u,sx:{flex:1},InputProps:{endAdornment:e.jsxs(Ve,{position:"end",sx:{zoom:.9},children:[(!(B||z)||v||C)&&e.jsx(ce,{onClick:()=>h(!0),children:e.jsx(ae,{icon:"icon-park-outline:setting-config"})}),!n&&e.jsx(ce,{onClick:x,color:z?"error":"default",children:e.jsx(ae,{icon:"ic:round-delete"})})]})},error:z,onChange:T}),z&&e.jsx(N,{variant:"caption",color:"error",children:d("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(N,{variant:"caption",color:"text.secondary",children:d("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&ln[o.key](u)&&e.jsx(N,{variant:"caption",color:"error",children:d("blocklet.publish.docker.volumeTips")})]}),a&&e.jsx(yt,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:d(v?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>h(!1),children:e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[B||z||v?null:e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{children:d("blocklet.publish.docker.needCustomInput")}),e.jsx(De,{disabled:n,checked:L,onChange:S,sx:{zoom:.9}})]}),v&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{children:d("blocklet.publish.docker.shared")}),e.jsx(De,{disabled:n,checked:o.shared,onChange:p,sx:{zoom:.9}})]}),v&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{children:d("blocklet.publish.docker.required")}),e.jsx(De,{disabled:n,checked:o.required,onChange:f,sx:{zoom:.9}})]}),v&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{children:d("blocklet.publish.docker.secure")}),e.jsx(De,{disabled:n,checked:o.secure,onChange:y,sx:{zoom:.9}})]}),v&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{children:d("blocklet.publish.docker.autoGenerated")}),e.jsx(De,{disabled:n,checked:o.value===ue.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:R,sx:{zoom:.9}})]}),v&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{sx:{flex:1},children:d("blocklet.publish.docker.description")}),e.jsx(oe,{disabled:n,value:o.description,onChange:I,sx:{flex:1},label:d("blocklet.publish.docker.description")})]}),C&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{sx:{flex:1},children:d("blocklet.publish.docker.portType")}),e.jsxs(ft,{value:o.type||"docker",onChange:j,children:[e.jsx(fe,{value:"docker",children:"Docker"}),e.jsx(fe,{value:"web",children:"Web"})]})]}),C&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{sx:{flex:1},children:d("blocklet.publish.docker.proxyBehavior")}),e.jsxs(ft,{value:o.proxyBehavior||"service",onChange:D,children:[e.jsx(fe,{value:"service",children:d("blocklet.publish.docker.serviceProxy")}),e.jsx(fe,{value:"direct",children:d("blocklet.publish.docker.directProxy")})]})]}),C&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(N,{sx:{flex:1},children:d("blocklet.publish.docker.prefix")}),e.jsx(oe,{disabled:n,value:o.prefix,onChange:k,sx:{flex:1},label:d("blocklet.publish.docker.prefix")})]})]})})]})}et.propTypes={dockerParams:r.object.isRequired,setDockerParams:r.func.isRequired,dataKey:r.string.isRequired,item:r.object.isRequired,t:r.func.isRequired,readOnly:r.bool.isRequired,index:r.number.isRequired};et.defaultProps={};const dl=`
|
|
173
173
|
docker run --name postgrest
|
|
174
174
|
-p 3000:3000
|
|
175
175
|
-e PGRST_DB_URI="postgres://username:password@host:port/database"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as P,b as st,g as Ls}from"./vendor-react-DEoibe3W.js";import{a as yi,m as ot}from"./vendor-hooks-DN4nZ7TU.js";import{a2 as ge,j as e,E as C,ae as xe,bk as us,T as q,a5 as Ce,s as Lt,A as Mt,a4 as j,aa as ce,al as ji,a3 as Q,ad as Ms,I as ne,M as ie,ak as nt,K as Si,bq as Ns,cb as Fs,cc as Ge,bQ as Bs,bp as Hs,bu as Ci,br as Ti,bN as ki,t as Ri,x as _i,bm as Pi}from"./vendor-mui-core-1jJmAutq.js";import{r as be,u as H,V as Ii,g as ps,ak as de,aq as Ai,Y as F,a5 as Nt,p as fe,aJ as Di,B as K,_ as Ft,bq as $s,l as Ei,b3 as Oi,bK as ms,bc as zi,bJ as Li}from"./vendor-ux-did-connect-DEbq97Xz.js";import{z as B,l as it,t as qs,M as Oe,C as Mi,a7 as Ni,f as Fi,b as Ze,ar as Bi,K as Us}from"./index-CwaFNZTA.js";import{q as Hi,c as $i,z as Bt,P as Me}from"./vendor-arcblock-V3HYELzG.js";import{W as Pe}from"./did-address-B_VfxEC5.js";import{u as Z}from"./dashboard-BX25tvc1.js";import{p as Ht}from"./util-1n1Ulk5w.js";import{w as we,P as Ws}from"./permission-CmHMB8NK.js";import{C as qi}from"./Google-DimUFzIe.js";import{L as Ie,au as Ui,J as Wi}from"./vendor-utils-C3FZIS9A.js";import{E as ut}from"./EditIcon-Bt91o1l6.js";import{C as $t}from"./confirm-D36_98HC.js";import{L as Vs}from"./list-header-BibBP5t1.js";import{f as Ye}from"./format-error-BrmqJs5a.js";import{_ as Vi}from"./useSetState-CWq0AVWn.js";import{L as Gi}from"./LockIcon-B84lMZao.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-Cq9THoCr.js";import"./PlayArrow-DpcMtsY5.js";import"./get-safe-url-D_Puq_oh.js";import"./index-uyugLR5M.js";import"./session-0rF5SuCk.js";import"./useAsyncRetry-W2lp7mi1.js";import"./useAsync-BxB2TpDl.js";import"./InfoOutlined-CEHciuDy.js";import"./use-mobile-DpXDDjat.js";import"./base32-CLGITfm-.js";import"./cloneDeep-DHAAvuEH.js";var qt={},Yi=ge;Object.defineProperty(qt,"__esModule",{value:!0});var It=qt.default=void 0;Zi(P);var Ki=Yi(be()),Xi=e;function Gs(t){if(typeof WeakMap!="function")return null;var s=new WeakMap,i=new WeakMap;return(Gs=function(p){return p?i:s})(t)}function Zi(t,s){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var i=Gs(s);if(i&&i.has(t))return i.get(t);var p={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in t)if(d!=="default"&&Object.prototype.hasOwnProperty.call(t,d)){var m=n?Object.getOwnPropertyDescriptor(t,d):null;m&&(m.get||m.set)?Object.defineProperty(p,d,m):p[d]=t[d]}return p.default=t,i&&i.set(t,p),p}It=qt.default=(0,Ki.default)((0,Xi.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"}),"Apple");var Ut={},Ji=ge;Object.defineProperty(Ut,"__esModule",{value:!0});var Ys=Ut.default=void 0,Qi=Ji(be()),er=e;Ys=Ut.default=(0,Qi.default)((0,er.jsx)("path",{d:"M20 18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Laptop");var Wt={},tr=ge;Object.defineProperty(Wt,"__esModule",{value:!0});var rt=Wt.default=void 0,sr=tr(be()),ir=e;rt=Wt.default=(0,sr.default)((0,ir.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-5 14H4v-4h11zm0-5H4V9h11zm5 5h-4V9h4z"}),"Web");var Vt={},rr=ge;Object.defineProperty(Vt,"__esModule",{value:!0});var Ks=Vt.default=void 0,ar=rr(be()),or=e;Ks=Vt.default=(0,ar.default)((0,or.jsx)("path",{d:"m17.6 9.48 1.84-3.18c.16-.31.04-.69-.26-.85-.29-.15-.65-.06-.83.22l-1.88 3.24c-2.86-1.21-6.08-1.21-8.94 0L5.65 5.67c-.19-.29-.58-.38-.87-.2-.28.18-.37.54-.22.83L6.4 9.48C3.3 11.25 1.28 14.44 1 18h22c-.28-3.56-2.3-6.75-5.4-8.52M7 15.25c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25m10 0c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25"}),"Android");var Gt={},nr=ge;Object.defineProperty(Gt,"__esModule",{value:!0});var Xs=Gt.default=void 0,lr=nr(be()),cr=e;Xs=Gt.default=(0,lr.default)((0,cr.jsx)("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"}),"PhoneIphone");var Yt={},dr=ge;Object.defineProperty(Yt,"__esModule",{value:!0});var Zs=Yt.default=void 0,ur=dr(be()),pr=e;Zs=Yt.default=(0,ur.default)((0,pr.jsx)("path",{d:"M21 4H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 1.99-.9 1.99-2L23 6c0-1.1-.9-2-2-2m-2 14H5V6h14z"}),"Tablet");var Kt={},mr=ge;Object.defineProperty(Kt,"__esModule",{value:!0});var at=Kt.default=void 0,fr=mr(be()),hr=e;at=Kt.default=(0,fr.default)((0,hr.jsx)("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6v2H8v2h8v-2h-2v-2h6c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"DesktopWindows");var xr="2.0.3",At=500,fs="user-agent",Ae="",hs="?",lt="function",he="undefined",De="object",Dt="string",V="browser",re="cpu",se="device",J="engine",X="os",Re="result",w="name",h="type",b="vendor",v="version",G="architecture",Ke="major",g="model",We="console",A="mobile",E="tablet",N="smarttv",te="wearable",wt="xr",Ve="embedded",Ne="inapp",Xt="brands",Se="formFactors",Zt="fullVersionList",_e="platform",Jt="platformVersion",pt="bitness",ve="sec-ch-ua",gr=ve+"-full-version-list",br=ve+"-arch",wr=ve+"-"+pt,vr=ve+"-form-factors",yr=ve+"-"+A,jr=ve+"-"+g,Js=ve+"-"+_e,Sr=Js+"-version",Qs=[Xt,Zt,A,g,_e,Jt,G,Se,pt],Qe="Amazon",Te="Apple",xs="ASUS",gs="BlackBerry",je="Google",bs="Huawei",ws="Lenovo",vs="Honor",et="LG",vt="Microsoft",yt="Motorola",jt="Nvidia",ys="OnePlus",St="OPPO",Fe="Samsung",js="Sharp",Be="Sony",Ct="Xiaomi",Tt="Zebra",Ss="Chrome",Cs="Chromium",ue="Chromecast",Cr="Edge",He="Firefox",$e="Opera",kt="Facebook",Ts="Sogou",ke="Mobile ",qe=" Browser",Et="Windows",Tr=typeof window!==he,Y=Tr&&window.navigator?window.navigator:void 0,pe=Y&&Y.userAgentData?Y.userAgentData:void 0,kr=function(t,s){var i={},p=s;if(!ct(s)){p={};for(var n in s)for(var d in s[n])p[d]=s[n][d].concat(p[d]?p[d]:[])}for(var m in t)i[m]=p[m]&&p[m].length%2===0?p[m].concat(t[m]):t[m];return i},mt=function(t){for(var s={},i=0;i<t.length;i++)s[t[i].toUpperCase()]=t[i];return s},Ot=function(t,s){if(typeof t===De&&t.length>0){for(var i in t)if(ae(t[i])==ae(s))return!0;return!1}return ze(t)?ae(s).indexOf(ae(t))!==-1:!1},ct=function(t,s){for(var i in t)return/^(browser|cpu|device|engine|os)$/.test(i)||(s?ct(t[i]):!1)},ze=function(t){return typeof t===Dt},Rt=function(t){if(t){for(var s=[],i=Ee(/\\?\"/g,t).split(","),p=0;p<i.length;p++)if(i[p].indexOf(";")>-1){var n=Xe(i[p]).split(";v=");s[p]={brand:n[0],version:n[1]}}else s[p]=Xe(i[p]);return s}},ae=function(t){return ze(t)?t.toLowerCase():t},_t=function(t){return ze(t)?Ee(/[^\d\.]/g,t).split(".")[0]:void 0},oe=function(t){for(var s in t){var i=t[s];typeof i==De&&i.length==2?this[i[0]]=i[1]:this[i]=void 0}return this},Ee=function(t,s){return ze(s)?s.replace(t,Ae):s},Ue=function(t){return Ee(/\\?\"/g,t)},Xe=function(t,s){if(ze(t))return t=Ee(/^\s\s*/,t),typeof s===he?t:t.substring(0,At)},Pt=function(t,s){if(!(!t||!s))for(var i=0,p,n,d,m,r,c;i<s.length&&!r;){var a=s[i],u=s[i+1];for(p=n=0;p<a.length&&!r&&a[p];)if(r=a[p++].exec(t),r)for(d=0;d<u.length;d++)c=r[++n],m=u[d],typeof m===De&&m.length>0?m.length===2?typeof m[1]==lt?this[m[0]]=m[1].call(this,c):this[m[0]]=m[1]:m.length===3?typeof m[1]===lt&&!(m[1].exec&&m[1].test)?this[m[0]]=c?m[1].call(this,c,m[2]):void 0:this[m[0]]=c?c.replace(m[1],m[2]):void 0:m.length===4&&(this[m[0]]=c?m[3].call(this,c.replace(m[1],m[2])):void 0):this[m]=c||void 0;i+=2}},me=function(t,s){for(var i in s)if(typeof s[i]===De&&s[i].length>0){for(var p=0;p<s[i].length;p++)if(Ot(s[i][p],t))return i===hs?void 0:i}else if(Ot(s[i],t))return i===hs?void 0:i;return s.hasOwnProperty("*")?s["*"]:t},ks={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Rs={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},_s={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[v,[w,ke+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[v,[w,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[w,v],[/opios[\/ ]+([\w\.]+)/i],[v,[w,$e+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[v,[w,$e+" GX"]],[/\bopr\/([\w\.]+)/i],[v,[w,$e]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[v,[w,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[v,[w,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[w,v],[/quark(?:pc)?\/([-\w\.]+)/i],[v,[w,"Quark"]],[/\bddg\/([\w\.]+)/i],[v,[w,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[v,[w,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[v,[w,"WeChat"]],[/konqueror\/([\w\.]+)/i],[v,[w,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[v,[w,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[v,[w,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[v,[w,"Smart "+ws+qe]],[/(avast|avg)\/([\w\.]+)/i],[[w,/(.+)/,"$1 Secure"+qe],v],[/\bfocus\/([\w\.]+)/i],[v,[w,He+" Focus"]],[/\bopt\/([\w\.]+)/i],[v,[w,$e+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[v,[w,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[v,[w,"Dolphin"]],[/coast\/([\w\.]+)/i],[v,[w,$e+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[v,[w,"MIUI"+qe]],[/fxios\/([\w\.-]+)/i],[v,[w,ke+He]],[/\bqihoobrowser\/?([\w\.]*)/i],[v,[w,"360"]],[/\b(qq)\/([\w\.]+)/i],[[w,/(.+)/,"$1Browser"],v],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[w,/(.+)/,"$1"+qe],v],[/samsungbrowser\/([\w\.]+)/i],[v,[w,Fe+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[v,[w,Ts+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[w,Ts+" Mobile"],v],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[w,v],[/(lbbrowser|rekonq)/i],[w],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[v,w],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[w,kt],v,[h,Ne]],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat)[\/ ]([-\w\.]+)/i],[w,v,[h,Ne]],[/\bgsa\/([\w\.]+) .*safari\//i],[v,[w,"GSA"],[h,Ne]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[v,[w,"TikTok"],[h,Ne]],[/\[(linkedin)app\]/i],[w,[h,Ne]],[/(chromium)[\/ ]([-\w\.]+)/i],[w,v],[/headlesschrome(?:\/([\w\.]+)| )/i],[v,[w,Ss+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[w,Ss+" WebView"],v],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[v,[w,"Android"+qe]],[/chrome\/([\w\.]+) mobile/i],[v,[w,ke+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[w,v],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[v,[w,ke+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[w,ke+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[v,w],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[w,[v,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[w,v],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[w,ke+He],v],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[w,"Netscape"],v],[/(wolvic|librewolf)\/([\w\.]+)/i],[w,v],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[v,[w,He+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[w,[v,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[w,[v,/[^\d\.]+./,Ae]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[G,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[G,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[G,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[G,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[G,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[G,/ower/,Ae,ae]],[/ sun4\w[;\)]/i],[[G,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[G,ae]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[g,[b,Fe],[h,E]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[g,[b,Fe],[h,A]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[g,[b,Te],[h,A]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[g,[b,Te],[h,E]],[/(macintosh);/i],[g,[b,Te]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[g,[b,js],[h,A]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[g,[b,vs],[h,E]],[/honor([-\w ]+)[;\)]/i],[g,[b,vs],[h,A]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[g,[b,bs],[h,E]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[g,[b,bs],[h,A]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[g,/_/g," "],[b,Ct],[h,E]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[g,/_/g," "],[b,Ct],[h,A]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[g,[b,St],[h,A]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[g,[b,me,{OnePlus:["304","403","203"],"*":St}],[h,E]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[g,[b,"BLU"],[h,A]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[g,[b,"Vivo"],[h,A]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[g,[b,"Realme"],[h,A]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[g,[b,yt],[h,A]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[g,[b,yt],[h,E]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[g,[b,et],[h,E]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i,/\blg-?([\d\w]+) bui/i],[g,[b,et],[h,A]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[g,[b,ws],[h,E]],[/(nokia) (t[12][01])/i],[b,g,[h,E]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[g,/_/g," "],[h,A],[b,"Nokia"]],[/(pixel (c|tablet))\b/i],[g,[b,je],[h,E]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[g,[b,je],[h,A]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[g,[b,Be],[h,A]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[g,"Xperia Tablet"],[b,Be],[h,E]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[g,[b,ys],[h,A]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[g,[b,Qe],[h,E]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[g,/(.+)/g,"Fire Phone $1"],[b,Qe],[h,A]],[/(playbook);[-\w\),; ]+(rim)/i],[g,b,[h,E]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[g,[b,gs],[h,A]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[g,[b,xs],[h,E]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[g,[b,xs],[h,A]],[/(nexus 9)/i],[g,[b,"HTC"],[h,E]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[b,[g,/_/g," "],[h,A]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[g,[b,"TCL"],[h,E]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[g,[b,"TCL"],[h,A]],[/(itel) ((\w+))/i],[[b,ae],g,[h,me,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[g,[b,"Acer"],[h,E]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[g,[b,"Meizu"],[h,A]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[g,[b,"Ulefone"],[h,A]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[g,[b,"Energizer"],[h,A]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[g,[b,"Cat"],[h,A]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[g,[b,"Smartfren"],[h,A]],[/droid.+; (a(?:015|06[35]|142p?))/i],[g,[b,"Nothing"],[h,A]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[g,[b,"Archos"],[h,E]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[g,[b,"Archos"],[h,A]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[b,g,[h,E]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[b,g,[h,A]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[b,g,[h,E]],[/(surface duo)/i],[g,[b,vt],[h,E]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[g,[b,"Fairphone"],[h,A]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[g,[b,jt],[h,E]],[/(sprint) (\w+)/i],[b,g,[h,A]],[/(kin\.[onetw]{3})/i],[[g,/\./g," "],[b,vt],[h,A]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[g,[b,Tt],[h,E]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[g,[b,Tt],[h,A]],[/smart-tv.+(samsung)/i],[b,[h,N]],[/hbbtv.+maple;(\d+)/i],[[g,/^/,"SmartTV"],[b,Fe],[h,N]],[/tcast.+(lg)e?. ([-\w]+)/i],[b,g,[h,N]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[b,et],[h,N]],[/(apple) ?tv/i],[b,[g,Te+" TV"],[h,N]],[/crkey.*devicetype\/chromecast/i],[[g,ue+" Third Generation"],[b,je],[h,N]],[/crkey.*devicetype\/([^/]*)/i],[[g,/^/,"Chromecast "],[b,je],[h,N]],[/fuchsia.*crkey/i],[[g,ue+" Nest Hub"],[b,je],[h,N]],[/crkey/i],[[g,ue],[b,je],[h,N]],[/(portaltv)/i],[g,[b,kt],[h,N]],[/droid.+aft(\w+)( bui|\))/i],[g,[b,Qe],[h,N]],[/(shield \w+ tv)/i],[g,[b,jt],[h,N]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[g,[b,js],[h,N]],[/(bravia[\w ]+)( bui|\))/i],[g,[b,Be],[h,N]],[/(mi(tv|box)-?\w+) bui/i],[g,[b,Ct],[h,N]],[/Hbbtv.*(technisat) (.*);/i],[b,g,[h,N]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[b,Xe],[g,Xe],[h,N]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[g,[h,N]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,N]],[/(ouya)/i,/(nintendo) (\w+)/i],[b,g,[h,We]],[/droid.+; (shield)( bui|\))/i],[g,[b,jt],[h,We]],[/(playstation \w+)/i],[g,[b,Be],[h,We]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[g,[b,vt],[h,We]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[g,[b,Fe],[h,te]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[b,g,[h,te]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[g,[b,St],[h,te]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[g,[b,Te],[h,te]],[/(opwwe\d{3})/i],[g,[b,ys],[h,te]],[/(moto 360)/i],[g,[b,yt],[h,te]],[/(smartwatch 3)/i],[g,[b,Be],[h,te]],[/(g watch r)/i],[g,[b,et],[h,te]],[/droid.+; (wt63?0{2,3})\)/i],[g,[b,Tt],[h,te]],[/droid.+; (glass) \d/i],[g,[b,je],[h,wt]],[/(pico) (4|neo3(?: link|pro)?)/i],[b,g,[h,wt]],[/(quest( \d| pro)?s?).+vr/i],[g,[b,kt],[h,wt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[b,[h,Ve]],[/(aeobc)\b/i],[g,[b,Qe],[h,Ve]],[/(homepod).+mac os/i],[g,[b,Te],[h,Ve]],[/windows iot/i],[[h,Ve]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[g,[h,me,{mobile:"Mobile",xr:"VR","*":E}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,E]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,A]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[g,[b,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[v,[w,Cr+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[w,v],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[v,[w,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[w,v],[/ladybird\//i],[[w,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[v,w]],os:[[/microsoft (windows) (vista|xp)/i],[w,v],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[w,[v,me,ks]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[v,me,ks],[w,Et]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[v,/_/g,"."],[w,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[w,"macOS"],[v,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[v,[w,ue+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[v,[w,ue+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[v,[w,ue+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[v,[w,ue+" Linux"]],[/crkey\/([\d\.]+)/i],[v,[w,ue]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[v,w],[/(ubuntu) ([\w\.]+) like android/i],[[w,/(.+)/,"$1 Touch"],v],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i],[w,v],[/\(bb(10);/i],[v,[w,gs]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[v,[w,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[v,[w,He+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[v,[w,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[v,[w,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[w,"Chrome OS"],v],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[w,v],[/(sunos) ?([\w\.\d]*)/i],[[w,"Solaris"],v],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[w,v]]},tt=function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return oe.call(t.init,[[V,[w,v,Ke,h]],[re,[G]],[se,[h,g,b]],[J,[w,v]],[X,[w,v]]]),oe.call(t.isIgnore,[[V,[v,Ke]],[J,[v]],[X,[v]]]),oe.call(t.isIgnoreRgx,[[V,/ ?browser$/i],[X,/ ?os$/i]]),oe.call(t.toString,[[V,[w,v]],[re,[G]],[se,[b,g]],[J,[w,v]],[X,[w,v]]]),t}(),Rr=function(t,s){var i=tt.init[s],p=tt.isIgnore[s]||0,n=tt.isIgnoreRgx[s]||0,d=tt.toString[s]||0;function m(){oe.call(this,i)}return m.prototype.getItem=function(){return t},m.prototype.withClientHints=function(){return pe?pe.getHighEntropyValues(Qs).then(function(r){return t.setCH(new ei(r,!1)).parseCH().get()}):t.parseCH().get()},m.prototype.withFeatureCheck=function(){return t.detectFeature().get()},s!=Re&&(m.prototype.is=function(r){var c=!1;for(var a in this)if(this.hasOwnProperty(a)&&!Ot(p,a)&&ae(n?Ee(n,this[a]):this[a])==ae(n?Ee(n,r):r)){if(c=!0,r!=he)break}else if(r==he&&c){c=!c;break}return c},m.prototype.toString=function(){var r=Ae;for(var c in d)typeof this[d[c]]!==he&&(r+=(r?" ":Ae)+this[d[c]]);return r||he}),pe||(m.prototype.then=function(r){var c=this,a=function(){for(var o in c)c.hasOwnProperty(o)&&(this[o]=c[o])};a.prototype={is:m.prototype.is,toString:m.prototype.toString};var u=new a;return r(u),u}),new m};function ei(t,s){if(t=t||{},oe.call(this,Qs),s)oe.call(this,[[Xt,Rt(t[ve])],[Zt,Rt(t[gr])],[A,/\?1/.test(t[yr])],[g,Ue(t[jr])],[_e,Ue(t[Js])],[Jt,Ue(t[Sr])],[G,Ue(t[br])],[Se,Rt(t[vr])],[pt,Ue(t[wr])]]);else for(var i in t)this.hasOwnProperty(i)&&typeof t[i]!==he&&(this[i]=t[i])}function Ps(t,s,i,p){return this.get=function(n){return n?this.data.hasOwnProperty(n)?this.data[n]:void 0:this.data},this.set=function(n,d){return this.data[n]=d,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(Y&&Y.userAgent==this.ua)switch(this.itemType){case V:Y.brave&&typeof Y.brave.isBrave==lt&&this.set(w,"Brave");break;case se:!this.get(h)&&pe&&pe[A]&&this.set(h,A),this.get(g)=="Macintosh"&&Y&&typeof Y.standalone!==he&&Y.maxTouchPoints&&Y.maxTouchPoints>2&&this.set(g,"iPad").set(h,E);break;case X:!this.get(w)&&pe&&pe[_e]&&this.set(w,pe[_e]);break;case Re:var n=this.data,d=function(m){return n[m].getItem().detectFeature().get()};this.set(V,d(V)).set(re,d(re)).set(se,d(se)).set(J,d(J)).set(X,d(X))}return this},this.parseUA=function(){return this.itemType!=Re&&Pt.call(this.data,this.ua,this.rgxMap),this.itemType==V&&this.set(Ke,_t(this.get(v))),this},this.parseCH=function(){var n=this.uaCH,d=this.rgxMap;switch(this.itemType){case V:case J:var m=n[Zt]||n[Xt],r;if(m)for(var c in m){var a=m[c].brand||m[c],u=m[c].version;this.itemType==V&&!/not.a.brand/i.test(a)&&(!r||/chrom/i.test(r)&&a!=Cs)&&(a=me(a,{Chrome:"Google Chrome",Edge:"Microsoft Edge","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"}),this.set(w,a).set(v,u).set(Ke,_t(u)),r=a),this.itemType==J&&a==Cs&&this.set(v,u)}break;case re:var o=n[G];o&&(o&&n[pt]=="64"&&(o+="64"),Pt.call(this.data,o+";",d));break;case se:if(n[A]&&this.set(h,A),n[g]&&(this.set(g,n[g]),!this.get(h)||!this.get(b))){var l={};Pt.call(l,"droid 9; "+n[g]+")",d),!this.get(h)&&l.type&&this.set(h,l.type),!this.get(b)&&l.vendor&&this.set(b,l.vendor)}if(n[Se]){var f;if(typeof n[Se]!="string")for(var S=0;!f&&S<n[Se].length;)f=me(n[Se][S++],Rs);else f=me(n[Se],Rs);this.set(h,f)}break;case X:var y=n[_e];if(y){var x=n[Jt];y==Et&&(x=parseInt(_t(x),10)>=13?"11":"10"),this.set(w,y).set(v,x)}this.get(w)==Et&&n[g]=="Xbox"&&this.set(w,"Xbox").set(v,void 0);break;case Re:var k=this.data,T=function(I){return k[I].getItem().setCH(n).parseCH().get()};this.set(V,T(V)).set(re,T(re)).set(se,T(se)).set(J,T(J)).set(X,T(X))}return this},oe.call(this,[["itemType",t],["ua",s],["uaCH",p],["rgxMap",i],["data",Rr(this,t)]]),this}function le(t,s,i){if(typeof t===De?(ct(t,!0)?(typeof s===De&&(i=s),s=t):(i=t,s=void 0),t=void 0):typeof t===Dt&&!ct(s,!0)&&(i=s,s=void 0),i&&typeof i.append===lt){var p={};i.forEach(function(c,a){p[a]=c}),i=p}if(!(this instanceof le))return new le(t,s,i).getResult();var n=typeof t===Dt?t:i&&i[fs]?i[fs]:Y&&Y.userAgent?Y.userAgent:Ae,d=new ei(i,!0),m=s?kr(_s,s):_s,r=function(c){return c==Re?function(){return new Ps(c,n,m,d).set("ua",n).set(V,this.getBrowser()).set(re,this.getCPU()).set(se,this.getDevice()).set(J,this.getEngine()).set(X,this.getOS()).get()}:function(){return new Ps(c,n,m[c],d).parseUA().get()}};return oe.call(this,[["getBrowser",r(V)],["getCPU",r(re)],["getDevice",r(se)],["getEngine",r(J)],["getOS",r(X)],["getResult",r(Re)],["getUA",function(){return n}],["setUA",function(c){return ze(c)&&(n=c.length>At?Xe(c,At):c),this}]]).setUA(n),this}le.VERSION=xr;le.BROWSER=mt([w,v,Ke,h]);le.CPU=mt([G]);le.DEVICE=mt([g,b,h,We,A,N,E,te,Ve]);le.ENGINE=le.OS=mt([w,v]);function _r(t){return!t||typeof t!="string"?"break-all":t.includes(" ")?"break-word":"break-all"}function Qt(t){const s={width:t.size,height:t.size,...t.sx},i=typeof t.name=="string"?t.name:t.logo,p=e.jsxs(xe,{direction:"row",alignItems:"center",spacing:1,className:`info-card-wrapper ${t.className}`,sx:{cursor:t.tooltip?"pointer":"default"},children:[t.logo?e.jsx(us,{src:t.logo,alt:t.logoName??i,variant:t.variant,sx:s}):e.jsx(us,{variant:t.variant,sx:s,children:i==null?void 0:i.slice(0,1)}),e.jsxs(xe,{direction:"column",alignItems:"flex-start",justifyContent:"space-around",sx:{wordBreak:_r(t.name),minWidth:{xs:100,sm:140}},children:[e.jsx(q,{variant:"body1",color:"text.primary",component:"div",children:t.name}),t.description&&e.jsx(q,{variant:"subtitle1",color:"text.secondary",children:t.description})]})]});return t.tooltip?e.jsx(Ce,{title:t.tooltip,placement:"top-start",componentsProps:{tooltip:{sx:{bgcolor:n=>n.palette.mode==="dark"?"#2a2e37":"#ffffff",color:n=>n.palette.mode==="dark"?"#ffffff":n.palette.text.primary,boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",borderRadius:2,padding:"10px 16px",fontSize:14,maxWidth:400,minWidth:240,wordBreak:"break-word",border:n=>n.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0","& .MuiTooltip-arrow":{color:n=>n.palette.mode==="dark"?"#2a2e37":"#ffffff","&::before":{border:n=>n.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0",backgroundColor:n=>n.palette.mode==="dark"?"#2a2e37":"#ffffff"}}}}},children:p}):p}Qt.propTypes={logo:C.string,name:C.oneOfType([C.string,C.node]).isRequired,description:C.oneOfType([C.string,C.node]),size:C.oneOfType([C.number,C.string]),variant:C.oneOf(["square","rounded","circular"]),sx:C.object,className:C.string,logoName:C.string,tooltip:C.oneOfType([C.string,C.node])};Qt.defaultProps={description:"",logo:"",size:40,variant:"rounded",sx:{},className:"",logoName:"",tooltip:null};function Pr(t){try{if(!t.trim())return{device:{icon:e.jsx(at,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(rt,{fontSize:"small"}),text:"Unknown Browser"}};const i=new le(t).getResult();let p="";const n=t.split(/\s+/).find(c=>c.startsWith("arcwallet"));if(n){const c=n.split("/");c.length>1&&ps.coerce(c[1])&&(p=ps.coerce(c[1]).version)}const d=(()=>{const{type:c="",model:a=""}=i.device;return c==="mobile"?{icon:e.jsx(Xs,{fontSize:"small"}),text:a||"Mobile Device"}:c==="tablet"?{icon:e.jsx(Zs,{fontSize:"small"}),text:a||"Tablet"}:{icon:e.jsx(Ys,{fontSize:"small"}),text:a||"Desktop"}})(),m=(()=>{const{name:c="",version:a=""}=i.os;return c.toLowerCase().includes("mac")?{icon:e.jsx(It,{fontSize:"small"}),text:`${c} ${a}`}:c.toLowerCase().includes("ios")?{icon:e.jsx(It,{fontSize:"small"}),text:`${c} ${a}`}:c.toLowerCase().includes("android")?{icon:e.jsx(Ks,{fontSize:"small"}),text:`${c} ${a}`}:c.toLowerCase().includes("windows")?{icon:e.jsx(at,{fontSize:"small"}),text:`${c} ${a}`}:{icon:null,text:c?`${c} ${a}`:"Unknown OS"}})(),r=(()=>{const{name:c="",version:a=""}=i.browser;return{icon:e.jsx(rt,{fontSize:"small"}),text:c?`${c} ${a}`:"Unknown Browser"}})();return{device:d,os:m,browser:r,...p?{walletVersion:{icon:null,text:p}}:{}}}catch(s){return console.error("Error parsing user agent:",s),{device:{icon:e.jsx(at,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(rt,{fontSize:"small"}),text:"Unknown Browser"}}}}function ti({ua:t}){const s=Pr(t);return e.jsx(xe,{spacing:1,children:Object.entries(s).map(([i,{icon:p,text:n}])=>e.jsxs(j,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(j,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:p}),e.jsx(q,{variant:"body2",sx:{display:"flex"},children:n})]},i))})}ti.propTypes={ua:C.string.isRequired};const si=()=>{const{t}=H(),s={$all:t("common.all"),owner:"Owner",admin:"Admin",member:"Member",guest:"Guest"};return{SYSTEM_ROLES:s,formatRoleName:p=>p.startsWith("$")?s[p]||p.slice(1):s[p]||p}},Ir=(t,s=!1)=>{const i=s?1:.6;switch(t){case"owner":return`rgba(232, 222, 255, ${i})`;case"admin":return`rgba(227, 242, 253, ${i})`;case"member":return`rgba(232, 245, 233, ${i})`;case"guest":return`rgba(245, 245, 245, ${i})`;default:return`rgba(245, 245, 245, ${i})`}},Ar=Lt(Mt)(({role:t})=>({backgroundColor:Ir(t),color:"#000000"})),Dr=t=>{switch(t){case"valid":return s=>s.palette.success.light;case"expired":return s=>s.palette.text.disabled;case"revoked":return s=>s.palette.error.light;default:return s=>s.palette.warning.light}},Er=Lt(Mt)(({theme:t,status:s})=>({backgroundColor:Dr(s)(t),color:"#FFFFFF"}));function ii({did:t}){return e.jsx(Pe,{size:14,responsive:!1,compact:!0,copyable:!1,did:t})}ii.propTypes={did:C.string.isRequired};function ri({timestamp:t,locale:s}){return e.jsx(j,{sx:{minWidth:"100px"},children:e.jsx(Ii,{value:t,locale:s})})}ri.propTypes={timestamp:C.number.isRequired,locale:C.string.isRequired};function ai({role:t}){const{formatRoleName:s}=si();return e.jsx(Ar,{label:s(t),size:"small",role:t,sx:{borderRadius:1}})}ai.propTypes={role:C.string.isRequired};function oi({status:t}){const{t:s}=H();return e.jsx(Er,{label:s(`team.passport.statusMap.${t}`),size:"small",status:t,sx:{borderRadius:1}})}oi.propTypes={status:C.string.isRequired};function ni({source:t}){const{t:s}=H();return t?s(`team.passport.sourceMaps.${t}`):"-"}ni.propTypes={source:C.string.isRequired};const es=st.memo(function({user:s,size:i="default",tooltip:p=!1,inService:n}){const{teamDid:d}=Z(),m=st.useMemo(()=>Ht(s.avatar,d,n),[s.avatar,d,n]),r=st.useMemo(()=>e.jsx(Pe,{did:s==null?void 0:s.did,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap"},size:12}),[s==null?void 0:s.did]);return e.jsx(Qt,{variant:"circular",logo:m,name:e.jsx(q,{sx:{maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"customer-link-name",children:s.fullName||s.email}),...i==="small"?{tooltip:p?e.jsx(Pe,{did:s==null?void 0:s.did}):!1,size:24}:{description:r,size:36}})});es.propTypes={user:C.object.isRequired,size:C.string,tooltip:C.bool,inService:C.bool};es.defaultProps={size:"default",tooltip:!1,inService:!1};const Or=t=>e.jsx(ii,{did:t}),ts=t=>e.jsx(ai,{role:t}),ss=t=>e.jsx(oi,{status:t}),li=(t,s)=>e.jsx(ri,{timestamp:t,locale:s}),dt=t=>e.jsx(ni,{source:t}),is=(t,s=!1)=>e.jsx(es,{user:t,inService:s}),zr=t=>e.jsx(ti,{ua:t}),Is="info";function rs({createPassportSvg:t,passport:s,onCancel:i,onSwitchPassport:p}){const{t:n}=H(),d=yi({tab:Is}),m={info:{label:n("common.basicInfo"),value:Is,component:()=>e.jsx(ci,{passport:s,createPassportSvg:t})},logs:{label:n("common.logs"),value:"logs",component:()=>e.jsx(pi,{passport:s})},related:{label:n("team.passport.related"),value:"related",component:()=>e.jsx(mi,{passport:s,onSwitchPassport:p})}},r=Object.values(m).map(({label:u,value:o})=>({label:u,value:o})).filter(u=>u.value==="related"?s.parentDid:!0),c=m[d.tab]||m.info,a=u=>{d.tab=u};return e.jsx(de,{title:n("common.passport"),onClose:i,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Lr,{children:[e.jsx(j,{className:"tabs",children:e.jsx(Ai,{tabs:r,current:d.tab,onChange:a,scrollButtons:"auto"})}),e.jsx(j,{className:"body",children:e.jsx(c.component,{})})]})})}rs.propTypes={createPassportSvg:C.func.isRequired,passport:C.object.isRequired,onCancel:C.func.isRequired,onSwitchPassport:C.func};rs.defaultProps={onSwitchPassport:()=>{}};const Lr=ce(j)`
|
|
1
|
+
import{r as P,b as st,g as Ls}from"./vendor-react-DEoibe3W.js";import{a as yi,m as ot}from"./vendor-hooks-DN4nZ7TU.js";import{a2 as ge,j as e,E as C,ae as xe,bk as us,T as q,a5 as Ce,s as Lt,A as Mt,a4 as j,aa as ce,al as ji,a3 as Q,ad as Ms,I as ne,M as ie,ak as nt,K as Si,bq as Ns,cb as Fs,cc as Ge,bQ as Bs,bp as Hs,bu as Ci,br as Ti,bN as ki,t as Ri,x as _i,bm as Pi}from"./vendor-mui-core-1jJmAutq.js";import{r as be,u as H,V as Ii,g as ps,ak as de,aq as Ai,Y as F,a5 as Nt,p as fe,aJ as Di,B as K,_ as Ft,bq as $s,l as Ei,b3 as Oi,bK as ms,bc as zi,bJ as Li}from"./vendor-ux-did-connect-DEbq97Xz.js";import{z as B,l as it,t as qs,M as Oe,C as Mi,a7 as Ni,f as Fi,b as Ze,ar as Bi,K as Us}from"./index-BjYech25.js";import{q as Hi,c as $i,z as Bt,P as Me}from"./vendor-arcblock-V3HYELzG.js";import{W as Pe}from"./did-address-B_VfxEC5.js";import{u as Z}from"./dashboard-BYUKOMAe.js";import{p as Ht}from"./util-1n1Ulk5w.js";import{w as we,P as Ws}from"./permission-CmHMB8NK.js";import{C as qi}from"./Google-DimUFzIe.js";import{L as Ie,au as Ui,J as Wi}from"./vendor-utils-C3FZIS9A.js";import{E as ut}from"./EditIcon-Bt91o1l6.js";import{C as $t}from"./confirm-B9OqaJpT.js";import{L as Vs}from"./list-header-BibBP5t1.js";import{f as Ye}from"./format-error-BrmqJs5a.js";import{_ as Vi}from"./useSetState-CWq0AVWn.js";import{L as Gi}from"./LockIcon-B84lMZao.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-Cq9THoCr.js";import"./PlayArrow-DpcMtsY5.js";import"./get-safe-url-D_Puq_oh.js";import"./index-Cp_gD4ZQ.js";import"./session-0rF5SuCk.js";import"./useAsyncRetry-DSYkC9r5.js";import"./useAsync-BENTIUEf.js";import"./InfoOutlined-CEHciuDy.js";import"./use-mobile-DpXDDjat.js";import"./base32-CLGITfm-.js";import"./cloneDeep-DHAAvuEH.js";var qt={},Yi=ge;Object.defineProperty(qt,"__esModule",{value:!0});var It=qt.default=void 0;Zi(P);var Ki=Yi(be()),Xi=e;function Gs(t){if(typeof WeakMap!="function")return null;var s=new WeakMap,i=new WeakMap;return(Gs=function(p){return p?i:s})(t)}function Zi(t,s){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var i=Gs(s);if(i&&i.has(t))return i.get(t);var p={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in t)if(d!=="default"&&Object.prototype.hasOwnProperty.call(t,d)){var m=n?Object.getOwnPropertyDescriptor(t,d):null;m&&(m.get||m.set)?Object.defineProperty(p,d,m):p[d]=t[d]}return p.default=t,i&&i.set(t,p),p}It=qt.default=(0,Ki.default)((0,Xi.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"}),"Apple");var Ut={},Ji=ge;Object.defineProperty(Ut,"__esModule",{value:!0});var Ys=Ut.default=void 0,Qi=Ji(be()),er=e;Ys=Ut.default=(0,Qi.default)((0,er.jsx)("path",{d:"M20 18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Laptop");var Wt={},tr=ge;Object.defineProperty(Wt,"__esModule",{value:!0});var rt=Wt.default=void 0,sr=tr(be()),ir=e;rt=Wt.default=(0,sr.default)((0,ir.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-5 14H4v-4h11zm0-5H4V9h11zm5 5h-4V9h4z"}),"Web");var Vt={},rr=ge;Object.defineProperty(Vt,"__esModule",{value:!0});var Ks=Vt.default=void 0,ar=rr(be()),or=e;Ks=Vt.default=(0,ar.default)((0,or.jsx)("path",{d:"m17.6 9.48 1.84-3.18c.16-.31.04-.69-.26-.85-.29-.15-.65-.06-.83.22l-1.88 3.24c-2.86-1.21-6.08-1.21-8.94 0L5.65 5.67c-.19-.29-.58-.38-.87-.2-.28.18-.37.54-.22.83L6.4 9.48C3.3 11.25 1.28 14.44 1 18h22c-.28-3.56-2.3-6.75-5.4-8.52M7 15.25c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25m10 0c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25"}),"Android");var Gt={},nr=ge;Object.defineProperty(Gt,"__esModule",{value:!0});var Xs=Gt.default=void 0,lr=nr(be()),cr=e;Xs=Gt.default=(0,lr.default)((0,cr.jsx)("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"}),"PhoneIphone");var Yt={},dr=ge;Object.defineProperty(Yt,"__esModule",{value:!0});var Zs=Yt.default=void 0,ur=dr(be()),pr=e;Zs=Yt.default=(0,ur.default)((0,pr.jsx)("path",{d:"M21 4H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 1.99-.9 1.99-2L23 6c0-1.1-.9-2-2-2m-2 14H5V6h14z"}),"Tablet");var Kt={},mr=ge;Object.defineProperty(Kt,"__esModule",{value:!0});var at=Kt.default=void 0,fr=mr(be()),hr=e;at=Kt.default=(0,fr.default)((0,hr.jsx)("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6v2H8v2h8v-2h-2v-2h6c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"DesktopWindows");var xr="2.0.3",At=500,fs="user-agent",Ae="",hs="?",lt="function",he="undefined",De="object",Dt="string",V="browser",re="cpu",se="device",J="engine",X="os",Re="result",w="name",h="type",b="vendor",v="version",G="architecture",Ke="major",g="model",We="console",A="mobile",E="tablet",N="smarttv",te="wearable",wt="xr",Ve="embedded",Ne="inapp",Xt="brands",Se="formFactors",Zt="fullVersionList",_e="platform",Jt="platformVersion",pt="bitness",ve="sec-ch-ua",gr=ve+"-full-version-list",br=ve+"-arch",wr=ve+"-"+pt,vr=ve+"-form-factors",yr=ve+"-"+A,jr=ve+"-"+g,Js=ve+"-"+_e,Sr=Js+"-version",Qs=[Xt,Zt,A,g,_e,Jt,G,Se,pt],Qe="Amazon",Te="Apple",xs="ASUS",gs="BlackBerry",je="Google",bs="Huawei",ws="Lenovo",vs="Honor",et="LG",vt="Microsoft",yt="Motorola",jt="Nvidia",ys="OnePlus",St="OPPO",Fe="Samsung",js="Sharp",Be="Sony",Ct="Xiaomi",Tt="Zebra",Ss="Chrome",Cs="Chromium",ue="Chromecast",Cr="Edge",He="Firefox",$e="Opera",kt="Facebook",Ts="Sogou",ke="Mobile ",qe=" Browser",Et="Windows",Tr=typeof window!==he,Y=Tr&&window.navigator?window.navigator:void 0,pe=Y&&Y.userAgentData?Y.userAgentData:void 0,kr=function(t,s){var i={},p=s;if(!ct(s)){p={};for(var n in s)for(var d in s[n])p[d]=s[n][d].concat(p[d]?p[d]:[])}for(var m in t)i[m]=p[m]&&p[m].length%2===0?p[m].concat(t[m]):t[m];return i},mt=function(t){for(var s={},i=0;i<t.length;i++)s[t[i].toUpperCase()]=t[i];return s},Ot=function(t,s){if(typeof t===De&&t.length>0){for(var i in t)if(ae(t[i])==ae(s))return!0;return!1}return ze(t)?ae(s).indexOf(ae(t))!==-1:!1},ct=function(t,s){for(var i in t)return/^(browser|cpu|device|engine|os)$/.test(i)||(s?ct(t[i]):!1)},ze=function(t){return typeof t===Dt},Rt=function(t){if(t){for(var s=[],i=Ee(/\\?\"/g,t).split(","),p=0;p<i.length;p++)if(i[p].indexOf(";")>-1){var n=Xe(i[p]).split(";v=");s[p]={brand:n[0],version:n[1]}}else s[p]=Xe(i[p]);return s}},ae=function(t){return ze(t)?t.toLowerCase():t},_t=function(t){return ze(t)?Ee(/[^\d\.]/g,t).split(".")[0]:void 0},oe=function(t){for(var s in t){var i=t[s];typeof i==De&&i.length==2?this[i[0]]=i[1]:this[i]=void 0}return this},Ee=function(t,s){return ze(s)?s.replace(t,Ae):s},Ue=function(t){return Ee(/\\?\"/g,t)},Xe=function(t,s){if(ze(t))return t=Ee(/^\s\s*/,t),typeof s===he?t:t.substring(0,At)},Pt=function(t,s){if(!(!t||!s))for(var i=0,p,n,d,m,r,c;i<s.length&&!r;){var a=s[i],u=s[i+1];for(p=n=0;p<a.length&&!r&&a[p];)if(r=a[p++].exec(t),r)for(d=0;d<u.length;d++)c=r[++n],m=u[d],typeof m===De&&m.length>0?m.length===2?typeof m[1]==lt?this[m[0]]=m[1].call(this,c):this[m[0]]=m[1]:m.length===3?typeof m[1]===lt&&!(m[1].exec&&m[1].test)?this[m[0]]=c?m[1].call(this,c,m[2]):void 0:this[m[0]]=c?c.replace(m[1],m[2]):void 0:m.length===4&&(this[m[0]]=c?m[3].call(this,c.replace(m[1],m[2])):void 0):this[m]=c||void 0;i+=2}},me=function(t,s){for(var i in s)if(typeof s[i]===De&&s[i].length>0){for(var p=0;p<s[i].length;p++)if(Ot(s[i][p],t))return i===hs?void 0:i}else if(Ot(s[i],t))return i===hs?void 0:i;return s.hasOwnProperty("*")?s["*"]:t},ks={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Rs={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},_s={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[v,[w,ke+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[v,[w,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[w,v],[/opios[\/ ]+([\w\.]+)/i],[v,[w,$e+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[v,[w,$e+" GX"]],[/\bopr\/([\w\.]+)/i],[v,[w,$e]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[v,[w,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[v,[w,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[w,v],[/quark(?:pc)?\/([-\w\.]+)/i],[v,[w,"Quark"]],[/\bddg\/([\w\.]+)/i],[v,[w,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[v,[w,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[v,[w,"WeChat"]],[/konqueror\/([\w\.]+)/i],[v,[w,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[v,[w,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[v,[w,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[v,[w,"Smart "+ws+qe]],[/(avast|avg)\/([\w\.]+)/i],[[w,/(.+)/,"$1 Secure"+qe],v],[/\bfocus\/([\w\.]+)/i],[v,[w,He+" Focus"]],[/\bopt\/([\w\.]+)/i],[v,[w,$e+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[v,[w,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[v,[w,"Dolphin"]],[/coast\/([\w\.]+)/i],[v,[w,$e+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[v,[w,"MIUI"+qe]],[/fxios\/([\w\.-]+)/i],[v,[w,ke+He]],[/\bqihoobrowser\/?([\w\.]*)/i],[v,[w,"360"]],[/\b(qq)\/([\w\.]+)/i],[[w,/(.+)/,"$1Browser"],v],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[w,/(.+)/,"$1"+qe],v],[/samsungbrowser\/([\w\.]+)/i],[v,[w,Fe+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[v,[w,Ts+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[w,Ts+" Mobile"],v],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[w,v],[/(lbbrowser|rekonq)/i],[w],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[v,w],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[w,kt],v,[h,Ne]],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat)[\/ ]([-\w\.]+)/i],[w,v,[h,Ne]],[/\bgsa\/([\w\.]+) .*safari\//i],[v,[w,"GSA"],[h,Ne]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[v,[w,"TikTok"],[h,Ne]],[/\[(linkedin)app\]/i],[w,[h,Ne]],[/(chromium)[\/ ]([-\w\.]+)/i],[w,v],[/headlesschrome(?:\/([\w\.]+)| )/i],[v,[w,Ss+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[w,Ss+" WebView"],v],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[v,[w,"Android"+qe]],[/chrome\/([\w\.]+) mobile/i],[v,[w,ke+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[w,v],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[v,[w,ke+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[w,ke+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[v,w],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[w,[v,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[w,v],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[w,ke+He],v],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[w,"Netscape"],v],[/(wolvic|librewolf)\/([\w\.]+)/i],[w,v],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[v,[w,He+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[w,[v,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[w,[v,/[^\d\.]+./,Ae]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[G,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[G,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[G,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[G,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[G,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[G,/ower/,Ae,ae]],[/ sun4\w[;\)]/i],[[G,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[G,ae]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[g,[b,Fe],[h,E]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[g,[b,Fe],[h,A]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[g,[b,Te],[h,A]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[g,[b,Te],[h,E]],[/(macintosh);/i],[g,[b,Te]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[g,[b,js],[h,A]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[g,[b,vs],[h,E]],[/honor([-\w ]+)[;\)]/i],[g,[b,vs],[h,A]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[g,[b,bs],[h,E]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[g,[b,bs],[h,A]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[g,/_/g," "],[b,Ct],[h,E]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[g,/_/g," "],[b,Ct],[h,A]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[g,[b,St],[h,A]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[g,[b,me,{OnePlus:["304","403","203"],"*":St}],[h,E]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[g,[b,"BLU"],[h,A]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[g,[b,"Vivo"],[h,A]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[g,[b,"Realme"],[h,A]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[g,[b,yt],[h,A]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[g,[b,yt],[h,E]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[g,[b,et],[h,E]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i,/\blg-?([\d\w]+) bui/i],[g,[b,et],[h,A]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[g,[b,ws],[h,E]],[/(nokia) (t[12][01])/i],[b,g,[h,E]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[g,/_/g," "],[h,A],[b,"Nokia"]],[/(pixel (c|tablet))\b/i],[g,[b,je],[h,E]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[g,[b,je],[h,A]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[g,[b,Be],[h,A]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[g,"Xperia Tablet"],[b,Be],[h,E]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[g,[b,ys],[h,A]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[g,[b,Qe],[h,E]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[g,/(.+)/g,"Fire Phone $1"],[b,Qe],[h,A]],[/(playbook);[-\w\),; ]+(rim)/i],[g,b,[h,E]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[g,[b,gs],[h,A]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[g,[b,xs],[h,E]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[g,[b,xs],[h,A]],[/(nexus 9)/i],[g,[b,"HTC"],[h,E]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[b,[g,/_/g," "],[h,A]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[g,[b,"TCL"],[h,E]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[g,[b,"TCL"],[h,A]],[/(itel) ((\w+))/i],[[b,ae],g,[h,me,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[g,[b,"Acer"],[h,E]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[g,[b,"Meizu"],[h,A]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[g,[b,"Ulefone"],[h,A]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[g,[b,"Energizer"],[h,A]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[g,[b,"Cat"],[h,A]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[g,[b,"Smartfren"],[h,A]],[/droid.+; (a(?:015|06[35]|142p?))/i],[g,[b,"Nothing"],[h,A]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[g,[b,"Archos"],[h,E]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[g,[b,"Archos"],[h,A]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[b,g,[h,E]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[b,g,[h,A]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[b,g,[h,E]],[/(surface duo)/i],[g,[b,vt],[h,E]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[g,[b,"Fairphone"],[h,A]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[g,[b,jt],[h,E]],[/(sprint) (\w+)/i],[b,g,[h,A]],[/(kin\.[onetw]{3})/i],[[g,/\./g," "],[b,vt],[h,A]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[g,[b,Tt],[h,E]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[g,[b,Tt],[h,A]],[/smart-tv.+(samsung)/i],[b,[h,N]],[/hbbtv.+maple;(\d+)/i],[[g,/^/,"SmartTV"],[b,Fe],[h,N]],[/tcast.+(lg)e?. ([-\w]+)/i],[b,g,[h,N]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[b,et],[h,N]],[/(apple) ?tv/i],[b,[g,Te+" TV"],[h,N]],[/crkey.*devicetype\/chromecast/i],[[g,ue+" Third Generation"],[b,je],[h,N]],[/crkey.*devicetype\/([^/]*)/i],[[g,/^/,"Chromecast "],[b,je],[h,N]],[/fuchsia.*crkey/i],[[g,ue+" Nest Hub"],[b,je],[h,N]],[/crkey/i],[[g,ue],[b,je],[h,N]],[/(portaltv)/i],[g,[b,kt],[h,N]],[/droid.+aft(\w+)( bui|\))/i],[g,[b,Qe],[h,N]],[/(shield \w+ tv)/i],[g,[b,jt],[h,N]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[g,[b,js],[h,N]],[/(bravia[\w ]+)( bui|\))/i],[g,[b,Be],[h,N]],[/(mi(tv|box)-?\w+) bui/i],[g,[b,Ct],[h,N]],[/Hbbtv.*(technisat) (.*);/i],[b,g,[h,N]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[b,Xe],[g,Xe],[h,N]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[g,[h,N]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,N]],[/(ouya)/i,/(nintendo) (\w+)/i],[b,g,[h,We]],[/droid.+; (shield)( bui|\))/i],[g,[b,jt],[h,We]],[/(playstation \w+)/i],[g,[b,Be],[h,We]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[g,[b,vt],[h,We]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[g,[b,Fe],[h,te]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[b,g,[h,te]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[g,[b,St],[h,te]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[g,[b,Te],[h,te]],[/(opwwe\d{3})/i],[g,[b,ys],[h,te]],[/(moto 360)/i],[g,[b,yt],[h,te]],[/(smartwatch 3)/i],[g,[b,Be],[h,te]],[/(g watch r)/i],[g,[b,et],[h,te]],[/droid.+; (wt63?0{2,3})\)/i],[g,[b,Tt],[h,te]],[/droid.+; (glass) \d/i],[g,[b,je],[h,wt]],[/(pico) (4|neo3(?: link|pro)?)/i],[b,g,[h,wt]],[/(quest( \d| pro)?s?).+vr/i],[g,[b,kt],[h,wt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[b,[h,Ve]],[/(aeobc)\b/i],[g,[b,Qe],[h,Ve]],[/(homepod).+mac os/i],[g,[b,Te],[h,Ve]],[/windows iot/i],[[h,Ve]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[g,[h,me,{mobile:"Mobile",xr:"VR","*":E}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,E]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,A]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[g,[b,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[v,[w,Cr+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[w,v],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[v,[w,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[w,v],[/ladybird\//i],[[w,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[v,w]],os:[[/microsoft (windows) (vista|xp)/i],[w,v],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[w,[v,me,ks]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[v,me,ks],[w,Et]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[v,/_/g,"."],[w,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[w,"macOS"],[v,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[v,[w,ue+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[v,[w,ue+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[v,[w,ue+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[v,[w,ue+" Linux"]],[/crkey\/([\d\.]+)/i],[v,[w,ue]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[v,w],[/(ubuntu) ([\w\.]+) like android/i],[[w,/(.+)/,"$1 Touch"],v],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i],[w,v],[/\(bb(10);/i],[v,[w,gs]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[v,[w,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[v,[w,He+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[v,[w,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[v,[w,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[w,"Chrome OS"],v],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[w,v],[/(sunos) ?([\w\.\d]*)/i],[[w,"Solaris"],v],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[w,v]]},tt=function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return oe.call(t.init,[[V,[w,v,Ke,h]],[re,[G]],[se,[h,g,b]],[J,[w,v]],[X,[w,v]]]),oe.call(t.isIgnore,[[V,[v,Ke]],[J,[v]],[X,[v]]]),oe.call(t.isIgnoreRgx,[[V,/ ?browser$/i],[X,/ ?os$/i]]),oe.call(t.toString,[[V,[w,v]],[re,[G]],[se,[b,g]],[J,[w,v]],[X,[w,v]]]),t}(),Rr=function(t,s){var i=tt.init[s],p=tt.isIgnore[s]||0,n=tt.isIgnoreRgx[s]||0,d=tt.toString[s]||0;function m(){oe.call(this,i)}return m.prototype.getItem=function(){return t},m.prototype.withClientHints=function(){return pe?pe.getHighEntropyValues(Qs).then(function(r){return t.setCH(new ei(r,!1)).parseCH().get()}):t.parseCH().get()},m.prototype.withFeatureCheck=function(){return t.detectFeature().get()},s!=Re&&(m.prototype.is=function(r){var c=!1;for(var a in this)if(this.hasOwnProperty(a)&&!Ot(p,a)&&ae(n?Ee(n,this[a]):this[a])==ae(n?Ee(n,r):r)){if(c=!0,r!=he)break}else if(r==he&&c){c=!c;break}return c},m.prototype.toString=function(){var r=Ae;for(var c in d)typeof this[d[c]]!==he&&(r+=(r?" ":Ae)+this[d[c]]);return r||he}),pe||(m.prototype.then=function(r){var c=this,a=function(){for(var o in c)c.hasOwnProperty(o)&&(this[o]=c[o])};a.prototype={is:m.prototype.is,toString:m.prototype.toString};var u=new a;return r(u),u}),new m};function ei(t,s){if(t=t||{},oe.call(this,Qs),s)oe.call(this,[[Xt,Rt(t[ve])],[Zt,Rt(t[gr])],[A,/\?1/.test(t[yr])],[g,Ue(t[jr])],[_e,Ue(t[Js])],[Jt,Ue(t[Sr])],[G,Ue(t[br])],[Se,Rt(t[vr])],[pt,Ue(t[wr])]]);else for(var i in t)this.hasOwnProperty(i)&&typeof t[i]!==he&&(this[i]=t[i])}function Ps(t,s,i,p){return this.get=function(n){return n?this.data.hasOwnProperty(n)?this.data[n]:void 0:this.data},this.set=function(n,d){return this.data[n]=d,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(Y&&Y.userAgent==this.ua)switch(this.itemType){case V:Y.brave&&typeof Y.brave.isBrave==lt&&this.set(w,"Brave");break;case se:!this.get(h)&&pe&&pe[A]&&this.set(h,A),this.get(g)=="Macintosh"&&Y&&typeof Y.standalone!==he&&Y.maxTouchPoints&&Y.maxTouchPoints>2&&this.set(g,"iPad").set(h,E);break;case X:!this.get(w)&&pe&&pe[_e]&&this.set(w,pe[_e]);break;case Re:var n=this.data,d=function(m){return n[m].getItem().detectFeature().get()};this.set(V,d(V)).set(re,d(re)).set(se,d(se)).set(J,d(J)).set(X,d(X))}return this},this.parseUA=function(){return this.itemType!=Re&&Pt.call(this.data,this.ua,this.rgxMap),this.itemType==V&&this.set(Ke,_t(this.get(v))),this},this.parseCH=function(){var n=this.uaCH,d=this.rgxMap;switch(this.itemType){case V:case J:var m=n[Zt]||n[Xt],r;if(m)for(var c in m){var a=m[c].brand||m[c],u=m[c].version;this.itemType==V&&!/not.a.brand/i.test(a)&&(!r||/chrom/i.test(r)&&a!=Cs)&&(a=me(a,{Chrome:"Google Chrome",Edge:"Microsoft Edge","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"}),this.set(w,a).set(v,u).set(Ke,_t(u)),r=a),this.itemType==J&&a==Cs&&this.set(v,u)}break;case re:var o=n[G];o&&(o&&n[pt]=="64"&&(o+="64"),Pt.call(this.data,o+";",d));break;case se:if(n[A]&&this.set(h,A),n[g]&&(this.set(g,n[g]),!this.get(h)||!this.get(b))){var l={};Pt.call(l,"droid 9; "+n[g]+")",d),!this.get(h)&&l.type&&this.set(h,l.type),!this.get(b)&&l.vendor&&this.set(b,l.vendor)}if(n[Se]){var f;if(typeof n[Se]!="string")for(var S=0;!f&&S<n[Se].length;)f=me(n[Se][S++],Rs);else f=me(n[Se],Rs);this.set(h,f)}break;case X:var y=n[_e];if(y){var x=n[Jt];y==Et&&(x=parseInt(_t(x),10)>=13?"11":"10"),this.set(w,y).set(v,x)}this.get(w)==Et&&n[g]=="Xbox"&&this.set(w,"Xbox").set(v,void 0);break;case Re:var k=this.data,T=function(I){return k[I].getItem().setCH(n).parseCH().get()};this.set(V,T(V)).set(re,T(re)).set(se,T(se)).set(J,T(J)).set(X,T(X))}return this},oe.call(this,[["itemType",t],["ua",s],["uaCH",p],["rgxMap",i],["data",Rr(this,t)]]),this}function le(t,s,i){if(typeof t===De?(ct(t,!0)?(typeof s===De&&(i=s),s=t):(i=t,s=void 0),t=void 0):typeof t===Dt&&!ct(s,!0)&&(i=s,s=void 0),i&&typeof i.append===lt){var p={};i.forEach(function(c,a){p[a]=c}),i=p}if(!(this instanceof le))return new le(t,s,i).getResult();var n=typeof t===Dt?t:i&&i[fs]?i[fs]:Y&&Y.userAgent?Y.userAgent:Ae,d=new ei(i,!0),m=s?kr(_s,s):_s,r=function(c){return c==Re?function(){return new Ps(c,n,m,d).set("ua",n).set(V,this.getBrowser()).set(re,this.getCPU()).set(se,this.getDevice()).set(J,this.getEngine()).set(X,this.getOS()).get()}:function(){return new Ps(c,n,m[c],d).parseUA().get()}};return oe.call(this,[["getBrowser",r(V)],["getCPU",r(re)],["getDevice",r(se)],["getEngine",r(J)],["getOS",r(X)],["getResult",r(Re)],["getUA",function(){return n}],["setUA",function(c){return ze(c)&&(n=c.length>At?Xe(c,At):c),this}]]).setUA(n),this}le.VERSION=xr;le.BROWSER=mt([w,v,Ke,h]);le.CPU=mt([G]);le.DEVICE=mt([g,b,h,We,A,N,E,te,Ve]);le.ENGINE=le.OS=mt([w,v]);function _r(t){return!t||typeof t!="string"?"break-all":t.includes(" ")?"break-word":"break-all"}function Qt(t){const s={width:t.size,height:t.size,...t.sx},i=typeof t.name=="string"?t.name:t.logo,p=e.jsxs(xe,{direction:"row",alignItems:"center",spacing:1,className:`info-card-wrapper ${t.className}`,sx:{cursor:t.tooltip?"pointer":"default"},children:[t.logo?e.jsx(us,{src:t.logo,alt:t.logoName??i,variant:t.variant,sx:s}):e.jsx(us,{variant:t.variant,sx:s,children:i==null?void 0:i.slice(0,1)}),e.jsxs(xe,{direction:"column",alignItems:"flex-start",justifyContent:"space-around",sx:{wordBreak:_r(t.name),minWidth:{xs:100,sm:140}},children:[e.jsx(q,{variant:"body1",color:"text.primary",component:"div",children:t.name}),t.description&&e.jsx(q,{variant:"subtitle1",color:"text.secondary",children:t.description})]})]});return t.tooltip?e.jsx(Ce,{title:t.tooltip,placement:"top-start",componentsProps:{tooltip:{sx:{bgcolor:n=>n.palette.mode==="dark"?"#2a2e37":"#ffffff",color:n=>n.palette.mode==="dark"?"#ffffff":n.palette.text.primary,boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",borderRadius:2,padding:"10px 16px",fontSize:14,maxWidth:400,minWidth:240,wordBreak:"break-word",border:n=>n.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0","& .MuiTooltip-arrow":{color:n=>n.palette.mode==="dark"?"#2a2e37":"#ffffff","&::before":{border:n=>n.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0",backgroundColor:n=>n.palette.mode==="dark"?"#2a2e37":"#ffffff"}}}}},children:p}):p}Qt.propTypes={logo:C.string,name:C.oneOfType([C.string,C.node]).isRequired,description:C.oneOfType([C.string,C.node]),size:C.oneOfType([C.number,C.string]),variant:C.oneOf(["square","rounded","circular"]),sx:C.object,className:C.string,logoName:C.string,tooltip:C.oneOfType([C.string,C.node])};Qt.defaultProps={description:"",logo:"",size:40,variant:"rounded",sx:{},className:"",logoName:"",tooltip:null};function Pr(t){try{if(!t.trim())return{device:{icon:e.jsx(at,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(rt,{fontSize:"small"}),text:"Unknown Browser"}};const i=new le(t).getResult();let p="";const n=t.split(/\s+/).find(c=>c.startsWith("arcwallet"));if(n){const c=n.split("/");c.length>1&&ps.coerce(c[1])&&(p=ps.coerce(c[1]).version)}const d=(()=>{const{type:c="",model:a=""}=i.device;return c==="mobile"?{icon:e.jsx(Xs,{fontSize:"small"}),text:a||"Mobile Device"}:c==="tablet"?{icon:e.jsx(Zs,{fontSize:"small"}),text:a||"Tablet"}:{icon:e.jsx(Ys,{fontSize:"small"}),text:a||"Desktop"}})(),m=(()=>{const{name:c="",version:a=""}=i.os;return c.toLowerCase().includes("mac")?{icon:e.jsx(It,{fontSize:"small"}),text:`${c} ${a}`}:c.toLowerCase().includes("ios")?{icon:e.jsx(It,{fontSize:"small"}),text:`${c} ${a}`}:c.toLowerCase().includes("android")?{icon:e.jsx(Ks,{fontSize:"small"}),text:`${c} ${a}`}:c.toLowerCase().includes("windows")?{icon:e.jsx(at,{fontSize:"small"}),text:`${c} ${a}`}:{icon:null,text:c?`${c} ${a}`:"Unknown OS"}})(),r=(()=>{const{name:c="",version:a=""}=i.browser;return{icon:e.jsx(rt,{fontSize:"small"}),text:c?`${c} ${a}`:"Unknown Browser"}})();return{device:d,os:m,browser:r,...p?{walletVersion:{icon:null,text:p}}:{}}}catch(s){return console.error("Error parsing user agent:",s),{device:{icon:e.jsx(at,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:e.jsx(rt,{fontSize:"small"}),text:"Unknown Browser"}}}}function ti({ua:t}){const s=Pr(t);return e.jsx(xe,{spacing:1,children:Object.entries(s).map(([i,{icon:p,text:n}])=>e.jsxs(j,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(j,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:p}),e.jsx(q,{variant:"body2",sx:{display:"flex"},children:n})]},i))})}ti.propTypes={ua:C.string.isRequired};const si=()=>{const{t}=H(),s={$all:t("common.all"),owner:"Owner",admin:"Admin",member:"Member",guest:"Guest"};return{SYSTEM_ROLES:s,formatRoleName:p=>p.startsWith("$")?s[p]||p.slice(1):s[p]||p}},Ir=(t,s=!1)=>{const i=s?1:.6;switch(t){case"owner":return`rgba(232, 222, 255, ${i})`;case"admin":return`rgba(227, 242, 253, ${i})`;case"member":return`rgba(232, 245, 233, ${i})`;case"guest":return`rgba(245, 245, 245, ${i})`;default:return`rgba(245, 245, 245, ${i})`}},Ar=Lt(Mt)(({role:t})=>({backgroundColor:Ir(t),color:"#000000"})),Dr=t=>{switch(t){case"valid":return s=>s.palette.success.light;case"expired":return s=>s.palette.text.disabled;case"revoked":return s=>s.palette.error.light;default:return s=>s.palette.warning.light}},Er=Lt(Mt)(({theme:t,status:s})=>({backgroundColor:Dr(s)(t),color:"#FFFFFF"}));function ii({did:t}){return e.jsx(Pe,{size:14,responsive:!1,compact:!0,copyable:!1,did:t})}ii.propTypes={did:C.string.isRequired};function ri({timestamp:t,locale:s}){return e.jsx(j,{sx:{minWidth:"100px"},children:e.jsx(Ii,{value:t,locale:s})})}ri.propTypes={timestamp:C.number.isRequired,locale:C.string.isRequired};function ai({role:t}){const{formatRoleName:s}=si();return e.jsx(Ar,{label:s(t),size:"small",role:t,sx:{borderRadius:1}})}ai.propTypes={role:C.string.isRequired};function oi({status:t}){const{t:s}=H();return e.jsx(Er,{label:s(`team.passport.statusMap.${t}`),size:"small",status:t,sx:{borderRadius:1}})}oi.propTypes={status:C.string.isRequired};function ni({source:t}){const{t:s}=H();return t?s(`team.passport.sourceMaps.${t}`):"-"}ni.propTypes={source:C.string.isRequired};const es=st.memo(function({user:s,size:i="default",tooltip:p=!1,inService:n}){const{teamDid:d}=Z(),m=st.useMemo(()=>Ht(s.avatar,d,n),[s.avatar,d,n]),r=st.useMemo(()=>e.jsx(Pe,{did:s==null?void 0:s.did,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap"},size:12}),[s==null?void 0:s.did]);return e.jsx(Qt,{variant:"circular",logo:m,name:e.jsx(q,{sx:{maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"customer-link-name",children:s.fullName||s.email}),...i==="small"?{tooltip:p?e.jsx(Pe,{did:s==null?void 0:s.did}):!1,size:24}:{description:r,size:36}})});es.propTypes={user:C.object.isRequired,size:C.string,tooltip:C.bool,inService:C.bool};es.defaultProps={size:"default",tooltip:!1,inService:!1};const Or=t=>e.jsx(ii,{did:t}),ts=t=>e.jsx(ai,{role:t}),ss=t=>e.jsx(oi,{status:t}),li=(t,s)=>e.jsx(ri,{timestamp:t,locale:s}),dt=t=>e.jsx(ni,{source:t}),is=(t,s=!1)=>e.jsx(es,{user:t,inService:s}),zr=t=>e.jsx(ti,{ua:t}),Is="info";function rs({createPassportSvg:t,passport:s,onCancel:i,onSwitchPassport:p}){const{t:n}=H(),d=yi({tab:Is}),m={info:{label:n("common.basicInfo"),value:Is,component:()=>e.jsx(ci,{passport:s,createPassportSvg:t})},logs:{label:n("common.logs"),value:"logs",component:()=>e.jsx(pi,{passport:s})},related:{label:n("team.passport.related"),value:"related",component:()=>e.jsx(mi,{passport:s,onSwitchPassport:p})}},r=Object.values(m).map(({label:u,value:o})=>({label:u,value:o})).filter(u=>u.value==="related"?s.parentDid:!0),c=m[d.tab]||m.info,a=u=>{d.tab=u};return e.jsx(de,{title:n("common.passport"),onClose:i,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Lr,{children:[e.jsx(j,{className:"tabs",children:e.jsx(Ai,{tabs:r,current:d.tab,onChange:a,scrollButtons:"auto"})}),e.jsx(j,{className:"body",children:e.jsx(c.component,{})})]})})}rs.propTypes={createPassportSvg:C.func.isRequired,passport:C.object.isRequired,onCancel:C.func.isRequired,onSwitchPassport:C.func};rs.defaultProps={onSwitchPassport:()=>{}};const Lr=ce(j)`
|
|
2
2
|
margin-top: -16px;
|
|
3
3
|
|
|
4
4
|
.tabs {
|