@abtnode/webapp 1.16.21 → 1.16.22-beta-f47f2cf7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/webapp",
3
- "version": "1.16.21",
3
+ "version": "1.16.22-beta-f47f2cf7",
4
4
  "keywords": [
5
5
  "arcblock",
6
6
  "react"
@@ -1,2 +0,0 @@
1
- /*! For license information please see 7875.c99786d4.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[7875],{77875:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>mi});var o=t(5057),i=t(68420),r=t(71171),a=t(33518),l=t(55898),s=t.n(l),c=t(37541),d=t(39948),p=t(7278),u=t(6838),m=t(87971),h=t(99194),f=t(67680),x=t(44919),g=t(10697),y=t(48037),v=t(34966),b=t(94552),j=t(55402),k=t(75239),C=t(48086),Z=t(88092),R=t(32207),w=t(35258),E=t(27773),S=t(26174),P=t(16147),T=t(55498),U=t(35432),I=t(44846),N=t(64886),D=t(28726),A=t(25710),B=t(38242),L=t(57156),O=t.n(L),F=t(86229),z=t(87363),M=t(17450),G=t(22228),q=t(6352),V=t.n(q),W=t(2078),H=t.n(W),K=t(19778),J=t(38898),Y=t(96266);function Q(e){var n;let{sourceInfo:t,blocklet:r}=e;const{t:a}=(0,o.useContext)(i.RD);return(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,Y.jsx)(K.Z,{type:"success",children:H()(t.source)},"source"),"registry"===t.source&&(0,Y.jsx)(J.Z,{href:V()(t.deployedFrom,"blocklets",(null===r||void 0===r||null===(n=r.meta)||void 0===n?void 0:n.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:a("blocklet.overview.viewInStore")})]})}Q.propTypes={sourceInfo:s().shape({source:s().string,deployedFrom:s().string}),blocklet:s().object},Q.defaultProps={sourceInfo:{},blocklet:{}};var _=t(81010),X=t(40736),$=t(77277),ee=t(70461),ne=t(58238),te=t(14491),oe=t(63406);function ie(e){let{blocklet:n,checkUpgrade:t,hasPermission:r,...a}=e;const{api:l}=(0,ne.h6)(),{t:s}=(0,o.useContext)(i.RD),[c,d]=(0,o.useState)(!1),[p,u]=(0,o.useState)(""),[m,h]=(0,o.useState)(null),[x,g]=(0,o.useState)(null);(0,o.useEffect)((()=>{h(null),t&&(n.mode,$.BLOCKLET_MODES.DEVELOPMENT)}),[n,t]);const y={title:"".concat(s("common.upgrade")," ").concat(s("common.blocklet")," ").concat((0,B.getDisplayName)(n)),description:s("blocklet.action.upgradeDescription"),confirm:s("blocklet.action.confirmUpgrade"),cancel:s("common.cancel"),onConfirm:async()=>{d(!0);try{const e={did:n.meta.did,version:m.version,storeUrl:m.registryUrl||""};await(0,te._v)(2e3),await l.upgradeBlocklet({input:e})}catch(e){F.Z.error("Blocklet upgrade failed: ".concat((0,te.Z)(e)))}finally{d(!1),g(null)}},onCancel:()=>{d(!1),g(null)}};return r&&m&&!(0,B.isInProgress)(n.status)?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(G.Z,{...a,children:n.meta.version}),(0,Y.jsx)(k.Z,{title:s("common.updateAvailable",{version:m.version}),children:(0,Y.jsx)(f.Z,{size:"small",style:{marginLeft:8},disabled:c,onClick:()=>g(y),children:c?(0,Y.jsx)(I.Z,{size:16}):(0,Y.jsx)(X.Z,{style:{fontSize:16,color:"red"}})})}),!!p&&(0,Y.jsx)(F.Z,{variant:"error",message:p,onClose:()=>u("")}),x&&(0,Y.jsx)(ee.Z,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]}):(0,Y.jsx)(G.Z,{...a,children:n.meta.version})}ie.propTypes={blocklet:s().object.isRequired,checkUpgrade:s().bool,hasPermission:s().bool},ie.defaultProps={checkUpgrade:!1,hasPermission:!1};const re=(0,oe.V)(ie,"mutate_blocklets"),ae=(0,oe.V)(ie,"",te.Wf);function le(e){const{inService:n}=(0,ne.h6)();return n?(0,Y.jsx)(ae,{...e}):(0,Y.jsx)(re,{...e})}var se=t(44784),ce=t(85531);function de(e){let{children:n,...t}=e;const{t:o}=(0,i.PE)(),{updateAutoCheckUpdate:r,autoCheckUpdate:a}=(0,ce.XN)(),l=Boolean(null===a||void 0===a?void 0:a.enabled);return(0,Y.jsxs)(d.Z,{display:"flex",flexDirection:"row",alignItems:"center",children:[n,(0,Y.jsx)(k.Z,{title:o("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:(0,Y.jsx)("div",{children:(0,Y.jsx)(se.Z,{checked:l,onChange:async()=>{try{const e=!(null!==a&&void 0!==a&&a.enabled);await r({enabled:e}),F.Z.success(o(e?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(e){F.Z.error(e.message)}},name:"enableWelcomePage",style:{...t.style,zoom:.8}})})})]})}de.propTypes={children:s().any},de.defaultProps={children:null};const pe=de;var ue,me,he=t(80378),fe=t(32349),xe=t(76667),ge=t(13128),ye=t(94464),ve=t(28358),be=t(47020),je=t(93938),ke=t(50185),Ce=t(35918),Ze=t(74782),Re=t(55419);const we=(e,n)=>{let{description:t}=e;return(Object.values($.CHAIN_PROP_MAP).includes(e.key)||(0,B.isEnvShareable)(e))&&(t=t?"".concat(t," (").concat(n("blocklet.config.sharedToAllComponents"),")"):n("blocklet.config.sharedToAllComponents")),t&&(0,Y.jsx)("div",{style:{marginLeft:12},children:t})},Ee=function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return!(null!==t&&void 0!==t&&t.length||e.custom||["CHAIN_ID","CHAIN_HOST"].includes(e.key)||n.meta.environments.find((n=>n.name===e.key))||!n.children.every((n=>!n.meta.environments.find((n=>n.name===e.key)))))||e.custom};function Se(e){let{blocklet:n,ancestors:t}=e;const r=(0,ne.h6)(),{inService:a}=r,{t:l}=(0,o.useContext)(i.RD),s=[...t.map((e=>e.meta.did)),n.meta.did],c=()=>F.Z.success(l("blocklet.config.changedTip")),d=e=>Ee(e,n,t);if((0,te.wS)(n.status))return null;if("unknown"===n.status&&(0,te.wS)(n.status))return null;const p=(n.configs||[]).filter((e=>!$.BLOCKLET_CONFIGURABLE_KEY[e.key])),u=(0,B.getSharedConfigObj)(t[0],n),m=(0,B.getComponentMissingConfigs)(n,t[0]),h=p.map((e=>({...e,value:Object.values($.CHAIN_PROP_MAP).includes(e.key)&&Object.keys(u).includes(e.key)?u[e.key]:u[e.key]||e.value}))),f=h.some((e=>e.key&&e.key.startsWith("BWA_"))),x={onRowAdd:async e=>{if(e.key.trim()&&e.value.trim())if(e.key.startsWith("BLOCKLET_")||e.key.startsWith("COMPONENT_"))F.Z.error(l("blocklet.config.environment.invalidKey"));else{e.custom=!0;try{const n=await r.api.configBlocklet({input:{did:s,configs:[e]}});c(n.blocklet)}catch(n){F.Z.error((0,te.Z)(n))}}else F.Z.error(l("blocklet.config.environment.keyValueRequired"))},onRowUpdate:async(e,o)=>{if(e.required&&(!e.key.trim()||!e.value.trim()))return void F.Z.error(l("blocklet.config.environment.keyValueRequired"));if(e.key.startsWith("BLOCKLET_")&&!$.BLOCKLET_CONFIGURABLE_KEY[e.key])return void F.Z.error(l("blocklet.config.environment.invalidKey"));if(e.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const n=(0,te.I)(e);if(n)return void F.Z.error(n)}const i=[e];if(e.key!==o.key){if(!Ee(e,n,t))return void F.Z.error("Only key of custom env can be changed");i.push({key:o.key,custom:!0})}try{const e=await r.api.configBlocklet({input:{did:s,configs:i}});c(e.blocklet)}catch(a){F.Z.error((0,te.Z)(a))}},onRowDelete:async e=>{if(e.required)F.Z.error(l("blocklet.config.environment.deleteForbidden"));else if(Ee(e,n,t))try{const n=await r.api.configBlocklet({input:{did:s,configs:[{key:e.key,custom:!0}]}});c(n.blocklet)}catch(o){F.Z.error((0,te.Z)(o))}else F.Z.error("Only key of custom env can be changed")},isDeletable:d};return(0,Y.jsxs)(Pe,{children:[!!m.length&&(0,Y.jsx)(je.Z,{severity:"error",style:{marginTop:24},children:l("blocklet.config.missingRequired")}),f&&(0,Y.jsx)(je.Z,{severity:"info",children:l("blocklet.config.environment.tip")}),(0,Y.jsx)(oe.Z,{permission:a?"":"mutate_blocklets",role:a?te.Wf:[],children:e=>(0,Y.jsx)(Ze.Z,{className:"config-table",children:(0,Y.jsx)(ve.ZP,{title:(0,Y.jsx)("h4",{children:l("common.environment")}),columns:[{title:l("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:e=>(0,Y.jsx)(ke.Z,{value:e.value,style:{color:e.required&&!e.value?"#ff4436":"#222222",fontWeight:e.required?"bold":"normal"},children:e.key}),editComponent:e=>{const{value:n,rowData:t,onChange:o}=e;return(0,Y.jsx)(Te,{children:(0,Y.jsx)(be.Z,{fullWidth:!0,size:"small",disabled:!1===d(t),value:n,onChange:e=>o(e.target.value),variant:"outlined",label:"Key",placeholder:l("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:l("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:e=>e.value?e.secure?"******":(0,Y.jsx)(ke.Z,{unstyled:!0,value:e.value,style:{wordBreak:"break-all"},children:e.value}):null,editComponent:e=>{const{value:n,rowData:t,onChange:o}=e;return(0,Y.jsxs)(Te,{children:[(0,Y.jsx)(be.Z,{fullWidth:!0,size:"small",value:"__encrypted__"===n?"":n,onChange:e=>o(e.target.value),variant:"outlined",label:l("common.value"),placeholder:l("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),we(t,l)]})}}],icons:{...Re.Z,...Ce.Z},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:l("common.actions")},body:{emptyDataSourceMessage:l("common.noData")}},data:h,editable:e?x:{}})})})]})}Se.propTypes={blocklet:s().object.isRequired,ancestors:s().array},Se.defaultProps={ancestors:[]};const Pe=a.Z.div(ue||(ue=(0,r.Z)(["\n .config-table {\n margin-bottom: 24px;\n position: relative;\n .hide-control {\n position: absolute;\n top: 10px;\n left: 200px;\n @media (max-width: ","px) {\n left: 160px;\n }\n }\n\n .MuiToolbar-root {\n display: flex;\n }\n\n .MuiTableRow-head {\n display: none;\n }\n\n &.hide-header {\n .MuiToolbar-root {\n display: none;\n }\n }\n }\n\n .accordion {\n margin-bottom: 16px;\n &:last-of-type {\n margin-bottom: 0;\n }\n padding: 8px 0 8px 0px;\n &.MuiAccordion-root {\n background: transparent;\n box-shadow: none;\n border: 1px solid #ddd;\n border-radius: 4px;\n &::before,\n &::after {\n height: 0;\n }\n .MuiAccordionSummary-root {\n padding-left: 0;\n }\n .accordion-title {\n font-weight: bold;\n padding-left: 16px;\n }\n }\n }\n"])),(e=>e.theme.breakpoints.values.sm)),Te=a.Z.div(me||(me=(0,r.Z)(["\n height: 60px;\n"])));var Ue,Ie=t(45239),Ne=t.n(Ie),De=t(28641);function Ae(e){let{blocklet:n,ancestors:t,hasPermission:r,...a}=e;const{t:l}=(0,i.PE)(),{api:s}=(0,ne.h6)(),c=!t.length,p=c?n.meta.did:t.map((e=>e.meta.did))[0],[u,m]=(0,o.useState)(""),[h,f]=(0,o.useState)(""),x=u||!r;if(!p)return null;if("unknown"===n.status&&(0,te.wS)(n.status))return null;return(0,Y.jsx)(Fe,{component:"div",...a,children:(0,Y.jsx)(d.Z,{mt:3,children:(0,Y.jsx)(De.Z,{label:l("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:u||x,loading:u,required:!0,initialValue:n.mountPoint,onSubmit:async e=>{m(!0);try{const t={rootDid:p,mountPoint:Ne()(e)};return c||(t.did=n.meta.did),await s.updateComponentMountPoint({input:t}),m(!1),!0}catch(t){throw m(!1),t.message=(0,te.Z)(t),F.Z.error(t.message),t}},onChange:e=>{f(l("common.slugifyHint",{value:(0,te.LN)(e)}))},helperText:h,formatterBeforeSubmit:e=>Ne()(e)})})})}const Be=(0,oe.V)(Ae,"mutate_blocklets"),Le=(0,oe.V)(Ae,"",te.Wf);function Oe(e){const{inService:n}=(0,ne.h6)();return n?(0,Y.jsx)(Le,{...e}):(0,Y.jsx)(Be,{...e})}Ae.propTypes={blocklet:s().object.isRequired,ancestors:s().array,hasPermission:s().bool},Ae.defaultProps={ancestors:[],hasPermission:!1};const Fe=a.Z.div(Ue||(Ue=(0,r.Z)([""])));var ze;function Me(e){let{blocklet:n,ancestors:t,children:r}=e;const[a,l]=(0,o.useState)(""),{t:s}=(0,i.PE)(),c=!!t.length,[p,u]=(0,o.useState)("settings"),m=c?(0,B.getDisplayName)(n,!0):s("blocklet.component.container");if((0,te.wS)(n.status))return null;if("unknown"===n.status&&(0,te.wS)(n.status))return null;const h=e=>{e.stopPropagation(),l(!0)},x={settings:{label:s("blocklet.component.setting"),value:"settings",component:(0,Y.jsx)(Oe,{blocklet:n,ancestors:t})},environments:{label:s("common.environment"),value:"environments",component:(0,Y.jsx)(Se,{blocklet:n,ancestors:t})}},g=Object.values(x).map((e=>{let{label:n,value:t}=e;return{label:n,value:t}})),y=x[p]||x.settings;return["function"===typeof r?r({open:h}):(0,Y.jsx)(f.Z,{onClick:h,"data-cy":"action-config-component",children:(0,Y.jsx)(xe.default,{})}),a&&(0,Y.jsx)(Ge,{open:!0,fullWidth:!0,maxWidth:"md",title:m,onClose:()=>{l(!1)},PaperProps:{style:{minHeight:"auto"}},children:c?(0,Y.jsxs)(d.Z,{mt:1,children:[(0,Y.jsx)(ye.Z,{tabs:g,current:p,onChange:e=>{u(e)},scrollButtons:"auto"}),y.component]}):(0,Y.jsx)(Se,{blocklet:n,ancestors:t})})]}Me.propTypes={blocklet:s().object.isRequired,ancestors:s().array,children:s().any},Me.defaultProps={ancestors:[],children:null};const Ge=(0,a.Z)(ge.ZP)(ze||(ze=(0,r.Z)(["\n .MuiDialogContent-root {\n padding-top: 0;\n margin-top: -32px;\n }\n .MuiToolbar-root {\n padding-right: 12px;\n }\n .ux-dialog_right {\n padding-right: 20px;\n }\n"])));var qe,Ve=t(11750),We=t(65140),He=t(87916);function Ke(e){let{component:n,remove:t,disabled:r,tip:a,showConfirm:l,hideBtn:s,onCancel:c}=e;const{t:d}=(0,o.useContext)(i.RD),[p,u]=(0,o.useState)(!1),[m,h]=(0,o.useState)(null),f=async e=>{u(!0),await t(e.component,e.removeType),u(!1),h(null)},x=r||p,g=()=>{h({title:"".concat(d("common.delete")," ").concat(n.meta.title||n.meta.name),description:(e,n)=>(0,Y.jsxs)(Ve.Z,{component:"div",children:[(0,Y.jsx)(Ve.Z,{gutterBottom:!0,children:d("blocklet.action.removeComponentDescription")}),(0,Y.jsxs)(He.Z,{name:"removeType",value:e.removeType,onChange:t=>n({...e,removeType:t.target.value}),children:[(0,Y.jsx)(S.Z,{value:"keepData",control:(0,Y.jsx)(We.Z,{}),label:d("blocklet.action.removeComponentKeepData")}),(0,Y.jsx)(S.Z,{value:"complete",control:(0,Y.jsx)(We.Z,{}),label:d("blocklet.action.removeComponentComplete")})]})]}),confirm:d("common.confirm"),cancel:d("common.cancel"),params:{component:n,removeType:"keepData"},onConfirm:f,onCancel:()=>{h(null),c()}})};(0,o.useEffect)((()=>{l?g():(u(!1),h(null))}),[l]);const y=(0,Y.jsx)(Je,{size:"small",disabled:x,onClick:()=>g,"data-cy":"delete-component-btn",children:(0,Y.jsx)(E.default,{disabled:x})}),v=(0,Y.jsx)(k.Z,{title:a||d("common.delete"),children:(0,Y.jsx)("span",{children:y})});return(0,Y.jsxs)(Y.Fragment,{children:[!s&&v,m&&(0,Y.jsx)(ee.Z,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}Ke.propTypes={component:s().object.isRequired,remove:s().func,onCancel:s().func,disabled:s().bool,showConfirm:s().bool,hideBtn:s().bool,tip:s().string},Ke.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const Je=(0,a.Z)(f.Z)(qe||(qe=(0,r.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"])));var Ye,Qe=t(22754),_e=t(98451);function Xe(e){let{component:n,onStart:t,onStop:r,disabled:a,tip:l}=e;const{t:s}=(0,o.useContext)(i.RD),[c,d]=(0,o.useState)(!1),[p,u]=(0,o.useState)(),m=a||c,h=["starting","running","stopping"].includes(n.status),f=h?_e.Z:Qe.Z,x=(0,Y.jsx)($e,{disabled:m,onClick:()=>{var e;h?u({title:"".concat(s("common.stop")," ").concat(null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.title),description:s("blocklet.action.stopComponentDescription"),confirm:s("blocklet.action.confirmStop"),cancel:s("common.cancel"),onConfirm:()=>(u(null),(async()=>{d(!0);try{await r(n)}catch(e){F.Z.error(e.message)}d(!1)})()),onCancel:()=>u(null)}):(async()=>{d(!0);try{await t(n)}catch(e){F.Z.error(e.message)}d(!1)})()},"data-cy":"".concat(h?"stop":"start","-component-btn"),children:(0,Y.jsx)(f,{disabled:m})});return[(0,Y.jsx)(k.Z,{title:l||s("common.".concat(h?"stop":"start")),children:(0,Y.jsx)("span",{children:x})},"btn"),p&&(0,Y.jsx)(ee.Z,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel},"connect")]}Xe.propTypes={component:s().object.isRequired,onStart:s().func,onStop:s().func,disabled:s().bool,tip:s().string},Xe.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const $e=(0,a.Z)(f.Z)(Ye||(Ye=(0,r.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"])));var en=t(74286),nn=t(74490),tn=t(33271),on=t(72904),rn=t(5952),an=t(85493),ln=t(30278),sn=t.n(ln),cn=t(79077),dn=t.n(cn),pn=t(75506),un=t.n(pn),mn=t(3785),hn=t.n(mn),fn=t(2660),xn=t(42876),gn=t(63902),yn=t(51703),vn=t(88574),bn=t(35266),jn=t(55309),kn=t(29054),Cn=t(24558),Zn=t(13727),Rn=t(56184),wn=t(11819),En=t(67486);const Sn={description:s().string,editing:s().bool,onChange:s().func,required:s().bool,value:s().any,componentProps:s().object,render:s().func,renderFormItem:s().func};function Pn(e){let{editing:n,value:t,onChange:i}=e;const[r,a]=(0,o.useState)(!1),l=(0,o.useRef)(),s=(0,o.useRef)(t);(0,o.useEffect)((()=>{let e=null;return n&&(e=setTimeout((()=>{a(!0)}),50)),()=>{clearTimeout(e)}}),[n]);const c=(0,Y.jsx)(d.Z,{className:"form-item-input slot",px:1,children:(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t,"auto"!==t&&(0,Y.jsx)("div",{style:{marginLeft:4,backgroundColor:t,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=(0,Y.jsxs)(d.Z,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:()=>{a(!1),i(s.current)},children:[(0,Y.jsx)(d.Z,{display:"flex",alignItems:"center",onClick:()=>a(!0),children:(0,Y.jsx)("div",{ref:l,style:{flexShrink:0,marginLeft:"8px",backgroundColor:t,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:"auto"===t?"default":"pointer"}})}),(0,Y.jsx)(wn.ZP,{open:r,anchorEl:l.current,onClose:()=>a(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:(0,Y.jsx)(En.AI,{color:t,onChange:e=>{return n=e.hex,s.current=n,void i(n);var n}})})]});return n?p:c}function Tn(e){let{editing:n,description:t,value:i,onChange:r,componentProps:a,...l}=e;const{placeholder:s}=a,c=(0,o.useRef)(i),p=e=>{"Enter"===e.key&&r(c.current,"confirm")};return n?(0,Y.jsx)(be.Z,{style:{flex:1},fullWidth:!0,value:i,onChange:e=>{var n;e.persist(),n=e.target.value,c.current=n,r(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:t||s,onKeyDown:p,...l}):(0,Y.jsx)(d.Z,{px:1,className:"form-item-input slot",children:i})}Pn.propTypes=Sn,Tn.propTypes=Sn,Tn.defaultProps={componentProps:{}};var Un=t(49777),In=t.n(Un),Nn=t(76818);function Dn(e){let{editing:n,value:t,onChange:o,componentProps:i,...r}=e;const{blocklet:a}=i,l="auto"===t?(0,Nn.getPassportColorFromDid)(a.appDid):t;return(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,Y.jsx)("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:In()({title:"Owner",issuer:(0,B.getDisplayName)(a),issuerDid:a.appDid,ownerName:"Your Name",ownerDid:a.appDid,preferredColor:t||"auto"})}}),(0,Y.jsx)(Pn,{...r,editing:n,value:n?l:t,onChange:o,componentProps:i})]})}Dn.propTypes={...Sn,componentProps:s().shape({blocklet:s().object.isRequired}).isRequired},Dn.defaultProps={};var An,Bn=t(35406),Ln=t(11875),On=t(59375);const Fn={input:Tn,color:Pn,passport:Dn,uploader:e=>(0,Y.jsx)(On.Z,{...e.componentProps})};function zn(e){let{schema:n,loading:t,value:i,defaultValue:r,onChange:a,style:l,disabled:s}=e;const c="[object Object]"===Object.prototype.toString.call(i),[p,u]=(0,o.useState)(null),[m,h]=(0,o.useState)(c?i:r),x=(0,o.useRef)();function g(e,n,t){const{key:o,secure:i}=e,r=m[o]!==n,l={...m,[o]:n};r&&h(l),a({[o]:n},{allValues:l,action:t,currentItem:e}),"confirm"===t&&i&&h({...m,[o]:"__encrypted__"}),["confirm","cancel"].includes(t)?y(null):y(e)}function y(e){if(e)return x.current=m[e.key],void u(e);x.current=null,u(null)}return(0,Y.jsx)(Mn,{className:"form",style:l,children:null===n||void 0===n?void 0:n.map((e=>{const{key:n,description:o,required:r,solo:a=!1,hidden:l=!1,componentProps:u={}}=e;if(l)return null;const h=!(!p||n!==p.key),y=function(e,n){let{editing:t=!1}=n;const{key:o}=e,r=c?i[o]:m[o];return"__encrypted__"===r?t?"":"******":r}(e,{editing:h}),v=function(e,n){let{editing:t=!1}=n;const{componentType:o="input",render:i,renderFormItem:r}=e;return t&&r?r:!t&&i?i:Fn[null===o||void 0===o?void 0:o.toLowerCase()]}(e,{editing:h}),b={inputProps:{"data-cy":"schema-form-item-component"},key:n,description:o,editing:h,value:y,onChange:function(n){return g(e,n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"change")},componentProps:u};return(0,Y.jsxs)(d.Z,{className:"form-item",children:[!a&&(0,Y.jsxs)(d.Z,{className:"form-item-label",style:{color:r&&!y?"#ff0000":"#333"},children:[o,r&&(0,Y.jsx)(Bn.Z,{})]}),(0,Y.jsxs)(d.Z,{className:"form-item-body",children:[(0,Y.jsx)(d.Z,{className:"form-item-input",sx:{textAlign:a?"center":"left"},children:(0,Y.jsx)(v,{...b})}),!a&&(0,Y.jsx)(d.Z,{className:"form-item-action",children:h?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(f.Z,{"data-cy":"schema-form-item-confirm",onClick:()=>{g(e,y,"confirm")},disabled:s||t,size:"large",children:t?(0,Y.jsx)(I.Z,{size:24}):(0,Y.jsx)(Rn.Z,{})}),(0,Y.jsx)(f.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{g(e,x.current,"cancel")},disabled:s||t,size:"large",children:(0,Y.jsx)(Zn.default,{})})]}):(0,Y.jsx)(f.Z,{"data-cy":"schema-form-item-edit",onClick:()=>{g(e,m[n],"edit")},disabled:s||p,size:"large",children:(0,Y.jsx)(Cn.Z,{})})})]})]},n)}))})}zn.propTypes={schema:s().array.isRequired,loading:s().bool,onChange:s().func.isRequired,value:s().object,defaultValue:s().object,style:s().object,disabled:s().bool},zn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Mn=(0,a.Z)(Ln.Z)(An||(An=(0,r.Z)([""])));var Gn=t(43316),qn=t(28018),Vn=t.n(qn),Wn=t(60344),Hn=t(73170);function Kn(e){let{meta:n,onCancel:t,mode:r,handlePaySuccess:a}=e;const{t:l,locale:s}=(0,i.PE)(),{info:c}=(0,ne.h6)(),d=(0,te.yP)(c),[p,u]=(0,o.useState)(null),m=new URL(null===n||void 0===n?void 0:n.registryUrl).origin,h=(0,B.getDisplayName)({meta:n});if((0,o.useEffect)((()=>{if("purchase"===r){const t=new URL(m);t.pathname="/api/did/verify-purchase-blocklet/token",t.searchParams.set("serverDid",c.did),t.searchParams.set("blockletDid",null===n||void 0===n?void 0:n.did);try{Wn.hi.get(t.href).then((e=>{let{data:n}=e;const t="".concat(n.url);u(t)}))}catch(e){console.error("get next workflow url error: ",e)}}return()=>{u(null)}}),[r]),"purchase"===r&&!p)return"";const f={verify:{action:"verify-purchase-blocklet",checkFn:Wn.od.create({baseURL:m}).get,extraParams:{serverDid:c.did,blockletDid:null===n||void 0===n?void 0:n.did},messages:{title:l("store.purchase.verify.auth.title",{name:h}),scan:l("store.purchase.verify.auth.scan"),confirm:l("store.purchase.verify.auth.confirm"),success:l("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Wn.od.create({baseURL:V()(m,"/store")}).get,extraParams:{factory:n.nftFactory,nw:p},messages:{title:l("store.purchase.auth.title",{name:h}),scan:l("store.purchase.auth.scan"),confirm:l("store.purchase.auth.confirm"),success:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("p",{children:l("store.purchase.auth.success")}),(0,Y.jsx)("p",{children:l("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return(0,Y.jsx)(Gn.Z,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:m,onSuccess:async(e,n)=>{const o=e=>{let{downloadTokenList:n}=e;a({downloadTokenList:n})},i=e=>{F.Z.error(e),t(e)};if("purchase"===r&&p){const{statusUrl:e}=(0,te.Pi)(p);await(s=e,Vn()((()=>Wn.hi.get(s).then((async e=>{let{data:n}=e;const t=null===n||void 0===n?void 0:n.downloadTokenList;return"succeed"===n.status?t&&t.length?(await o({downloadTokenList:t}),!0):(await i(l("blocklet.component.missDownloadTokenTip")),!0):"error"===n.status&&(console.error("vc error: ",n),await i(null===n||void 0===n?void 0:n.error),!0)}))),{interval:1e3}))}else await o({downloadTokenList:e.downloadTokenList&&n(e.downloadTokenList)});var s},cancelWhenScanned:t,onClose:t,checkTimeout:3e5,webWalletUrl:d,disableClose:!0,showDownload:!1,...f[r]})}Kn.propTypes={...Hn.$7,handlePaySuccess:s().func,mode:s().oneOf(["verify","purchase"]).isRequired},Kn.defaultProps={handlePaySuccess:()=>{}};const Jn=(0,o.forwardRef)(((e,n)=>{let{mode:t,...i}=e;const[r,a]=(0,o.useState)("both"!==t?t:"verify"),[l,s]=(0,o.useState)("both"!==t?2:1),c=e=>{e!==r&&a(e)},d=()=>{r&&2!==l&&s(2)};return(0,o.useImperativeHandle)(n,(()=>({onNext:d,getCurrentStep:()=>l}))),1===l?(0,Y.jsx)("div",{style:{maxWidth:520},children:(0,Y.jsx)(Hn.AP,{action:r,onNext:null,onSelect:c})}):(0,Y.jsx)(Kn,{...i,mode:r})}));Jn.propTypes={mode:s().oneOf(["both","verify","purchase"]).isRequired,ref:s().any},Jn.defaultProps={ref:{}};const Yn=Jn;var Qn,_n=t(51233),Xn=t(31440),$n=t(61813),et=t(49390),nt=t(67654),tt=t(22714),ot=t(45170);function it(e){let{onChange:n,loading:t,children:r,extra:a,stores:l,storageKey:s}=e;const{t:c}=(0,i.PE)(),{info:d,inService:p}=(0,ne.h6)(),{blocklet:u}=(0,kn.y0)(),[m,h]=(0,o.useState)(!1),f=(0,o.useRef)(null),[x,g]=(0,o.useState)(),[y,v]=(0,nt.Z)(s||"tmp"),[b,j]=s?[y,v]:[x,g],{storeList:k,teamDid:C}=(0,te.dX)({fromBlocklet:p,blocklet:u,nodeInfo:d}),Z=sn()([...l.map((e=>({...e,protected:!0}))),...k],"url"),R=b&&Z.find((e=>b===e.url))||Z[0],w=d.mode===U.NODE_MODES.SERVERLESS;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(rt,{children:[(0,Y.jsx)(D.Z,{ref:f,color:"secondary","data-cy":"add-component-select-store",endIcon:(0,Y.jsx)(et.Z,{color:"secondary"}),onClick:()=>{h(!0)},style:{padding:"0 2px"},children:(0,Y.jsx)(Ve.Z,{color:"secondary",children:R.name})}),(0,Y.jsx)(Ve.Z,{color:"secondary",children:a})]}),(0,Y.jsxs)(be.Z,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:c("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:R,autoFocus:!0,onChange:e=>{const t=e.target.value;j(t.url),n(t)},SelectProps:{open:m,MenuProps:{anchorEl:f.current},renderValue:e=>null===e||void 0===e?void 0:e.name,onClose:()=>{h(!1)}},style:{display:"none"},margin:"normal",children:[null===Z||void 0===Z?void 0:Z.map((e=>(0,Y.jsx)(nn.Z,{value:e,"data-cy":e.url,children:(0,Y.jsx)(ot.Z,{teamDid:C,store:e,onDelete:()=>{var n;b===e.url&&j(null===(n=Z[0])||void 0===n?void 0:n.url)}})},e.url))),!w&&(0,Y.jsx)(tt.Z,{disabled:t,storeList:Z,teamDid:C,onAdd:e=>{j(e)}})]}),r({currentRegistry:R})]})}it.propTypes={onChange:s().func,loading:s().bool,children:s().any.isRequired,extra:s().node,storageKey:s().string,stores:s().arrayOf(s().shape({name:s().string.isRequired,url:s().string.isRequired}))},it.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const rt=a.Z.div(Qn||(Qn=(0,r.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n\n span {\n font-size: 16px;\n color: ",";\n // font-weight: bold;\n }\n"])),(e=>e.theme.palette.common.black));var at,lt=t(71569),st=t(52439),ct=t(77121),dt=t(44727);const pt=(e,n)=>V()(n,"/blocklets/".concat(e.did)),ut=e=>{let{blocklet:n,attribute:t,value:o}=e;return n._formatted?n._formatted[t]:o},mt=e=>e.inStore&&!1===(0,B.isFreeBlocklet)(e);function ht(e){let{blocklet:n,blocklets:t,handleButtonClick:r,endpoint:a}=e;const{t:l}=(0,i.PE)(),s=V()(a,(0,te.lk)(n.did,n.logo||"")),[c,d]=(0,o.useState)(!1),p=mt(n)?l("common.purchase"):l("blocklet.component.choose");return(0,Y.jsx)(J.Z,{href:pt(n,a),style:{color:"initial",textDecoration:"none"},onClick:e=>!!e.currentTarget.contains(e.target)||(e.preventDefault(),!1),target:"_blank",children:(0,Y.jsx)(xt,{title:ut({blocklet:n,attribute:"title",value:n.title||n.name}),did:n.did,description:ut({blocklet:n,attribute:"description",value:n.description}),cover:n.logo?s:"",version:n.version,button:(0,Y.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,Y.jsx)(dt.Kk,{children:(0,Y.jsx)(D.Z,{onClick:async e=>{e.preventDefault(),e.stopPropagation();try{d(!0),await r({meta:n,registryUrl:a,blocklets:t})}catch(o){F.Z.error(o.message)}finally{d(!1)}},size:"small",disabled:c,variant:"outlined",color:"primary","data-cy":"install-blocklet",children:c?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(I.Z,{size:16,style:{marginRight:3}}),p]}):p},n.did)})})})})}function ft(e){let{handleButtonClick:n,handleSearchSelect:t,storeUrl:r,handleBlockletRender:a,extraFilter:l,serverVersion:s,resourceType:c,resourceDid:d,...p}=e;const{locale:u}=(0,i.PE)(),[m,h]=(0,o.useState)(!1),[f,x]=(0,o.useState)({}),g=r;return(0,o.useEffect)((()=>{x({resourceType:c,resourceDid:d})}),[g,c,d]),(0,o.useEffect)((()=>{h(!0),x({resourceType:c,resourceDid:d})}),[]),(0,Y.jsx)(st.ErrorBoundary,{FallbackComponent:lt.H,resetKeys:[g],children:(0,Y.jsx)("div",{...p,children:m&&(0,Y.jsx)(ct.Z,{blockletRender:e=>{const t={...e,handleButtonClick:n,endpoint:g};return a({...e,defaultRender:(0,Y.jsx)(ht,{...t})})},baseSearch:!0,endpoint:g,locale:u,onFilterChange:e=>{x(e)},onSearchSelect:t,filters:f,extraFilter:l,serverVersion:s,fetchCategoryDelay:500})})})}ht.propTypes={blocklet:s().object.isRequired,blocklets:s().array,handleButtonClick:s().func,endpoint:s().string},ht.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]},ft.propTypes={storeUrl:s().string.isRequired,handleButtonClick:s().func,handleSearchSelect:s().func,handleBlockletRender:s().func,extraFilter:s().func,serverVersion:s().string,resourceType:s().string,resourceDid:s().string},ft.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:""};const xt=(0,a.Z)(dt.ZP)(at||(at=(0,r.Z)(["\n .ms-highlight {\n color: ",";\n }\n"])),(e=>e.theme.palette.primary.main));var gt=t(35966);function yt(e){let{...n}=e;return(0,Y.jsx)(D.Z,{className:"bottom-button",variant:"contained",color:"primary",...n})}var vt,bt,jt=t(96366);function kt(){let{key:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{key:"sm"};const n=(0,jt.Z)();return(0,on.Z)(n.breakpoints.down(e))}function Ct(e){let{blocklet:n,onStartNow:t,children:o,disabled:r}=e;const{t:a}=(0,i.PE)(),l=kt();return!n||(0,te.bg)(n.meta)?(0,Y.jsx)(Zt,{children:o}):(0,Y.jsxs)(Rt,{isMobile:l,children:[(0,Y.jsx)(yt,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:a("setup.startNow")}),(0,Y.jsx)(d.Z,{display:"flex",alignItems:"center",children:o})]})}Ct.propTypes={blocklet:s().object,onStartNow:s().func,children:s().any,disabled:s().bool},Ct.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Zt=(0,a.Z)(d.Z)(vt||(vt=(0,r.Z)(["\n width: 100%;\n margin-top: auto;\n padding-top: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n .bottom-button {\n min-width: 200px;\n }\n "," {\n .bottom-button {\n width: 100%;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md"))),Rt=(0,a.Z)(d.Z)(bt||(bt=(0,r.Z)(["\n padding-top: 24px;\n margin-top: auto;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n .start-now {\n min-width: 140px;\n }\n .bottom-button {\n min-width: 120px;\n }\n "," {\n width: 100%;\n }\n\n "," {\n .start-now {\n min-width: inherit;\n }\n .bottom-button {\n min-width: 100px;\n }\n }\n\n "," {\n justify-content: space-between;\n gap: '32px',\n }}\n"])),(e=>e.theme.breakpoints.down("lg")),(e=>e.theme.breakpoints.down("md")),(e=>e.isMobile));var wt=t(8790),Et=function(e){return(0,Y.jsxs)("svg",{...e,children:[(0,Y.jsxs)("g",{filter:"url(#a)",children:[(0,Y.jsx)("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97z",fill:"#DDD"}),(0,Y.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.192 6.222l-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97z",fill:"#000",fillOpacity:".08"}),(0,Y.jsx)("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:(0,Y.jsx)("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97z",fill:"#D9D9D9"})}),(0,Y.jsxs)("g",{mask:"url(#b)",children:[(0,Y.jsx)("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),(0,Y.jsx)("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),(0,Y.jsx)("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568zm11.546-10.102V169h-1.756v-11.636h1.756zM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29z",fill:"#fff"}),(0,Y.jsx)("path",{d:"M117.604 47.263L121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847z",fill:"url(#e)"}),(0,Y.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047z",fill:"url(#f)"}),(0,Y.jsxs)("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[(0,Y.jsx)("path",{d:"M50.928 216.089l1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911zm2.439.564h-1.13v1.193h1.13v-1.193zm-1.13 2.983h1.13v1.193h-1.13v-1.193z",fillOpacity:".8"}),(0,Y.jsx)("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762zM36.355 214h-1.011v7.783h1.01V214zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75zM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894zm6.946 1.803h1.13v1.193h-1.13v-1.193zm1.13 2.983h-1.13v1.193h1.13v-1.193zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751z"})]}),(0,Y.jsx)("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),(0,Y.jsx)("path",{d:"M192.064 213.333l.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46z",fill:"#fff"}),(0,Y.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26z",fill:"#fff"})]})]}),(0,Y.jsxs)("defs",{children:[(0,Y.jsxs)("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,Y.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,Y.jsx)("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,Y.jsx)("feOffset",{dy:"2"}),(0,Y.jsx)("feGaussianBlur",{stdDeviation:"2"}),(0,Y.jsx)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,Y.jsx)("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),(0,Y.jsx)("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),(0,Y.jsx)("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),(0,Y.jsx)("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,Y.jsx)("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),(0,Y.jsxs)("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[(0,Y.jsx)("stop",{stopColor:"#101010"}),(0,Y.jsx)("stop",{offset:"1",stopColor:"#272727"})]}),(0,Y.jsxs)("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,Y.jsx)("stop",{stopColor:"#fff",stopOpacity:".4"}),(0,Y.jsx)("stop",{offset:"1",stopColor:"#fff"})]}),(0,Y.jsxs)("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,Y.jsx)("stop",{stopColor:"#fff"}),(0,Y.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),(0,Y.jsxs)("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[(0,Y.jsx)("stop",{stopColor:"#016BED"}),(0,Y.jsx)("stop",{offset:".699",stopColor:"#4498FB"}),(0,Y.jsx)("stop",{offset:"1",stopColor:"#9DFFE8"})]}),(0,Y.jsx)("clipPath",{id:"g",children:(0,Y.jsx)("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),(0,Y.jsx)("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYzl5zRUq3sx3I+JL7sBJKXchDGJY9D+SfHAIoA+TuHCyYYYFjkhNB8tO5hhju0ANjdCITLx4/JDL+yyP0ErZR+m3M322bY8OKHzoOcAXLQMBHiIh+X59pv6udCJ7MAV9HARPtTEuFSdAzNVn7uPmkk3TpBGHb8DJZ3p36ScsuJVFQP6CUBXimN3BABZJUiEwBOMsHUisZiXU8k3bVSTrPcHsKEEg8gV/vP7U26vRWhl2UnfEbX3VlVbRHgSwmcy2tWTjsxmIb4YjgbAkmpyEOINs1gCtSC4YsjwnY9l1MJYRz1NMk5N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YAo9QybSeFUX5a9bl1On+cL5YHUjp/eID+XwV2AwZUXHswFw0IhIUlwmaTdQtlKJUpbAArh1IONYy6WQkAc9+ZocJMnELtCFNKLySGLwUIuW1fJLBKOoydII6+sDlhy8xYI1vchhF6qZnM0/oZSUzcd5By2cDzUtH3ng8PHIzAKL25wuSv+gDBsggYWWkvLT27f2dhwRULpny5D5yKI7vD/4iAW9KWHB7JsEZeCE1E/mdgVHZTOci8X+YIanJt7+aBd2k8f2RL45Z2puefelcXjUWbKdMSYwr58dAPaHymSU0o9/zjFt7/VoGmNAwCyvrKe2L1hYJqtd5gh6FGiCAGzqFk6on9pQdSAQzkctDTtXGbDih5iRPVIk9TwCJGwP3tpATkHsNwloUilnNMFce7twgDgrgWhsE8jWW+EBLlTDMn9pmtJOefTJc6Cxld039TN4XiwL4pMtU+8tXJ4g/LghG5APdF7/e3FSi4v8vnEBiIEm+5LlZtsk2LbbbY5hN9JkkJkd5BjQFPoUcwjJdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};function St(){const{t:e}=(0,i.PE)();return(0,Y.jsx)(d.Z,{children:(0,Y.jsxs)(d.Z,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[(0,Y.jsx)(Et,{style:{width:200,height:250}}),(0,Y.jsx)(Ve.Z,{marginTop:"24px",marginBottom:"24px",children:e("storage.spaces.connect.providerForStorage")})]})})}Et.defaultProps={width:"228",height:"258",viewBox:"0 0 228 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},St.propTypes={};const Pt=St;var Tt=t(19654),Ut=t(39565),It=t(84584),Nt=t(47595),Dt=t(60939),At=t(72443),Bt=t.n(At);function Lt(e){let{spaceGateway:n,onDeleteSpace:t}=e;const{t:r}=(0,i.PE)(),[a,l]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1),d=(e,n)=>{null===e||void 0===e||e.stopPropagation(),l(n)};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(f.Z,{size:"small",onClick:e=>d(e,!0),children:(0,Y.jsx)(Nt.default,{})}),(0,Y.jsx)(Dt.Z,{title:r("common.delConfirmDescription",{data:"".concat(null===n||void 0===n?void 0:n.name)}),open:a,confirmButton:{text:r("common.confirm"),props:{variant:"contained",color:"error",loading:s}},cancelButton:{text:r("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:async e=>{try{null===e||void 0===e||e.stopPropagation(),c(!0),await t(n),l(!1)}catch(o){console.error(o),F.Z.error("".concat(r("storage.spaces.gateway.delete.failed"),": ").concat(Bt()(o)))}finally{c(!1)}},onCancel:e=>d(e,!1)})]})}Lt.propTypes={onDeleteSpace:s().func,spaceGateway:s().shape({name:s().string.isRequired,url:s().string.isRequired,protected:s().bool}).isRequired},Lt.defaultProps={onDeleteSpace:()=>{}};const Ot=Lt;var Ft,zt=function(e){return(0,Y.jsx)("svg",{...e,children:(0,Y.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};function Mt(e){let{spaceGateway:n,connected:t,onDisconnect:o,...r}=e;const a=kt(),{t:l}=(0,i.PE)();return(0,Y.jsxs)(Gt,{style:{position:"relative"},children:[(0,Y.jsxs)(d.Z,{sx:{backgroundColor:t?"#F0FDFF":"inherit","&:hover":{backgroundColor:t?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px",...r,children:[(0,Y.jsx)(d.Z,{display:"flex",children:(0,Y.jsx)(Ut.Z,{alt:n.did,src:(0,It.Jf)(n.endpoint)})}),(0,Y.jsxs)(d.Z,{className:"spaces-info",display:"flex",flexGrow:1,flexDirection:"column",sx:{marginLeft:"20px",padding:"0px 0px"},children:[(0,Y.jsxs)(d.Z,{className:"spaces-info",display:"flex",maxWidth:"360px",alignItems:"center",children:[(0,Y.jsx)(Ve.Z,{color:t?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:n.name}),(0,Y.jsx)(Tt.Z,{label:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(zt,{style:{marginRight:"4px"}}),l("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:a?null:"20px",fontWeight:"bold"}})]}),(0,Y.jsx)(d.Z,{className:"spaces-address",display:"flex",color:"#9397A1",marginTop:"8px",children:(0,Y.jsx)(Ve.Z,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:n.did&&(0,Y.jsx)(M.Z,{copyable:!1,size:14,compact:!0,responsive:!1,did:n.did})})})]}),(0,Y.jsx)(d.Z,{className:"spaces-backup",display:"flex",alignItems:"center",children:(0,Y.jsx)(d.Z,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:(0,Y.jsx)(Ot,{spaceGateway:n,onDeleteSpace:async()=>{try{await o(),F.Z.success(l("storage.spaces.gateway.delete.succeeded",{name:n.name}))}catch(e){console.error(e),F.Z.error((0,te.Z)(e))}}})})})]}),(0,Y.jsx)(d.Z,{className:"selected-container selected",children:(0,Y.jsx)(xn.default,{className:"selected-icon"})})]})}zt.defaultProps={width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Mt.propTypes={spaceGateway:s().shape({did:s().string.isRequired,name:s().string.isRequired,url:s().string.isRequired,endpoint:s().string.isRequired,protected:s().bool}).isRequired,connected:l.bool,onDisconnect:l.func},Mt.defaultProps={connected:!1,onDisconnect:()=>{}};const Gt=(0,a.Z)(d.Z)(Ft||(Ft=(0,r.Z)(["\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"]))),qt=Mt;var Vt=t(65873),Wt=t(41899);const Ht=(0,o.createContext)({}),{Provider:Kt,Consumer:Jt}=Ht;function Yt(e){let{children:n}=e;const[t,i]=(0,o.useState)(!1),[r,a]=(0,o.useState)(null),{blocklet:l,actions:{refreshBlocklet:s}}=(0,kn.y0)(),{storageEndpoint:c}=function(){const[e,n]=(0,o.useState)(null),{blocklet:t}=(0,kn.y0)();return(0,o.useEffect)((()=>{n((0,It.EJ)(t))}),[t]),{storageEndpoint:e}}(),{api:d}=(0,ne.h6)();(0,Wt.Z)((async()=>{try{if(i(!0),(0,Vt.isEmpty)(c))return void a(null);const e=await(0,It.UV)(c);a(e)}catch(e){console.error(e),F.Z.error(e.message)}finally{i(!1)}}),[c]);const p=async e=>{await d.configBlocklet({input:{did:[l.meta.did],configs:[{key:$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:e}]}}),s()};(0,o.useEffect)((()=>{!async function(){if(!r)return;const e=await(0,It.nU)(r.endpoint,r.name),n=(0,Vt.merge)(r,{name:e});a(n)}()}),[]);const u=Boolean(c&&r);return(0,Y.jsx)(Kt,{value:{loading:t,spaceGateway:r,deleteSpaceGateway:()=>{a(null),s()},updateSpaceGateway:async e=>{a(e),await p(e.endpoint),s()},storageEndpoint:c,settingStorageEndpoint:p,hasStorageEndpoint:u},children:n})}function Qt(){return(0,o.useContext)(Ht)}Yt.propTypes={children:l.node.isRequired},Yt.defaultProps={};const _t=function(){const{t:e}=(0,i.PE)(),{spaceGateway:n,settingStorageEndpoint:t}=Qt();return(0,Y.jsxs)(d.Z,{display:"flex",flexDirection:"column",children:[(0,Y.jsx)(d.Z,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:(0,Y.jsx)(Ve.Z,{fontSize:"1.2rem",fontWeight:"bold",children:e("storage.spaces.connected.title")})}),(0,Y.jsx)(d.Z,{children:(0,Y.jsx)(qt,{style:{marginTop:"12px"},spaceGateway:n,connected:!0,onDisconnect:()=>t(null)},n.endpoint)})]})};var Xt=t(55372),$t=t(17682),eo=t(56277);function no(e){let{onConnect:n,...t}=e;const{blocklet:r}=(0,kn.y0)(),{info:a}=(0,ne.h6)(),{t:l,locale:s}=(0,i.PE)(),[c,p]=(0,o.useState)(""),[u,m]=(0,o.useState)(!1),[h,f]=(0,o.useState)(!1),[x,g]=(0,o.useState)(""),y=(0,eo.Z)({blocklet:r}),v=(0,te.yP)(a),{storageEndpoint:b}=Qt(),[j,k]=(0,o.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,prefix:V()(U.PROD_DID_SPACES.CORE_URL,"space/api/did"),baseUrl:new URL(U.PROD_DID_SPACES.CORE_URL).origin,checkFn:Wn.od.create({baseURL:V()(U.PROD_DID_SPACES.CORE_URL,"space")}).get,messages:{title:l("storage.spaces.provideNFT.title",{appName:y.appName},s),scan:l("storage.spaces.provideNFT.scan",{appName:y.appName},s),confirm:"",success:(0,Y.jsx)(Ve.Z,{gutterBottom:!0,children:l("storage.spaces.provideNFT.success")})},onClose:()=>{k((e=>({...e,open:!1})))}}),[C,Z]=(0,o.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,messages:{title:l("storage.spaces.authorize.title",{appName:y.appName},s),scan:l("storage.spaces.authorize.scan",{appName:y.appName},s),confirm:"",success:(0,Y.jsx)(Ve.Z,{gutterBottom:!0,children:l("storage.spaces.authorize.success")})},onClose:()=>{Z((e=>({...e,open:!1})))}}),R=(e,n)=>{setTimeout((async()=>{Z((e=>({...e,open:!1}))),p(null),k((e=>({...e,open:!1})));const t=n(e.endpoint),o=e.space?n(e.space):{};await w({endpoint:t,did:(0,It.LQ)(t),name:"DID Space",...o})}),0)},w=async e=>{let{did:t,name:o,endpoint:i}=e;const r=await(0,It.Z3)(i);if(!await(0,It.w2)(r))return void F.Z.error(l("storage.spaces.gateway.add.invalidUrl"));const a={name:o,did:t,url:r,endpoint:i};await n(a),F.Z.success(l("storage.spaces.connectedWithName",{name:a.name}))},E=async()=>{try{m(!0);const e=await(0,It.Z3)(c),n=(0,It.ag)(e),t=new URL(e).searchParams.get("spaceDid");if(!await(0,It.w2)(n))throw new Error(l("storage.spaces.gateway.add.invalidUrl"));Z((e=>({...e,open:!0,prefix:V()(n,"space/api/did"),baseUrl:new URL(n).origin,checkFn:Wn.od.create({baseURL:V()(n,"space")}).get,extraParams:{appDid:y.appDid,appName:y.appName,appDescription:y.appDescription,scopes:y.scopes,appUrl:y.appUrl,referrer:y.referrer,nodeDid:a.did,spaceDid:t}}))),f(!1)}catch(e){const n="".concat(l("storage.spaces.gateway.add.failed",s),": ").concat((0,te.Z)(e));g(n)}finally{m(!1)}};return(0,Y.jsxs)(d.Z,{children:[(0,Y.jsx)($t.Z,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:()=>{k((e=>({...e,open:!0,extraParams:{appDid:y.appDid,appName:y.appName,appDescription:y.appDescription,scopes:y.scopes,appUrl:y.appUrl,referrer:y.referrer,nodeDid:a.did}})))},variant:"outlined",menu:[(0,Y.jsx)($t.Z.Item,{sx:{textTransform:"none"},onClick:()=>f(!0),size:"small",...t,children:l(b?"storage.spaces.connect.useSpaceGatewayReconnect":"storage.spaces.connect.useSpaceGateway")},"1")],children:(0,Y.jsx)(Ve.Z,{sx:{fontWeight:"bold",textTransform:"none"},children:l(b?"storage.spaces.connect.useWalletReconnect":"storage.spaces.connect.useWallet")})}),(0,Y.jsx)(Gn.Z,{forceConnected:!1,saveConnect:!1,prefix:j.prefix,open:j.open,popup:!0,action:j.action,webWalletUrl:v,baseUrl:j.baseUrl,checkFn:j.checkFn,onSuccess:R,onClose:j.onClose,checkTimeout:j.checkTimeout,extraParams:j.extraParams,messages:j.messages,locale:s}),(0,Y.jsx)(Gn.Z,{forceConnected:!1,saveConnect:!1,prefix:C.prefix,open:C.open,popup:!0,action:C.action,baseUrl:C.baseUrl,checkFn:C.checkFn,onSuccess:R,onClose:C.onClose,checkTimeout:C.checkTimeout,extraParams:C.extraParams,messages:C.messages,locale:s}),(0,Y.jsxs)(ge.ZP,{title:l("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:h,onClose:()=>f(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(D.Z,{onClick:e=>{e.stopPropagation(),f(!1)},color:"inherit",children:l("common.cancel")}),(0,Y.jsxs)(D.Z,{onClick:E,color:"primary",disabled:u||!c,variant:"contained",autoFocus:!0,children:[u&&(0,Y.jsx)(I.Z,{size:16}),l("common.confirm")]})]}),children:[(0,Y.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,Y.jsx)(Xt.Z,{component:"div",children:(0,Y.jsx)(Ve.Z,{component:"div",children:(0,Y.jsx)(be.Z,{label:l("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:c,onChange:e=>{g(null),p(e.target.value)},disabled:u,onKeyPress:async e=>{"Enter"===e.key&&await E()},autoFocus:!0})})})}),Boolean(x)&&(0,Y.jsx)(vn.Z,{type:"error",style:{width:"100%"},children:x})]})]})}no.propTypes={onConnect:l.func},no.defaultProps={onConnect:()=>{}};const to=no;var oo;function io(e){var n;let{blockletMeta:t,onEndpointUpdate:i}=e;const r=kt(),{blocklet:a}=(0,kn.y0)(),{updateSpaceGateway:l,loading:s,hasStorageEndpoint:c}=Qt();return(0,o.useEffect)((()=>{null===i||void 0===i||i()}),[a]),s?(0,Y.jsx)(gt.Z,{relative:"parent",children:(0,Y.jsx)(I.Z,{})}):(0,Y.jsxs)(ro,{children:[(0,Y.jsx)(d.Z,{width:r?"360px":"720px",children:c?(0,Y.jsx)(_t,{}):(0,Y.jsx)(Pt,{})}),"required"===(null===t||void 0===t||null===(n=t.capabilities)||void 0===n?void 0:n.didSpace)&&(0,Y.jsx)(Ct,{mt:8,children:(0,Y.jsx)(to,{onConnect:l})})]})}io.propTypes={blockletMeta:s().any.isRequired,onEndpointUpdate:l.func},io.defaultProps={onEndpointUpdate:()=>{}};const ro=(0,a.Z)(wt.Z)(oo||(oo=(0,r.Z)(["\n height: 100%;\n overflow-y: auto;\n"]))),ao=io;var lo,so,co,po,uo,mo,ho;const fo=e=>e.inStore&&!1===(0,B.isFreeBlocklet)(e),xo=e=>{var n;return null===e||void 0===e||null===(n=e.capabilities)||void 0===n?void 0:n.didSpace},go=e=>{var n,t;return(null===e||void 0===e||null===(n=e.configs)||void 0===n||null===(t=n.find((e=>e.key===$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===t?void 0:t.value)||null},yo=e=>(e.environments||[]).some((e=>e.required)),vo=(e,n)=>null===e||void 0===e?void 0:e.some((e=>e.required&&!n[e.key])),bo=e=>{let{params:n,blocklet:t,t:o}=e;const i=n.title||n.name;if(!i)return o("common.next");return o(((null===t||void 0===t?void 0:t.children)||[]).find((e=>e.meta.bundleDid===n.bundleDid))?"blocklet.component.upgradeNext":"blocklet.component.addNext",{name:i})},jo=(0,o.forwardRef)(((e,n)=>{let{meta:t,isMobile:r,onStepChange:a}=e;const{steps:l,activeStep:s,setActiveStepByKey:c,setActiveStepByIndex:d}=(0,yn.s)(),{t:p,locale:u}=(0,i.PE)(),m=l[s];return(0,o.useEffect)((()=>{a(s)}),[a,s]),(0,o.useImperativeHandle)(n,(()=>({setActiveStepByKey:c,setActiveStepByIndex:d}))),(0,Y.jsx)(So,{component:"div",className:r?"mobileStyle":"",sx:{height:"calc(100% - 56px)"},children:(0,Y.jsx)(gn.Z,{locale:u,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?(0,te.aZ)({did:t.did,baseUrl:t.registryUrl,logoPath:t.logo}):null,stepTip:p("blocklet.component.add"),children:(0,Y.jsx)(wo,{children:null!==m&&void 0!==m&&m.body&&"function"===typeof m.body?m.body():m.body})})})}));jo.propTypes={meta:s().any,onStepChange:s().func.isRequired,isMobile:s().bool.isRequired},jo.defaultProps={meta:null};const ko=function(e){setTimeout((()=>{window.parent.postMessage({event:"component.installed",componentDid:e},"*")}),arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3)};function Co(e){var n,t,r,a,l,s,c;let{onClose:p,mode:u,stores:m,resourceType:h,resourceDid:f,storageKey:x,inDialog:g}=e;const{t:y,locale:v}=(0,i.PE)(),[b,j]=(0,o.useState)(!1),[k,C]=(0,o.useState)(null),[Z,R]=(0,o.useState)(""),[w,E]=(0,o.useState)(""),{api:S,ws:{useSubscription:P},inService:T,info:N}=(0,ne.h6)(),{blocklet:A,actions:{refreshBlocklet:L}}=(0,kn.y0)(),[O,z]=(0,o.useState)(null),[M,G]=(0,o.useState)(!1),q={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceCapability:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[V,W]=(0,o.useState)(q),[H,K]=(0,o.useState)(0),J=(0,o.useRef)({}),Q=(0,o.useRef)({}),_=(0,o.useRef)({}),X=(0,on.Z)((e=>e.breakpoints.down("md"))),ee=(0,an.useParams)(),{meta:oe}=J.current,{setActiveStepByIndex:ie}=Q.current||{},re=N.mode===U.NODE_MODES.SERVERLESS,ae=e=>W((n=>({...n,...e})));(0,o.useEffect)((()=>{if(V.pathPrefix){const{errMsg:e}=he({...V,pathPrefix:V.pathPrefix,locale:v});R(e)}}),[V.pathPrefix]),(0,o.useEffect)((()=>{0===H&&W(q)}),[H]);const le=()=>{var e;const n=null!==(e=go(A))&&void 0!==e?e:"";ae({didSpaceEndpoint:n})},se=()=>{var e;return null!==J&&void 0!==J&&null!==(e=J.current)&&void 0!==e&&e.meta?(0,B.getDisplayName)(J.current):""},ce=e=>{const n=t=>{ae({installResultProps:{variant:"error",title:se(),subTitle:e,footer:(0,Y.jsx)(D.Z,{className:"bottom-button",disabled:t,"data-cy":"retry-install-component",onClick:async()=>{n(!0),await me(J.current.installInput)},children:(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t&&(0,Y.jsx)(I.Z,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};n()},de=e=>n=>{var t,o;((null===n||void 0===n||null===(t=n.meta)||void 0===t?void 0:t.did)||(null===n||void 0===n?void 0:n.meta))===(null===A||void 0===A||null===(o=A.meta)||void 0===o?void 0:o.did)&&e(n)};P($.BlockletEvents.statusChange,de((e=>{if(e.status===$.BlockletStatus.upgrading)ae({installResultProps:{variant:"success",title:se(),subTitle:y("blocklet.component.installSuccessTip")}}),ko(ee.componentDid);const n=go(A);ae((e=>({...e,didSpaceEndpoint:n})))})),[null===A||void 0===A||null===(n=A.meta)||void 0===n?void 0:n.did]),P($.BlockletEvents.downloadFailed,de((()=>{ce(y("blocklet.component.installComponentError"))})),[null===A||void 0===A||null===(t=A.meta)||void 0===t?void 0:t.did]),P($.BlockletEvents.installFailed,de((()=>{ce(y("blocklet.component.installComponentError"))})),[null===A||void 0===A||null===(r=A.meta)||void 0===r?void 0:r.did]);const pe=()=>{j(!1),W({}),J.current={},p()},ue=e=>((null===A||void 0===A?void 0:A.children)||[]).some((n=>n.meta.did===e)),me=async e=>{var n,t;const{pathPrefix:o,bundleDid:i,title:r,componentName:a="",componentDid:l=""}=V,{configs:s=[],registryUrl:c,inStore:d,inputUrl:p}=(null===(n=J.current)||void 0===n?void 0:n.meta)||{},u=null===(t=J.current)||void 0===t?void 0:t.downloadTokenList,m=d?(0,te.Rn)(c,i):p;j(!0);const h={rootDid:A.meta.did,url:m,mountPoint:Ne()(o),title:r,name:a,did:l,...V.hasEnvironmentsStep&&s.length>0?{configs:s.map((e=>({...e,value:V.configsValue[e.key]||""})))}:{},...u?{downloadTokenList:u}:{},...e};try{if(await S.installComponent({input:h}),c){const{teamDid:e,storeList:n}=(0,te.dX)({fromBlocklet:T,nodeInfo:N,blocklet:A}),{isNew:t,decoded:o}=(0,te.bQ)(c,n);t&&await S.addBlockletStore({input:{teamDid:e,url:o}})}ae({installResultProps:{}}),L({showError:!1,attachRuntimeInfo:!1})}catch(f){const e=(0,te.Z)(f);F.Z.error(e),console.error("installComponent error: ",f),ce(e)}finally{j(!1),J.current.installInput=h}},he=e=>({errMsg:(0,_n.Rw)({params:{...e,did:e.bundleDid},blocklets:[A],blocklet:A,locale:v})}),fe=async e=>{const{errMsg:n}=he({...V,locale:v});R(n),H===ye.length-2&&await me(e),ie((e=>e+1))},xe=()=>{ie((e=>e-1))},ge=e=>{var n,t;let{chooseParams:o=J.current,componentDid:i,isInit:r=!1}=e;const{meta:a,registryUrl:l,inStore:s,inputUrl:c}=o,{did:d,title:p,name:u}=a,m=((null===(n=A.settings)||void 0===n?void 0:n.children)||[]).filter((e=>"deleted"===e.status&&e.meta.bundleDid===d)),h=i||"",f=null===(t=a.environments)||void 0===t?void 0:t.map((e=>{const{name:n,validation:t,...o}=e;return{...o,key:n,...{validation:hn()(t)?"":t}}}));J.current={...o,meta:{...a,configs:f,registryUrl:l,inStore:s,inputUrl:c}};let x={};if(r){const e=[A],n=f||[],t=[],o=sn()(dn()([...n,...t]),"key").filter((e=>!!e.key)).sort(((e,n)=>e.required&&!n.required?-1:n.required&&!e.required?1:0)),i=(0,B.getSharedConfigObj)(e[0],{configs:o}),r={},a=o.map((e=>{const{default:n,key:t,...o}=e;return r[t]=i[t]||n,{...o,key:t,hidden:!!$.BLOCKLET_CONFIGURABLE_KEY[t]}}));x={...x,configsList:a,configsValue:r,hasMissRequiredConfigs:vo(a,r)}}const g=A.children.some((e=>"/"===e.mountPoint)),y=m.find((e=>e.meta.bundleDid===d)),v=A.children.find((e=>e.meta.bundleDid===d));if(x.title=p||"",y)x={...x,pathPrefix:y.mountPoint||"",componentName:y.meta.name,hasEnvironmentsStep:!1};else if(v)x={...x,pathPrefix:v.mountPoint||"",componentName:v.meta.name,hasEnvironmentsStep:!1};else{var b,j;x={...x,pathPrefix:g?"/".concat(Ne()(p)||Ne()(u)):"/",componentName:"",hasEnvironmentsStep:(null===(b=J.current.meta)||void 0===b||null===(j=b.environments)||void 0===j?void 0:j.length)>0}}const k=fo(J.current.meta),C=xo(J.current.meta),Z=go(A);ae({bundleDid:d,componentDid:h,...x,hasRequiredEnvironments:yo(J.current.meta),requirePurchase:k,didSpaceCapability:C,didSpaceEndpoint:Z}),r&&k&&(()=>{const{pathPrefix:e,bundleDid:n,title:t,componentName:o="",componentDid:i=""}=V,{meta:r={}}=J.current||{},{registryUrl:a,inStore:l,inputUrl:s}=r,c=l?(0,te.Rn)(a,n):s;z({meta:r,installOpts:{type:"component",rootDid:A.meta.did,mountPoint:e,url:c,title:t,name:o,did:i}})})()},ye=[{key:"selectComponent",name:y("blocklet.component.selectComponent"),body:(0,Y.jsxs)(Ro,{component:"div",children:[V.showFromUrlDialog&&(0,Y.jsx)($n.Z,{mode:"component",onCancel:()=>{ae({showFromUrlDialog:!1})},onSuccess:e=>{let{meta:n,inputUrl:t,inStore:o,registryUrl:i}=e;ge({chooseParams:{meta:n,inputUrl:t,inStore:o,registryUrl:i},isInit:!0}),ae({showFromUrlDialog:!1}),fe()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),(0,Y.jsx)(it,{stores:m,extra:re?null:(0,Y.jsxs)(D.Z,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{ae({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[(0,Y.jsx)(tn.Z,{style:{fontSize:20,marginRight:4}})," ",y("blocklet.component.addComponentTip.fromUrl")," "]}),loading:b,onChange:()=>{W({}),J.current={}},storageKey:x,children:e=>{let{currentRegistry:n}=e;return(0,Y.jsx)(ft,{serverVersion:null===N||void 0===N?void 0:N.version,style:X?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:n.url,resourceType:h,resourceDid:f,handleButtonClick:e=>{ge({chooseParams:{...e,inStore:!0},isInit:!0})},handleBlockletRender:e=>{let{blocklet:n,defaultRender:t}=e;const o=(null===V||void 0===V?void 0:V.bundleDid)&&(null===V||void 0===V?void 0:V.bundleDid)===(null===n||void 0===n?void 0:n.did);return(0,Y.jsxs)(To,{children:[o&&(0,Y.jsx)("div",{className:"check-container",children:(0,Y.jsx)(xn.default,{className:"check-icon"})}),(0,Y.jsx)("div",{className:o?"choose-blocklet":"",style:{marginLeft:16},children:t})]})}})}})]}),cancel:"embed"===u?void 0:y("common.cancel"),confirm:bo({params:V,blocklet:A,t:y}),onCancel:pe,onConfirm:()=>{fe()}},{key:"agreement",name:y("launchBlocklet.introduction"),body:(0,Y.jsxs)(Ro,{component:"div",className:"agreement-wrapper",children:[(0,Y.jsx)(fn.Z,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),(0,Y.jsx)(Xn.Z,{meta:oe,onClickNext:fe,handleDescEle:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("p",{children:(0,Y.jsx)("div",{dangerouslySetInnerHTML:{__html:y("blocklet.component.addComponentTip.".concat(V.requirePurchase?"isPurchase":"isFree"),{name:se()})}})}),(0,Y.jsx)("p",{children:y("blocklet.component.addComponentTip.belowInformation")})]})})]}),cancel:y("common.pre"),confirm:y("launchBlocklet.next"),onCancel:xe,onConfirm:()=>{G(!1),fe()}},oe&&V.requirePurchase&&{key:"purchase",name:(0,Y.jsxs)(Y.Fragment,{children:[y("common.verifyNFT"),(0,Y.jsx)(Bn.Z,{})]}),body:(0,Y.jsxs)(Ro,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(2===(null===(a=_.current)||void 0===a||null===(l=a.getCurrentStep)||void 0===l?void 0:l.call(a))||M)&&(0,Y.jsx)(Po,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),un()(V.purchaseResultProps)?O&&(0,Y.jsx)(Yn,{ref:_,meta:O.meta,mode:V.componentDid?"verify":"both",onCancel:e=>{G(!1),ae({purchaseResultProps:{variant:"error",title:se(),subTitle:e,style:{paddingTop:120},footer:(0,Y.jsx)(D.Z,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{ae({purchaseResultProps:{}})},children:y("common.retry")})}})},installOpts:O.installOpts,handlePaySuccess:e=>{let{downloadTokenList:n}=e;J.current.downloadTokenList=n,G(!1),fe()}}):(0,Y.jsx)("div",{className:"flex-align-center flex-justify-center",children:(0,Y.jsx)(jn.Z,{...V.purchaseResultProps})})]}),disabled:2===(null===(s=_.current)||void 0===s||null===(c=s.getCurrentStep)||void 0===c?void 0:c.call(s))||M,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{"function"===typeof _.current.onNext&&(_.current.onNext(),G(!0))},onCancel:()=>{xe()}},(0,B.hasStartEngine)(oe)&&!ue(oe.did)&&{key:"config",name:y("common.config"),error:Z,body:(0,Y.jsxs)(Ro,{component:"div",children:[(0,Y.jsx)(Po,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),(0,Y.jsx)(be.Z,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:w||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:V.pathPrefix,onChange:e=>{const n=e.target.value;ae({pathPrefix:n}),E(y("common.slugifyHint",{value:(0,te.LN)(n)}))}}),!!Z&&(0,Y.jsx)(vn.Z,{type:"error",style:{width:"100%",marginTop:8},children:Z})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:xe,onConfirm:()=>{fe()}},oe&&!ue(oe.did)&&(null===V||void 0===V?void 0:V.hasEnvironmentsStep)&&{key:"environment",name:(0,Y.jsxs)(Y.Fragment,{children:[y("common.environment")," ",V.hasRequiredEnvironments&&(0,Y.jsx)(Bn.Z,{})]}),disabled:!!k||(null===V||void 0===V?void 0:V.hasMissRequiredConfigs),body:()=>(0,Y.jsxs)(Ro,{component:"div",children:[(0,Y.jsx)(Po,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),(0,Y.jsx)(zn,{style:{marginTop:-12,width:"100%"},schema:V.configsList,defaultValue:V.configsValue,onChange:(e,n)=>{let{action:t,currentItem:o,allValues:i}=n;"confirm"===t&&ae({hasMissRequiredConfigs:vo(V.configsList,i),configsValue:i}),"edit"===t?C(o):["cancel","confirm"].includes(t)&&C(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:xe,onConfirm:fe},oe&&!ue(oe.did)&&(null===V||void 0===V?void 0:V.didSpaceCapability)&&{key:"didSpace",name:(0,Y.jsxs)(Y.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ","required"===V.didSpaceCapability&&(0,Y.jsx)(Bn.Z,{})]}),disabled:"required"===V.didSpaceCapability&&!V.didSpaceEndpoint,body:()=>(0,Y.jsx)(Yt,{children:(0,Y.jsxs)(Ro,{component:"div",children:[(0,Y.jsx)(Po,{title:y("blocklet.component.didSpaceConfig"),subTitle:y("blocklet.component.didSpaceConfigTip")}),(0,Y.jsx)(d.Z,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:(0,Y.jsx)(ao,{blockletMeta:J.current.meta,onNext:()=>{fe()},onEndpointUpdate:le})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:xe,onConfirm:fe},{key:"install",name:ue(null===oe||void 0===oe?void 0:oe.did)?y("common.upgrade"):y("common.install"),disabled:!1,loading:!1,body:(0,Y.jsx)(Ro,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:un()(V.installResultProps)?(0,Y.jsx)(bn.Z,{message:(0,Y.jsx)(Uo,{children:y("blocklet.component.installingCanCloseWindowTip")}),increaseSpeed:.3,messageLoop:!1}):(0,Y.jsx)("div",{style:{marginTop:120},children:(0,Y.jsx)(jn.Z,{...V.installResultProps})})}),confirm:y("common.complete"),onConfirm:()=>{ko(ee.componentDid),pe(),setTimeout((()=>{const e=document.getElementsByClassName("dashboard-main")[0];e&&(e.scrollTop=e.scrollHeight)}),200)}}].filter((e=>e)),ve=ye[H]||{};return A?(0,Y.jsxs)(Zo,{sx:X?{width:"100%",height:window.innerHeight}:{width:"100%",height:g?"72vh":"100vh"},children:[(0,Y.jsx)(yn.W,{steps:ye,mode:"memory",children:(0,Y.jsx)(jo,{ref:Q,meta:oe,isMobile:X,onStepChange:e=>{K(e)}})}),(0,Y.jsxs)(d.Z,{className:"action-bar",children:[ve.cancel&&(0,Y.jsx)(D.Z,{onClick:e=>{e.stopPropagation(),ve.onCancel()},disabled:H===ye.length-2&&b,color:"inherit",children:ve.cancel||y("common.cancel")}),ve.confirm&&(0,Y.jsx)(D.Z,{onClick:e=>{e.stopPropagation(),ve.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:b||("boolean"===typeof ve.disabled?ve.disabled:!(!b&&!ve.error&&V.bundleDid)||H>1&&!V.pathPrefix),variant:"contained",autoFocus:!0,title:ve.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[("boolean"===typeof ve.loading?ve.loading:b)&&(0,Y.jsx)(I.Z,{style:{marginRight:8},size:16}),ve.confirm]})})]})]}):null}Co.propTypes={onClose:s().func,mode:s().oneOf(["normal","embed"]),inDialog:s().bool,stores:s().arrayOf(s().string),resourceType:s().string,resourceDid:s().string,storageKey:s().string},Co.defaultProps={onClose:()=>{},mode:"normal",stores:[],resourceType:"",resourceDid:"",storageKey:"",inDialog:!0};const Zo=(0,a.Z)(d.Z)(lo||(lo=(0,r.Z)(["\n .action-bar {\n display: flex;\n justify-content: flex-end;\n position: sticky;\n bottom: 0;\n padding-top: 16px;\n z-index: 100;\n width: 100%;\n background: #fff;\n border-top: 1px solid #eee;\n }\n"]))),Ro=(0,a.Z)(Ve.Z)(so||(so=(0,r.Z)(["\n width: 100%;\n height: 100%;\n"]))),wo=a.Z.div(co||(co=(0,r.Z)(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n\n // blocklet-select-side\n aside {\n width: 140px;\n }\n"]))),Eo=e=>e.isMobile?"\n height: calc(100vh - 56px - 64px - 48px);\n ":"",So=(0,a.Z)(d.Z)(po||(po=(0,r.Z)(["\n ","\n\n & .flex-justify-center {\n display: flex;\n justify-content: center;\n }\n\n & .flex-align-center {\n display: flex;\n height: 100%;\n align-items: center;\n ","\n }\n\n & .agreement-wrapper {\n ","\n max-height: 60vh;\n .eula-trigger {\n padding-right: 0;\n }\n .next-button {\n display: none;\n }\n }\n\n & .connect {\n background: white;\n }\n"])),(e=>{let{className:n}=e;return"mobileStyle"===n?"\n & > div{\n height: 100%;\n }\n .root-header {\n .app-name-content {\n display: none;\n }\n }\n\n\n\n // content-panel\n .root-header + div{\n padding-top: 0;\n position: relative;\n & > div {\n padding-top: 0;\n }\n }\n\n header + div {\n padding-top: 0;\n }\n\n header {\n .header-title {\n margin-left: 0;\n }\n\n .header-title-name {\n max-width: 100% !important;\n }\n }\n ":"\n position: relative;\n .root-header {\n z-index: auto !important;\n position: fixed !important;\n }\n & > div {\n height: 100%;\n width: 100%;\n max-width: 100%;\n & > div {\n max-height: unset !important;\n max-width: 100%;\n & > div {\n // left-panel\n &:first-child {\n padding: 0;\n width: 25%;\n min-width: 240px;\n & > div:first-child {\n display: none;\n }\n // step\n & > div:last-child {\n // margin-top: 32px;\n margin-top: 0;\n }\n }\n // right-panel\n &:last-child {\n padding-top: 0;\n padding-right: 0px;\n overflow-y: auto;\n .app-content {\n padding: 0 0 24px 0;\n }\n .button-container {\n padding-right: 0;\n }\n }\n }\n }\n }\n\n "}),(e=>Eo(e)),(e=>Eo(e))),Po=(0,a.Z)(fn.Z)(uo||(uo=(0,r.Z)(["\n margin-bottom: 24px;\n"]))),To=a.Z.div(mo||(mo=(0,r.Z)(["\n position: relative;\n\n .choose-blocklet {\n background-color: rgb(236, 251, 253);\n border-color: rgb(236, 251, 253);\n border-radius: 8px;\n }\n\n .check-container {\n position: absolute;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: flex-end;\n align-items: flex-end;\n width: 30px;\n height: 30px;\n border-radius: 0 0 8px 0;\n color: ",";\n overflow: hidden;\n transition: all ease 0.3s;\n &:after {\n position: absolute;\n z-index: 0;\n display: block;\n width: 0;\n height: 0;\n border-top: transparent solid 15px;\n border-left: transparent solid 15px;\n border-bottom: "," solid 15px;\n border-right: "," solid 15px;\n transition: all ease 0.1s;\n content: '';\n }\n\n .check-icon {\n position: relative;\n z-index: 2;\n margin: 0 1px 1px 0;\n font-size: 16px;\n transition: all ease 0.2s;\n }\n }\n"])),(e=>e.theme.palette.common.white),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.primary.main)),Uo=a.Z.div(ho||(ho=(0,r.Z)(["\n color: ",";\n .msg-before {\n display: inline-block;\n color: #aaa;\n font-size: 14px;\n margin-right: 6px;\n }\n"])),(e=>e.theme.palette.primary.main));var Io;function No(e){let{blocklet:n,children:t}=e;const{t:r}=(0,i.PE)(),[a,l]=(0,o.useState)(!1),s=(0,on.Z)((e=>e.breakpoints.down("md"))),{inService:c}=(0,ne.h6)(),d=()=>{l(!1)},p=e=>{e.stopPropagation(),l(!0)};return(0,Y.jsxs)(Y.Fragment,{children:["function"===typeof t?t({open:p}):(0,Y.jsxs)(nn.Z,{onClick:p,className:"component-action","data-cy":"action-add-component",children:[(0,Y.jsx)(tn.Z,{style:{fontSize:18,marginRight:5}}),r("blocklet.component.add")]}),a&&(0,Y.jsx)(Do,{title:r("blocklet.component.addWithName",{name:(0,B.getDisplayName)(n)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:s?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(e,n)=>{"backdropClick"!==n&&d()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:(0,Y.jsx)(Co,{onClose:d,storageKey:c?rn.K_:rn.WC})})]})}No.propTypes={children:s().any,blocklet:s().object.isRequired},No.defaultProps={children:null};const Do=(0,a.Z)(ge.ZP)(Io||(Io=(0,r.Z)(["\n .MuiDialogContent-root {\n }\n"]))),Ao=e=>e.children.filter((e=>e.meta.interfaces.find((e=>e.type===$.BLOCKLET_INTERFACE_TYPE_WEB))));function Bo(e){let{params:n,setParams:t,setError:r,serviceTypes:a}=e;const{t:l}=(0,i.PE)(),{blocklet:s}=(0,kn.y0)(),c=s.meta.did,d=Ao(s),[p,u]=(0,o.useState)([]),m={301:l("common.redirectPermanently"),302:l("common.redirectTemporary"),307:l("common.redirectTemporary"),308:l("common.redirectPermanently")};return(0,o.useEffect)((()=>{if(n.type===U.ROUTING_RULE_TYPES.COMPONENT&&n.componentId){const e=d.find((e=>e.meta.did===n.componentId)),o=(0,B.findWebInterface)(e.meta),i=(Array.isArray(null===o||void 0===o?void 0:o.pageGroups)?o.pageGroups:[]).map((e=>({value:e,label:"".concat(e," pages")})));i.length&&i.unshift({value:"",label:"All pages"}),u(i),n.pageGroup&&!1===i.find((e=>e.value===n.pageGroup))&&t({...n,pageGroups:""})}}),[n.componentId,n.type]),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(be.Z,{select:!0,label:l("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:n.type,onChange:e=>{r(""),t({...n,type:e.target.value,did:e.target.value===U.ROUTING_RULE_TYPES.BLOCKLET?c:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map((e=>{let{name:n,value:t}=e;return(0,Y.jsx)(nn.Z,{value:t,children:n},t)}))}),n.type===U.ROUTING_RULE_TYPES.REDIRECT&&[(0,Y.jsx)(be.Z,{select:!0,label:l("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:n.redirectCode,onChange:e=>t({...n,redirectCode:e.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(m).map((e=>(0,Y.jsx)(nn.Z,{value:e,children:"".concat(m[e]," - ").concat(e)},e)))},"redirectCode"),(0,Y.jsx)(be.Z,{label:l("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"redirect-url-input",fullWidth:!0,value:n.url,helperText:l("router.urlHelperText"),style:{marginBottom:32},onChange:e=>{t({...n,url:e.target.value,__disableConfirm:!e.target.value.trim()}),e.target.value.trim()?r(""):r(l("router.validation.redirectUrlRequired"))}},"redirectUrl")],n.type===U.ROUTING_RULE_TYPES.COMPONENT&&[(0,Y.jsx)(be.Z,{select:!0,label:l("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:n.componentId,onChange:e=>{t({...n,componentId:e.target.value})},style:{marginBottom:32},SelectProps:{},children:d.map((e=>(0,Y.jsx)(nn.Z,{value:e.meta.did,selected:e.meta.did===n.componentId,children:(0,B.getDisplayName)(e,!0)},e.meta.did)))},"componentId"),p.length?(0,Y.jsx)(be.Z,{select:!0,label:l("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:n.pageGroup,helperText:l("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:e=>{t({...n,pageGroup:e.target.value})},SelectProps:{},children:p.map((e=>(0,Y.jsx)(nn.Z,{value:e.value,selected:e.value===n.pageGroup,children:e.label},e.label)))},"pageGroup"):null].filter(Boolean),n.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,Y.jsx)(be.Z,{label:l("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:n.url,helperText:l("router.urlHelperText"),style:{marginBottom:32},onChange:e=>{t({...n,url:e.target.value,__disableConfirm:!e.target.value.trim()}),e.target.value.trim()?r(""):r(l("router.validation.rewriteUrlRequired"))}},"url")]})}function Lo(e){let{children:n}=e;const{t:t}=(0,i.PE)(),{api:r}=(0,ne.h6)(),{blocklet:a}=(0,kn.y0)(),[l,s]=(0,o.useState)(!1),[c,d]=(0,o.useState)(null),p=a.meta.did,u=a.site.id,m={title:t("router.rule.add.title"),description:(e,n,o)=>(0,Y.jsxs)(Ve.Z,{component:"div",children:[(0,Y.jsx)(be.Z,{label:t("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix","data-cy":"path-prefix-input",fullWidth:!0,autoFocus:!0,helperText:e.pathPrefixHint||t("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:i=>{let r=!1;const l=(0,_n.Rw)({params:{...e,pathPrefix:i.target.value},blocklets:[a]});o(l),e.type===U.ROUTING_RULE_TYPES.BLOCKLET&&l&&(r=!0),e.type!==U.ROUTING_RULE_TYPES.REDIRECT||e.url||(r=!0),e.type!==U.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(r=!0),i.target.value.trim()||(r=!0,o(t("router.validation.pathPrefixRequired"))),r||o("");const s=t("common.slugifyHint",{value:(0,te.LN)(i.target.value)});n({...e,pathPrefix:i.target.value,pathPrefixHint:s,__disableConfirm:r})}}),(0,Y.jsx)(Bo,{params:e,setParams:e=>{o(null);(0,_n.fX)(e,t)?n({...e,__disableConfirm:!0}):n({...e})},setError:o})]}),confirm:t("router.rule.add.confirm"),cancel:t("common.cancel"),params:{did:"",pathPrefix:"",type:U.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,__disableConfirm:!0},onConfirm:async e=>{try{const n=await(0,_n.fX)(e,t);if(n)throw n;s(!0);const o={from:{pathPrefix:Ne()(e.pathPrefix)},to:{type:e.type}};e.type===U.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=e.url.trim(),o.to.redirectCode=e.redirectCode),e.type===U.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=p,o.to.componentId=e.componentId,o.to.pageGroup=e.pageGroup),e.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=Ne()(e.url)),await r.addRoutingRule({input:{id:u,rule:o,teamDid:p}})}catch(n){F.Z.error(n.message)}finally{s(!1),d(null)}},onCancel:()=>{s(!1),d(null)}},h=e=>{e.stopPropagation(),d(m)};return(0,Y.jsxs)(Y.Fragment,{children:["function"===typeof n?n({loading:l,open:h}):(0,Y.jsxs)(nn.Z,{onClick:h,className:"rule-action","data-cy":"action-add-rule",children:[l?(0,Y.jsx)(I.Z,{size:16}):(0,Y.jsx)(tn.Z,{style:{fontSize:18,marginRight:5}}),t("router.rule.add.title")]}),c&&(0,Y.jsx)(ee.Z,{title:c.title,description:c.description,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel,color:"primary"})]})}Bo.propTypes={params:s().object,serviceTypes:s().array,setParams:s().func,setError:s().func},Bo.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:U.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:U.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:U.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Component - Pass traffic to blocklet component",value:U.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}},Lo.propTypes={children:s().any},Lo.defaultProps={children:null};var Oo=t(82434),Fo=t.n(Oo),zo=t(62681),Mo=t(18067),Go=t(71363);function qo(e){let{id:n,from:t,children:r}=e;const{t:a}=(0,i.PE)(),{api:l}=(0,ne.h6)(),{blocklet:s}=(0,kn.y0)(),[c,d]=(0,o.useState)(!1),[p,u]=(0,o.useState)(null),m=s.meta.did,h=s.site.id,f=t.pathPrefix,x={keyName:f,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:"<b>".concat(f,"</b>")}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:f}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:async()=>{d(!0);try{await l.deleteRoutingRule({input:{id:h,ruleId:n,teamDid:m}})}catch(e){F.Z.error(e.message)}finally{u(null),d(!1)}},onCancel:()=>{d(!1),u(null)}},g=e=>{e.stopPropagation(),u(x)};return(0,Y.jsxs)(Y.Fragment,{children:["function"===typeof r?r({loading:c,open:g}):(0,Y.jsxs)(nn.Z,{onClick:g,className:"rule-action","data-cy":"action-delete-rule",children:[c?(0,Y.jsx)(I.Z,{size:16}):(0,Y.jsx)(E.default,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),p&&(0,Y.jsx)(Go.Z,{keyName:p.keyName,title:p.title,description:p.description,confirmPlaceholder:p.confirmPlaceholder,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}function Vo(e){let{id:n,from:t,to:r,children:a}=e;const{t:l}=(0,i.PE)(),{api:s}=(0,ne.h6)(),{blocklet:c}=(0,kn.y0)(),[d,p]=(0,o.useState)(!1),[u,m]=(0,o.useState)(null),h=c.meta.did,f=c.site.id,x=t.pathPrefix,g={title:l("router.rule.update.title"),description:(e,n,t)=>(0,Y.jsxs)(Ve.Z,{component:"div",children:[(0,Y.jsx)(be.Z,{label:l("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix","data-cy":"path-prefix-input",fullWidth:!0,autoFocus:!0,helperText:e.helperText||l("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:o=>{let i=!1;e.type!==U.ROUTING_RULE_TYPES.REDIRECT||e.url||(i=!0),e.type!==U.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(i=!0),o.target.value.trim()||(i=!0,t(l("router.validation.pathPrefixRequired"))),i||t("");const r=l("common.slugifyHint",{value:(0,te.LN)(o.target.value)});n({...e,pathPrefix:o.target.value,helperText:r,__disableConfirm:i})}}),(0,Y.jsx)(Bo,{params:e,setParams:e=>{(0,_n.fX)(e,l)?n({...e,__disableConfirm:!0}):n({...e})},setError:t})]}),confirm:l("router.rule.update.confirm"),cancel:l("router.rule.update.cancel"),color:"primary",params:{did:r.did||"",pathPrefix:"/"===x?x:x.replace(/^\/+/,"").replace(/\/+$/,""),type:r.type||U.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:r.redirectCode||302,componentId:r.componentId||"",pageGroup:r.pageGroup||"",url:r.url||"",__disableConfirm:!1},onConfirm:async e=>{try{const t=await(0,_n.fX)(e,l);if(t)throw t;p(!0);const o={id:n,from:{pathPrefix:Ne()(e.pathPrefix)},to:{type:e.type}};e.type===U.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=e.url,o.to.redirectCode=e.redirectCode),e.type===U.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=h,o.to.componentId=e.componentId,o.to.pageGroup=e.pageGroup),e.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=Ne()(e.url)),await s.updateRoutingRule({input:{id:f,rule:o,teamDid:h}})}catch(t){F.Z.error(t.message)}finally{p(!1),m(null)}},onCancel:()=>{p(!1),m(null)}},y=e=>{e.stopPropagation(),m(g)};return(0,Y.jsxs)(Y.Fragment,{children:["function"===typeof a?a({loading:d,open:y}):(0,Y.jsxs)(nn.Z,{onClick:y,className:"rule-action","data-cy":"action-update-rule",children:[d?(0,Y.jsx)(I.Z,{size:16}):(0,Y.jsx)(xe.default,{style:{fontSize:18,marginRight:5}}),l("router.rule.update.title")]}),u&&(0,Y.jsx)(ee.Z,{title:u.title,description:u.description,confirm:u.confirm,color:u.color,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}function Wo(e){const{locale:n}=(0,i.PE)(),{blocklet:t,recommendedDomain:o}=(0,kn.y0)(),r=(0,te.Sk)(o,e.from.pathPrefix,(0,te.f0)(t,n));return(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,Y.jsx)("a",{target:"_blank",href:r,rel:"noopener noreferrer",title:r,children:(0,Y.jsx)(f.Z,{size:"small",children:(0,Y.jsx)(b.Z,{})})}),(0,Y.jsx)(Vo,{...e,children:n=>{let{open:t}=n;return(0,Y.jsx)(f.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-update-rule",children:(0,Y.jsx)(y.Z,{})})}}),(0,Y.jsx)(qo,{...e,children:n=>{let{open:t}=n;return(0,Y.jsx)(f.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-delete-rule",children:(0,Y.jsx)(E.default,{})})}})]})}function Ho(e){let{group:n,...t}=e;return n?(0,Y.jsx)(G.Z,{type:"reverse",...t,children:n}):null}function Ko(e){let{domain:n,isHttps:t,toUrl:o}=e;const i=t?"https":"http";let r=o;return Fo()(r)||(r="".concat(i,"://").concat(n).concat(o)),(0,Y.jsx)(J.Z,{href:r,target:"_blank",style:{fontSize:14},underline:"hover",children:o},r)}function Jo(e){let{hasPermission:n}=e;const{t:t,locale:o}=(0,i.PE)(),r=(0,jt.Z)(),{blocklet:a,recommendedDomain:l}=(0,kn.y0)();return a.site.rules.filter((e=>e.to.type!==U.ROUTING_RULE_TYPES.BLOCKLET)).map((e=>{let i=null,s=null;e.to.type===U.ROUTING_RULE_TYPES.NONE?i="404":e.to.type===U.ROUTING_RULE_TYPES.REDIRECT?i=e.to.redirectCode:e.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE?i="R":e.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&(s=a.children.find((n=>n.meta.did===e.to.componentId)),i="C");const c=e.isProtected?(0,Y.jsx)(k.Z,{title:t("blocklet.router.urlLockTooltip"),placement:"top",children:(0,Y.jsx)("span",{children:(0,Y.jsx)(f.Z,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:(0,Y.jsx)(Mo.Z,{style:{fill:r.palette.text.disabled}})})})}):(0,Y.jsx)(Wo,{...e});return[(0,Y.jsxs)(d.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,Y.jsxs)(d.Z,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,Y.jsx)(d.Z,{width:28}),"object"===typeof i?i:(0,Y.jsx)(zo.Z,{children:i}),(0,Y.jsxs)(d.Z,{ml:2,children:[(0,Y.jsxs)(d.Z,{style:{color:"#222",fontSize:16},children:[e.to.type===U.ROUTING_RULE_TYPES.NONE&&t("common.page404"),e.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&t("common.redirect"),e.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t("common.rewrite"),e.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&(0,B.getDisplayName)(s,!0)]}),(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[e.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&(0,Y.jsx)(Ko,{domain:l,toUrl:e.to.url}),e.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,Y.jsx)(Ko,{domain:l,toUrl:e.to.url}),e.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&(0,Y.jsx)(Ho,{group:e.to.pageGroup})]})]})]}),(0,Y.jsx)(d.Z,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,Y.jsx)(J.Z,{href:(0,te.Sk)(l,e.from.pathPrefix,(0,te.f0)(a,o)),target:"_blank",style:{fontSize:16},underline:"hover",children:e.from.pathPrefix})},e.from.pathPrefix),(0,Y.jsx)(d.Z,{children:n&&(0,Y.jsx)("div",{style:{textAlign:"right"},children:c})},"actions")]},"rule"),(0,Y.jsx)(en.Z,{},"divider")]}))}qo.propTypes={id:s().string.isRequired,from:s().object.isRequired,children:s().any},qo.defaultProps={children:null},Vo.propTypes={id:s().string.isRequired,from:s().object.isRequired,to:s().object.isRequired,children:s().any},Vo.defaultProps={children:null},Wo.propTypes={isProtected:s().bool},Wo.defaultProps={isProtected:!1},Ho.propTypes={group:s().string.isRequired},Ko.propTypes={domain:s().string.isRequired,toUrl:s().string.isRequired,isHttps:s().bool},Ko.defaultProps={isHttps:!1},Jo.propTypes={hasPermission:s().bool},Jo.defaultProps={hasPermission:!1};const Yo=(0,oe.V)(Jo,"mutate_blocklets"),Qo=(0,oe.V)(Jo,"",te.Wf);function _o(e){const{inService:n}=(0,ne.h6)();return n?(0,Y.jsx)(Qo,{...e}):(0,Y.jsx)(Yo,{...e})}var Xo,$o,ei,ni=t(92726),ti=t(44125);const oi=(e,n)=>e?[{name:n("common.name"),value:e.displayName},{name:n("common.description"),value:e.description},{name:n("common.version"),value:(0,Y.jsx)(G.Z,{children:e.version})}]:[],ii=e=>{const{source:n,deployedFrom:t,bundleSource:o}=e;return n?{source:n,deployedFrom:t}:o?o.url?{source:"url",deployedFrom:t||Array.isArray(o.url)?o.url[0]:o.url}:o.store?{source:"registry",deployedFrom:t||Array.isArray(o.store)?o.store[0]:o.store}:{}:{source:"upload",deployedFrom:t}},ri=(e,n)=>{const t=e.split("/").slice(1);let o=n,i=0;const r=[];for(;o&&i<t.length;){const e=o.children.find((e=>e.meta.did===t[i]));o=e,i++,e&&r.push(e.meta.title)}return r.join(" / ")},ai=e=>{var n;return"pack"===(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.group)};function li(e){var n,t,r,a,l;let{blocklet:s,ancestors:m,depth:h,onRemove:x,onStart:g,onStop:j,onRestart:C,onReload:Z,getComponentUrl:S,app:P}=e;const{t:U,locale:I}=(0,o.useContext)(i.RD),[D,A]=(0,o.useState)(),[L,F]=(0,o.useState)(!1),[q,V]=(0,o.useState)(!1),[W,H]=(0,o.useState)(null),{deletingBlocklets:K}=(0,z.K)();let{status:J}=s;1===h&&K.includes(s.meta.did)&&(J="deleting");const X="/".concat(s.mountPoint||"/").replace(/\/+/g,"/"),$=S(X),ne=D?ii(D):{},oe=D?[{name:U("common.name"),value:(0,B.getDisplayName)(D,!0)},{name:U("common.version"),value:(0,Y.jsx)(le,{blocklet:D,checkUpgrade:!1})},{name:U("common.status"),value:(0,Y.jsx)(_.Z,{status:J,source:D.source,progress:s.progress})},"running"===s.status?{name:U("blocklet.startedAt"),value:(0,te.B2)(s.startedAt,I)}:null,"running"!==s.status?{name:U("blocklet.stoppedAt"),value:(0,te.B2)(s.stoppedAt,I)}:null,s.installedAt?{name:U("blocklet.installedAt"),value:(0,te.B2)(s.installedAt,I)}:null,(0,B.hasStartEngine)(s.meta)?{name:U("common.mountPoint"),value:X}:null,D.meta.group?{name:U("common.group"),value:(0,Y.jsx)(G.Z,{type:"success",children:D.meta.group})}:null,{name:U("blocklet.overview.source"),value:(0,Y.jsx)(Q,{sourceInfo:ne,blocklet:s})},{name:U("blocklet.overview.deployedFrom"),value:ne.deployedFrom||"-"},{name:U("common.did"),value:(0,Y.jsx)(M.Z,{did:D.meta.did})},{name:U("common.author"),value:(0,te.rq)(D.meta.author)},{name:U("common.engine"),value:oi(D.engine,U).map((e=>{let{name:n,value:t}=e;return(0,Y.jsx)(N.Z,{style:{marginBottom:4},nameWidth:120,name:n,children:t},n)}))},null!==(n=s.dependents)&&void 0!==n&&n.length?{name:U("common.dependents"),value:(0,Y.jsx)(d.Z,{children:s.dependents.map((e=>(0,Y.jsx)(d.Z,{children:"".concat(ri(e.id,P)," ").concat(e.required?"(".concat(U("common.required"),")"):"")},e.id)))})}:null,null!==(t=s.meta.resources)&&void 0!==t&&t.length?{name:U("common.resource"),value:s.meta.resources.join(", ")}:null].filter(Boolean):[],ie=(0,B.isInProgress)(P.status),re=(0,B.isInProgress)(s.status);let ae="";if(ie||re||1===h&&K.includes(s.meta.did))ae=U("blocklet.component.tip.stopBlocklet");else if(null!==(r=s.dependents)&&void 0!==r&&r.length){const e=s.dependents.filter((e=>e.required));if(e.length){const n=e.map((e=>ri(e.id,P)));ae=U("blocklet.component.tip.requiredBy",{name:n.join(", ")})}}return[(0,Y.jsxs)(ci,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,Y.jsxs)(d.Z,{pl:2,width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,Y.jsx)(he.Z,{blocklet:s,ancestors:m}),(0,Y.jsxs)(d.Z,{ml:"16px",children:[(0,Y.jsxs)(d.Z,{className:"component-header",onClick:()=>A(s),children:[(0,Y.jsx)(d.Z,{className:"component-name",children:(0,B.getDisplayName)(s,!0)}),(0,Y.jsx)(d.Z,{className:"component-version",children:null===s||void 0===s||null===(a=s.meta)||void 0===a?void 0:a.version})]}),(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:["unknown"!==J&&(0,Y.jsx)(_.Z,{style:{marginLeft:4},status:J,source:s.source,progress:s.progress}),(0,Y.jsx)(fe.Z,{style:{marginLeft:4},mode:s.mode||""}),!(null===(l=s.dependents)||void 0===l||!l.length)&&(0,Y.jsx)(k.Z,{title:["".concat(U("common.dependents"),": "),s.dependents.map((e=>(0,Y.jsx)(d.Z,{pl:1,children:"".concat(ri(e.id,P)," ").concat(e.required?"(".concat(U("common.required"),")"):"")},e.id)))],children:(0,Y.jsx)(d.Z,{display:"flex",color:"primary.main",ml:1,children:(0,Y.jsx)(T.JO,{icon:"octicon:package-dependents-16"})})})]})]})]},s),(0,B.hasStartEngine)(s.meta)&&(0,Y.jsx)(d.Z,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,Y.jsx)("a",{target:"_blank",href:$,rel:"noopener noreferrer",title:$,children:(0,Y.jsx)(d.Z,{maxWidth:400,sx:{color:"secondary.main",fontSize:18,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:O()(X)})})},X),(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,B.hasStartEngine)(s.meta)&&(0,Y.jsx)(k.Z,{title:U("common.visit"),children:(0,Y.jsx)("a",{target:"_blank",href:$,rel:"noopener noreferrer",children:(0,Y.jsx)(f.Z,{size:"small",children:(0,Y.jsx)(b.Z,{})})})}),(0,B.hasStartEngine)(s.meta)&&(0,Y.jsx)(Me,{blocklet:s,ancestors:m,children:e=>{let{open:n}=e;return(0,Y.jsx)(k.Z,{title:U("common.config"),children:(0,Y.jsx)(si,{color:"error",badgeContent:"",variant:"dot",invisible:!(0,B.getComponentMissingConfigs)(s,m[0]).length,children:(0,Y.jsx)(f.Z,{onClick:n,size:"small",children:(0,Y.jsx)(y.Z,{})})})},"config")}}),(0,Y.jsx)(Xe,{blocklet:P,component:s,onStart:g,onStop:j,disabled:!["starting","stopping"].includes(P.status)&&(0,B.isInProgress)(P.status)}),(0,Y.jsx)(ni.Z,{"data-cy":"component-actions",actions:[(0,B.hasStartEngine)(s.meta)?{icon:(0,Y.jsx)(v.Z,{}),text:U("common.detail"),onClick:()=>{A(s)}}:null,!ai(s)&&{icon:(0,Y.jsx)(R.default,{}),text:U("common.restart"),onClick:()=>{H({title:"".concat(U("common.restart")," ").concat(s.meta.title),description:U("blocklet.action.restartDescription"),confirm:U("blocklet.action.confirmRestart"),cancel:U("common.cancel"),onConfirm:async()=>{V(!0),await C(s),V(!1)},onCancel:()=>H(null)})},disabled:ie||re||"running"!==s.status},!ai(s)&&{icon:(0,Y.jsx)(w.Z,{}),text:U("common.reload"),onClick:async()=>{V(!0),await Z(s),V(!1)},disabled:q||ie||re||"running"!==s.status},{icon:(0,Y.jsx)(E.default,{}),text:U("common.delete"),onClick:()=>{F(!0)},disabled:ie||re||!!ae,tip:ae}].filter(Boolean)})]},"actions")]},"group-not-gateway-box"),(0,Y.jsx)(en.Z,{depth:2},"line"),!!D&&(0,Y.jsx)(c.Z,{open:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{A(null)},children:(0,Y.jsxs)(d.Z,{paddingY:1.5,children:[(0,Y.jsx)(u.Z,{children:U("common.componentBasicInfo")}),(0,Y.jsx)(p.Z,{children:(se=oe,se.map((e=>e.name===U("common.did")||e.name===U("blocklet.appId")?(0,Y.jsx)(N.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>e.name,children:e.value},e.name):(0,Y.jsx)(N.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name))))})]},"dialog-wrapper")},"base-info-dialog"),(0,Y.jsx)(Ke,{blocklet:P,component:s,remove:async function(){V(!0);try{await x(...arguments)}catch{}V(!1),F(!1)},onCancel:()=>F(!1),hideBtn:!0,showConfirm:L},"delete-component"),W&&(0,Y.jsx)(ee.Z,{title:W.title,description:W.description,confirm:W.confirm,cancel:W.cancel,params:W.params,onConfirm:W.onConfirm,onCancel:W.onCancel},"confirm-setting")];var se}li.propTypes={blocklet:s().object.isRequired,ancestors:s().array,depth:s().number,onRemove:s().func,onStart:s().func,onStop:s().func,onRestart:s().func,onReload:s().func,getComponentUrl:s().func,app:s().object},li.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},onReload:()=>{},getComponentUrl:()=>window.location.origin,app:null};const si=(0,a.Z)(g.Z)(Xo||(Xo=(0,r.Z)(["\n .BaseBadge-badge {\n top: ","px;\n right: ","px;\n }\n"])),(e=>8*e.top||6),(e=>8*e.right||6)),ci=(0,a.Z)(d.Z)($o||($o=(0,r.Z)(["\n .component-header {\n display: flex;\n align-items: center;\n align-items: flex-end;\n cursor: pointer;\n }\n .component-name {\n color: #222;\n font-size: 16px;\n }\n .component-version {\n color: #999;\n font-size: 12px;\n margin-left: 4px;\n transform: translateY(-1px);\n }\n"])));function di(e){let{blocklet:n,onUpdate:t,getComponentUrl:r,...a}=e;const{t:l}=(0,o.useContext)(i.RD),{api:s,inService:g,info:v}=(0,ne.h6)(),{addDeletingDid:b,removeDeletingDid:R,matchDeletingDid:w}=(0,z.K)(),[E,T]=(0,o.useState)(!1),[N,L]=(0,o.useState)(null),[O,M]=(0,o.useState)(null),[G,q]=(0,o.useState)(!1),V=n&&n.structVersion!==U.APP_STRUCT_VERSION,[W,H]=(0,o.useState)(!1),K=[...n.children]||[];"gateway"!==n.meta.group&&K.unshift(n),w(K.map((e=>e.meta.did)));const J=async()=>{if(!E){T(!0);try{const{updateId:e,updateList:t}=(await s.checkComponentsForUpdates({input:{did:n.meta.did}})).preUpdateInfo||{};if(T(!1),!e)return void F.Z.info(l("blocklet.component.noUpdate"));const o=[];(0,B.forEachChildSync)(n,((e,n)=>{let{id:i,ancestors:r}=n;const a=t.find((e=>e.id===i));if(a){const n=r.slice(1).concat(e).map((e=>e.meta.title||e.meta.name)).join(" / "),t=(r[1]||e).meta.did;o.push({groupId:t,name:n,version:e.meta.version,newVersion:a.meta.version})}}));const i={};o.forEach((e=>{i[e.groupId]?e.disabled=!0:i[e.groupId]=!0})),L({params:{updateId:e},list:o,checks:i,hasChecks:!0})}catch(e){T(!1),F.Z.error((0,te.Z)(e))}}},Q=async(e,t)=>{b(e.meta.did);try{await s.deleteComponent({input:{did:e.meta.did,keepData:"keepData"===t,rootDid:n.meta.did}}),await(0,te._v)(800)}catch(o){F.Z.error((0,te.Z)(o)),R(e.meta.did)}},_=async e=>{try{await s.startBlocklet({input:{did:n.meta.did,componentDids:[e.meta.did]}}),await(0,te._v)(800)}catch(t){F.Z.error((0,te.Z)(t))}},X=async e=>{try{await s.stopBlocklet({input:{did:n.meta.did,componentDids:[e.meta.did]}}),await(0,te._v)(800)}catch(t){F.Z.error((0,te.Z)(t))}},$=async e=>{try{await s.restartBlocklet({input:{did:n.meta.did,componentDids:[e.meta.did]}}),await(0,te._v)(800)}catch(t){F.Z.error((0,te.Z)(t))}},ee=async e=>{try{await s.reloadBlocklet({input:{did:n.meta.did,componentDids:[e.meta.did]}}),await(0,te._v)(800),F.Z.success(l("blocklet.reloadSuccess"))}catch(t){F.Z.error((0,te.Z)(t))}};return(0,ti.Tb)(J),(0,Y.jsxs)(pi,{component:"div",...a,children:[(0,Y.jsxs)(d.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,Y.jsxs)(d.Z,{className:"title",flexDirection:"row",display:"flex",alignItems:"center",style:{marginLeft:"1em"},children:[l("common.components"),!V&&(0,Y.jsx)(oe.Z,{permission:g?"":"mutate_blocklets",role:g?te.Wf:[],children:(0,Y.jsx)(pe,{children:(0,Y.jsx)(si,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!W,children:(0,Y.jsxs)(D.Z,{disabled:E||(0,B.isInProgress)(n.status),color:"secondary",onClick:()=>{J()},"data-cy":"check-for-updates",children:[(0,Y.jsx)(d.Z,{mr:.5,display:"flex",children:E?(0,Y.jsx)(I.Z,{size:16}):(0,Y.jsx)(h.Z,{style:{fontSize:"1em"}})}),l("blocklet.component.checkUpdateTitle")]})})})})]}),(0,Y.jsx)(oe.Z,{permission:g?"":"mutate_blocklets",role:g?te.Wf:[],children:(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,Y.jsx)(Lo,{children:e=>{let{open:t}=e;return(0,Y.jsxs)(D.Z,{disabled:E||(0,B.isInProgress)(n.status),variant:"text",color:"primary","data-cy":"add-rule",onClick:t,children:[(0,Y.jsx)(x.Z,{style:{fontSize:"1.3em",marginRight:4}}),l("router.rule.add.title")]})}}),!V&&(0,Y.jsx)(No,{blocklet:n,serverVersion:v.version,children:e=>{let{open:t}=e;return(0,Y.jsxs)(D.Z,{disabled:E||(0,B.isInProgress)(n.status),variant:"text",color:"primary","data-cy":"add-component",onClick:t,children:[(0,Y.jsx)(x.Z,{style:{fontSize:"1.3em",marginRight:4}}),l("blocklet.component.add")]})}}),!V&&(0,Y.jsx)(Me,{blocklet:n,ancestors:[],children:e=>{let{open:n}=e;return(0,Y.jsx)(k.Z,{title:"".concat(l("blocklet.component.container")).concat(l("common.config")),children:(0,Y.jsx)(f.Z,{onClick:n,size:"small",color:"primary",children:(0,Y.jsx)(y.Z,{style:{fontSize:18}})})},"config")}})]})})]}),null!==K&&void 0!==K&&K.length?(0,Y.jsxs)(d.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},children:["gateway"!==n.meta.group&&(0,Y.jsx)(li,{blocklet:n,app:n,onRemove:Q,onStart:_,onStop:X,onReload:ee,onRestart:$,getComponentUrl:r},"0-".concat(n.meta.did)),n.children.map((e=>(0,Y.jsx)(li,{depth:1,blocklet:e,ancestors:[n],app:n,onRemove:Q,onStart:_,onStop:X,onReload:ee,onRestart:$,getComponentUrl:r},"1-".concat(e.meta.did))))]},"top-blocklet-".concat(n.meta.did)):(0,Y.jsx)(d.Z,{mt:8,children:(0,Y.jsx)(A.Z,{children:l("blocklet.component.noComponent")})}),!!n.site.rules.length&&(0,Y.jsx)(d.Z,{mt:0,ml:{xs:"-16px",md:"-28px"},children:(0,Y.jsx)(_o,{})}),!!N&&(0,Y.jsx)(c.Z,{open:!0,fullWidth:!0,children:(0,Y.jsxs)(d.Z,{paddingY:1.5,children:[(0,Y.jsx)(u.Z,{children:l("blocklet.component.updateTitle")}),(0,Y.jsx)(d.Z,{component:p.Z,py:4,children:N.list.map((e=>(0,Y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,Y.jsx)(Z.Z,{checked:N.checks[e.groupId],onChange:n=>((e,n)=>{const{checked:t}=e.target;L((e=>{const o=Object.entries(e.checks).reduce(((e,o)=>{let[i,r]=o;return e[i]=n===i?t:r,e}),{}),i=Object.values(o).includes(!0);return{...e,checks:o,hasChecks:i}}))})(n,e.groupId),style:{marginLeft:e.disabled?16:0},defaultChecked:!0,disabled:e.disabled}),(0,Y.jsxs)(d.Z,{flexGrow:1,mt:3,children:[(0,Y.jsx)(d.Z,{item:!0,xs:8,children:e.name}),e.version&&(0,Y.jsxs)(j.ZP,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[(0,Y.jsx)(j.ZP,{item:!0,xs:3,children:e.version}),(0,Y.jsx)(j.ZP,{item:!0,xs:1,children:(0,Y.jsx)(C.Z,{style:{fontSize:"0.9em"}})}),(0,Y.jsx)(j.ZP,{item:!0,xs:3,children:(0,Y.jsx)(d.Z,{color:"secondary.main",children:e.newVersion})})]})]},"".concat(e.name,"-").concat(e.newVersion))]},e.name)))}),(0,Y.jsxs)(m.Z,{style:{padding:"8px 24px 24px"},children:[(0,Y.jsx)(D.Z,{onClick:()=>{L(null)},children:l("common.cancel")}),(0,Y.jsxs)(D.Z,{onClick:e=>{e.stopPropagation(),(async()=>{if(!E)try{T(!0);const e=Object.keys(N.checks).filter((e=>N.checks[e])),t={updateId:N.params.updateId,rootDid:n.meta.did,selectedComponents:e};await s.upgradeComponents({input:t}),T(!1),L(null),H(null)}catch(e){T(!1),F.Z.error((0,te.Z)(e))}})()},color:"primary",disabled:E||!N.hasChecks,variant:"contained",autoFocus:!0,children:[E&&(0,Y.jsx)(I.Z,{size:16}),l("common.update")]})]})]})}),!!O&&(0,Y.jsx)(c.Z,{open:!0,fullWidth:!0,onClose:()=>M(!1),children:(0,Y.jsxs)(d.Z,{paddingY:1.5,children:[(0,Y.jsx)(u.Z,{children:l("common.configuration")}),(0,Y.jsx)(p.Z,{children:(0,Y.jsx)(d.Z,{py:2,children:(0,Y.jsx)(S.Z,{control:(0,Y.jsx)(P.Z,{checked:G,onChange:e=>q(!!e.target.checked)}),label:l("blocklet.component.showContainer")})})})]})})]})}di.propTypes={blocklet:s().object.isRequired,onUpdate:s().func,getComponentUrl:s().func},di.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const pi=a.Z.div(ei||(ei=(0,r.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n }\n\n @keyframes showDelay {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n }\n\n .component-item {\n animation: showDelay 0.75s ease 1;\n }\n"])));var ui=t(93677);function mi(e){const{locale:n}=(0,o.useContext)(i.RD),{blocklet:t,recommendedDomain:r}=(0,ui.y0)();return(0,Y.jsx)(di,{blocklet:t,getComponentUrl:e=>(0,te.vH)({blocklet:t,domain:{value:r},mountPoint:e,params:(0,te.f0)(t,n)}),...e})}mi.defaultProps={}},44543:(e,n,t)=>{const o=t(57156);e.exports=(e,n)=>o(e)===o(n)},92726:(e,n,t)=>{"use strict";t.d(n,{Z:()=>x});var o,i=t(71171),r=t(5057),a=t(55898),l=t.n(a),s=t(33518),c=t(67680),d=t(61533),p=t(74490),u=t(45267),m=t(46954),h=t(44067),f=t(96266);function x(e){let{actions:n,size:t,...o}=e;const[i,a]=(0,r.useState)(null),l=Boolean(i),s=e=>{try{e.stopPropagation(),e.preventDefault()}catch{}a(null)};return(0,f.jsxs)(g,{...o,children:[(0,f.jsx)(c.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"actions-menu-icon",onClick:e=>{try{e.stopPropagation(),e.preventDefault()}catch{}a(e.currentTarget)},size:t,children:(0,f.jsx)(u.Z,{})}),(0,f.jsx)(d.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:i,keepMounted:!0,open:l,onClose:s,PaperProps:{},children:n.map(((e,n)=>{if("function"===typeof e)return e({close:s});const{icon:t,text:o,onClick:i,disabled:a=!1,...l}=e;return(0,r.createElement)(p.Z,{...l,disabled:a,dense:!0,onClick:async e=>{await i(e),s()},key:n,"data-cy":"actions-menu-".concat(n)},(0,f.jsx)(m.Z,{style:{minWidth:24,marginRight:8},children:t}),(0,f.jsx)(h.Z,{primary:o}))}))})]})}x.propTypes={actions:l().array,size:l().oneOf(["small","medium","large"])},x.defaultProps={actions:[],size:"small"};const g=s.Z.div(o||(o=(0,i.Z)([""])))},31440:(e,n,t)=>{"use strict";t.d(n,{Z:()=>f});var o,i=t(71171),r=t(55898),a=t.n(r),l=t(85493),s=t(33518),c=t(68420),d=t(40265),p=t(44566),u=t(35432),m=t(96266);function h(e){let{...n}=e;return(0,m.jsxs)("div",{...n,style:{width:"100%"},children:[(0,m.jsx)("h3",{children:"End User License Agreement for Application"}),(0,m.jsxs)("p",{children:["Blocklet Server License Agreement ",u.COPYRIGHT_OWNER," version 2020-08-28"]}),(0,m.jsx)("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),(0,m.jsx)("p",{children:"\u6682\u65e0"})]})}function f(e){let{meta:n,onClickNext:t,handleDescEle:o}=e;const i=(0,l.useNavigate)(),{t:r,locale:a}=(0,c.PE)(),s=t||(()=>{i("/launch-blocklet/install".concat(window.location.search))});return(0,m.jsxs)(x,{children:[(0,m.jsx)("div",{className:"app-content",children:(0,m.jsx)("div",{className:"agreement",children:(0,m.jsx)("div",{className:"agreement-content",children:(0,m.jsx)(p.Z,{blockletMeta:{data:n},locale:a,handleDescEle:o})})})}),(0,m.jsx)("div",{className:"button-container","data-cy":"agree-all",children:(0,m.jsx)(d.Z,{onContinue:s,description:(0,m.jsx)(h,{}),texts:{listenName:r("launchBlocklet.license"),buttonNext:r("launchBlocklet.next")}})})]})}f.propTypes={meta:a().object.isRequired,onClickNext:a().func,handleDescEle:a().node},f.defaultProps={onClickNext:null,handleDescEle:""};const x=s.Z.div(o||(o=(0,i.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n flex: 1;\n .app-content {\n padding: 2px 24px 24px;\n "," {\n padding-top: 10px;\n }\n width: 100%;\n flex: 1;\n letter-spacing: normal;\n }\n .agreement {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n border: 1px solid ",";\n border-radius: 12px;\n "," {\n margin-top: 24px;\n }\n "," {\n margin-top: 16px;\n }\n .agreement-content {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n font-size: 14px;\n overflow-y: auto;\n "," {\n padding: 0 24px;\n }\n "," {\n padding: 0 16px;\n }\n &:after {\n display: block;\n content: '';\n height: 24px;\n }\n }\n }\n .button-container {\n padding-top: 24px;\n padding-bottom: 34px;\n "," {\n padding-right: 24px;\n margin-left: auto;\n }\n "," {\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.palette.grey[100]),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")))},80378:(e,n,t)=>{"use strict";t.d(n,{Z:()=>m});var o=t(55898),i=t.n(o),r=t(62681),a=t(72333),l=t(6352),s=t.n(l),c=t(35432),d=t(58238),p=t(14491);var u=t(96266);function m(e){let{blocklet:n,style:t,size:o,ancestors:i,...l}=e;const m=(0,d.h6)(),{logoUrl:h,inService:f}=function(e){var n;let{blocklet:t,ancestors:o=[]}=e;const i=(0,d.h6)(),{inService:r}=i,a="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,p.XN)(null===t||void 0===t?void 0:t.status)?"~":"");let l=r?s()(p.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",a):s()(i.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)l=s()(t.deployedFrom,(0,p.lk)(t.meta.bundleDid,t.meta.logo),a);else{const e=window.env.apiPrefix||"/",n=o.concat(t),i=r?n.slice(1):n;l=s()(e,"/blocklet/logo-bundle".concat(i.map((e=>"/".concat(e.meta.did))).join("")),a)}return{logoUrl:l,inService:r}}({blocklet:n,ancestors:i}),{variant:x}=l,g=f?()=>{}:e=>{e.target.src="".concat(m.imgPrefix,"/blocklet.png")};let y=(0,u.jsx)("img",{src:h,onError:g,alt:n.meta.name,style:{width:o}});return n.meta.logo||(y=(0,u.jsx)(a.Z,{did:n.meta.did||"",responsive:!0})),(0,u.jsx)(r.Z,{variant:x||"square",style:Object.assign({backgroundColor:"transparent",width:o,height:o,borderRadius:10},t),...l,children:y})}m.propTypes={blocklet:i().object.isRequired,style:i().object,size:i().oneOfType([i().number,i().string]),ancestors:i().array},m.defaultProps={style:{},size:40,ancestors:[]}},74286:(e,n,t)=>{"use strict";t.d(n,{Z:()=>l});var o=t(55898),i=t.n(o),r=t(39948),a=t(96266);function l(e){let{depth:n}=e;return(0,a.jsx)(r.Z,{ml:Math.max(2*(n-1),0),sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}l.propTypes={depth:i().number},l.defaultProps={depth:1}},61813:(e,n,t)=>{"use strict";t.d(n,{Z:()=>w});var o=t(5057),i=t(55898),r=t.n(i),a=t(13128),l=t(44846),s=t(55372),c=t(11750),d=t(47020),p=t(20870),u=t(31089),m=t(71767),h=t(64886),f=t(43316),x=t(68420),g=t(28726),y=t(88574),v=t(38242),b=t(58238),j=t(73545),k=t(14491),C=t(4651),Z=t(17450),R=t(96266);function w(e){let{defaultUrl:n,onCancel:t,onSuccess:i,onError:r,mode:w,handleText:E}=e;const{api:S}=(0,b.h6)(),{api:P}=(0,j.T)(),[T,U]=(0,o.useState)(!1),[I,N]=(0,o.useState)(""),{t:D}=(0,x.PE)(),A={dist:{}},[B,L]=(0,o.useState)(n),[O,F]=(0,o.useState)(n?1:0),[z,M]=(0,o.useState)(A),[G,q]=(0,o.useState)(!1),[V,W]=(0,o.useState)({}),H="component"===w,K=!!H||!n,J=async()=>{M(A),N(null),U(!0);try{const e=decodeURIComponent(B.trim());try{new URL(e)}catch{throw new Error("Invalid URL")}const{meta:n,inStore:t,registryUrl:o}=await S.getBlockletMetaFromUrl({input:{url:e}});M(n),W({inStore:t,registryUrl:o,inputUrl:B.trim()})}catch(e){console.error(e);const n="Blocklet Install failed: ".concat((0,k.Z)(e));N(n),r(e)}finally{U(!1)}};(0,o.useEffect)((()=>{n&&J()}),[n]);const Y=[{name:D("common.name"),value:(0,v.getDisplayName)({meta:z},!0)},{name:D("common.version"),value:z.version},{name:D("common.did"),value:(0,R.jsx)(Z.Z,{did:z.did})},{name:D("common.author"),value:(0,k.rq)(z.author)},{name:D("blocklet.dist.downloadLink"),value:z.dist.tarball}],Q=[{label:D("blocklet.fromUrl.step0"),body:(0,R.jsx)(c.Z,{component:"div",children:(0,R.jsx)(d.Z,{label:D("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,style:{marginBottom:32},margin:"dense",helperText:D("blocklet.fromUrl.description"),value:B,onChange:e=>{N(null),L(e.target.value)},disabled:T,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),J(),F(1))}})}),cancel:D("common.cancel"),confirm:D("common.next"),onCancel:t,onConfirm:()=>{J(),F(1)}},{label:D("blocklet.fromUrl.step1"),body:T?(0,R.jsx)("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:(0,R.jsx)(l.Z,{})}):z.did?(0,R.jsx)("div",{style:{paddingLeft:"10%"},children:Y.map((e=>e.name===D("common.did")?(0,R.jsx)(h.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>D("common.did"),children:e.value},e.name):(0,R.jsx)(h.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)))}):null,cancel:D(K?"common.pre":"common.cancel"),confirm:(null===E||void 0===E?void 0:E.confirm)||D("blocklet.fromUrl.confirm"),onCancel:()=>{K?F((e=>e-1)):t()},onConfirm:()=>{(()=>{if(H)return i({meta:z,...V}),void t();U(!0),q(!0)})()}}],_=Q[O];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(a.ZP,{title:(null===E||void 0===E?void 0:E.title)||D("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>_.onCancel(),showCloseButton:0===O,disableEscapeKeyDown:!0,open:!0,actions:(0,R.jsxs)(R.Fragment,{children:[_.cancel&&(0,R.jsx)(g.Z,{onClick:e=>{e.stopPropagation(),N(null),_.onCancel()},color:"inherit",children:_.cancel||D("common.cancel")}),(0,R.jsxs)(g.Z,{onClick:e=>{e.stopPropagation(),_.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:T||!B||I,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[T&&0===O&&(0,R.jsx)(l.Z,{size:16}),_.confirm]})]}),children:[K&&(0,R.jsx)(p.Z,{alternativeLabel:!0,activeStep:O,children:Q.map((e=>{let{label:n}=e;return(0,R.jsx)(u.Z,{children:(0,R.jsx)(m.Z,{children:n})},n)}))}),(0,R.jsx)(s.Z,{component:"div",style:{marginTop:24},children:_.body}),!!I&&(0,R.jsx)(y.Z,{type:"error",style:{width:"100%",marginTop:8},children:I})]}),z&&G&&(0,R.jsx)(f.Z,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:P.get,checkTimeout:3e5,onSuccess:()=>{U(!1),q(!1),i({meta:z,...V}),t()},extraParams:{title:z.title,wt:(0,C.iK)(z),blockletMetaUrl:decodeURIComponent(B.trim())},messages:{title:D("setup.keyPair.title"),scan:D("setup.keyPair.scan"),confirm:D("setup.keyPair.confirm"),success:D("setup.keyPair.success")},onClose:()=>{U(!1),q(!1)}})]})}w.propTypes={defaultUrl:r().string,onCancel:r().func.isRequired,onSuccess:r().func.isRequired,onError:r().func,mode:r().oneOf(["install","component"]),handleText:r().object},w.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}}},59375:(e,n,t)=>{"use strict";t.d(n,{Z:()=>b});var o,i=t(71171),r=t(5057),a=t(55898),l=t.n(a),s=t(6352),c=t.n(s),d=t(33518),p=t(92706),u=t.n(p),m=t(39948),h=t(52277),f=t.n(h),x=t(68420),g=t(96266);const y=(0,r.lazy)((()=>Promise.all([t.e(1294),t.e(4382)]).then(t.bind(t,23826)).then((e=>({default:e.Uploader}))))),v="/blocklet/logo/upload";function b(e){let{url:n,height:t,width:o,enabled:i,type:a,did:l,prefix:s,headers:d,onUploaded:p}=e;const{t:u}=(0,x.PE)(),h=(0,r.useRef)(null),b={cursor:i?"pointer":"default","&::after":{content:'"'.concat(u("common.switch"),'"')}};return(0,g.jsxs)(j,{id:"uploader-".concat(l,"-").concat(a),children:[(0,g.jsx)(y,{ref:h,popup:!0,onUploadFinish:()=>{var e;p(),null===(e=h.current)||void 0===e||e.close()},plugins:["ImageEditor"],apiPathProps:{uploader:c()(s,v,a,l),disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".gif",".svg"],maxFileSize:10485760,maxNumberOfFiles:1}},tusProps:{headers:d}}),(0,g.jsx)(m.Z,{className:f()("uploader-wrapper",i&&"enabled"),sx:b,onClick:()=>{var e;null===(e=h.current)||void 0===e||e.open()},children:(0,g.jsx)("img",{alt:"Logo",src:n,style:{height:t,width:o}})})]},"uploader-".concat(l,"-").concat(a))}b.propTypes={url:l().string.isRequired,type:l().oneOf(["square","rect","favicon"]).isRequired,did:l().string.isRequired,prefix:l().string.isRequired,headers:l().func,onUploaded:l().func,height:l().number,width:l().any,enabled:l().bool},b.defaultProps={height:80,width:"auto",enabled:!0,headers:()=>({}),onUploaded:u()};const j=d.Z.div(o||(o=(0,i.Z)(["\n .uploader-wrapper {\n display: inline-flex;\n position: relative;\n font-size: 0px;\n &.enabled {\n cursor: pointer;\n }\n &::after {\n display: none;\n }\n &.enabled::after {\n display: block;\n opacity: 0;\n position: absolute;\n bottom: 0;\n background: rgba(0, 0, 0, 0.2);\n left: 0;\n right: 0;\n height: 2.2em;\n color: white;\n text-align: center;\n font-size: 12px;\n line-height: 2em;\n transition: opacity 0.3s ease;\n }\n &:hover::after {\n opacity: 1;\n }\n }\n"])))},32349:(e,n,t)=>{"use strict";t.d(n,{Z:()=>l});var o=t(55898),i=t.n(o),r=t(22228),a=t(96266);function l(e){let{mode:n,...t}=e;return"development"===n?(0,a.jsx)(r.Z,{type:"primary",...t,children:"DEV"}):null}l.propTypes={mode:i().string.isRequired}},73170:(e,n,t)=>{"use strict";t.d(n,{$7:()=>x,AP:()=>y});var o=t(92877),i=t(55898),r=t.n(i),a=t(19577),l=t(2478),s=t(44067),c=t(46954),d=t(42507),p=t(40184),u=t(28726),m=t(76223),h=t(68420),f=t(96266);const x={meta:r().object.isRequired,onCancel:r().func.isRequired},g=(0,o.Z)((()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}})));function y(e){let{action:n,onSelect:t,onNext:o}=e;const i=g(),{t:r}=(0,h.PE)(),x=[{action:"purchase",title:r("store.purchase.purchase.title"),description:r("store.purchase.purchase.description")},{action:"verify",title:r("store.purchase.verify.title"),description:r("store.purchase.verify.description")}];return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(a.Z,{className:i.tabPanel,children:x.map((e=>(0,f.jsxs)(l.ZP,{button:!0,selected:n===e.action,onClick:()=>t(e.action),children:[(0,f.jsx)(c.Z,{className:i.iconRoot,children:"purchase"===e.action?(0,f.jsx)(d.Z,{style:{color:"purchase"===n?m.Z.primary.main:"#AAA",fontSize:32}}):(0,f.jsx)(p.Z,{style:{color:"verify"===n?m.Z.primary.main:"#AAA",fontSize:32}})}),(0,f.jsx)(s.Z,{primary:e.title,secondary:e.description})]},e.action)))}),o&&(0,f.jsx)(u.Z,{fullWidth:!0,disabled:!n,variant:"contained",color:"primary",style:{marginTop:16},onClick:o,children:r("common.next")})]})}y.propTypes={action:r().oneOf(["both","purchase","verify"]).isRequired,onSelect:r().func.isRequired,onNext:r().func.isRequired}},51233:(e,n,t)=>{"use strict";t.d(n,{Rw:()=>d,fX:()=>c,sf:()=>p});var o=t(35432),i=t(44543),r=t.n(i),a=t(77277),l=t(32828);const s=(e,n)=>{if(e.type===o.ROUTING_RULE_TYPES.REDIRECT){if(!e.url)return new Error("".concat(n("router.validation.redirectUrlRequired")));if(!e.redirectCode)return new Error("redirect ".concat(n("router.validation.redirectCodeRequired")))}else if(e.type===o.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(n("router.validation.didRequired"));return null},c=(e,n)=>{const t=s(e,n);return t||(e.pathPrefix.length?e.pathPrefix.length>150?new Error(n("router.validation.pathPrefixTooLong",{length:150})):null:new Error(n("router.validation.pathPrefixCannotBeEmpty")))},d=e=>{let{params:n,blocklets:t,blocklet:o,locale:i="en"}=e;if(o){let e=(o.children||[]).find((e=>(0,l.default)(e.meta)&&r()(e.mountPoint,n.pathPrefix)));if("gateway"!==o.meta.group&&"/"===n.pathPrefix&&(e="/"),e)return{zh:"\u6302\u8f7d\u70b9 ".concat(n.pathPrefix," \u5df2\u5b58\u5728\uff0c\u8bf7\u4f7f\u7528\u5176\u4ed6\u6302\u8f7d\u70b9"),en:"The mount point ".concat(n.pathPrefix," already exist, please use another mount point")}[i]}const s=t.find((e=>e.meta.did===n.did));if(!s)return"";const c=s.meta.interfaces.find((e=>"web"===e.type));return c&&c.prefix!==a.BLOCKLET_DYNAMIC_PATH_PREFIX&&n.pathPrefix!==c.prefix?{zh:"\u8be5 blocklet \u53ea\u80fd\u6302\u8f7d\u5728 ".concat(c.prefix),en:"This blocklet can only be mounted on ".concat(c.prefix)}[i]:""},p=e=>{if(!e||"string"!==typeof e)return e;let n=e.trim();try{return n=n.toLowerCase(),n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n}catch(t){return console.error("format domain failed",t),n}}},50185:(e,n,t)=>{"use strict";t.d(n,{Z:()=>c});var o=t(5057),i=t(55898),r=t.n(i),a=t(12937),l=t(68420),s=t(96266);function c(e){let{children:n,...t}=e;const{t:i}=(0,o.useContext)(l.RD);return(0,s.jsx)(a.Z,{tip:i("common.copyTip"),copiedTip:i("common.copiedTip"),...t,children:n})}c.propTypes={children:r().any.isRequired}},71363:(e,n,t)=>{"use strict";t.d(n,{Z:()=>u});var o=t(55898),i=t.n(o),r=t(11750),a=t(47020),l=t(93938),s=t(68420),c=t(50185),d=t(70461),p=t(96266);function u(e){let{title:n,description:t,confirmPlaceholder:o,cancel:i,confirm:u,params:m,onCancel:h,onConfirm:f,keyName:x}=e;const{t:g}=(0,s.PE)(),y={title:()=>(0,p.jsxs)("div",{children:[n," (".concat(x,")")]}),description:(e,n)=>(0,p.jsxs)("div",{children:[(0,p.jsx)(l.Z,{severity:"warning",style:{width:"100%"},children:g("common.notice")}),(0,p.jsx)("div",{style:{marginTop:24,marginBottom:24},dangerouslySetInnerHTML:{__html:t}}),(0,p.jsxs)("div",{style:{marginBottom:24},children:[g("common.click"),"\uff1a",(0,p.jsx)(c.Z,{"data-cy":"click-copy",children:x})]}),(0,p.jsx)(r.Z,{component:"div",children:(0,p.jsx)(a.Z,{label:o,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:e.inputVal,onChange:t=>{var o;o={...e,inputVal:t.target.value,__disableConfirm:x!==t.target.value},n({...o,__disableConfirm:o.__disableConfirm})}})})]}),confirm:u,cancel:i,onConfirm:f,onCancel:h,params:{inputVal:"",__disableConfirm:!0,...m}};return(0,p.jsx)(d.Z,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})}u.propTypes={title:i().any.isRequired,keyName:i().any.isRequired,description:i().any.isRequired,confirmPlaceholder:i().any.isRequired,cancel:i().string,confirm:i().string,params:i().object,onCancel:i().func,onConfirm:i().func.isRequired},u.defaultProps={onCancel:()=>{},cancel:"",confirm:"Confirm",params:{}}},28641:(e,n,t)=>{"use strict";t.d(n,{Z:()=>g});var o=t(5057),i=t(55898),r=t.n(i),a=t(39948),l=t(47020),s=t(44846),c=t(13727),d=t(56184),p=t(67680),u=t(35406),m=t(11875),h=t(95890),f=t(96266);const x=(e,n,t)=>null===e&&n&&t?"******":e?n?"******":e:"";function g(e){let{label:n,disabled:t,required:i,initialValue:r,onChange:g,placeholder:y,style:v,onSubmit:b,secure:j,triggers:k,formatterBeforeSubmit:C,...Z}=e;const[R,w]=(0,o.useState)(!1),[E,S]=(0,o.useState)(!1),[P,T]=(0,o.useState)(j&&"__encrypted__"===r?null:r),[U,I]=(0,o.useState)(P),N=async()=>{S(!0);try{if(!1===await b(U))I(P);else{let e=U;"function"===typeof C&&(e=C(U)),I(e),T(e)}}catch(e){I(P)}finally{S(!1),w(!1)}},D=R?(0,f.jsx)(l.Z,{style:{flex:1},fullWidth:!0,value:U,onChange:e=>{var n;n=e.target.value,I(n),g(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:y,onKeyDown:e=>{"Enter"===e.key&&N()},disabled:t,type:j?"password":"text",...Z}):(0,f.jsx)(a.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:x(U,j,r)});return(0,f.jsx)(m.Z,{className:"form",style:v,children:(0,f.jsxs)(a.Z,{className:"form-item",children:[(0,f.jsxs)(a.Z,{className:"form-item-label",children:[n,i&&(0,f.jsx)(u.Z,{})]}),(0,f.jsxs)(a.Z,{className:"form-item-body",children:[(0,f.jsx)(a.Z,{className:"form-item-input",children:D}),(0,f.jsx)(a.Z,{className:"form-item-action",children:R?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.Z,{"data-cy":"schema-form-item-confirm",onClick:N,disabled:t||E,size:"large",children:E?(0,f.jsx)(s.Z,{size:24}):(0,f.jsx)(d.Z,{})}),(0,f.jsx)(p.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{I(P),w(!1)},disabled:t||E,size:"large",children:(0,f.jsx)(c.default,{})})]}):(0,f.jsx)(h.Z,{triggers:k,onEnterEdit:()=>w(!0),disabled:t})})]})]})})}g.propTypes={style:r().object,onSubmit:r().func,onChange:r().func,label:r().string,initialValue:r().string,placeholder:r().string,required:r().bool,disabled:r().bool,secure:r().bool,triggers:r().array,formatterBeforeSubmit:r().func},g.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},11875:(e,n,t)=>{"use strict";t.d(n,{Z:()=>l});var o,i=t(71171),r=t(33518),a=t(39948);const l=(0,r.Z)(a.Z)(o||(o=(0,i.Z)(["\n width: 100%;\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n "," {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n "," {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n\n .MuiChip-root {\n margin-top: -4px;\n }\n }\n\n .MuiSelect-select {\n padding: 8px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n "," {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")))},95890:(e,n,t)=>{"use strict";t.d(n,{Z:()=>g});var o=t(5057),i=t(55898),r=t.n(i),a=t(24558),l=t(67680),s=t(56556),c=t(49127),d=t(49390),p=t(37200),u=t(25228),m=t(24202),h=t(74490),f=t(1733),x=t(96266);function g(e){let{triggers:n,onEnterEdit:t,disabled:i}=e;const r=o.useRef(null),[g,y]=o.useState(!1);return 0===n.length?(0,x.jsx)(l.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,x.jsx)(a.Z,{})}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(c.Z,{variant:"outlined",ref:r,"aria-label":"split button",children:[(0,x.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,x.jsx)(a.Z,{})}),(0,x.jsx)(s.Z,{size:"small","aria-controls":g?"split-button-menu":void 0,"aria-expanded":g?"true":void 0,onClick:()=>{y((e=>!e))},children:(0,x.jsx)(d.Z,{})})]}),(0,x.jsx)(m.Z,{sx:{zIndex:9999},open:g,anchorEl:r.current,role:void 0,placement:"bottom-end",children:(0,x.jsx)(u.Z,{children:(0,x.jsx)(p.d,{onClickAway:e=>{r.current&&r.current.contains(e.target)||y(!1)},children:(0,x.jsx)(f.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((e=>(0,x.jsx)(h.Z,{onClick:()=>{return n=e.handler,y(!1),void n();var n},children:e.title},e.key)))})})})})]})}g.propTypes={triggers:r().arrayOf(r().shape({key:r().string.isRequired,title:r().string.isRequired,handler:r().func.isRequired})),onEnterEdit:r().func.isRequired,disabled:r().bool.isRequired},g.defaultProps={triggers:[]}},35406:(e,n,t)=>{"use strict";t.d(n,{Z:()=>r});var o,i=t(71171);const r=t(33518).Z.span(o||(o=(0,i.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(e=>e.theme.palette.error.main))},8790:(e,n,t)=>{"use strict";t.d(n,{Z:()=>c});var o,i=t(71171),r=t(33518),a=t(55898),l=t.n(a),s=t(96266);function c(e){let{children:n,...t}=e;return(0,s.jsx)(d,{...t,children:n})}c.propTypes={children:l().any.isRequired};const d=r.Z.div(o||(o=(0,i.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n\n .header {\n text-align: center;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 30px;\n width: 100%;\n min-height: 200px;\n flex: 1;\n\n "," {\n padding: 24px;\n }\n\n "," {\n padding: 0 16px 16px;\n }\n }\n\n .footer {\n display: flex;\n justify-content: center;\n\n "," {\n padding-bottom: 34px;\n }\n\n "," {\n margin-top: auto;\n padding-bottom: 10px;\n }\n }\n"])),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.up("sm")),(e=>e.theme.breakpoints.down("md")))},22714:(e,n,t)=>{"use strict";t.d(n,{Z:()=>j});var o=t(5057),i=t(55898),r=t.n(i),a=t(92877),l=t(44846),s=t(13128),c=t(55372),d=t(11750),p=t(47020),u=t(2478),m=t(44919),h=t(68420),f=t(28726),x=t(88574),g=t(58238),y=t(14491),v=t(96266);const b=(0,a.Z)((e=>({addMenuItemRoot:{justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}})));function j(e){let{disabled:n,storeList:t,teamDid:i,onAdd:r}=e;const{api:a}=(0,g.h6)(),[j,k]=(0,o.useState)(!1),[C,Z]=(0,o.useState)(!0),[R,w]=(0,o.useState)(!1),[E,S]=(0,o.useState)(""),[P,T]=(0,o.useState)(""),{t:U}=(0,h.PE)(),I=b(),N=async()=>{k(!0);try{const{isNew:e,decoded:n}=(0,y.bQ)(E,t);if(!e)throw new Error(U("store.blockletRegistry.haveSameRegistry"));await a.addBlockletStore({input:{teamDid:i,url:n}}),r(n),w(!1)}catch(e){const n="".concat(U("store.blockletRegistry.addFailed")," ").concat((0,y.Z)(e));T(n)}finally{k(!1)}};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(u.ZP,{button:!0,disabled:n,className:I.addMenuItemRoot,onClick:()=>{w(!0)},children:[(0,v.jsx)(m.Z,{font:!0}),(0,v.jsx)(d.Z,{variant:"inherit",children:U("store.blockletRegistry.addRegistry")})]}),(0,v.jsxs)(s.ZP,{title:U("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:R,onClose:()=>w(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(f.Z,{onClick:e=>{e.stopPropagation(),w(!1)},color:"inherit",children:U("common.cancel")}),(0,v.jsxs)(f.Z,{onClick:e=>{e.stopPropagation(),N()},color:"primary","data-cy":"install-blocklet-next-step",disabled:j||!E||C,variant:"contained",autoFocus:!0,children:[j&&(0,v.jsx)(l.Z,{size:16}),U("common.confirm")]})]}),children:[(0,v.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,v.jsx)(c.Z,{component:"div",children:(0,v.jsx)(d.Z,{component:"div",children:(0,v.jsx)(p.Z,{label:U("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:E,onChange:e=>{T(null);let n=!1;e.target.value.trim()||(n=!0),e.target.value.trim()||T(U("store.blockletRegistry.registryUrlEmpty")),S(e.target.value),Z(n)},disabled:j,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),e.target.value.trim()?N():T(U("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!P&&(0,v.jsx)(x.Z,{type:"error",style:{width:"100%"},children:P})]})]})}j.propTypes={teamDid:r().string.isRequired,disabled:r().bool,storeList:r().array,onAdd:r().func},j.defaultProps={disabled:!1,storeList:[],onAdd:()=>{}}},45170:(e,n,t)=>{"use strict";t.d(n,{Z:()=>j});var o=t(92877),i=t(11750),r=t(83580),a=t(94552),l=t(67680),s=t(55898),c=t.n(s),d=t(5057),p=t(96366),u=t(68420),m=t(47595),h=t(86229),f=t(58238),x=t(71363),g=t(14491),y=t(96266);function v(e){let{store:n,teamDid:t,onDelete:o}=e;const{api:i}=(0,f.h6)(),{t:r}=(0,u.PE)(),[a,s]=(0,d.useState)(!1),[c,v]=(0,d.useState)(null),b=(0,p.Z)(),j={keyName:n.url,title:r("store.blockletRegistry.deleteRegistry"),description:r("store.blockletRegistry.deleteDesc",{name:"<b>".concat(n.url,"</b>"),color:b.palette.error.main}),confirmPlaceholder:r("store.blockletRegistry.confirmDesc",{name:n.url}),confirm:r("common.delConfirm"),cancel:r("common.cancel"),onConfirm:async()=>{try{s(!0),await i.deleteBlockletStore({input:{teamDid:t,url:n.url}}),o&&"function"===typeof o&&o()}catch(e){h.Z.error("Remove Blocklet Store Error: ".concat((0,g.Z)(e)))}finally{s(!1),v(null)}},onCancel:()=>{s(!1),v(null)}};return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(l.Z,{disabled:a,onClick:e=>{e.stopPropagation(),v(j)},size:"large",children:(0,y.jsx)(m.default,{})}),c&&(0,y.jsx)(x.Z,{keyName:c.keyName,title:c.title,description:c.description,confirmPlaceholder:c.confirmPlaceholder,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}v.propTypes={teamDid:c().string.isRequired,store:c().object.isRequired,onDelete:c().func},v.defaultProps={onDelete:()=>{}};const b=(0,o.Z)((()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},menuName:{display:"flex",flexDirection:"column",marginRight:"100px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})));function j(e){let{teamDid:n,store:t,onDelete:o}=e;const s=b();return(0,y.jsxs)("div",{className:s.menuName,children:[(0,y.jsx)(i.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:t.name}),(0,y.jsx)(i.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(t.url)}),(0,y.jsxs)(r.Z,{children:[(0,y.jsx)(l.Z,{onClick:e=>{e.stopPropagation(),window.open(t.url)},size:"large",children:(0,y.jsx)(a.Z,{})}),!t.protected&&(0,y.jsx)(v,{store:t,onDelete:o,teamDid:n})]})]})}j.propTypes={teamDid:c().string.isRequired,store:c().shape({name:c().string.isRequired,url:c().string.isRequired,protected:c().bool}).isRequired,onDelete:c().func},j.defaultProps={onDelete:()=>{}}},35918:(e,n,t)=>{"use strict";t.d(n,{Z:()=>y});var o=t(44919),i=t(42876),r=t(27773),a=t(11997),l=t(93734),s=t(76667),c=t(39293),d=t(36903),p=t(3422),u=t(92273),m=t(72906),h=t(57201),f=t(49390),x=t(33225),g=t(30770);const y={Add:o.Z,Check:i.default,Delete:r.default,Edit:s.default,Clear:a.default,DetailPanel:u.default,Filter:c.Z,FirstPage:d.default,LastPage:p.default,NextPage:u.default,PreviousPage:m.default,Search:h.default,ResetSearch:a.default,SortArrow:f.Z,Export:l.default,ThirdStateCheck:x.default,ViewColumn:g.default}},74782:(e,n,t)=>{"use strict";t.d(n,{Z:()=>r});var o,i=t(71171);const r=t(33518).Z.div(o||(o=(0,i.Z)(["\n .MuiPaper-root {\n box-shadow: none !important;\n border: none !important;\n border-radius: 0 !important;\n background: transparent;\n }\n .MuiToolbar-root {\n background: transparent;\n padding-left: 0;\n display: none;\n }\n\n &.show-pagination {\n .MuiTablePagination-toolbar {\n display: flex;\n }\n }\n\n .MuiTableHead-root th {\n min-width: 100px;\n background: transparent;\n }\n\n .MuiTable-root {\n overflow-y: hidden;\n }\n .MuiTableRow-root {\n border: none !important;\n }\n\n .MuiTableCell-root {\n padding-right: 16px;\n &:last-of-type {\n padding-right: 0;\n }\n }\n\n /* @material-table/core@next \u517c\u5bb9 mui v5, \u4f46 pagination \u6837\u5f0f\u4f3c\u4e4e\u6709\u4e9b\u95ee\u9898, \u6682\u5730\u5b9a\u5236\u4e0b\u9762\u7684\u6837\u5f0f\u4fee\u590d, \u540e\u9762\u8003\u8651\u5f03\u7528 material-table */\n .MuiTablePagination-selectLabel,\n .MuiTablePagination-displayedRows {\n display: none;\n }\n .MuiTypography-caption {\n display: inline-block;\n }\n .MuiTablePagination-selectLabel + .MuiInputBase-root {\n margin-right: 8px;\n }\n"])))},5952:(e,n,t)=>{"use strict";t.d(n,{K_:()=>o,WC:()=>i});const o="blocklet-add-component-registry",i="server-add-registry"},40736:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),r=t(96266),a=(0,i.default)((0,r.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");n.Z=a},56184:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),r=t(96266),a=(0,i.default)((0,r.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}),"Done");n.Z=a},34966:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),r=t(96266),a=(0,i.default)((0,r.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");n.Z=a},33271:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),r=t(96266),a=(0,i.default)((0,r.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"}),"Link");n.Z=a},48037:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),r=t(96266),a=(0,i.default)((0,r.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7.14 1.13zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}),"SettingsOutlined");n.Z=a},99194:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),r=t(96266),a=(0,i.default)((0,r.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3v7.12zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5z"}),"Update");n.Z=a},52277:(e,n)=>{var t;!function(){"use strict";var o={}.hasOwnProperty;function i(){for(var e=[],n=0;n<arguments.length;n++){var t=arguments[n];if(t){var r=typeof t;if("string"===r||"number"===r)e.push(t);else if(Array.isArray(t)){if(t.length){var a=i.apply(null,t);a&&e.push(a)}}else if("object"===r){if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]")){e.push(t.toString());continue}for(var l in t)o.call(t,l)&&t[l]&&e.push(l)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(t=function(){return i}.apply(n,[]))||(e.exports=t)}()},2078:(e,n,t)=>{var o=t(26849);e.exports=function(e){return o(e).toUpperCase()}},30278:(e,n,t)=>{var o=t(31104),i=t(43676);e.exports=function(e,n){return e&&e.length?i(e,o(n,2)):[]}}}]);