@abtnode/webapp 1.16.25 → 1.16.26-beta-bdd2d7c0
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/build/asset-manifest.json +47 -47
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/static/js/1059.cd52ca65.chunk.js +1 -0
- package/build/static/js/{1371.384ff23d.chunk.js → 1371.c21feb0c.chunk.js} +1 -1
- package/build/static/js/1575.eebd3dd7.chunk.js +1 -0
- package/build/static/js/{1667.dc49a80d.chunk.js → 1667.34ff0c47.chunk.js} +1 -1
- package/build/static/js/1846.6e3f3612.chunk.js +1 -0
- package/build/static/js/2019.2d3a40ae.chunk.js +1 -0
- package/build/static/js/{2098.6c45c749.chunk.js → 2098.a38c7200.chunk.js} +1 -1
- package/build/static/js/{2183.ddd3936e.chunk.js → 2183.0f4144d9.chunk.js} +1 -1
- package/build/static/js/2264.f2eb6130.chunk.js +1 -0
- package/build/static/js/233.a4c19158.chunk.js +1 -0
- package/build/static/js/2611.b0ece77c.chunk.js +1 -0
- package/build/static/js/{2960.b8de1df9.chunk.js → 2960.ba10b91c.chunk.js} +1 -1
- package/build/static/js/{3389.83a58684.chunk.js → 3389.7f3e3f8a.chunk.js} +1 -1
- package/build/static/js/3803.df3cb936.chunk.js +1 -0
- package/build/static/js/3930.31250151.chunk.js +1 -0
- package/build/static/js/4423.0b4a3962.chunk.js +1 -0
- package/build/static/js/4465.d622f2c2.chunk.js +1 -0
- package/build/static/js/{4549.40b371f5.chunk.js → 4549.40465785.chunk.js} +1 -1
- package/build/static/js/{4550.6398038b.chunk.js → 4550.b2afea4a.chunk.js} +1 -1
- package/build/static/js/{4775.bc1f9bc3.chunk.js → 4775.6cffbd67.chunk.js} +1 -1
- package/build/static/js/4906.9b6bdc77.chunk.js +1 -0
- package/build/static/js/{5059.963d527c.chunk.js → 5059.af256250.chunk.js} +1 -1
- package/build/static/js/{5526.09906842.chunk.js → 5526.1aec6323.chunk.js} +2 -2
- package/build/static/js/{5672.c3cf88bf.chunk.js → 5672.12d96543.chunk.js} +1 -1
- package/build/static/js/5748.12e93155.chunk.js +1 -0
- package/build/static/js/5979.a7c1a387.chunk.js +1 -0
- package/build/static/js/{6230.a542a601.chunk.js → 6230.4c0db690.chunk.js} +1 -1
- package/build/static/js/6471.cc995637.chunk.js +1 -0
- package/build/static/js/6511.94eda291.chunk.js +1 -0
- package/build/static/js/670.cc95cf88.chunk.js +1 -0
- package/build/static/js/{6743.fc32eb89.chunk.js → 6743.f19f7583.chunk.js} +2 -2
- package/build/static/js/6906.244f97fe.chunk.js +1 -0
- package/build/static/js/{6931.fa818149.chunk.js → 6931.3b4c19d0.chunk.js} +1 -1
- package/build/static/js/6944.d847d48d.chunk.js +1 -0
- package/build/static/js/{7022.76c60285.chunk.js → 7022.7b668dae.chunk.js} +1 -1
- package/build/static/js/7534.58ee2840.chunk.js +1 -0
- package/build/static/js/8170.38d0b64e.chunk.js +1 -0
- package/build/static/js/{8219.bc63e11b.chunk.js → 8219.0110ce93.chunk.js} +1 -1
- package/build/static/js/8427.b510fa70.chunk.js +2 -0
- package/build/static/js/8590.f59207df.chunk.js +1 -0
- package/build/static/js/9041.62504f43.chunk.js +1 -0
- package/build/static/js/{2677.491ccc30.chunk.js → 9237.82494039.chunk.js} +2 -2
- package/build/static/js/9552.d10aac40.chunk.js +1 -0
- package/build/static/js/9586.efb66311.chunk.js +1 -0
- package/build/static/js/main.914d9380.js +2 -0
- package/build/static/js/{main.20a607fe.js.LICENSE.txt → main.914d9380.js.LICENSE.txt} +8 -5
- package/package.json +1 -1
- package/build/static/js/1059.446f653a.chunk.js +0 -1
- package/build/static/js/1575.9889e444.chunk.js +0 -1
- package/build/static/js/1846.8091d9b8.chunk.js +0 -1
- package/build/static/js/2019.c4e134a4.chunk.js +0 -1
- package/build/static/js/233.5cf94cae.chunk.js +0 -1
- package/build/static/js/2365.a3571172.chunk.js +0 -1
- package/build/static/js/2611.4eb6822b.chunk.js +0 -1
- package/build/static/js/3217.ca7a654b.chunk.js +0 -1
- package/build/static/js/3803.a22da8fb.chunk.js +0 -1
- package/build/static/js/3930.5079b881.chunk.js +0 -1
- package/build/static/js/4423.fc17ebc1.chunk.js +0 -1
- package/build/static/js/4465.88a081e5.chunk.js +0 -1
- package/build/static/js/4906.0bf02a4f.chunk.js +0 -1
- package/build/static/js/5748.d017d106.chunk.js +0 -1
- package/build/static/js/5979.73ce82e4.chunk.js +0 -1
- package/build/static/js/6511.6b799f59.chunk.js +0 -1
- package/build/static/js/670.6c2a6ee0.chunk.js +0 -1
- package/build/static/js/6906.6c830eaf.chunk.js +0 -1
- package/build/static/js/6944.ac06ea4a.chunk.js +0 -1
- package/build/static/js/7534.ea3b613f.chunk.js +0 -1
- package/build/static/js/8170.4ad15204.chunk.js +0 -1
- package/build/static/js/8427.9d00acc3.chunk.js +0 -2
- package/build/static/js/8590.f6c87639.chunk.js +0 -1
- package/build/static/js/9041.a5b13c5d.chunk.js +0 -1
- package/build/static/js/9552.be5312c3.chunk.js +0 -1
- package/build/static/js/9586.e21d0d28.chunk.js +0 -1
- package/build/static/js/main.20a607fe.js +0 -2
- /package/build/static/css/{2677.bceba133.chunk.css → 9237.bceba133.chunk.css} +0 -0
- /package/build/static/js/{5526.09906842.chunk.js.LICENSE.txt → 5526.1aec6323.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{6743.fc32eb89.chunk.js.LICENSE.txt → 6743.f19f7583.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{8427.9d00acc3.chunk.js.LICENSE.txt → 8427.b510fa70.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{2677.491ccc30.chunk.js.LICENSE.txt → 9237.82494039.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 8427.b510fa70.chunk.js.LICENSE.txt */
|
|
2
|
+
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8427],{48427:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>wi});var o=t(5057),i=t(68420),l=t(71171),r=t(33518),a=t(55898),s=t.n(a),c=t(37541),d=t(39948),p=t(7278),m=t(6838),u=t(87971),h=t(99194),f=t(67680),x=t(44919),g=t(48037),y=t(55402),v=t(75239),b=t(48086),j=t(88092),k=t(26174),Z=t(16147),C=t(35432),E=t(44846),w=t(28726),R=t(25710),S=t(38242),T=t(86229),P=t(87363),I=t(44784),U=t(85531),N=t(96266);function D(e){let{children:n,...t}=e;const{t:o}=(0,i.PE)(),{updateAutoCheckUpdate:l,autoCheckUpdate:r}=(0,U.XN)(),a=Boolean(null===r||void 0===r?void 0:r.enabled);return(0,N.jsxs)(d.Z,{display:"flex",flexDirection:"row",alignItems:"center",children:[n,(0,N.jsx)(v.Z,{title:o("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:(0,N.jsx)("div",{children:(0,N.jsx)(I.Z,{checked:a,onChange:async()=>{try{const e=!(null!==r&&void 0!==r&&r.enabled);await l({enabled:e}),T.Z.success(o(e?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(e){T.Z.error(e.message)}},name:"enableWelcomePage",style:{...t.style,zoom:.8}})})})]})}D.propTypes={children:s().any},D.defaultProps={children:null};const B=D;var L,O,A=t(58238),F=t(46090),M=t(63406),G=t(76667),z=t(13128),q=t(94464),V=t(28358),W=t(47020),_=t(93938),H=t(77277),K=t(50185),J=t(35918),Y=t(74782),Q=t(55419);const X=(e,n)=>{let{description:t}=e;return(Object.values(H.CHAIN_PROP_MAP).includes(e.key)||(0,S.isEnvShareable)(e))&&(t=t?"".concat(t," (").concat(n("blocklet.config.sharedToAllComponents"),")"):n("blocklet.config.sharedToAllComponents")),t&&(0,N.jsx)("div",{style:{marginLeft:12},children:t})},$=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 ee(e){let{blocklet:n,ancestors:t}=e;const l=(0,A.h6)(),{inService:r}=l,{t:a}=(0,o.useContext)(i.RD),s=[...t.map((e=>e.meta.did)),n.meta.did],c=()=>T.Z.success(a("blocklet.config.changedTip")),d=e=>$(e,n,t);if((0,F.wS)(n.status))return null;if("unknown"===n.status&&(0,F.wS)(n.status))return null;const p=(n.configs||[]).filter((e=>!H.BLOCKLET_CONFIGURABLE_KEY[e.key])),m=(0,S.getSharedConfigObj)(t[0],n),u=(0,S.getComponentMissingConfigs)(n,t[0]),h=p.map((e=>({...e,value:Object.values(H.CHAIN_PROP_MAP).includes(e.key)&&Object.keys(m).includes(e.key)?m[e.key]:m[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_"))T.Z.error(a("blocklet.config.environment.invalidKey"));else{e.custom=!0;try{const n=await l.api.configBlocklet({input:{did:s,configs:[e]}});c(n.blocklet)}catch(n){T.Z.error((0,F.Z)(n))}}else T.Z.error(a("blocklet.config.environment.keyValueRequired"))},onRowUpdate:async(e,o)=>{if(e.required&&(!e.key.trim()||!e.value.trim()))return void T.Z.error(a("blocklet.config.environment.keyValueRequired"));if(e.key.startsWith("BLOCKLET_")&&!H.BLOCKLET_CONFIGURABLE_KEY[e.key])return void T.Z.error(a("blocklet.config.environment.invalidKey"));if(e.key===H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const n=(0,F.I)(e);if(n)return void T.Z.error(n)}const i=[{...e,value:e.secure&&"__encrypted__"===e.value?"":e.value}];if(e.key!==o.key){if(!$(e,n,t))return void T.Z.error("Only key of custom env can be changed");i.push({key:o.key,custom:!0})}try{const e=await l.api.configBlocklet({input:{did:s,configs:i}});c(e.blocklet)}catch(r){T.Z.error((0,F.Z)(r))}},onRowDelete:async e=>{if(e.required)T.Z.error(a("blocklet.config.environment.deleteForbidden"));else if($(e,n,t))try{const n=await l.api.configBlocklet({input:{did:s,configs:[{key:e.key,custom:!0}]}});c(n.blocklet)}catch(o){T.Z.error((0,F.Z)(o))}else T.Z.error("Only key of custom env can be changed")},isDeletable:d};return(0,N.jsxs)(ne,{children:[!!u.length&&(0,N.jsx)(_.Z,{severity:"error",style:{marginTop:24},children:a("blocklet.config.missingRequired")}),f&&(0,N.jsx)(_.Z,{severity:"info",children:a("blocklet.config.environment.tip")}),(0,N.jsx)(M.Z,{permission:r?"":"mutate_blocklets",role:r?F.Wf:[],children:e=>(0,N.jsx)(Y.Z,{className:"config-table",children:(0,N.jsx)(V.ZP,{title:(0,N.jsx)("h4",{children:a("common.environment")}),columns:[{title:a("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:e=>(0,N.jsx)(K.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,N.jsx)(te,{children:(0,N.jsx)(W.Z,{fullWidth:!0,size:"small",disabled:!1===d(t),value:n,onChange:e=>o(e.target.value),variant:"outlined",label:"Key",placeholder:a("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:a("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:e=>e.value?e.secure?"******":(0,N.jsx)(K.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,N.jsxs)(te,{children:[(0,N.jsx)(W.Z,{fullWidth:!0,size:"small",value:"__encrypted__"===n?"":n,onChange:e=>o(e.target.value),variant:"outlined",label:a("common.value"),placeholder:a("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),X(t,a)]})}}],icons:{...Q.Z,...J.Z},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:a("common.actions")},body:{emptyDataSourceMessage:a("common.noData")}},data:h,editable:e?x:{}})})})]})}ee.propTypes={blocklet:s().object.isRequired,ancestors:s().array},ee.defaultProps={ancestors:[]};const ne=r.Z.div(L||(L=(0,l.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=r.Z.div(O||(O=(0,l.Z)(["\n height: 60px;\n"])));var oe,ie=t(45239),le=t.n(ie),re=t(28641);function ae(e){let{blocklet:n,ancestors:t,hasPermission:l,...r}=e;const{t:a}=(0,i.PE)(),{api:s}=(0,A.h6)(),c=!t.length,p=c?n.meta.did:t.map((e=>e.meta.did))[0],[m,u]=(0,o.useState)(""),[h,f]=(0,o.useState)(""),x=m||!l;if(!p)return null;if("unknown"===n.status&&(0,F.wS)(n.status))return null;return(0,N.jsx)(pe,{component:"div",...r,children:(0,N.jsx)(d.Z,{mt:3,children:(0,N.jsx)(re.Z,{label:a("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:m||x,loading:m,required:!0,initialValue:n.mountPoint,onSubmit:async e=>{u(!0);try{const t={rootDid:p,mountPoint:le()(e)};return c||(t.did=n.meta.did),await s.updateComponentMountPoint({input:t}),u(!1),!0}catch(t){throw u(!1),t.message=(0,F.Z)(t),T.Z.error(t.message),t}},onChange:e=>{f(a("common.slugifyHint",{value:(0,F.LN)(e)}))},helperText:h,formatterBeforeSubmit:e=>le()(e)})})})}const se=(0,M.V)(ae,"mutate_blocklets"),ce=(0,M.V)(ae,"",F.Wf);function de(e){const{inService:n}=(0,A.h6)();return n?(0,N.jsx)(ce,{...e}):(0,N.jsx)(se,{...e})}ae.propTypes={blocklet:s().object.isRequired,ancestors:s().array,hasPermission:s().bool},ae.defaultProps={ancestors:[],hasPermission:!1};const pe=r.Z.div(oe||(oe=(0,l.Z)([""])));var me;function ue(e){let{blocklet:n,ancestors:t,children:l}=e;const[r,a]=(0,o.useState)(""),{t:s}=(0,i.PE)(),c=!!t.length,[p,m]=(0,o.useState)((0,S.hasStartEngine)(null===n||void 0===n?void 0:n.meta)?"settings":"environments"),u=c?(0,S.getDisplayName)(n,!0):s("blocklet.component.container");if((0,F.wS)(n.status))return null;if("unknown"===n.status&&(0,F.wS)(n.status))return null;const h=e=>{e.stopPropagation(),a(!0)},x={settings:(0,S.hasStartEngine)(n.meta)&&{label:s("blocklet.component.setting"),value:"settings",component:(0,N.jsx)(de,{blocklet:n,ancestors:t})},environments:{label:s("common.environment"),value:"environments",component:(0,N.jsx)(ee,{blocklet:n,ancestors:t})}},g=Object.values(x).filter(Boolean),y=g.map((e=>{let{label:n,value:t}=e;return{label:n,value:t}})),v=x[p]||g[0];return["function"===typeof l?l({open:h}):(0,N.jsx)(f.Z,{onClick:h,"data-cy":"action-config-component",children:(0,N.jsx)(G.default,{})}),r&&(0,N.jsx)(he,{open:!0,fullWidth:!0,maxWidth:"md",title:u,onClose:()=>{a(!1)},PaperProps:{style:{minHeight:"auto"}},children:c?(0,N.jsxs)(d.Z,{mt:1,children:[(0,N.jsx)(q.Z,{tabs:y,current:p,onChange:e=>{m(e)},scrollButtons:"auto"}),v.component]}):(0,N.jsx)(ee,{blocklet:n,ancestors:t})})]}ue.propTypes={blocklet:s().object.isRequired,ancestors:s().array,children:s().any},ue.defaultProps={ancestors:[],children:null};const he=(0,r.Z)(z.ZP)(me||(me=(0,l.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 fe=t(74490),xe=t(33271),ge=t(15715),ye=t(5952),ve=t(85493),be=t(30278),je=t.n(be),ke=t(79077),Ze=t.n(ke),Ce=t(75506),Ee=t.n(Ce),we=t(3785),Re=t.n(we),Se=t(2660),Te=t(11750),Pe=t(42876),Ie=t(63902),Ue=t(51703),Ne=t(88574),De=t(35266),Be=t(55309),Le=t(29054),Oe=t(24558),Ae=t(13727),Fe=t(56184),Me=t(11819),Ge=t(67486);const ze={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 qe(e){let{editing:n,value:t,onChange:i}=e;const[l,r]=(0,o.useState)(!1),a=(0,o.useRef)(),s=(0,o.useRef)(t);(0,o.useEffect)((()=>{let e=null;return n&&(e=setTimeout((()=>{r(!0)}),50)),()=>{clearTimeout(e)}}),[n]);const c=(0,N.jsx)(d.Z,{className:"form-item-input slot",px:1,children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t,"auto"!==t&&(0,N.jsx)("div",{style:{marginLeft:4,backgroundColor:t,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=(0,N.jsxs)(d.Z,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:()=>{r(!1),i(s.current)},children:[(0,N.jsx)(d.Z,{display:"flex",alignItems:"center",onClick:()=>r(!0),children:(0,N.jsx)("div",{ref:a,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,N.jsx)(Me.ZP,{open:l,anchorEl:a.current,onClose:()=>r(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:(0,N.jsx)(Ge.AI,{color:t,onChange:e=>{return n=e.hex,s.current=n,void i(n);var n}})})]});return n?p:c}function Ve(e){let{editing:n,description:t,value:i,onChange:l,componentProps:r,...a}=e;const{placeholder:s}=r,c=(0,o.useRef)(i),p=e=>{"Enter"===e.key&&l(c.current,"confirm")};return n?(0,N.jsx)(W.Z,{style:{flex:1},fullWidth:!0,value:i,onChange:e=>{var n;e.persist(),n=e.target.value,c.current=n,l(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:t||s,onKeyDown:p,...a}):(0,N.jsx)(d.Z,{px:1,className:"form-item-input slot",children:i})}qe.propTypes=ze,Ve.propTypes=ze,Ve.defaultProps={componentProps:{}};var We=t(49777),_e=t.n(We),He=t(76818);function Ke(e){let{editing:n,value:t,onChange:o,componentProps:i,...l}=e;const{blocklet:r}=i,a="auto"===t?(0,He.getPassportColorFromDid)(r.appDid):t;return(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:_e()({title:"Owner",issuer:(0,S.getDisplayName)(r),issuerDid:r.appDid,ownerName:"Your Name",ownerDid:r.appDid,preferredColor:t||"auto"})}}),(0,N.jsx)(qe,{...l,editing:n,value:n?a:t,onChange:o,componentProps:i})]})}Ke.propTypes={...ze,componentProps:s().shape({blocklet:s().object.isRequired}).isRequired},Ke.defaultProps={};var Je,Ye=t(35406),Qe=t(11875),Xe=t(59375);const $e={input:Ve,color:qe,passport:Ke,uploader:e=>(0,N.jsx)(Xe.Z,{...e.componentProps})};function en(e){let{schema:n,loading:t,value:i,defaultValue:l,onChange:r,style:a,disabled:s}=e;const c="[object Object]"===Object.prototype.toString.call(i),[p,m]=(0,o.useState)(null),[u,h]=(0,o.useState)(c?i:l),x=(0,o.useRef)();function g(e,n,t){const{key:o,secure:i}=e,l=u[o]!==n,a={...u,[o]:n};l&&h(a),r({[o]:n},{allValues:a,action:t,currentItem:e}),"confirm"===t&&i&&h({...u,[o]:"__encrypted__"}),["confirm","cancel"].includes(t)?y(null):y(e)}function y(e){if(e)return x.current=u[e.key],void m(e);x.current=null,m(null)}return(0,N.jsx)(nn,{className:"form",style:a,children:null===n||void 0===n?void 0:n.map((e=>{const{key:n,description:o,required:l,solo:r=!1,hidden:a=!1,componentProps:m={}}=e;if(a)return null;const h=!(!p||n!==p.key),y=function(e,n){let{editing:t=!1}=n;const{key:o}=e,l=c?i[o]:u[o];return"__encrypted__"===l?t?"":"******":l}(e,{editing:h}),v=function(e,n){let{editing:t=!1}=n;const{componentType:o="input",render:i,renderFormItem:l}=e;return t&&l?l:!t&&i?i:$e[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:m};return(0,N.jsxs)(d.Z,{className:"form-item",children:[!r&&(0,N.jsxs)(d.Z,{className:"form-item-label",style:{color:l&&!y?"#ff0000":"#333"},children:[o,l&&(0,N.jsx)(Ye.Z,{})]}),(0,N.jsxs)(d.Z,{className:"form-item-body",children:[(0,N.jsx)(d.Z,{className:"form-item-input",sx:{textAlign:r?"center":"left"},children:(0,N.jsx)(v,{...b})}),!r&&(0,N.jsx)(d.Z,{className:"form-item-action",children:h?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(f.Z,{"data-cy":"schema-form-item-confirm",onClick:()=>{g(e,y,"confirm")},disabled:s||t,size:"large",children:t?(0,N.jsx)(E.Z,{size:24}):(0,N.jsx)(Fe.Z,{})}),(0,N.jsx)(f.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{g(e,x.current,"cancel")},disabled:s||t,size:"large",children:(0,N.jsx)(Ae.default,{})})]}):(0,N.jsx)(f.Z,{"data-cy":"schema-form-item-edit",onClick:()=>{g(e,u[n],"edit")},disabled:s||p,size:"large",children:(0,N.jsx)(Oe.Z,{})})})]})]},n)}))})}en.propTypes={schema:s().array.isRequired,loading:s().bool,onChange:s().func.isRequired,value:s().object,defaultValue:s().object,style:s().object,disabled:s().bool},en.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const nn=(0,r.Z)(Qe.Z)(Je||(Je=(0,l.Z)([""])));var tn=t(6352),on=t.n(tn),ln=t(22425),rn=t(28018),an=t.n(rn),sn=t(60344),cn=t(73170);function dn(e){let{meta:n,onCancel:t,mode:l,handlePaySuccess:r}=e;const{t:a,locale:s}=(0,i.PE)(),{info:c}=(0,A.h6)(),d=(0,F.yP)(c),[p,m]=(0,o.useState)(null),u=new URL(null===n||void 0===n?void 0:n.registryUrl).origin,h=(0,S.getDisplayName)({meta:n});if((0,o.useEffect)((()=>{if("purchase"===l){const t=new URL(u);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{sn.hi.get(t.href).then((e=>{let{data:n}=e;const t="".concat(n.url);m(t)}))}catch(e){console.error("get next workflow url error: ",e)}}return()=>{m(null)}}),[l]),"purchase"===l&&!p)return"";const f={verify:{action:"verify-purchase-blocklet",checkFn:sn.od.create({baseURL:u}).get,extraParams:{serverDid:c.did,blockletDid:null===n||void 0===n?void 0:n.did},messages:{title:a("store.purchase.verify.auth.title",{name:h}),scan:a("store.purchase.verify.auth.scan"),confirm:a("store.purchase.verify.auth.confirm"),success:a("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:sn.od.create({baseURL:on()(u,"/store")}).get,extraParams:{factory:n.nftFactory,nw:p},messages:{title:a("store.purchase.auth.title",{name:h}),scan:a("store.purchase.auth.scan"),confirm:a("store.purchase.auth.confirm"),success:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:a("store.purchase.auth.success")}),(0,N.jsx)("p",{children:a("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return(0,N.jsx)(ln.Z,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:u,onSuccess:async(e,n)=>{const o=e=>{let{downloadTokenList:n}=e;r({downloadTokenList:n})},i=e=>{T.Z.error(e),t(e)};if("purchase"===l&&p){const{statusUrl:e}=(0,F.Pi)(p);await(s=e,an()((()=>sn.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(a("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[l]})}dn.propTypes={...cn.$7,handlePaySuccess:s().func,mode:s().oneOf(["verify","purchase"]).isRequired},dn.defaultProps={handlePaySuccess:()=>{}};const pn=(0,o.forwardRef)(((e,n)=>{let{mode:t,...i}=e;const[l,r]=(0,o.useState)("both"!==t?t:"verify"),[a,s]=(0,o.useState)("both"!==t?2:1),c=e=>{e!==l&&r(e)},d=()=>{l&&2!==a&&s(2)};return(0,o.useImperativeHandle)(n,(()=>({onNext:d,getCurrentStep:()=>a}))),1===a?(0,N.jsx)("div",{style:{maxWidth:520},children:(0,N.jsx)(cn.AP,{action:l,onNext:null,onSelect:c})}):(0,N.jsx)(dn,{...i,mode:l})}));pn.propTypes={mode:s().oneOf(["both","verify","purchase"]).isRequired,ref:s().any},pn.defaultProps={ref:{}};const mn=pn;var un,hn=t(51233),fn=t(53927),xn=t(61813),gn=t(49390),yn=t(67654),vn=t(22714),bn=t(45170);function jn(e){let{onChange:n,loading:t,children:l,extra:r,stores:a,storageKey:s}=e;const{t:c}=(0,i.PE)(),{info:d,inService:p}=(0,A.h6)(),{blocklet:m}=(0,Le.y0)(),[u,h]=(0,o.useState)(!1),f=(0,o.useRef)(null),[x,g]=(0,o.useState)(),[y,v]=(0,yn.Z)(s||"tmp"),[b,j]=s?[y,v]:[x,g],{storeList:k,teamDid:Z}=(0,F.dX)({fromBlocklet:p,blocklet:m,nodeInfo:d}),E=je()([...a.map((e=>({...e,protected:!0}))),...k],"url"),R=b&&E.find((e=>b===e.url))||E[0],S=d.mode===C.NODE_MODES.SERVERLESS;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(kn,{children:[(0,N.jsx)(w.Z,{ref:f,color:"primary","data-cy":"add-component-select-store",endIcon:(0,N.jsx)(gn.Z,{color:"primary"}),onClick:()=>{h(!0)},style:{padding:"0 2px"},children:(0,N.jsx)(Te.Z,{color:"primary",children:R.name})}),(0,N.jsx)(Te.Z,{color:"primary",children:r})]}),(0,N.jsxs)(W.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:u,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===E||void 0===E?void 0:E.map((e=>(0,N.jsx)(fe.Z,{sx:{width:"400px",maxWidth:"90vw"},value:e,"data-cy":e.url,children:(0,N.jsx)(bn.Z,{teamDid:Z,store:e,onDelete:()=>{var n;b===e.url&&j(null===(n=E[0])||void 0===n?void 0:n.url)}})},e.url))),!S&&(0,N.jsx)(vn.Z,{disabled:t,storeList:E,teamDid:Z,onAdd:e=>{j(e)}})]}),l({currentRegistry:R})]})}jn.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}))},jn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const kn=r.Z.div(un||(un=(0,l.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 Zn,Cn=t(38898),En=t(71569),wn=t(52439),Rn=t(44040),Sn=t(44727);const Tn=(e,n)=>on()(n,"/blocklets/".concat(e.did)),Pn=e=>{let{blocklet:n,attribute:t,value:o}=e;return n._formatted?n._formatted[t]:o},In=e=>e.inStore&&!1===(0,S.isFreeBlocklet)(e);function Un(e){let{blocklet:n,blocklets:t,handleButtonClick:l,endpoint:r}=e;const{t:a}=(0,i.PE)();let s=on()(r,(0,F.lk)(n.did,n.logo||""));try{const e=new URL(s);e.searchParams.set("v",n.version||+new Date),s=e.href}catch{}const[c,d]=(0,o.useState)(!1),p=In(n)?a("common.purchase"):a("blocklet.component.choose");return(0,N.jsx)(Cn.Z,{href:Tn(n,r),style:{color:"initial",textDecoration:"none"},onClick:e=>!!e.currentTarget.contains(e.target)||(e.preventDefault(),!1),target:"_blank",children:(0,N.jsx)(Dn,{title:Pn({blocklet:n,attribute:"title",value:n.title||n.name}),did:n.did,description:Pn({blocklet:n,attribute:"description",value:n.description}),cover:n.logo?s:"",version:n.version,button:(0,N.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,N.jsx)(Sn.Kk,{children:(0,N.jsx)(w.Z,{onClick:async e=>{e.preventDefault(),e.stopPropagation();try{d(!0),await l({meta:n,registryUrl:r,blocklets:t})}catch(o){T.Z.error(o.message)}finally{d(!1)}},size:"small",disabled:c,variant:"outlined",color:"primary","data-cy":"install-blocklet",children:c?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(E.Z,{size:16,style:{marginRight:3}}),p]}):p},n.did)})})})})}function Nn(e){let{handleButtonClick:n,handleSearchSelect:t,storeUrl:l,handleBlockletRender:r,extraFilter:a,serverVersion:s,resourceType:c,resourceDid:d,...p}=e;const{locale:m}=(0,i.PE)(),[u,h]=(0,o.useState)(!1),[f,x]=(0,o.useState)({}),g=l;return(0,o.useEffect)((()=>{x({resourceType:c,resourceDid:d})}),[g,c,d]),(0,o.useEffect)((()=>{h(!0),x({resourceType:c,resourceDid:d})}),[]),(0,N.jsx)(wn.ErrorBoundary,{FallbackComponent:En.H,resetKeys:[g],children:(0,N.jsx)("div",{...p,children:u&&(0,N.jsx)(Rn.Z,{blockletRender:e=>{const t={...e,handleButtonClick:n,endpoint:g};return r({...e,defaultRender:(0,N.jsx)(Un,{...t})})},baseSearch:!0,endpoint:g,locale:m,onFilterChange:e=>{x(e)},onSearchSelect:t,filters:f,extraFilter:a,serverVersion:s,fetchCategoryDelay:500})})})}Un.propTypes={blocklet:s().object.isRequired,blocklets:s().array,handleButtonClick:s().func,endpoint:s().string},Un.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]},Nn.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},Nn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:""};const Dn=(0,r.Z)(Sn.ZP)(Zn||(Zn=(0,l.Z)(["\n .ms-highlight {\n color: ",";\n }\n"])),(e=>e.theme.palette.primary.main));var Bn=t(35966);function Ln(e){let{...n}=e;return(0,N.jsx)(w.Z,{className:"bottom-button",variant:"contained",color:"primary",...n})}var On,An,Fn=t(96366);function Mn(){let{key:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{key:"sm"};const n=(0,Fn.Z)();return(0,ge.Z)(n.breakpoints.down(e))}function Gn(e){let{blocklet:n,onStartNow:t,children:o,disabled:l}=e;const{t:r}=(0,i.PE)(),a=Mn();return!n||(0,F.bg)(n.meta)?(0,N.jsx)(zn,{children:o}):(0,N.jsxs)(qn,{isMobile:a,children:[(0,N.jsx)(Ln,{className:"start-now",variant:"contained",color:"primary",disabled:l,onClick:()=>t(),children:r("setup.startNow")}),(0,N.jsx)(d.Z,{display:"flex",alignItems:"center",children:o})]})}Gn.propTypes={blocklet:s().object,onStartNow:s().func,children:s().any,disabled:s().bool},Gn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const zn=(0,r.Z)(d.Z)(On||(On=(0,l.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"))),qn=(0,r.Z)(d.Z)(An||(An=(0,l.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 Vn=t(8790),Wn=function(e){return(0,N.jsxs)("svg",{...e,children:[(0,N.jsxs)("g",{filter:"url(#a)",children:[(0,N.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,N.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-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,N.jsx)("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:(0,N.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,N.jsxs)("g",{mask:"url(#b)",children:[(0,N.jsx)("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),(0,N.jsx)("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),(0,N.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,N.jsx)("path",{d:"M117.604 47.263 121.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,N.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,N.jsxs)("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[(0,N.jsx)("path",{d:"m50.928 216.089 1.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,N.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,N.jsx)("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),(0,N.jsx)("path",{d:"m192.064 213.333.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,N.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,N.jsxs)("defs",{children:[(0,N.jsxs)("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[(0,N.jsx)("stop",{stopColor:"#101010"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#272727"})]}),(0,N.jsxs)("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,N.jsx)("stop",{stopColor:"#fff",stopOpacity:".4"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#fff"})]}),(0,N.jsxs)("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,N.jsx)("stop",{stopColor:"#fff"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),(0,N.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,N.jsx)("stop",{stopColor:"#016BED"}),(0,N.jsx)("stop",{offset:".699",stopColor:"#4498FB"}),(0,N.jsx)("stop",{offset:"1",stopColor:"#9DFFE8"})]}),(0,N.jsx)("clipPath",{id:"g",children:(0,N.jsx)("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),(0,N.jsx)("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,N.jsx)("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),(0,N.jsxs)("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,N.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,N.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,N.jsx)("feOffset",{dy:"2"}),(0,N.jsx)("feGaussianBlur",{stdDeviation:"2"}),(0,N.jsx)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,N.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,N.jsx)("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),(0,N.jsx)("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),(0,N.jsx)("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQ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UTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};function _n(){const{t:e}=(0,i.PE)();return(0,N.jsx)(d.Z,{children:(0,N.jsxs)(d.Z,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[(0,N.jsx)(Wn,{style:{width:200,height:250}}),(0,N.jsx)(Te.Z,{marginTop:"24px",marginBottom:"24px",children:e("storage.spaces.connect.providerForStorage")})]})})}Wn.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},_n.propTypes={};const Hn=_n;var Kn=t(19654),Jn=t(39565),Yn=t(84584),Qn=t(17450),Xn=t(47595),$n=t(60939),et=t(72443),nt=t.n(et);function tt(e){let{spaceGateway:n,onDeleteSpace:t}=e;const{t:l}=(0,i.PE)(),[r,a]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1),d=(e,n)=>{null===e||void 0===e||e.stopPropagation(),a(n)};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(f.Z,{size:"small",onClick:e=>d(e,!0),children:(0,N.jsx)(Xn.default,{})}),(0,N.jsx)($n.Z,{title:l("common.delConfirmDescription",{data:"".concat(null===n||void 0===n?void 0:n.name)}),open:r,confirmButton:{text:l("common.confirm"),props:{variant:"contained",color:"error",loading:s}},cancelButton:{text:l("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:async e=>{try{null===e||void 0===e||e.stopPropagation(),c(!0),await t(n),a(!1)}catch(o){console.error(o),T.Z.error("".concat(l("storage.spaces.gateway.delete.failed"),": ").concat(nt()(o)))}finally{c(!1)}},onCancel:e=>d(e,!1)})]})}tt.propTypes={onDeleteSpace:s().func,spaceGateway:s().shape({name:s().string.isRequired,url:s().string.isRequired,protected:s().bool}).isRequired},tt.defaultProps={onDeleteSpace:()=>{}};const ot=tt;var it,lt=function(e){return(0,N.jsx)("svg",{...e,children:(0,N.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};function rt(e){let{spaceGateway:n,connected:t,onDisconnect:o,...l}=e;const r=Mn(),{t:a}=(0,i.PE)();return(0,N.jsxs)(at,{style:{position:"relative"},children:[(0,N.jsxs)(d.Z,{sx:{backgroundColor:t?"#F0FDFF":"inherit","&:hover":{backgroundColor:t?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px",...l,children:[(0,N.jsx)(d.Z,{display:"flex",children:(0,N.jsx)(Jn.Z,{alt:n.did,src:(0,Yn.Jf)(n.endpoint)})}),(0,N.jsxs)(d.Z,{className:"spaces-info",display:"flex",flexGrow:1,flexDirection:"column",sx:{marginLeft:"20px",padding:"0px 0px"},children:[(0,N.jsxs)(d.Z,{className:"spaces-info",display:"flex",maxWidth:"360px",alignItems:"center",children:[(0,N.jsx)(Te.Z,{color:t?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:n.name}),(0,N.jsx)(Kn.Z,{label:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(lt,{style:{marginRight:"4px"}}),a("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:r?null:"20px",fontWeight:"bold"}})]}),(0,N.jsx)(d.Z,{className:"spaces-address",display:"flex",color:"#9397A1",marginTop:"8px",children:(0,N.jsx)(Te.Z,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:n.did&&(0,N.jsx)(Qn.Z,{copyable:!1,size:14,compact:!0,responsive:!1,did:n.did})})})]}),(0,N.jsx)(d.Z,{className:"spaces-backup",display:"flex",alignItems:"center",children:(0,N.jsx)(d.Z,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:(0,N.jsx)(ot,{spaceGateway:n,onDeleteSpace:async()=>{try{await o(),T.Z.success(a("storage.spaces.gateway.delete.succeeded",{name:n.name}))}catch(e){console.error(e),T.Z.error((0,F.Z)(e))}}})})})]}),(0,N.jsx)(d.Z,{className:"selected-container selected",children:(0,N.jsx)(Pe.default,{className:"selected-icon"})})]})}lt.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt.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:a.bool,onDisconnect:a.func},rt.defaultProps={connected:!1,onDisconnect:()=>{}};const at=(0,r.Z)(d.Z)(it||(it=(0,l.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"]))),st=rt;var ct=t(65873),dt=t(41899);const pt=(0,o.createContext)({}),{Provider:mt,Consumer:ut}=pt;function ht(e){let{children:n}=e;const[t,i]=(0,o.useState)(!1),[l,r]=(0,o.useState)(null),{blocklet:a,actions:{refreshBlocklet:s}}=(0,Le.y0)(),{storageEndpoint:c}=function(){const[e,n]=(0,o.useState)(null),{blocklet:t}=(0,Le.y0)();return(0,o.useEffect)((()=>{n((0,Yn.EJ)(t))}),[t]),{storageEndpoint:e}}(),{api:d}=(0,A.h6)();(0,dt.Z)((async()=>{try{if(i(!0),(0,ct.isEmpty)(c))return void r(null);const e=await(0,Yn.UV)(c);r(e)}catch(e){console.error(e),T.Z.error(e.message)}finally{i(!1)}}),[c]);const p=async e=>{await d.configBlocklet({input:{did:[a.meta.did],configs:[{key:H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:e}]}}),s()};(0,o.useEffect)((()=>{!async function(){if(!l)return;const e=await(0,Yn.nU)(l.endpoint,l.name),n=(0,ct.merge)(l,{name:e});r(n)}()}),[]);const m=Boolean(c&&l);return(0,N.jsx)(mt,{value:{loading:t,spaceGateway:l,deleteSpaceGateway:()=>{r(null),s()},updateSpaceGateway:async e=>{r(e),await p(e.endpoint),s()},storageEndpoint:c,settingStorageEndpoint:p,hasStorageEndpoint:m},children:n})}function ft(){return(0,o.useContext)(pt)}ht.propTypes={children:a.node.isRequired},ht.defaultProps={};const xt=function(){const{t:e}=(0,i.PE)(),{spaceGateway:n,settingStorageEndpoint:t}=ft();return(0,N.jsxs)(d.Z,{display:"flex",flexDirection:"column",children:[(0,N.jsx)(d.Z,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:(0,N.jsx)(Te.Z,{fontSize:"1.2rem",fontWeight:"bold",children:e("storage.spaces.connected.title")})}),(0,N.jsx)(d.Z,{children:(0,N.jsx)(st,{style:{marginTop:"12px"},spaceGateway:n,connected:!0,onDisconnect:()=>t(null)},n.endpoint)})]})};var gt=t(55372),yt=t(17682),vt=t(56277);function bt(e){let{onConnect:n,...t}=e;const{blocklet:l}=(0,Le.y0)(),{info:r}=(0,A.h6)(),{t:a,locale:s}=(0,i.PE)(),[c,p]=(0,o.useState)(""),[m,u]=(0,o.useState)(!1),[h,f]=(0,o.useState)(!1),[x,g]=(0,o.useState)(""),y=(0,vt.Z)({blocklet:l}),v=(0,F.yP)(r),{storageEndpoint:b}=ft(),[j,k]=(0,o.useState)({open:!1,action:"connect-to-did-spaces",checkTimeout:3e5,prefix:"/api/did",checkFn:sn.od.create({baseURL:on()(window.location.origin,(0,F.Y5)())}).get,messages:{title:a("storage.spaces.provideNFT.title",{appName:y.appName},s),scan:a("storage.spaces.provideNFT.scan",{appName:y.appName},s),confirm:"",success:(0,N.jsx)(Te.Z,{gutterBottom:!0,children:a("storage.spaces.provideNFT.success")})},onClose:()=>{k((e=>({...e,open:!1})))}}),[Z,C]=(0,o.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,messages:{title:a("storage.spaces.authorize.title",{appName:y.appName},s),scan:a("storage.spaces.authorize.scan",{appName:y.appName},s),confirm:"",success:(0,N.jsx)(Te.Z,{gutterBottom:!0,children:a("storage.spaces.authorize.success")})},onClose:()=>{C((e=>({...e,open:!1})))}}),R=async e=>{let{did:t,name:o,endpoint:i}=e;const l=await(0,Yn.Z3)(i);if(!await(0,Yn.w2)(l))return void T.Z.error(a("storage.spaces.gateway.add.invalidUrl"));const r={name:o,did:t,url:l,endpoint:i};await n(r),T.Z.success(a("storage.spaces.connectedWithName",{name:r.name}))},S=(e,n)=>{setTimeout((async()=>{if(C((e=>({...e,open:!1}))),p(null),k((e=>({...e,open:!1}))),!Ee()(e.spaceGateway))return void await R(n(e.spaceGateway));const t=n(e.endpoint),o=e.space?n(e.space):{};await R({endpoint:t,did:(0,Yn.LQ)(t),name:"DID Space",...o})}),0)},P=async()=>{try{u(!0);const e=await(0,Yn.Z3)(c),n=(0,Yn.ag)(e),t=new URL(e).searchParams.get("spaceDid");if(!await(0,Yn.w2)(n))throw new Error(a("storage.spaces.gateway.add.invalidUrl"));C((e=>({...e,open:!0,prefix:on()(n,"space/api/did"),baseUrl:new URL(n).origin,checkFn:sn.od.create({baseURL:on()(n,"space")}).get,extraParams:{appDid:y.appDid,appName:y.appName,appDescription:y.appDescription,scopes:y.scopes,appUrl:y.appUrl,referrer:y.referrer,nodeDid:r.did,spaceDid:t}}))),f(!1)}catch(e){const n="".concat(a("storage.spaces.gateway.add.failed",s),": ").concat((0,F.Z)(e));g(n)}finally{u(!1)}};return(0,N.jsxs)(d.Z,{children:[(0,N.jsx)(yt.Z,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:()=>{k((e=>({...e,open:!0,extraParams:{appPid:l.appPid,referrer:window.location.href}})))},variant:"outlined",menu:[(0,N.jsx)(yt.Z.Item,{sx:{textTransform:"none"},onClick:()=>f(!0),size:"small",...t,children:a(b?"storage.spaces.connect.useSpaceGatewayReconnect":"storage.spaces.connect.useSpaceGateway")},"1")],children:(0,N.jsx)(Te.Z,{sx:{fontWeight:"bold",textTransform:"none"},children:a(b?"storage.spaces.connect.useWalletReconnect":"storage.spaces.connect.useWallet")})}),(0,N.jsx)(ln.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:S,onClose:j.onClose,checkTimeout:j.checkTimeout,extraParams:j.extraParams,messages:j.messages,locale:s}),(0,N.jsx)(ln.Z,{forceConnected:!1,saveConnect:!1,prefix:Z.prefix,open:Z.open,popup:!0,action:Z.action,baseUrl:Z.baseUrl,checkFn:Z.checkFn,onSuccess:S,onClose:Z.onClose,checkTimeout:Z.checkTimeout,extraParams:Z.extraParams,messages:Z.messages,locale:s}),(0,N.jsxs)(z.ZP,{title:a("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:h,onClose:()=>f(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(w.Z,{onClick:e=>{e.stopPropagation(),f(!1)},color:"inherit",children:a("common.cancel")}),(0,N.jsxs)(w.Z,{onClick:P,color:"primary",disabled:m||!c,variant:"contained",autoFocus:!0,children:[m&&(0,N.jsx)(E.Z,{size:16}),a("common.confirm")]})]}),children:[(0,N.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,N.jsx)(gt.Z,{component:"div",children:(0,N.jsx)(Te.Z,{component:"div",children:(0,N.jsx)(W.Z,{label:a("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:c,onChange:e=>{g(null),p(e.target.value)},disabled:m,onKeyPress:async e=>{"Enter"===e.key&&await P()},autoFocus:!0})})})}),Boolean(x)&&(0,N.jsx)(Ne.Z,{type:"error",style:{width:"100%"},children:x})]})]})}bt.propTypes={onConnect:a.func},bt.defaultProps={onConnect:()=>{}};const jt=bt;var kt;function Zt(e){var n;let{blockletMeta:t,onEndpointUpdate:i}=e;const l=Mn(),{blocklet:r}=(0,Le.y0)(),{updateSpaceGateway:a,loading:s,hasStorageEndpoint:c}=ft();return(0,o.useEffect)((()=>{null===i||void 0===i||i()}),[r]),s?(0,N.jsx)(Bn.Z,{relative:"parent",children:(0,N.jsx)(E.Z,{})}):(0,N.jsxs)(Ct,{children:[(0,N.jsx)(d.Z,{width:l?"360px":"720px",children:c?(0,N.jsx)(xt,{}):(0,N.jsx)(Hn,{})}),"required"===(null===t||void 0===t||null===(n=t.capabilities)||void 0===n?void 0:n.didSpace)&&(0,N.jsx)(Gn,{mt:8,children:(0,N.jsx)(jt,{onConnect:a})})]})}Zt.propTypes={blockletMeta:s().any.isRequired,onEndpointUpdate:a.func},Zt.defaultProps={onEndpointUpdate:()=>{}};const Ct=(0,r.Z)(Vn.Z)(kt||(kt=(0,l.Z)(["\n height: 100%;\n overflow-y: auto;\n padding-bottom: 32px;\n overflow-x: hidden;\n"]))),Et=Zt;var wt,Rt,St,Tt,Pt,It,Ut;const Nt=e=>e.inStore&&!1===(0,S.isFreeBlocklet)(e),Dt=e=>{var n;return[H.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,H.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(null===e||void 0===e||null===(n=e.capabilities)||void 0===n?void 0:n.didSpace)},Bt=e=>{var n;return(null===e||void 0===e||null===(n=e.configs)||void 0===n||null===(n=n.find((e=>e.key===H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===n?void 0:n.value)||null},Lt=e=>(e.environments||[]).some((e=>e.required)),Ot=(e,n)=>null===e||void 0===e?void 0:e.some((e=>e.required&&!n[e.key])),At=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})},Ft=(0,o.forwardRef)(((e,n)=>{let{meta:t,isMobile:l,onStepChange:r}=e;const{steps:a,activeStep:s,setActiveStepByKey:c,setActiveStepByIndex:d}=(0,Ue.s)(),{t:p,locale:m}=(0,i.PE)(),u=a[s];return(0,o.useEffect)((()=>{r(s)}),[r,s]),(0,o.useImperativeHandle)(n,(()=>({setActiveStepByKey:c,setActiveStepByIndex:d}))),(0,N.jsx)(_t,{component:"div",className:l?"mobileStyle":"",sx:{height:"calc(100% - 56px)"},children:(0,N.jsx)(Ie.Z,{locale:m,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?(0,F.aZ)({did:t.did,baseUrl:t.registryUrl,logoPath:t.logo}):null,stepTip:p("blocklet.component.add"),children:(0,N.jsx)(Vt,{children:null!==u&&void 0!==u&&u.body&&"function"===typeof u.body?u.body():u.body})})})}));Ft.propTypes={meta:s().any,onStepChange:s().func.isRequired,isMobile:s().bool.isRequired},Ft.defaultProps={meta:null};const Mt=function(e){setTimeout((()=>{window.parent.postMessage({event:"component.installed",componentDid:e},"*")}),arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3)};function Gt(e){var n,t,l,r,a,s,c;let{onClose:p,mode:m,stores:u,resourceType:h,resourceDid:f,storageKey:x,inDialog:g,selectedMeta:y}=e;const{t:v,locale:b}=(0,i.PE)(),[j,k]=(0,o.useState)(!1),[Z,R]=(0,o.useState)(null),[P,I]=(0,o.useState)(""),[U,D]=(0,o.useState)(""),{api:B,ws:{useSubscription:L},inService:O,info:M}=(0,A.h6)(),{blocklet:G,actions:{refreshBlocklet:z}}=(0,Le.y0)(),[q,V]=(0,o.useState)(null),[_,K]=(0,o.useState)(!1),J={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[Y,Q]=(0,o.useState)(J),[X,$]=(0,o.useState)(0),ee=(0,o.useRef)({}),ne=(0,o.useRef)({}),te=(0,o.useRef)({}),oe=(0,ge.Z)((e=>e.breakpoints.down("md"))),ie=(0,ve.useParams)(),[re,ae]=(0,o.useState)(!0),{meta:se}=ee.current,ce=M.mode===C.NODE_MODES.SERVERLESS,de=e=>Q((n=>({...n,...e})));(0,o.useEffect)((()=>{if(Y.pathPrefix){const{errMsg:e}=ke({...Y,pathPrefix:Y.pathPrefix,locale:b});I(e)}}),[Y.pathPrefix]),(0,o.useEffect)((()=>{0===X&&Q(J)}),[X]);const pe=()=>{var e;const n=null!==(e=Bt(G))&&void 0!==e?e:"";de({didSpaceEndpoint:n})},me=()=>{var e;return null!==ee&&void 0!==ee&&null!==(e=ee.current)&&void 0!==e&&e.meta?(0,S.getDisplayName)(ee.current):""},ue=e=>{const n=t=>{de({installResultProps:{variant:"error",title:me(),subTitle:e,footer:(0,N.jsx)(w.Z,{className:"bottom-button",disabled:t,"data-cy":"retry-install-component",onClick:async()=>{n(!0),await be(ee.current.installInput)},children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t&&(0,N.jsx)(E.Z,{size:16,style:{marginRight:8}}),v("common.retry")]})})}})};n()},he=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===G||void 0===G||null===(o=G.meta)||void 0===o?void 0:o.did)&&e(n)};L(H.BlockletEvents.statusChange,he((e=>{if(e.status===H.BlockletStatus.upgrading)de({installResultProps:{variant:"success",title:me(),subTitle:v("blocklet.component.installSuccessTip")}}),Mt(ie.componentDid);const n=Bt(G);de((e=>({...e,didSpaceEndpoint:n})))})),[null===G||void 0===G||null===(n=G.meta)||void 0===n?void 0:n.did]),L(H.BlockletEvents.downloadFailed,he((()=>{ue(v("blocklet.component.installComponentError"))})),[null===G||void 0===G||null===(t=G.meta)||void 0===t?void 0:t.did]),L(H.BlockletEvents.installFailed,he((()=>{ue(v("blocklet.component.installComponentError"))})),[null===G||void 0===G||null===(l=G.meta)||void 0===l?void 0:l.did]);const fe=()=>{k(!1),Q({}),ee.current={},p()},ye=e=>((null===G||void 0===G?void 0:G.children)||[]).some((n=>n.meta.did===e)),be=async e=>{var n,t;const{pathPrefix:o,bundleDid:i,title:l,componentName:r="",componentDid:a=""}=Y,{configs:s=[],registryUrl:c,inStore:d,inputUrl:p,dist:m}=(null===(n=ee.current)||void 0===n?void 0:n.meta)||{},u=null===(t=ee.current)||void 0===t?void 0:t.downloadTokenList,h=d?(0,F.Rn)(c,i,m):p;k(!0);const f={rootDid:G.meta.did,url:h,mountPoint:le()(o),title:l,name:r,did:a,onlyRequired:!re,...Y.hasEnvironmentsStep&&s.length>0?{configs:s.map((e=>({...e,value:Y.configsValue[e.key]||""})))}:{},...u?{downloadTokenList:u}:{},...e};try{if(await B.installComponent({input:f}),c){const{teamDid:e,storeList:n}=(0,F.dX)({fromBlocklet:O,nodeInfo:M,blocklet:G}),{isNew:t,decoded:o}=(0,F.bQ)(c,n);t&&await B.addBlockletStore({input:{teamDid:e,url:o}})}de({installResultProps:{}}),z({showError:!1,attachRuntimeInfo:!1})}catch(x){const e=(0,F.Z)(x);T.Z.error(e),console.error("installComponent error: ",x),ue(e)}finally{k(!1),ee.current.installInput=f}},ke=e=>({errMsg:(0,hn.Rw)({params:{...e,did:e.bundleDid},blocklets:[G],blocklet:G,locale:b})}),Ce=async e=>{var n,t;const{errMsg:o}=ke({...Y,locale:b});I(o),X===Ie.length-2&&await be(e),null===(n=ne.current)||void 0===n||null===(t=n.setActiveStepByIndex)||void 0===t||t.call(n,(e=>e+1))},we=()=>{var e,n;null===(e=ne.current)||void 0===e||null===(n=e.setActiveStepByIndex)||void 0===n||n.call(e,(e=>e-1))},Te=e=>{var n,t;let{chooseParams:o=ee.current,componentDid:i,isInit:l=!1}=e;const{meta:r,registryUrl:a,inStore:s,inputUrl:c}=o,{did:d,title:p,name:m}=r,u=((null===(n=G.settings)||void 0===n?void 0:n.children)||[]).filter((e=>"deleted"===e.status&&e.meta.bundleDid===d)),h=i||"",f=null===(t=r.environments)||void 0===t?void 0:t.map((e=>{const{name:n,validation:t,...o}=e;return{...o,key:n,...{validation:Re()(t)?"":t}}}));ee.current={...o,meta:{...r,configs:f,registryUrl:a,inStore:s,inputUrl:c}};let x={};if(l){const e=[G],n=f||[],t=[],o=je()(Ze()([...n,...t]),"key").filter((e=>!!e.key)).sort(((e,n)=>e.required&&!n.required?-1:n.required&&!e.required?1:0)),i=(0,S.getSharedConfigObj)(e[0],{configs:o}),l={},r=o.map((e=>{const{default:n,key:t,...o}=e;return l[t]=i[t]||n,{...o,key:t,hidden:!!H.BLOCKLET_CONFIGURABLE_KEY[t]}}));x={...x,configsList:r,configsValue:l,hasMissRequiredConfigs:Ot(r,l)}}const g=G.children.some((e=>"/"===e.mountPoint)),y=u.find((e=>e.meta.bundleDid===d)),v=G.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;x={...x,pathPrefix:g?"/".concat(le()(p)||le()(m)).toLowerCase():"/",componentName:"",hasEnvironmentsStep:(null===(b=ee.current.meta)||void 0===b||null===(b=b.environments)||void 0===b?void 0:b.length)>0}}const j=Nt(ee.current.meta),k=Dt(ee.current.meta),Z=Bt(G);de({bundleDid:d,componentDid:h,...x,hasRequiredEnvironments:Lt(ee.current.meta),requirePurchase:j,didSpaceIsRequiredSetup:k,didSpaceEndpoint:Z}),l&&j&&(()=>{const{pathPrefix:e,bundleDid:n,title:t,componentName:o="",componentDid:i=""}=Y,{meta:l={}}=ee.current||{},{registryUrl:r,inStore:a,inputUrl:s,dist:c}=l,d=a?(0,F.Rn)(r,n,c):s;V({meta:l,installOpts:{type:"component",rootDid:G.meta.did,mountPoint:e,url:d,title:t,name:o,did:i}})})()};(0,o.useEffect)((()=>{y&&0===X&&(Te({chooseParams:{blocklets:[y],meta:y,registryUrl:y.homepage,inStore:!0},isInit:!0}),de({showFromUrlDialog:!1}),Ce())}),[y,X]);const Ie=[{key:"selectComponent",name:v("blocklet.component.selectComponent"),body:(0,N.jsxs)(qt,{sx:{width:400},component:"div",children:[Y.showFromUrlDialog&&(0,N.jsx)(xn.Z,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:e=>{let{meta:n,inputUrl:t,inStore:o,registryUrl:i}=e;Te({chooseParams:{meta:n,inputUrl:t,inStore:o,registryUrl:i},isInit:!0}),de({showFromUrlDialog:!1}),Ce()},handleText:{title:v("blocklet.component.addComponentTip.fromUrl"),confirm:v("blocklet.component.choose")}}),(0,N.jsx)(jn,{stores:u,extra:ce?null:(0,N.jsxs)(w.Z,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[(0,N.jsx)(xe.Z,{style:{fontSize:20,marginRight:4}})," ",v("blocklet.component.addComponentTip.fromUrl")," "]}),loading:j,onChange:()=>{Q({}),ee.current={}},storageKey:x,children:e=>{let{currentRegistry:n}=e;return(0,N.jsx)(Nn,{serverVersion:null===M||void 0===M?void 0:M.version,style:oe?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:n.url,resourceType:h,resourceDid:f,handleButtonClick:e=>{Te({chooseParams:{...e,inStore:!0},isInit:!0})},handleBlockletRender:e=>{let{blocklet:n,defaultRender:t}=e;const o=(null===Y||void 0===Y?void 0:Y.bundleDid)&&(null===Y||void 0===Y?void 0:Y.bundleDid)===(null===n||void 0===n?void 0:n.did);return(0,N.jsxs)(Kt,{children:[o&&(0,N.jsx)("div",{className:"check-container",children:(0,N.jsx)(Pe.default,{className:"check-icon"})}),(0,N.jsx)("div",{className:o?"choose-blocklet":"",style:{marginLeft:16},children:t})]})}})}})]}),cancel:"embed"===m?void 0:v("common.cancel"),confirm:At({params:Y,blocklet:G,t:v}),onCancel:fe,onConfirm:()=>{Ce()}},{key:"agreement",name:v("launchBlocklet.introduction"),body:(0,N.jsxs)(qt,{component:"div",className:"agreement-wrapper",children:[(0,N.jsx)(Se.Z,{title:v("launchBlocklet.introduction"),subTitle:v("blocklet.component.addComponentTip.introduction")}),(0,N.jsx)(fn.Z,{meta:se,onClickNext:Ce,installRelated:re,onChangeInstallRelated:ae,handleDescEle:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:v("blocklet.component.addComponentTip.".concat(Y.requirePurchase?"isPurchase":"isFree"),{name:me()})}})}),(0,N.jsx)("p",{children:v("blocklet.component.addComponentTip.belowInformation")})]})})]}),cancel:v(y?"common.cancel":"common.pre"),confirm:v("launchBlocklet.next"),onCancel:y?fe:we,onConfirm:()=>{K(!1),Ce()}},se&&Y.requirePurchase&&{key:"purchase",name:(0,N.jsxs)(N.Fragment,{children:[v("common.verifyNFT"),(0,N.jsx)(Ye.Z,{})]}),body:(0,N.jsxs)(qt,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(2===(null===(r=te.current)||void 0===r||null===(a=r.getCurrentStep)||void 0===a?void 0:a.call(r))||_)&&(0,N.jsx)(Ht,{title:v("common.verifyNFT"),subTitle:v("blocklet.component.addComponentTip.verifyNFT")}),Ee()(Y.purchaseResultProps)?q&&(0,N.jsx)(mn,{ref:te,meta:q.meta,mode:Y.componentDid?"verify":"both",onCancel:e=>{K(!1),de({purchaseResultProps:{variant:"error",title:me(),subTitle:e,style:{paddingTop:120},footer:(0,N.jsx)(w.Z,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:v("common.retry")})}})},installOpts:q.installOpts,handlePaySuccess:e=>{let{downloadTokenList:n}=e;ee.current.downloadTokenList=n,K(!1),Ce()}}):(0,N.jsx)("div",{className:"flex-align-center flex-justify-center",children:(0,N.jsx)(Be.Z,{...Y.purchaseResultProps})})]}),disabled:2===(null===(s=te.current)||void 0===s||null===(c=s.getCurrentStep)||void 0===c?void 0:c.call(s))||_,cancel:v("common.pre"),confirm:v("common.next"),onConfirm:()=>{"function"===typeof te.current.onNext&&(te.current.onNext(),K(!0))},onCancel:()=>{we()}},(0,S.hasStartEngine)(se)&&!ye(se.did)&&{key:"config",name:v("common.config"),error:P,body:(0,N.jsxs)(qt,{component:"div",children:[(0,N.jsx)(Ht,{title:v("common.config"),subTitle:v("blocklet.component.addComponentTip.config")}),(0,N.jsx)(W.Z,{label:v("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:U||v("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:Y.pathPrefix,onChange:e=>{const n=e.target.value;de({pathPrefix:n}),D(v("common.slugifyHint",{value:(0,F.LN)(n)}))}}),!!P&&(0,N.jsx)(Ne.Z,{type:"error",style:{width:"100%",marginTop:8},children:P})]}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:we,onConfirm:()=>{Ce()}},se&&!ye(se.did)&&(null===Y||void 0===Y?void 0:Y.hasEnvironmentsStep)&&{key:"environment",name:(0,N.jsxs)(N.Fragment,{children:[v("common.environment")," ",Y.hasRequiredEnvironments&&(0,N.jsx)(Ye.Z,{})]}),disabled:!!Z||(null===Y||void 0===Y?void 0:Y.hasMissRequiredConfigs),body:()=>(0,N.jsxs)(qt,{component:"div",children:[(0,N.jsx)(Ht,{title:v("common.environment"),subTitle:v("blocklet.component.addComponentTip.environment")}),(0,N.jsx)(en,{style:{marginTop:-12,width:"100%"},schema:Y.configsList,defaultValue:Y.configsValue,onChange:(e,n)=>{let{action:t,currentItem:o,allValues:i}=n;"confirm"===t&&de({hasMissRequiredConfigs:Ot(Y.configsList,i),configsValue:i}),"edit"===t?R(o):["cancel","confirm"].includes(t)&&R(null)}})]}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:we,onConfirm:Ce},se&&!ye(se.did)&&(null===Y||void 0===Y?void 0:Y.didSpaceIsRequiredSetup)&&{key:"didSpace",name:(0,N.jsxs)(N.Fragment,{children:[v("blocklet.component.didSpaceConfig")," ","required"===Y.didSpaceIsRequiredSetup&&(0,N.jsx)(Ye.Z,{})]}),disabled:(null===Y||void 0===Y?void 0:Y.didSpaceIsRequiredSetup)&&!Y.didSpaceEndpoint,body:()=>(0,N.jsx)(ht,{children:(0,N.jsxs)(qt,{component:"div",children:[(0,N.jsx)(Ht,{title:v("blocklet.component.didSpaceConfig"),subTitle:v("blocklet.component.didSpaceConfigTip")}),(0,N.jsx)(d.Z,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:(0,N.jsx)(Et,{blockletMeta:ee.current.meta,onNext:()=>{Ce()},onEndpointUpdate:pe})})]})}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:we,onConfirm:Ce},{key:"install",name:ye(null===se||void 0===se?void 0:se.did)?v("common.upgrade"):v("common.install"),disabled:!1,loading:!1,body:(0,N.jsx)(qt,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Ee()(Y.installResultProps)?(0,N.jsx)(De.Z,{message:(0,N.jsx)(Jt,{children:v("blocklet.component.installingCanCloseWindowTip")}),increaseSpeed:.3,messageLoop:!1}):(0,N.jsx)("div",{style:{marginTop:120},children:(0,N.jsx)(Be.Z,{...Y.installResultProps})})}),confirm:v("common.complete"),onConfirm:()=>{Mt(ie.componentDid),fe(),setTimeout((()=>{const e=document.getElementsByClassName("dashboard-main")[0];e&&(e.scrollTop=e.scrollHeight)}),200)}}].filter((e=>e)),Oe=Ie[X]||{};return G?(0,N.jsxs)(zt,{sx:oe?{width:"100%",height:window.innerHeight}:{width:"100%",height:g?"72vh":"100vh"},children:[(0,N.jsx)(Ue.W,{steps:Ie,mode:"memory",children:(0,N.jsx)(Ft,{ref:ne,meta:se,isMobile:oe,onStepChange:e=>{$(e)}})}),(0,N.jsxs)(d.Z,{className:"action-bar",children:[Oe.cancel&&(0,N.jsx)(w.Z,{onClick:e=>{e.stopPropagation(),Oe.onCancel()},disabled:X===Ie.length-2&&j,color:"inherit",children:Oe.cancel||v("common.cancel")}),Oe.confirm&&(0,N.jsx)(w.Z,{onClick:e=>{e.stopPropagation(),Oe.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||("boolean"===typeof Oe.disabled?Oe.disabled:!(!j&&!Oe.error&&Y.bundleDid)||X>1&&!Y.pathPrefix),variant:"contained",autoFocus:!0,title:Oe.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[("boolean"===typeof Oe.loading?Oe.loading:j)&&(0,N.jsx)(E.Z,{style:{marginRight:8},size:16}),Oe.confirm]})})]})]}):null}Gt.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,selectedMeta:s().object},Gt.defaultProps={onClose:()=>{},mode:"normal",stores:[],resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null};const zt=(0,r.Z)(d.Z)(wt||(wt=(0,l.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"]))),qt=(0,r.Z)(Te.Z)(Rt||(Rt=(0,l.Z)(["\n width: 100%;\n height: 100%;\n"]))),Vt=r.Z.div(St||(St=(0,l.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"]))),Wt=e=>e.isMobile?"\n height: calc(100vh - 56px - 64px - 48px);\n ":"",_t=(0,r.Z)(d.Z)(Tt||(Tt=(0,l.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 .ll-container { // \u901a\u8fc7 Launcher Layout \u7ec4\u4ef6\u7ea6\u5b9a\u7684 .ll-container class \u81ea\u5b9a\u4e49 Layout \u6837\u5f0f\n width: 100%;\n height: 100%;\n }\n\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: hidden;\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=>Wt(e)),(e=>Wt(e))),Ht=(0,r.Z)(Se.Z)(Pt||(Pt=(0,l.Z)(["\n margin-bottom: 24px;\n"]))),Kt=r.Z.div(It||(It=(0,l.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)),Jt=r.Z.div(Ut||(Ut=(0,l.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 Yt;function Qt(e){let{blocklet:n,showDialog:t,setShowDialog:o,selectedMeta:l}=e;const{t:r}=(0,i.PE)(),a=(0,ge.Z)((e=>e.breakpoints.down("md"))),{inService:s}=(0,A.h6)(),c=()=>{o(!1)};return t?(0,N.jsx)(Xt,{title:r("blocklet.component.addWithName",{name:(0,S.getDisplayName)(n)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:a?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(e,n)=>{"backdropClick"!==n&&c()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:(0,N.jsx)(Gt,{selectedMeta:l,onClose:c,storageKey:s?ye.K_:ye.WC})}):null}Qt.propTypes={selectedMeta:s().object,showDialog:s().bool.isRequired,setShowDialog:s().func.isRequired,blocklet:s().object.isRequired},Qt.defaultProps={selectedMeta:null};const Xt=(0,r.Z)(z.ZP)(Yt||(Yt=(0,l.Z)(["\n .MuiDialogContent-root {\n }\n"])));function $t(e){let{blocklet:n,children:t}=e;const{t:l}=(0,i.PE)(),[r,a]=(0,o.useState)(!1),s=e=>{e.stopPropagation(),a(!0)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof t?t({open:s}):(0,N.jsxs)(fe.Z,{onClick:s,className:"component-action","data-cy":"action-add-component",children:[(0,N.jsx)(xe.Z,{style:{fontSize:18,marginRight:5}}),l("blocklet.component.add")]}),(0,N.jsx)(Qt,{showDialog:r,setShowDialog:a,blocklet:n})]})}$t.propTypes={children:s().any,blocklet:s().object.isRequired},$t.defaultProps={children:null};var eo=t(70461);const no=e=>e.children.filter((e=>e.meta.interfaces.find((e=>e.type===H.BLOCKLET_INTERFACE_TYPE_WEB))));function to(e){let{params:n,setParams:t,setError:l,serviceTypes:r}=e;const{t:a}=(0,i.PE)(),{blocklet:s}=(0,Le.y0)(),c=s.meta.did,d=no(s),[p,m]=(0,o.useState)([]),u={301:a("common.redirectPermanently"),302:a("common.redirectTemporary"),307:a("common.redirectTemporary"),308:a("common.redirectPermanently")};return(0,o.useEffect)((()=>{if(n.type===C.ROUTING_RULE_TYPES.COMPONENT&&n.componentId){const e=d.find((e=>e.meta.did===n.componentId)),o=(0,S.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"}),m(i),n.pageGroup&&!1===i.find((e=>e.value===n.pageGroup))&&t({...n,pageGroups:""})}}),[n.componentId,n.type]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(W.Z,{select:!0,label:a("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:n.type,onChange:e=>{l(""),t({...n,type:e.target.value,did:e.target.value===C.ROUTING_RULE_TYPES.BLOCKLET?c:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:r.map((e=>{let{name:n,value:t}=e;return(0,N.jsx)(fe.Z,{value:t,children:n},t)}))}),n.type===C.ROUTING_RULE_TYPES.REDIRECT&&[(0,N.jsx)(W.Z,{select:!0,label:a("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(u).map((e=>(0,N.jsx)(fe.Z,{value:e,children:"".concat(u[e]," - ").concat(e)},e)))},"redirectCode"),(0,N.jsx)(W.Z,{label:a("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:n.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:e=>{t({...n,url:e.target.value,__disableConfirm:!e.target.value.trim()}),e.target.value.trim()?l(""):l(a("router.validation.redirectUrlRequired"))}},"redirectUrl")],n.type===C.ROUTING_RULE_TYPES.COMPONENT&&[(0,N.jsx)(W.Z,{select:!0,label:a("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,N.jsx)(fe.Z,{value:e.meta.did,selected:e.meta.did===n.componentId,children:(0,S.getDisplayName)(e,!0)},e.meta.did)))},"componentId"),p.length?(0,N.jsx)(W.Z,{select:!0,label:a("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:n.pageGroup,helperText:a("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:e=>{t({...n,pageGroup:e.target.value})},SelectProps:{},children:p.map((e=>(0,N.jsx)(fe.Z,{value:e.value,selected:e.value===n.pageGroup,children:e.label},e.label)))},"pageGroup"):null].filter(Boolean),n.type===C.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,N.jsx)(W.Z,{label:a("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:n.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:e=>{const o=e.target.value.trim();t({...n,url:e.target.value,__disableConfirm:!o}),l(o?"":a("router.validation.rewriteUrlRequired"))}},"url"),n.type===C.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[(0,N.jsx)(W.Z,{select:!0,label:a("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:n.responseType,onChange:e=>t({...n,responseType:e.target.value}),style:{marginBottom:32},SelectProps:{},children:C.ROUTING_RESPONSE_TYPES.map((e=>(0,N.jsx)(fe.Z,{value:e.value,children:e.text},e.value)))},"responseType"),(0,N.jsx)(W.Z,{label:a("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:n.responseBody,helperText:a("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:e=>{const o=e.target.value.trim();t({...n,responseBody:e.target.value,__disableConfirm:!o}),l(o?"":a("router.rule.add.responseBodyRequired"))}},"response-body")]]})}function oo(e){let{children:n}=e;const{t:t}=(0,i.PE)(),{api:l}=(0,A.h6)(),{blocklet:r}=(0,Le.y0)(),[a,s]=(0,o.useState)(!1),[c,d]=(0,o.useState)(null),p=r.meta.did,m=r.site.id,u={title:t("router.rule.add.title"),description:(e,n,o)=>(0,N.jsxs)(Te.Z,{component:"div",children:[(0,N.jsx)(W.Z,{label:t("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"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 l=!1;const a=(0,hn.Rw)({params:{...e,pathPrefix:i.target.value},blocklets:[r]});o(a),e.type===C.ROUTING_RULE_TYPES.BLOCKLET&&a&&(l=!0),e.type!==C.ROUTING_RULE_TYPES.REDIRECT||e.url||(l=!0),e.type!==C.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(l=!0),e.type!==C.ROUTING_RULE_TYPES.DIRECT_RESPONSE||e.responseType&&e.responseBody||(l=!0),i.target.value.trim()||(l=!0,o(t("router.validation.pathPrefixRequired"))),l||o("");const s=t("common.slugifyHint",{value:(0,F.LN)(i.target.value)});n({...e,pathPrefix:i.target.value,pathPrefixHint:s,__disableConfirm:l})}}),(0,N.jsx)(to,{params:e,setParams:e=>{o(null);(0,hn.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:C.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:async e=>{try{const n=await(0,hn.fX)(e,t);if(n)throw n;s(!0);const o={from:{pathPrefix:le()(e.pathPrefix)},to:{type:e.type}};e.type===C.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=e.url.trim(),o.to.redirectCode=e.redirectCode),e.type===C.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=p,o.to.componentId=e.componentId,o.to.pageGroup=e.pageGroup),e.type===C.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=le()(e.url)),e.type===C.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(o.to.response={status:200,contentType:e.responseType,body:e.responseBody}),await l.addRoutingRule({input:{id:m,rule:o,teamDid:p}})}catch(n){T.Z.error(n.message)}finally{s(!1),d(null)}},onCancel:()=>{s(!1),d(null)}},h=e=>{e.stopPropagation(),d(u)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof n?n({loading:a,open:h}):(0,N.jsxs)(fe.Z,{onClick:h,className:"rule-action","data-cy":"action-add-rule",children:[a?(0,N.jsx)(E.Z,{size:16}):(0,N.jsx)(xe.Z,{style:{fontSize:18,marginRight:5}}),t("router.rule.add.title")]}),c&&(0,N.jsx)(eo.Z,{title:c.title,description:c.description,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel,color:"primary"})]})}to.propTypes={params:s().object,serviceTypes:s().array,setParams:s().func,setError:s().func},to.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:C.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:C.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:C.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:C.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:C.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}},oo.propTypes={children:s().any},oo.defaultProps={children:null};var io=t(82434),lo=t.n(io),ro=t(3257),ao=t.n(ro),so=t(62681),co=t(18067);const po=(0,t(57471).Z)((0,N.jsx)("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");var mo=t(74286),uo=t(27773),ho=t(94552),fo=t(71363);function xo(e){let{id:n,from:t,children:l}=e;const{t:r}=(0,i.PE)(),{api:a}=(0,A.h6)(),{blocklet:s}=(0,Le.y0)(),[c,d]=(0,o.useState)(!1),[p,m]=(0,o.useState)(null),u=s.meta.did,h=s.site.id,f=t.pathPrefix,x={keyName:f,title:r("router.rule.delete.title"),description:r("router.rule.delete.description",{name:"<b>".concat(f,"</b>")}),confirmPlaceholder:r("router.rule.delete.confirm_desc",{name:f}),confirm:r("common.delConfirm"),cancel:r("router.rule.delete.cancel"),onConfirm:async()=>{d(!0);try{await a.deleteRoutingRule({input:{id:h,ruleId:n,teamDid:u}})}catch(e){T.Z.error(e.message)}finally{m(null),d(!1)}},onCancel:()=>{d(!1),m(null)}},g=e=>{e.stopPropagation(),m(x)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof l?l({loading:c,open:g}):(0,N.jsxs)(fe.Z,{onClick:g,className:"rule-action","data-cy":"action-delete-rule",children:[c?(0,N.jsx)(E.Z,{size:16}):(0,N.jsx)(uo.default,{style:{fontSize:18,marginRight:5}}),r("router.rule.delete.title")]}),p&&(0,N.jsx)(fo.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 go(e){var n,t;let{id:l,from:r,to:a,children:s}=e;const{t:c}=(0,i.PE)(),{api:d}=(0,A.h6)(),{blocklet:p}=(0,Le.y0)(),[m,u]=(0,o.useState)(!1),[h,f]=(0,o.useState)(null),x=p.meta.did,g=p.site.id,y=r.pathPrefix,v={title:c("router.rule.update.title"),description:(e,n,t)=>(0,N.jsxs)(Te.Z,{component:"div",children:[(0,N.jsx)(W.Z,{label:c("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:e.helperText||c("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:o=>{let i=!1;e.type!==C.ROUTING_RULE_TYPES.REDIRECT||e.url||(i=!0),e.type!==C.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(i=!0),e.type!==C.ROUTING_RULE_TYPES.DIRECT_RESPONSE||e.responseType&&e.responseBody||(i=!0),o.target.value.trim()||(i=!0,t(c("router.validation.pathPrefixRequired"))),i||t("");const l=c("common.slugifyHint",{value:(0,F.LN)(o.target.value)});n({...e,pathPrefix:o.target.value,helperText:l,__disableConfirm:i})}}),(0,N.jsx)(to,{params:e,setParams:e=>{(0,hn.fX)(e,c)?n({...e,__disableConfirm:!0}):n({...e})},setError:t})]}),confirm:c("router.rule.update.confirm"),cancel:c("router.rule.update.cancel"),color:"primary",params:{did:a.did||"",pathPrefix:"/"===y?y:y.replace(/^\/+/,"").replace(/\/+$/,""),type:a.type||C.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:a.redirectCode||302,componentId:a.componentId||"",pageGroup:a.pageGroup||"",url:a.url||"",responseType:(null===(n=a.response)||void 0===n?void 0:n.contentType)||"",responseBody:((null===(t=a.response)||void 0===t?void 0:t.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:async e=>{try{const n=await(0,hn.fX)(e,c);if(n)throw n;u(!0);const t={id:l,from:{pathPrefix:le()(e.pathPrefix)},to:{type:e.type}};e.type===C.ROUTING_RULE_TYPES.REDIRECT&&(t.to.url=e.url,t.to.redirectCode=e.redirectCode),e.type===C.ROUTING_RULE_TYPES.COMPONENT&&(t.to.did=x,t.to.componentId=e.componentId,t.to.pageGroup=e.pageGroup),e.type===C.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(t.to.url=le()(e.url)),e.type===C.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(t.to.response={status:200,contentType:e.responseType,body:e.responseBody}),await d.updateRoutingRule({input:{id:g,rule:t,teamDid:x}})}catch(n){T.Z.error(n.message)}finally{u(!1),f(null)}},onCancel:()=>{u(!1),f(null)}},b=e=>{e.stopPropagation(),f(v)};return(0,N.jsxs)(N.Fragment,{children:["function"===typeof s?s({loading:m,open:b}):(0,N.jsxs)(fe.Z,{onClick:b,className:"rule-action","data-cy":"action-update-rule",children:[m?(0,N.jsx)(E.Z,{size:16}):(0,N.jsx)(G.default,{style:{fontSize:18,marginRight:5}}),c("router.rule.update.title")]}),h&&(0,N.jsx)(eo.Z,{title:h.title,description:h.description,confirm:h.confirm,color:h.color,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}function yo(e){const{locale:n}=(0,i.PE)(),{blocklet:t,recommendedDomain:o}=(0,Le.y0)(),l=(0,F.Sk)(o,e.from.pathPrefix,(0,F.f0)(t,n));return(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)("a",{target:"_blank",href:l,rel:"noopener noreferrer",title:l,children:(0,N.jsx)(f.Z,{size:"small",children:(0,N.jsx)(ho.Z,{})})}),(0,N.jsx)(go,{...e,children:n=>{let{open:t}=n;return(0,N.jsx)(f.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-update-rule",children:(0,N.jsx)(g.Z,{})})}}),(0,N.jsx)(xo,{...e,children:n=>{let{open:t}=n;return(0,N.jsx)(f.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-delete-rule",children:(0,N.jsx)(uo.default,{})})}})]})}xo.propTypes={id:s().string.isRequired,from:s().object.isRequired,children:s().any},xo.defaultProps={children:null},go.propTypes={id:s().string.isRequired,from:s().object.isRequired,to:s().object.isRequired,children:s().any},go.defaultProps={children:null},yo.propTypes={isProtected:s().bool},yo.defaultProps={isProtected:!1};var vo=t(22228);function bo(e){let{group:n,...t}=e;return n?(0,N.jsx)(vo.Z,{type:"reverse",...t,children:n}):null}function jo(e){let{domain:n,isHttps:t,toUrl:o}=e;const i=t?"https":"http";let l=o;return lo()(l)||(l="".concat(i,"://").concat(n).concat(o)),(0,N.jsx)(Cn.Z,{href:l,target:"_blank",style:{fontSize:14},underline:"hover",children:o},l)}function ko(e){let{hasPermission:n}=e;const{t:t,locale:o}=(0,i.PE)(),l=(0,Fn.Z)(),{blocklet:r,recommendedDomain:a}=(0,Le.y0)();return r.site.rules.filter((e=>e.to.type!==C.ROUTING_RULE_TYPES.BLOCKLET)).map((e=>{var i;let s=null,c=null;e.to.type===C.ROUTING_RULE_TYPES.NONE?s="404":e.to.type===C.ROUTING_RULE_TYPES.REDIRECT?s=e.to.redirectCode:e.to.type===C.ROUTING_RULE_TYPES.GENERAL_REWRITE?s="R":e.to.type===C.ROUTING_RULE_TYPES.DIRECT_RESPONSE?s=(0,N.jsx)(po,{sx:{color:"text.secondary",fontSize:"45px"}}):e.to.type===C.ROUTING_RULE_TYPES.COMPONENT&&(c=r.children.find((n=>n.meta.did===e.to.componentId)),s="C");const p=e.isProtected?(0,N.jsx)(v.Z,{title:t("blocklet.router.urlLockTooltip"),placement:"top",children:(0,N.jsx)("span",{children:(0,N.jsx)(f.Z,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:(0,N.jsx)(co.Z,{style:{fill:l.palette.text.disabled}})})})}):(0,N.jsx)(yo,{...e});return[(0,N.jsxs)(d.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,N.jsxs)(d.Z,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,N.jsx)(d.Z,{className:"component-item__indent",width:28}),"object"===typeof s?s:(0,N.jsx)(so.Z,{children:s}),(0,N.jsxs)(d.Z,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[(0,N.jsxs)(d.Z,{style:{color:"#222",fontSize:16},children:[e.to.type===C.ROUTING_RULE_TYPES.NONE&&t("common.page404"),e.to.type===C.ROUTING_RULE_TYPES.REDIRECT&&t("common.redirect"),e.to.type===C.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t("common.rewrite"),e.to.type===C.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(null===(i=C.ROUTING_RESPONSE_TYPES.find((n=>n.value===e.to.response.contentType)))||void 0===i?void 0:i.text),e.to.type===C.ROUTING_RULE_TYPES.COMPONENT&&(0,S.getDisplayName)(c,!0)]}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[e.to.type===C.ROUTING_RULE_TYPES.REDIRECT&&(0,N.jsx)(jo,{domain:a,toUrl:e.to.url}),e.to.type===C.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,N.jsx)(jo,{domain:a,toUrl:e.to.url}),e.to.type===C.ROUTING_RULE_TYPES.COMPONENT&&(0,N.jsx)(bo,{group:e.to.pageGroup})]})]})]}),(0,N.jsx)(d.Z,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,N.jsx)(Cn.Z,{href:(0,F.Sk)(a,e.from.pathPrefix,(0,F.f0)(r,o)),target:"_blank",style:{fontSize:16},underline:"hover",children:ao()(e.from.pathPrefix,"/")||"/"})},e.from.pathPrefix),(0,N.jsx)(d.Z,{children:n&&(0,N.jsx)("div",{style:{textAlign:"right"},children:p})},"actions")]},"rule"),(0,N.jsx)(mo.Z,{},"divider")]}))}bo.propTypes={group:s().string.isRequired},jo.propTypes={domain:s().string.isRequired,toUrl:s().string.isRequired,isHttps:s().bool},jo.defaultProps={isHttps:!1},ko.propTypes={hasPermission:s().bool},ko.defaultProps={hasPermission:!1};const Zo=(0,M.V)(ko,"mutate_blocklets"),Co=(0,M.V)(ko,"",F.Wf);function Eo(e){const{inService:n}=(0,A.h6)();return n?(0,N.jsx)(Co,{...e}):(0,N.jsx)(Zo,{...e})}var wo=t(44125);const Ro=function(){let{blocklet:e,scrollToComponent:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{blocklet:null,scrollToComponent:!1};const t=(0,ve.useNavigate)(),{t:l}=(0,i.PE)(),r=(0,o.useRef)(null),a=(0,o.useMemo)((()=>{if(!e||!e.optionalComponents)return null;const o=new URLSearchParams(window.location.search),i=o.get("install-component");if(i){r.current=i,o.delete("install-component"),t(o.toString());const a=e.optionalComponents.find((e=>e.meta.did===i));if(!a)return T.Z.success(l("notification.installComponentError",{did:i})),null;const{meta:s}=a;if(n){const e=document.getElementById("optional-component-".concat(i)),n=document.querySelector(".dashboard-main");if(e){const t=e.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTo({top:t.top-o.top+n.scrollTop,behavior:"smooth"})}}return s}return null}),[e,t,l,n]);return(0,o.useEffect)((()=>{var n;r.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},null===(n=window.blocklet)||void 0===n?void 0:n.appUrl)}),[e]),a};var So=t(83407),To=t(34966),Po=t(32207),Io=t(35258),Uo=t(55498),No=t(64886),Do=t(57156),Bo=t.n(Do),Lo=t(2078),Oo=t.n(Lo),Ao=t(19778);function Fo(e){var n;let{sourceInfo:t,blocklet:l}=e;const{t:r}=(0,o.useContext)(i.RD);return(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)(Ao.Z,{type:"success",children:Oo()(t.source)},"source"),"registry"===t.source&&(0,N.jsx)(Cn.Z,{href:on()(t.deployedFrom,"blocklets",(null===l||void 0===l||null===(n=l.meta)||void 0===n?void 0:n.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:r("blocklet.overview.viewInStore")})]})}Fo.propTypes={sourceInfo:s().shape({source:s().string,deployedFrom:s().string}),blocklet:s().object},Fo.defaultProps={sourceInfo:{},blocklet:{}};var Mo=t(81010),Go=t(40736);function zo(e){let{blocklet:n,checkUpgrade:t,hasPermission:l,...r}=e;const{api:a}=(0,A.h6)(),{t:s}=(0,o.useContext)(i.RD),[c,d]=(0,o.useState)(!1),[p,m]=(0,o.useState)(""),[u,h]=(0,o.useState)(null),[x,g]=(0,o.useState)(null);(0,o.useEffect)((()=>{h(null),t&&(n.mode,H.BLOCKLET_MODES.DEVELOPMENT)}),[n,t]);const y={title:"".concat(s("common.upgrade")," ").concat(s("common.blocklet")," ").concat((0,S.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:u.version,storeUrl:u.registryUrl||""};await(0,F._v)(2e3),await a.upgradeBlocklet({input:e})}catch(e){T.Z.error("Blocklet upgrade failed: ".concat((0,F.Z)(e)))}finally{d(!1),g(null)}},onCancel:()=>{d(!1),g(null)}};return l&&u&&!(0,S.isInProgress)(n.status)?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(vo.Z,{...r,children:n.meta.version}),(0,N.jsx)(v.Z,{title:s("common.updateAvailable",{version:u.version}),children:(0,N.jsx)(f.Z,{size:"small",style:{marginLeft:8},disabled:c,onClick:()=>g(y),children:c?(0,N.jsx)(E.Z,{size:16}):(0,N.jsx)(Go.Z,{style:{fontSize:16,color:"red"}})})}),!!p&&(0,N.jsx)(T.Z,{variant:"error",message:p,onClose:()=>m("")}),x&&(0,N.jsx)(eo.Z,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]}):(0,N.jsx)(vo.Z,{...r,children:n.meta.version})}zo.propTypes={blocklet:s().object.isRequired,checkUpgrade:s().bool,hasPermission:s().bool},zo.defaultProps={checkUpgrade:!1,hasPermission:!1};const qo=(0,M.V)(zo,"mutate_blocklets"),Vo=(0,M.V)(zo,"",F.Wf);function Wo(e){const{inService:n}=(0,A.h6)();return n?(0,N.jsx)(Vo,{...e}):(0,N.jsx)(qo,{...e})}var _o,Ho=t(80378),Ko=t(32349),Jo=t(65140),Yo=t(87916);function Qo(e){let{component:n,remove:t,disabled:l,tip:r,showConfirm:a,hideBtn:s,onCancel:c}=e;const{t:d}=(0,o.useContext)(i.RD),[p,m]=(0,o.useState)(!1),[u,h]=(0,o.useState)(null),f=async e=>{m(!0),await t(e.component,e.removeType),m(!1),h(null)},x=l||p,g=()=>{h({title:"".concat(d("common.delete")," ").concat(n.meta.title||n.meta.name),description:(e,n)=>(0,N.jsxs)(Te.Z,{component:"div",children:[(0,N.jsx)(Te.Z,{gutterBottom:!0,children:d("blocklet.action.removeComponentDescription")}),(0,N.jsxs)(Yo.Z,{name:"removeType",value:e.removeType,onChange:t=>n({...e,removeType:t.target.value}),children:[(0,N.jsx)(k.Z,{value:"keepData",control:(0,N.jsx)(Jo.Z,{}),label:d("blocklet.action.removeComponentKeepData")}),(0,N.jsx)(k.Z,{value:"complete",control:(0,N.jsx)(Jo.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)((()=>{a?g():(m(!1),h(null))}),[a]);const y=(0,N.jsx)(Xo,{size:"small",disabled:x,onClick:()=>g,"data-cy":"delete-component-btn",children:(0,N.jsx)(uo.default,{disabled:x})}),b=(0,N.jsx)(v.Z,{title:r||d("common.delete"),children:(0,N.jsx)("span",{children:y})});return(0,N.jsxs)(N.Fragment,{children:[!s&&b,u&&(0,N.jsx)(eo.Z,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}Qo.propTypes={component:s().object.isRequired,remove:s().func,onCancel:s().func,disabled:s().bool,showConfirm:s().bool,hideBtn:s().bool,tip:s().string},Qo.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const Xo=(0,r.Z)(f.Z)(_o||(_o=(0,l.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"])));var $o,ei=t(22754),ni=t(98451);function ti(e){let{component:n,onStart:t,onStop:l,disabled:r,tip:a}=e;const{t:s}=(0,o.useContext)(i.RD),[c,d]=(0,o.useState)(!1),[p,m]=(0,o.useState)(),u=r||c,h=["starting","running","stopping"].includes(n.status),f=h?ni.Z:ei.Z,x=(0,N.jsx)(oi,{disabled:u,onClick:()=>{var e;h?m({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:()=>(m(null),(async()=>{d(!0);try{await l(n)}catch(e){T.Z.error(e.message)}d(!1)})()),onCancel:()=>m(null)}):(async()=>{d(!0);try{await t(n)}catch(e){T.Z.error(e.message)}d(!1)})()},"data-cy":"".concat(h?"stop":"start","-component-btn"),children:(0,N.jsx)(f,{disabled:u})});return[(0,N.jsx)(v.Z,{title:a||s("common.".concat(h?"stop":"start")),children:(0,N.jsx)("span",{children:x})},"btn"),p&&(0,N.jsx)(eo.Z,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel},"connect")]}ti.propTypes={component:s().object.isRequired,onStart:s().func,onStop:s().func,disabled:s().bool,tip:s().string},ti.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const oi=(0,r.Z)(f.Z)($o||($o=(0,l.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"])));var ii,li,ri=t(92726);const ai=(e,n)=>e?[{name:n("common.name"),value:e.displayName},{name:n("common.description"),value:e.description},{name:n("common.version"),value:(0,N.jsx)(vo.Z,{children:e.version})}]:[],si=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}},ci=(e,n)=>{const t=e.split("/").slice(1);let o=n,i=0;const l=[];for(;o&&i<t.length;){const e=o.children.find((e=>e.meta.did===t[i]));o=e,i++,e&&l.push(e.meta.title)}return l.join(" / ")},di=e=>{var n;return"pack"===(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.group)};function pi(e){var n,t,l,r,a;let{blocklet:s,ancestors:u,depth:h,onRemove:x,onStart:y,onStop:b,onRestart:j,onReload:k,getComponentUrl:Z,app:C}=e;const{t:E,locale:w}=(0,o.useContext)(i.RD),[R,T]=(0,o.useState)(),[I,U]=(0,o.useState)(!1),[D,B]=(0,o.useState)(!1),[L,O]=(0,o.useState)(null),{deletingBlocklets:A}=(0,P.K)();let{status:M}=s;1===h&&A.includes(s.meta.did)&&(M="deleting");const G="/".concat(s.mountPoint||"/").replace(/\/+/g,"/"),z=Z(G),q=R?si(R):{},V=R?[{name:E("common.name"),value:(0,S.getDisplayName)(R,!0)},{name:E("common.version"),value:(0,N.jsx)(Wo,{blocklet:R,checkUpgrade:!1})},{name:E("common.status"),value:(0,N.jsx)(Mo.Z,{status:M,source:R.source,progress:s.progress})},"running"===s.status?{name:E("blocklet.startedAt"),value:(0,F.B2)(s.startedAt,w)}:null,"running"!==s.status?{name:E("blocklet.stoppedAt"),value:(0,F.B2)(s.stoppedAt,w)}:null,s.installedAt?{name:E("blocklet.installedAt"),value:(0,F.B2)(s.installedAt,w)}:null,(0,S.hasStartEngine)(s.meta)?{name:E("common.mountPoint"),value:G}:null,R.meta.group?{name:E("common.group"),value:(0,N.jsx)(vo.Z,{type:"success",children:R.meta.group})}:null,{name:E("blocklet.overview.source"),value:(0,N.jsx)(Fo,{sourceInfo:q,blocklet:s})},{name:E("blocklet.overview.deployedFrom"),value:q.deployedFrom||"-"},{name:E("common.did"),value:(0,N.jsx)(Qn.Z,{did:R.meta.did,showQrcode:!0})},{name:E("common.author"),value:(0,F.rq)(R.meta.author)},{name:E("common.engine"),value:ai(R.engine,E).map((e=>{let{name:n,value:t}=e;return(0,N.jsx)(No.Z,{style:{marginBottom:4},nameWidth:120,name:n,children:t},n)}))},null!==(n=s.dependents)&&void 0!==n&&n.length?{name:E("common.dependents"),value:(0,N.jsx)(d.Z,{children:s.dependents.map((e=>(0,N.jsx)(d.Z,{children:"".concat(ci(e.id,C)," ").concat(e.required?"(".concat(E("common.required"),")"):"")},e.id)))})}:null,null!==(t=s.meta.resources)&&void 0!==t&&t.length?{name:E("common.resource"),value:s.meta.resources.join(", ")}:null].filter(Boolean):[],W=(0,S.isInProgress)(C.status),_=(0,S.isInProgress)(s.status);let H="";if(W||_||1===h&&A.includes(s.meta.did))H=E("blocklet.component.tip.stopBlocklet");else if(null!==(l=s.dependents)&&void 0!==l&&l.length){const e=s.dependents.filter((e=>e.required));if(e.length){const n=e.map((e=>ci(e.id,C)));H=E("blocklet.component.tip.requiredBy",{name:n.join(", ")})}}return[(0,N.jsxs)(ui,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[(0,N.jsxs)(d.Z,{pl:2,width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,N.jsx)(Ho.Z,{blocklet:s,ancestors:u}),(0,N.jsxs)(d.Z,{ml:"16px",children:[(0,N.jsxs)(d.Z,{className:"component-header",onClick:()=>T(s),children:[(0,N.jsx)(d.Z,{className:"component-name",children:(0,S.getDisplayName)(s,!0)}),(0,N.jsx)(d.Z,{className:"component-version",children:null===s||void 0===s||null===(r=s.meta)||void 0===r?void 0:r.version})]}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:["unknown"!==M&&(0,N.jsx)(Mo.Z,{style:{marginLeft:4},status:M,source:s.source,progress:s.progress}),(0,N.jsx)(Ko.Z,{style:{marginLeft:4},mode:s.mode||""}),!(null===(a=s.dependents)||void 0===a||!a.length)&&(0,N.jsx)(v.Z,{title:["".concat(E("common.dependents"),": "),s.dependents.map((e=>(0,N.jsx)(d.Z,{pl:1,children:"".concat(ci(e.id,C)," ").concat(e.required?"(".concat(E("common.required"),")"):"")},e.id)))],children:(0,N.jsx)(d.Z,{display:"flex",color:"primary.main",ml:1,children:(0,N.jsx)(Uo.JO,{icon:"octicon:package-dependents-16"})})})]})]})]},s),(0,S.hasStartEngine)(s.meta)&&(0,N.jsx)(d.Z,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,N.jsx)("a",{target:"_blank",href:z,rel:"noopener noreferrer",title:z,children:(0,N.jsx)(d.Z,{maxWidth:400,sx:{color:"secondary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:Bo()(G)})})},G),(0,N.jsx)("div",{style:{flex:1}}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,S.hasStartEngine)(s.meta)&&(0,N.jsx)(v.Z,{title:E("common.visit"),children:(0,N.jsx)("a",{target:"_blank",href:z,rel:"noopener noreferrer",children:(0,N.jsx)(f.Z,{size:"small",children:(0,N.jsx)(ho.Z,{})})})}),(0,N.jsx)(ue,{blocklet:s,ancestors:u,children:e=>{let{open:n}=e;return(0,N.jsx)(v.Z,{title:E("common.config"),children:(0,N.jsx)(mi,{color:"error",badgeContent:"",variant:"dot",invisible:!(0,S.getComponentMissingConfigs)(s,u[0]).length,children:(0,N.jsx)(f.Z,{onClick:n,size:"small",children:(0,N.jsx)(g.Z,{})})})},"config")}}),(0,N.jsx)(ti,{blocklet:C,component:s,onStart:y,onStop:b,disabled:!["starting","stopping"].includes(C.status)&&(0,S.isInProgress)(C.status)}),(0,N.jsx)(ri.Z,{"data-cy":"component-actions",actions:[(0,S.hasStartEngine)(s.meta)?{icon:(0,N.jsx)(To.Z,{}),text:E("common.detail"),onClick:()=>{T(s)}}:null,!di(s)&&{icon:(0,N.jsx)(Po.default,{}),text:E("common.restart"),onClick:()=>{O({title:"".concat(E("common.restart")," ").concat(s.meta.title),description:E("blocklet.action.restartDescription"),confirm:E("blocklet.action.confirmRestart"),cancel:E("common.cancel"),onConfirm:async()=>{B(!0),await j(s),B(!1)},onCancel:()=>O(null)})},disabled:W||_||"running"!==s.status},!di(s)&&{icon:(0,N.jsx)(Io.Z,{}),text:E("common.reload"),onClick:async()=>{B(!0),await k(s),B(!1)},disabled:D||W||_||"running"!==s.status},{icon:(0,N.jsx)(uo.default,{}),text:E("common.delete"),onClick:()=>{U(!0)},disabled:W||_||!!H,tip:H}].filter(Boolean)})]},"actions")]},"group-not-gateway-box"),(0,N.jsx)(mo.Z,{},"line"),!!R&&(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{T(null)},children:(0,N.jsxs)(d.Z,{paddingY:1.5,children:[(0,N.jsx)(m.Z,{children:E("common.componentBasicInfo")}),(0,N.jsx)(p.Z,{children:(K=V,K.map((e=>e.name===E("common.did")||e.name===E("blocklet.appId")?(0,N.jsx)(No.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>e.name,children:e.value},e.name):(0,N.jsx)(No.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name))))})]},"dialog-wrapper")},"base-info-dialog"),(0,N.jsx)(Qo,{blocklet:C,component:s,remove:async function(){B(!0);try{await x(...arguments)}catch{}B(!1),U(!1)},onCancel:()=>U(!1),hideBtn:!0,showConfirm:I},"delete-component"),L&&(0,N.jsx)(eo.Z,{title:L.title,description:L.description,confirm:L.confirm,cancel:L.cancel,params:L.params,onConfirm:L.onConfirm,onCancel:L.onCancel},"confirm-setting")];var K}pi.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},pi.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},onReload:()=>{},getComponentUrl:()=>window.location.origin,app:null};const mi=(0,r.Z)(So.Z)(ii||(ii=(0,l.Z)(["\n .BaseBadge-badge {\n top: ","px;\n right: ","px;\n }\n"])),(e=>8*e.top||6),(e=>8*e.right||6)),ui=(0,r.Z)(d.Z)(li||(li=(0,l.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"])));var hi,fi=t(56556);function xi(e){let{meta:n,dependencies:t,logoUrl:o,setInstallComponentMeta:l}=e;const r=(0,A.h6)(),{t:a}=(0,i.PE)();return(0,N.jsxs)(gi,{id:"optional-component-".concat(n.did),children:[(0,N.jsxs)("div",{className:"cell",children:[(0,N.jsxs)("div",{className:"component-left",children:[(0,N.jsx)("img",{className:"component-logo",src:o,onError:()=>"".concat(r.imgPrefix,"/blocklet.png"),alt:n.title,style:{width:40,height:40}}),(0,N.jsxs)("div",{className:"component-header",children:[(0,N.jsx)("div",{className:"component-name",children:n.title}),(0,N.jsx)("div",{className:"component-version",children:n.version})]}),(0,N.jsx)(v.Z,{title:["".concat(a("common.dependents"),": "),t.map((e=>(0,N.jsx)(d.Z,{pl:1,children:"".concat(e.parentTitle," ").concat(e.required?"(".concat(a("common.required"),")"):"")},e.parentName+e.mount_point)))],children:(0,N.jsx)(d.Z,{display:"flex",color:"primary.main",ml:1,children:(0,N.jsx)(Uo.JO,{icon:"octicon:package-dependents-16"})})})]}),(0,N.jsx)("div",{style:{flex:1}}),(0,N.jsx)(fi.Z,{onClick:()=>{l(n)},startIcon:(0,N.jsx)(Uo.JO,{icon:"ph:download-simple-bold"}),children:a("common.install")})]}),(0,N.jsx)(mo.Z,{class:"line"},"line")]})}xi.propTypes={meta:s().object.isRequired,logoUrl:s().string,setInstallComponentMeta:s().func.isRequired,dependencies:s().arrayOf(s().shape({parentDid:s().string,parentName:s().string,parentPoint:s().string,required:s().bool}))},xi.defaultProps={logoUrl:"",dependencies:[]};const gi=(0,r.Z)(ui)(hi||(hi=(0,l.Z)(["\n .line {\n opacity: 0.5;\n }\n .cell {\n display: flex;\n width: 100%;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n padding-top: 16px;\n padding-bottom: 16px;\n }\n .component-left {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n }\n .component-logo {\n width: 40px;\n margin-left: 16px;\n opacity: 0.5;\n border-radius: 10px;\n overflow: hidden;\n }\n .component-header {\n opacity: 0.5;\n margin-left: 12px;\n display: flex;\n align-items: center;\n align-items: flex-end;\n cursor: pointer;\n }\n .component-name {\n opacity: 0.5;\n color: #222;\n font-size: 16px;\n }\n .component-version {\n opacity: 0.8;\n color: #999;\n font-size: 12px;\n margin-left: 4px;\n transform: translateY(-1px);\n }\n"])));var yi,vi,bi;function ji(e){var n;let{blocklet:t,onUpdate:l,getComponentUrl:r,...a}=e;const{t:s}=(0,o.useContext)(i.RD),{api:I,inService:U,info:D}=(0,A.h6)(),{addDeletingDid:L,removeDeletingDid:O,matchDeletingDid:G}=(0,P.K)(),[z,q]=(0,o.useState)(!1),[V,W]=(0,o.useState)(null),[_,H]=(0,o.useState)(null),[K,J]=(0,o.useState)(!1),[Y,Q]=(0,o.useState)(null),X=t&&t.structVersion!==C.APP_STRUCT_VERSION,[$,ee]=(0,o.useState)(!1),ne=[...t.children]||[];"gateway"!==t.meta.group&&ne.unshift(t),G(ne.map((e=>e.meta.did)));const te=async()=>{if(!z){q(!0);try{const{updateId:e,updateList:n}=(await I.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(q(!1),!e)return void T.Z.info(s("blocklet.component.noUpdate"));const o=[];(0,S.forEachChildSync)(t,((e,t)=>{let{id:i,ancestors:l}=t;const r=n.find((e=>e.id===i));if(r){const n=l.slice(1).concat(e).map((e=>e.meta.title||e.meta.name)).join(" / "),t=(l[1]||e).meta.did;o.push({groupId:t,name:n,version:e.meta.version,newVersion:r.meta.version})}}));const i={};o.forEach((e=>{i[e.groupId]?e.disabled=!0:i[e.groupId]=!0})),W({params:{updateId:e},list:o,checks:i,hasChecks:!0})}catch(e){q(!1),T.Z.error((0,F.Z)(e))}}},oe=async(e,n)=>{L(e.meta.did);try{await I.deleteComponent({input:{did:e.meta.did,keepData:"keepData"===n,rootDid:t.meta.did}}),await(0,F._v)(800)}catch(o){T.Z.error((0,F.Z)(o)),O(e.meta.did)}},ie=async e=>{try{await I.startBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800)}catch(n){T.Z.error((0,F.Z)(n))}},le=async e=>{try{await I.stopBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800)}catch(n){T.Z.error((0,F.Z)(n))}},re=async e=>{try{await I.restartBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800)}catch(n){T.Z.error((0,F.Z)(n))}},ae=async e=>{try{await I.reloadBlocklet({input:{did:t.meta.did,componentDids:[e.meta.did]}}),await(0,F._v)(800),T.Z.success(s("blocklet.reloadSuccess"))}catch(n){T.Z.error((0,F.Z)(n))}};(0,wo.Z)(te);const se=Ro({blocklet:t,scrollToComponent:!0}),ce=Y||se;return(0,N.jsxs)(ki,{component:"div",...a,children:[(0,N.jsxs)(Zi,{display:"flex",children:[(0,N.jsxs)(Ci,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[s("common.components"),!X&&(0,N.jsx)(M.Z,{permission:U?"":"mutate_blocklets",role:U?F.Wf:[],children:(0,N.jsx)(B,{children:(0,N.jsx)(mi,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!$,children:(0,N.jsxs)(w.Z,{disabled:z||(0,S.isInProgress)(t.status),color:"secondary",onClick:()=>{te()},"data-cy":"check-for-updates",children:[(0,N.jsx)(d.Z,{mr:.5,display:"flex",children:z?(0,N.jsx)(E.Z,{size:16}):(0,N.jsx)(h.Z,{style:{fontSize:"1em"}})}),s("blocklet.component.checkUpdateTitle")]})})})})]}),(0,N.jsx)(M.Z,{permission:U?"":"mutate_blocklets",role:U?F.Wf:[],children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)(oo,{children:e=>{let{open:n}=e;return(0,N.jsxs)(w.Z,{disabled:z||(0,S.isInProgress)(t.status),variant:"text",color:"primary","data-cy":"add-rule",className:"sm-hide-icon",onClick:n,children:[(0,N.jsx)(x.Z,{style:{fontSize:"1.3em",marginRight:4}}),s("router.rule.add.title")]})}}),!X&&(0,N.jsx)($t,{blocklet:t,serverVersion:D.version,children:e=>{let{open:n}=e;return(0,N.jsxs)(w.Z,{disabled:z||(0,S.isInProgress)(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:n,children:[(0,N.jsx)(x.Z,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.component.add")]})}}),!X&&(0,N.jsx)(ue,{blocklet:t,ancestors:[],children:e=>{let{open:n}=e;return(0,N.jsx)(v.Z,{title:"".concat(s("blocklet.component.container")).concat(s("common.config")),children:(0,N.jsx)(f.Z,{onClick:n,size:"small",color:"primary",children:(0,N.jsx)(g.Z,{style:{fontSize:18}})})},"config")}})]})})]}),null!==ne&&void 0!==ne&&ne.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(d.Z,{mt:2,children:["gateway"!==t.meta.group&&(0,N.jsx)(pi,{blocklet:t,app:t,onRemove:oe,onStart:ie,onStop:le,onReload:ae,onRestart:re,getComponentUrl:r},"0-".concat(t.meta.did)),t.children.map((e=>(0,N.jsx)(pi,{depth:1,blocklet:e,ancestors:[t],app:t,onRemove:oe,onStart:ie,onStop:le,onReload:ae,onRestart:re,getComponentUrl:r},"1-".concat(e.meta.did))))]},"top-blocklet-".concat(t.meta.did)),null===(n=t.optionalComponents)||void 0===n?void 0:n.map((e=>(0,N.jsx)(ui,{children:(0,N.jsx)(xi,{setInstallComponentMeta:Q,...e})},e.meta.did)))]}):(0,N.jsx)(d.Z,{mt:8,children:(0,N.jsx)(R.Z,{children:s("blocklet.component.noComponent")})}),!!t.site.rules.length&&(0,N.jsx)(d.Z,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:(0,N.jsx)(Eo,{})}),!!V&&(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,children:(0,N.jsxs)(d.Z,{paddingY:1.5,children:[(0,N.jsx)(m.Z,{children:s("blocklet.component.updateTitle")}),(0,N.jsx)(d.Z,{component:p.Z,py:4,children:V.list.map((e=>(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)(j.Z,{checked:V.checks[e.groupId],onChange:n=>((e,n)=>{const{checked:t}=e.target;W((e=>{const o=Object.entries(e.checks).reduce(((e,o)=>{let[i,l]=o;return e[i]=n===i?t:l,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,N.jsxs)(d.Z,{flexGrow:1,mt:3,children:[(0,N.jsx)(d.Z,{item:!0,xs:8,children:e.name}),e.version&&(0,N.jsxs)(y.ZP,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[(0,N.jsx)(y.ZP,{item:!0,xs:3,children:e.version}),(0,N.jsx)(y.ZP,{item:!0,xs:1,children:(0,N.jsx)(b.Z,{style:{fontSize:"0.9em"}})}),(0,N.jsx)(y.ZP,{item:!0,xs:3,children:(0,N.jsx)(d.Z,{color:"secondary.main",children:e.newVersion})})]})]},"".concat(e.name,"-").concat(e.newVersion))]},e.name)))}),(0,N.jsxs)(u.Z,{style:{padding:"8px 24px 24px"},children:[(0,N.jsx)(w.Z,{onClick:()=>{W(null)},children:s("common.cancel")}),(0,N.jsxs)(w.Z,{onClick:e=>{e.stopPropagation(),(async()=>{if(!z)try{q(!0);const e=Object.keys(V.checks).filter((e=>V.checks[e])),n={updateId:V.params.updateId,rootDid:t.meta.did,selectedComponents:e};await I.upgradeComponents({input:n}),q(!1),W(null),ee(null)}catch(e){q(!1),T.Z.error((0,F.Z)(e))}})()},color:"primary",disabled:z||!V.hasChecks,variant:"contained",autoFocus:!0,children:[z&&(0,N.jsx)(E.Z,{size:16}),s("common.update")]})]})]})}),!!_&&(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,onClose:()=>H(!1),children:(0,N.jsxs)(d.Z,{paddingY:1.5,children:[(0,N.jsx)(m.Z,{children:s("common.configuration")}),(0,N.jsx)(p.Z,{children:(0,N.jsx)(d.Z,{py:2,children:(0,N.jsx)(k.Z,{control:(0,N.jsx)(Z.Z,{checked:K,onChange:e=>J(!!e.target.checked)}),label:s("blocklet.component.showContainer")})})})]})}),(0,N.jsx)(Qt,{selectedMeta:ce,blocklet:t,showDialog:!!ce,setShowDialog:()=>Q(null)})]})}ji.propTypes={blocklet:s().object.isRequired,onUpdate:s().func,getComponentUrl:s().func},ji.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const ki=r.Z.div(yi||(yi=(0,l.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"]))),Zi=(0,r.Z)(d.Z)(vi||(vi=(0,l.Z)(["\n "," {\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n }\n "," {\n flex-direction: column;\n justify-content: flex-end;\n align-items: flex-end;\n .sm-hide-icon > svg {\n display: none;\n }\n }\n"])),(e=>e.theme.breakpoints.up("sm")),(e=>e.theme.breakpoints.down("sm"))),Ci=(0,r.Z)(d.Z)(bi||(bi=(0,l.Z)(["\n "," {\n width: 100%;\n justify-content: space-between;\n }\n"])),(e=>e.theme.breakpoints.down("sm")));var Ei=t(21289);function wi(e){const{locale:n}=(0,o.useContext)(i.RD),{blocklet:t,recommendedDomain:l}=(0,Ei.y0)();return(0,N.jsx)(ji,{blocklet:t,getComponentUrl:e=>(0,F.vH)({blocklet:t,domain:{value:l},mountPoint:e,params:(0,F.f0)(t,n)}),...e})}wi.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),l=t(5057),r=t(55898),a=t.n(r),s=t(33518),c=t(67680),d=t(61533),p=t(74490),m=t(45267),u=t(46954),h=t(44067),f=t(96266);function x(e){let{actions:n,size:t,...o}=e;const[i,r]=(0,l.useState)(null),a=Boolean(i),s=e=>{try{e.stopPropagation(),e.preventDefault()}catch{}r(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{}r(e.currentTarget)},size:t,children:(0,f.jsx)(m.Z,{})}),(0,f.jsx)(d.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:i,keepMounted:!0,open:a,onClose:s,slotProps:{paper:{}},children:n.map(((e,n)=>{if("function"===typeof e)return e({close:s});const{icon:t,text:o,onClick:i,disabled:r=!1,...a}=e;return(0,l.createElement)(p.Z,{...a,disabled:r,dense:!0,onClick:async e=>{await i(e),s()},key:n,"data-cy":"actions-menu-".concat(n)},(0,f.jsx)(u.Z,{style:{minWidth:24,marginRight:8},children:t}),(0,f.jsx)(h.Z,{primary:o}))}))})]})}x.propTypes={actions:a().array,size:a().oneOf(["small","medium","large"])},x.defaultProps={actions:[],size:"small"};const g=s.Z.div(o||(o=(0,i.Z)([""])))},53927:(e,n,t)=>{"use strict";t.d(n,{Z:()=>S});var o=t(71171),i=t(55898),l=t.n(i),r=t(85493),a=t(33518),s=t(68420),c=t(40265),d=t(44566),p=t(55498),m=t(39948),u=t(26174),h=t(88092),f=t(67680),x=t(5057),g=t(35432),y=t(96266);function v(e){let{...n}=e;return(0,y.jsxs)("div",{...n,style:{width:"100%"},children:[(0,y.jsx)("h3",{children:"End User License Agreement for Application"}),(0,y.jsxs)("p",{children:["Blocklet Server License Agreement ",g.COPYRIGHT_OWNER," version 2020-08-28"]}),(0,y.jsx)("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),(0,y.jsx)("p",{children:"\u6682\u65e0"})]})}var b=t(13128),j=t(15715);function k(e){var n,t,o,i;return"".concat((null===(n=e.bundleSource)||void 0===n?void 0:n.store)||e.meta.homepage,"/assets/").concat(null===(t=e.meta)||void 0===t?void 0:t.did,"/").concat((null===(o=e.meta)||void 0===o?void 0:o.logo)||"logo.png","?v=").concat(null===(i=e.meta)||void 0===i?void 0:i.version)}function Z(e){let{installRelated:n,meta:t,show:o,onClose:i,components:l,loading:r}=e;const{t:a}=(0,s.PE)(),c=(0,j.Z)((e=>e.breakpoints.down("md")));if(!o)return null;const d=!r&&0===l.length,u=!r&&0!==l.length;return(0,y.jsxs)(b.ZP,{title:a("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(e,n)=>{"backdropClick"!==n&&i(!1)},PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[r&&(0,y.jsx)(m.Z,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:(0,y.jsx)(m.Z,{sx:{fontSize:32},color:"primary.main",component:p.JO,icon:"line-md:loading-loop"})}),d&&(0,y.jsx)(m.Z,{sx:{textAlign:"center"},children:a("blocklet.component.noDependencies",{name:t.title})}),u&&(0,y.jsx)(m.Z,{sx:{marginBottom:2},children:l.map((e=>{if(!e.meta)return null;const{required:t}=e;let o;return o=n||t?1:.5,(0,y.jsxs)(m.Z,{sx:{opacity:o,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[(0,y.jsx)("img",{style:{width:40,height:40,minWidth:40,minHeight:40},src:k(e),alt:e.meta.title}),(0,y.jsxs)(m.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[(0,y.jsxs)(m.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var n;window.open("".concat((null===(n=e.bundleSource)||void 0===n?void 0:n.store)||e.meta.homepage,"/blocklets/").concat(e.meta.did),"_blank")},children:[e.meta.title,(0,y.jsx)(m.Z,{sx:{display:t?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:a("blocklet.component.required")}),(0,y.jsxs)(m.Z,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[e.meta.version,(0,y.jsx)(m.Z,{className:"link-icon",icon:"fluent:open-20-filled",component:p.JO,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),(0,y.jsx)(m.Z,{sx:{marginTop:0,opacity:.7},children:e.meta.description})]})]},e.meta.did)}))})]})}Z.propTypes={meta:l().object,show:l().bool,onClose:l().func.isRequired,installRelated:l().func,components:l().array.isRequired,loading:l().bool.isRequired},Z.defaultProps={meta:null,show:!1,installRelated:!1};var C=t(15849),E=t(58238);const w=function(e){const{api:n}=(0,E.h6)(),[t]=(0,C.useSearchParams)(),o=t.get("blocklet_meta_url")||function(e){return e&&(e.registryUrl||e.homepage)&&e.did?"".concat(e.registryUrl||e.homepage,"/api/blocklets/").concat(null===e||void 0===e?void 0:e.did,"/blocklet.json"):""}(e),[i,l]=(0,x.useState)([]),[r,a]=(0,x.useState)(!1);return(0,x.useEffect)((()=>{!o||null!==e&&void 0!==e&&e.inputUrl||(a(!0),n.getDynamicComponents({input:{url:o}}).then((e=>{l(e.components)})).finally((()=>{a(!1)})))}),[o]),{components:i,loading:r}};var R;function S(e){let{installRelated:n,onChangeInstallRelated:t,meta:o,onClickNext:i,handleDescEle:l}=e;const a=(0,r.useNavigate)(),{t:g,locale:b}=(0,s.PE)(),[j,k]=(0,x.useState)(!1),{components:C,loading:E}=w(o),R=i||(()=>{a("/launch-blocklet/install".concat(window.location.search))});return(0,y.jsxs)(T,{children:[(0,y.jsx)("div",{className:"app-content",children:(0,y.jsx)("div",{className:"agreement",children:(0,y.jsx)("div",{className:"agreement-content",children:(0,y.jsx)(d.Z,{blockletMeta:{data:o},locale:b,handleDescEle:l})})})}),(0,y.jsxs)(m.Z,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[E?(0,y.jsx)(p.JO,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,t&&null!==C&&void 0!==C&&C.length?(0,y.jsxs)(m.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[(0,y.jsx)(u.Z,{sx:{mr:.5},checked:n,onChange:e=>t(e.currentTarget.checked),control:(0,y.jsx)(h.Z,{}),label:(0,y.jsx)("span",{children:g("launchBlocklet.installRelatedComponents")})}),(0,y.jsx)(m.Z,{sx:{"> button svg":{color:"primary.main"}},children:(0,y.jsx)(f.Z,{size:"small",onClick:()=>{k(!0)},children:(0,y.jsx)(p.JO,{icon:"octicon:package-dependencies-16"})})})]}):null,(0,y.jsx)("div",{className:"button-container","data-cy":"agree-all",children:(0,y.jsx)(c.Z,{onContinue:R,description:(0,y.jsx)(v,{}),texts:{listenName:g("launchBlocklet.license"),buttonNext:g("launchBlocklet.next")}})})]}),(0,y.jsx)(Z,{installRelated:n,meta:o,show:j,onClose:()=>{k(!1)},components:C,loading:E})]})}S.propTypes={meta:l().object.isRequired,onClickNext:l().func,handleDescEle:l().node,installRelated:l().bool,onChangeInstallRelated:l().func},S.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const T=a.Z.div(R||(R=(0,o.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 .agreement-bottom {\n display: flex;\n width: 100%;\n padding: 24px;\n "," {\n flex-direction: row;\n align-items: center;\n margin-left: auto;\n }\n "," {\n flex-direction: column;\n align-items: center;\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n .button-container {\n "," {\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")),(e=>e.theme.breakpoints.up("md")),(e=>e.theme.breakpoints.down("md")))},80378:(e,n,t)=>{"use strict";t.d(n,{Z:()=>u});var o=t(55898),i=t.n(o),l=t(62681),r=t(72333),a=t(6352),s=t.n(a),c=t(35432),d=t(58238),p=t(46090);var m=t(96266);function u(e){let{blocklet:n,style:t,size:o,ancestors:i,...a}=e;const u=(0,d.h6)(),{logoUrl:h,inService:f}=function(e){var n;let{blocklet:t,ancestors:o=[]}=e;const i=(0,d.h6)(),{inService:l}=i,r="?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 a=l?s()(p.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",r):s()(i.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)a=s()(t.deployedFrom,(0,p.lk)(t.meta.bundleDid,t.meta.logo),r);else{const e=window.env.apiPrefix||"/",n=o.concat(t),i=l?n.slice(1):n;a=s()(e,"/blocklet/logo-bundle".concat(i.map((e=>"/".concat(e.meta.did))).join("")),r)}return{logoUrl:a,inService:l}}({blocklet:n,ancestors:i}),{variant:x}=a,g=f?()=>{}:e=>{e.target.src="".concat(u.imgPrefix,"/blocklet.png")};let y=(0,m.jsx)("img",{src:h,onError:g,alt:n.meta.name,style:{width:o}});return n.meta.logo||(y=(0,m.jsx)(r.Z,{did:n.meta.did||"",responsive:!0})),(0,m.jsx)(l.Z,{variant:x||"square",style:Object.assign({backgroundColor:"transparent",width:o,height:o,borderRadius:10},t),...a,children:y})}u.propTypes={blocklet:i().object.isRequired,style:i().object,size:i().oneOfType([i().number,i().string]),ancestors:i().array},u.defaultProps={style:{},size:40,ancestors:[]}},74286:(e,n,t)=>{"use strict";t.d(n,{Z:()=>a});var o=t(55898),i=t.n(o),l=t(39948),r=t(96266);function a(e){let{depth:n,className:t}=e;return(0,r.jsx)(l.Z,{ml:Math.max(2*(n-1),0),className:t,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}a.propTypes={depth:i().number,className:i().string},a.defaultProps={depth:1,className:""}},61813:(e,n,t)=>{"use strict";t.d(n,{Z:()=>w});var o=t(5057),i=t(55898),l=t.n(i),r=t(13128),a=t(44846),s=t(55372),c=t(11750),d=t(47020),p=t(20870),m=t(31089),u=t(71767),h=t(64886),f=t(22425),x=t(68420),g=t(28726),y=t(88574),v=t(38242),b=t(58238),j=t(73545),k=t(46090),Z=t(4651),C=t(17450),E=t(96266);function w(e){let{defaultUrl:n,onCancel:t,onSuccess:i,onError:l,mode:w,handleText:R}=e;const{api:S}=(0,b.h6)(),{api:T}=(0,j.T)(),[P,I]=(0,o.useState)(!1),[U,N]=(0,o.useState)(""),{t:D}=(0,x.PE)(),B={dist:{}},[L,O]=(0,o.useState)(n),[A,F]=(0,o.useState)(n?1:0),[M,G]=(0,o.useState)(B),[z,q]=(0,o.useState)(!1),[V,W]=(0,o.useState)({}),_="component"===w,H=!!_||!n,K=async()=>{G(B),N(null),I(!0);try{const e=decodeURIComponent(L.trim());try{new URL(e)}catch{throw new Error("Invalid URL")}const{meta:n,inStore:t,registryUrl:o}=await S.getBlockletMetaFromUrl({input:{url:e}});G(n),W({inStore:t,registryUrl:o,inputUrl:L.trim()})}catch(e){console.error(e);const n="Blocklet Install failed: ".concat((0,k.Z)(e));N(n),l(e)}finally{I(!1)}};(0,o.useEffect)((()=>{n&&K()}),[n]);const J=[{name:D("common.name"),value:(0,v.getDisplayName)({meta:M},!0)},{name:D("common.version"),value:M.version},{name:D("common.did"),value:(0,E.jsx)(C.Z,{did:M.did})},{name:D("common.author"),value:(0,k.rq)(M.author)},{name:D("blocklet.dist.downloadLink"),value:M.dist.tarball}],Y=[{label:D("blocklet.fromUrl.step0"),body:(0,E.jsx)(c.Z,{component:"div",children:(0,E.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:L,onChange:e=>{N(null),O(e.target.value)},disabled:P,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),K(),F(1))}})}),cancel:D("common.cancel"),confirm:D("common.next"),onCancel:t,onConfirm:()=>{K(),F(1)}},{label:D("blocklet.fromUrl.step1"),body:P?(0,E.jsx)("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:(0,E.jsx)(a.Z,{})}):M.did?(0,E.jsx)("div",{style:{paddingLeft:"10%"},children:J.map((e=>e.name===D("common.did")?(0,E.jsx)(h.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>D("common.did"),children:e.value},e.name):(0,E.jsx)(h.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)))}):null,cancel:D(H?"common.pre":"common.cancel"),confirm:(null===R||void 0===R?void 0:R.confirm)||D("blocklet.fromUrl.confirm"),onCancel:()=>{H?F((e=>e-1)):t()},onConfirm:()=>{(()=>{if(_)return i({meta:M,...V}),void t();I(!0),q(!0)})()}}],Q=Y[A];return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(r.ZP,{title:(null===R||void 0===R?void 0:R.title)||D("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Q.onCancel(),showCloseButton:0===A,disableEscapeKeyDown:!0,open:!0,actions:(0,E.jsxs)(E.Fragment,{children:[Q.cancel&&(0,E.jsx)(g.Z,{onClick:e=>{e.stopPropagation(),N(null),Q.onCancel()},color:"inherit",children:Q.cancel||D("common.cancel")}),(0,E.jsxs)(g.Z,{onClick:e=>{e.stopPropagation(),Q.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:P||!L||U,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[P&&0===A&&(0,E.jsx)(a.Z,{size:16}),Q.confirm]})]}),children:[H&&(0,E.jsx)(p.Z,{alternativeLabel:!0,activeStep:A,children:Y.map((e=>{let{label:n}=e;return(0,E.jsx)(m.Z,{children:(0,E.jsx)(u.Z,{children:n})},n)}))}),(0,E.jsx)(s.Z,{component:"div",style:{marginTop:24},children:Q.body}),!!U&&(0,E.jsx)(y.Z,{type:"error",style:{width:"100%",marginTop:8},children:U})]}),M&&z&&(0,E.jsx)(f.Z,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:T.get,checkTimeout:3e5,onSuccess:()=>{I(!1),q(!1),i({meta:M,...V}),t()},extraParams:{title:M.title,wt:(0,Z.iK)(M),blockletMetaUrl:decodeURIComponent(L.trim())},messages:{title:D("setup.keyPair.title"),scan:D("setup.keyPair.scan"),confirm:D("setup.keyPair.confirm"),success:D("setup.keyPair.success")},onClose:()=>{I(!1),q(!1)}})]})}w.propTypes={defaultUrl:l().string,onCancel:l().func.isRequired,onSuccess:l().func.isRequired,onError:l().func,mode:l().oneOf(["install","component"]),handleText:l().object},w.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}}},59375:(e,n,t)=>{"use strict";t.d(n,{Z:()=>b});var o,i=t(71171),l=t(5057),r=t(55898),a=t.n(r),s=t(6352),c=t.n(s),d=t(33518),p=t(92706),m=t.n(p),u=t(39948),h=t(52277),f=t.n(h),x=t(68420),g=t(96266);const y=(0,l.lazy)((()=>Promise.all([t.e(6547),t.e(5760),t.e(6743),t.e(9818),t.e(1294),t.e(6472)]).then(t.bind(t,84804)).then((e=>({default:e.Uploader}))))),v="/blocklet/logo/upload";function b(e){let{url:n,height:t,width:o,enabled:i,type:r,did:a,prefix:s,headers:d,onUploaded:p}=e;const{t:m}=(0,x.PE)(),h=(0,l.useRef)(null),b={cursor:i?"pointer":"default","&::after":{content:'"'.concat(m("common.switch"),'"')}};return(0,g.jsxs)(j,{id:"uploader-".concat(a,"-").concat(r),children:[(0,g.jsx)(y,{ref:h,popup:!0,onUploadFinish:()=>{var e;p(),null===(e=h.current)||void 0===e||e.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:c()(s,v,r,a),disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".gif",".svg"],maxFileSize:10485760,maxNumberOfFiles:1}},tusProps:{headers:d}}),(0,g.jsx)(u.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(a,"-").concat(r))}b.propTypes={url:a().string.isRequired,type:a().oneOf(["square","rect","favicon"]).isRequired,did:a().string.isRequired,prefix:a().string.isRequired,headers:a().func,onUploaded:a().func,height:a().number,width:a().any,enabled:a().bool},b.defaultProps={height:80,width:"auto",enabled:!0,headers:()=>({}),onUploaded:m()};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:()=>a});var o=t(55898),i=t.n(o),l=t(22228),r=t(96266);function a(e){let{mode:n,...t}=e;return"development"===n?(0,r.jsx)(l.Z,{type:"primary",...t,children:"DEV"}):null}a.propTypes={mode:i().string.isRequired}},51233:(e,n,t)=>{"use strict";t.d(n,{Rw:()=>d,fX:()=>c,sf:()=>p});var o=t(35432),i=t(44543),l=t.n(i),r=t(77277),a=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,a.default)(e.meta)&&l()(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!==r.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}}},28641:(e,n,t)=>{"use strict";t.d(n,{Z:()=>g});var o=t(5057),i=t(55898),l=t.n(i),r=t(39948),a=t(47020),s=t(44846),c=t(13727),d=t(56184),p=t(67680),m=t(35406),u=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:l,onChange:g,placeholder:y,style:v,onSubmit:b,secure:j,triggers:k,formatterBeforeSubmit:Z,...C}=e;const[E,w]=(0,o.useState)(!1),[R,S]=(0,o.useState)(!1),[T,P]=(0,o.useState)(j&&"__encrypted__"===l?null:l),[I,U]=(0,o.useState)(T),N=async()=>{S(!0);try{if(!1===await b(I))U(T);else{let e=I;"function"===typeof Z&&(e=Z(I)),U(e),P(e)}}catch(e){U(T)}finally{S(!1),w(!1)}},D=E?(0,f.jsx)(a.Z,{style:{flex:1},fullWidth:!0,value:I,onChange:e=>{var n;n=e.target.value,U(n),g(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:y,onKeyDown:e=>{"Enter"===e.key&&N()},disabled:t,type:j?"password":"text",...C}):(0,f.jsx)(r.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:x(I,j,l)});return(0,f.jsx)(u.Z,{className:"form",style:v,children:(0,f.jsxs)(r.Z,{className:"form-item",children:[(0,f.jsxs)(r.Z,{className:"form-item-label",children:[n,i&&(0,f.jsx)(m.Z,{})]}),(0,f.jsxs)(r.Z,{className:"form-item-body",children:[(0,f.jsx)(r.Z,{className:"form-item-input",children:D}),(0,f.jsx)(r.Z,{className:"form-item-action",children:E?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.Z,{"data-cy":"schema-form-item-confirm",onClick:N,disabled:t||R,size:"large",children:R?(0,f.jsx)(s.Z,{size:24}):(0,f.jsx)(d.Z,{})}),(0,f.jsx)(p.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{U(T),w(!1)},disabled:t||R,size:"large",children:(0,f.jsx)(c.default,{})})]}):(0,f.jsx)(h.Z,{triggers:k,onEnterEdit:()=>w(!0),disabled:t})})]})]})})}g.propTypes={style:l().object,onSubmit:l().func,onChange:l().func,label:l().string,initialValue:l().string,placeholder:l().string,required:l().bool,disabled:l().bool,secure:l().bool,triggers:l().array,formatterBeforeSubmit:l().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:()=>a});var o,i=t(71171),l=t(33518),r=t(39948);const a=(0,l.Z)(r.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),l=t.n(i),r=t(24558),a=t(67680),s=t(56556),c=t(80633),d=t(49390),p=t(72113),m=t(25228),u=t(49020),h=t(74490),f=t(1733),x=t(96266);function g(e){let{triggers:n,onEnterEdit:t,disabled:i}=e;const l=o.useRef(null),[g,y]=o.useState(!1);return 0===n.length?(0,x.jsx)(a.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,x.jsx)(r.Z,{})}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(c.Z,{variant:"outlined",ref:l,"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)(r.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)(u.Z,{sx:{zIndex:9999},open:g,anchorEl:l.current,role:void 0,placement:"bottom-end",children:(0,x.jsx)(m.Z,{children:(0,x.jsx)(p.d,{onClickAway:e=>{l.current&&l.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:l().arrayOf(l().shape({key:l().string.isRequired,title:l().string.isRequired,handler:l().func.isRequired})),onEnterEdit:l().func.isRequired,disabled:l().bool.isRequired},g.defaultProps={triggers:[]}},35406:(e,n,t)=>{"use strict";t.d(n,{Z:()=>l});var o,i=t(71171);const l=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),l=t(33518),r=t(55898),a=t.n(r),s=t(96266);function c(e){let{children:n,...t}=e;return(0,s.jsx)(d,{...t,children:n})}c.propTypes={children:a().any.isRequired};const d=l.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")))},35918:(e,n,t)=>{"use strict";t.d(n,{Z:()=>y});var o=t(44919),i=t(42876),l=t(27773),r=t(11997),a=t(93734),s=t(76667),c=t(39293),d=t(36903),p=t(3422),m=t(92273),u=t(72906),h=t(57201),f=t(49390),x=t(33225),g=t(30770);const y={Add:o.Z,Check:i.default,Delete:l.default,Edit:s.default,Clear:r.default,DetailPanel:m.default,Filter:c.Z,FirstPage:d.default,LastPage:p.default,NextPage:m.default,PreviousPage:u.default,Search:h.default,ResetSearch:r.default,SortArrow:f.Z,Export:a.default,ThirdStateCheck:x.default,ViewColumn:g.default}},74782:(e,n,t)=>{"use strict";t.d(n,{Z:()=>l});var o,i=t(71171);const l=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"])))},40736:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward")},34966:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.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 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined")},33271:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.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.1M8 13h8v-2H8zm9-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-5"}),"Link")},48037:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.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-.64zm-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.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined")},99194:(e,n,t)=>{"use strict";var o=t(71600);n.Z=void 0;var i=o(t(56930)),l=t(96266);n.Z=(0,i.default)((0,l.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 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update")},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 l=typeof t;if("string"===l||"number"===l)e.push(t);else if(Array.isArray(t)){if(t.length){var r=i.apply(null,t);r&&e.push(r)}}else if("object"===l){if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]")){e.push(t.toString());continue}for(var a in t)o.call(t,a)&&t[a]&&e.push(a)}}}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)):[]}}}]);
|