@abtnode/webapp 1.16.27-beta-d1555a79 → 1.16.27-beta-595ed831

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/build/asset-manifest.json +39 -40
  4. package/build/index.html +1 -1
  5. package/build/service-worker.js +1 -1
  6. package/build/static/css/8890.bfca650f.chunk.css +1 -0
  7. package/build/static/js/1366.cd4e7c5a.chunk.js +2 -0
  8. package/build/static/js/1486.bcbf63f3.chunk.js +1 -0
  9. package/build/static/js/{1667.0afb32ac.chunk.js → 1667.a0c1bd62.chunk.js} +1 -1
  10. package/build/static/js/1697.bb3daf90.chunk.js +2 -0
  11. package/build/static/js/1794.bb39fcdb.chunk.js +1 -0
  12. package/build/static/js/1869.4e5165a8.chunk.js +1 -0
  13. package/build/static/js/2355.fe9e5eaf.chunk.js +1 -0
  14. package/build/static/js/{2362.43aba25e.chunk.js → 2362.535a39b0.chunk.js} +1 -1
  15. package/build/static/js/2646.3c94c81b.chunk.js +1 -0
  16. package/build/static/js/3108.8df89363.chunk.js +1 -0
  17. package/build/static/js/3217.53b4e93a.chunk.js +1 -0
  18. package/build/static/js/3351.be676eac.chunk.js +1 -0
  19. package/build/static/js/{3504.59653aaf.chunk.js → 3504.6df392db.chunk.js} +1 -1
  20. package/build/static/js/3595.a73deb26.chunk.js +1 -0
  21. package/build/static/js/3646.9ca707d1.chunk.js +1 -0
  22. package/build/static/js/3815.1e4840e2.chunk.js +1 -0
  23. package/build/static/js/3998.533e1d9e.chunk.js +1 -0
  24. package/build/static/js/{4527.6d3ce631.chunk.js → 4527.8771abf6.chunk.js} +2 -2
  25. package/build/static/js/4542.6e54cc7d.chunk.js +1 -0
  26. package/build/static/js/{4804.20a6de7e.chunk.js → 4804.9dc4ff41.chunk.js} +2 -2
  27. package/build/static/js/4852.d006afae.chunk.js +1 -0
  28. package/build/static/js/{4906.91460902.chunk.js → 4906.fc570676.chunk.js} +1 -1
  29. package/build/static/js/5083.ecb059e3.chunk.js +2 -0
  30. package/build/static/js/5261.d805c13c.chunk.js +1 -0
  31. package/build/static/js/{5374.1135dab5.chunk.js → 5374.623a9a80.chunk.js} +1 -1
  32. package/build/static/js/5433.21c26373.chunk.js +1 -0
  33. package/build/static/js/6129.0d902ffa.chunk.js +1 -0
  34. package/build/static/js/{6867.929ff2ac.chunk.js → 6867.56a2df81.chunk.js} +1 -1
  35. package/build/static/js/{436.d3dfe09b.chunk.js → 7000.9ee7ffdd.chunk.js} +1 -1
  36. package/build/static/js/7702.7030cc56.chunk.js +1 -0
  37. package/build/static/js/{7718.b9fb672b.chunk.js → 7718.44fb1ee7.chunk.js} +1 -1
  38. package/build/static/js/8110.2ca1dc99.chunk.js +1 -0
  39. package/build/static/js/{8399.5f81511d.chunk.js → 8399.d74f7fac.chunk.js} +1 -1
  40. package/build/static/js/8890.339faf81.chunk.js +2 -0
  41. package/build/static/js/{7676.96ca7a9d.chunk.js.LICENSE.txt → 8890.339faf81.chunk.js.LICENSE.txt} +0 -7
  42. package/build/static/js/9779.de94e6a6.chunk.js +1 -0
  43. package/build/static/js/main.2503ad39.js +2 -0
  44. package/package.json +1 -1
  45. package/build/static/css/7676.7f909312.chunk.css +0 -1
  46. package/build/static/js/1366.cf2949cf.chunk.js +0 -2
  47. package/build/static/js/1794.88e130cc.chunk.js +0 -1
  48. package/build/static/js/1869.6c2448a7.chunk.js +0 -1
  49. package/build/static/js/2355.b4578354.chunk.js +0 -1
  50. package/build/static/js/2613.4592208a.chunk.js +0 -2
  51. package/build/static/js/2646.8f5483fb.chunk.js +0 -1
  52. package/build/static/js/3108.29977e3b.chunk.js +0 -1
  53. package/build/static/js/3135.d72dbe37.chunk.js +0 -1
  54. package/build/static/js/3198.88e502ec.chunk.js +0 -1
  55. package/build/static/js/3217.e1a959bf.chunk.js +0 -1
  56. package/build/static/js/3595.36d3f261.chunk.js +0 -1
  57. package/build/static/js/3646.3c8374e7.chunk.js +0 -1
  58. package/build/static/js/3815.e65ec43b.chunk.js +0 -1
  59. package/build/static/js/3998.61ea719b.chunk.js +0 -1
  60. package/build/static/js/442.d95b0c5a.chunk.js +0 -1
  61. package/build/static/js/4542.2d4966ad.chunk.js +0 -1
  62. package/build/static/js/4852.11a0c1a1.chunk.js +0 -1
  63. package/build/static/js/5261.067b7dc4.chunk.js +0 -1
  64. package/build/static/js/5433.46b3adc5.chunk.js +0 -1
  65. package/build/static/js/5570.c66dd1dc.chunk.js +0 -2
  66. package/build/static/js/6129.cf511102.chunk.js +0 -1
  67. package/build/static/js/7676.96ca7a9d.chunk.js +0 -2
  68. package/build/static/js/7702.ad9a8c43.chunk.js +0 -1
  69. package/build/static/js/8110.c292b9cf.chunk.js +0 -1
  70. package/build/static/js/9779.e657536a.chunk.js +0 -1
  71. package/build/static/js/main.67a70213.js +0 -2
  72. /package/build/static/css/{5570.bceba133.chunk.css → 5083.bceba133.chunk.css} +0 -0
  73. /package/build/static/js/{1366.cf2949cf.chunk.js.LICENSE.txt → 1366.cd4e7c5a.chunk.js.LICENSE.txt} +0 -0
  74. /package/build/static/js/{2613.4592208a.chunk.js.LICENSE.txt → 1697.bb3daf90.chunk.js.LICENSE.txt} +0 -0
  75. /package/build/static/js/{4527.6d3ce631.chunk.js.LICENSE.txt → 4527.8771abf6.chunk.js.LICENSE.txt} +0 -0
  76. /package/build/static/js/{4804.20a6de7e.chunk.js.LICENSE.txt → 4804.9dc4ff41.chunk.js.LICENSE.txt} +0 -0
  77. /package/build/static/js/{5570.c66dd1dc.chunk.js.LICENSE.txt → 5083.ecb059e3.chunk.js.LICENSE.txt} +0 -0
  78. /package/build/static/js/{main.67a70213.js.LICENSE.txt → main.2503ad39.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[2355],{42355:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>Li});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),w=t(44846),R=t(28726),E=t(25710),S=t(38242),T=t(86229),P=t(80514),I=t(67357),U=t(71167),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,A,O=t(22324),F=t(64387),M=t(73881),G=t(76667),z=t(13128),q=t(94464),W=t(28358),V=t(47020),_=t(93938),K=t(77277),J=t(69561),H=t(12816),Y=t(28039),Q=t(22192);const X=(e,n)=>{let{description:t}=e;return(Object.values(K.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,O.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=>!K.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(K.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_")&&!K.BLOCKLET_CONFIGURABLE_KEY[e.key])return void T.Z.error(a("blocklet.config.environment.invalidKey"));if(e.key===K.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)(W.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)(J.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)(V.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)(J.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)(V.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,...H.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(A||(A=(0,l.Z)(["\n height: 60px;\n"])));var oe,ie=t(45239),le=t.n(ie),re=t(30629);function ae(e){let{blocklet:n,ancestors:t,hasPermission:l,...r}=e;const{t:a}=(0,i.PE)(),{api:s}=(0,O.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,O.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(86884),ve=t(85493),be=t(34056),je=t.n(be),ke=t(67444),Ze=t(88574),Ce=t(47685),we=t(35266),Re=t(51703),Ee=t(55309),Se=t(2660),Te=t(42876),Pe=t(25813),Ie=t(11750),Ue=t(79077),Ne=t.n(Ue),De=t(75506),Be=t.n(De),Le=t(3785),Ae=t.n(Le),Oe=t(30278),Fe=t.n(Oe),Me=t(33650),Ge=t(65873),ze=t(41899),qe=t(96567);const We=(0,o.createContext)({}),{Provider:Ve,Consumer:_e}=We;function Ke(e){let{children:n}=e;const[t,i]=(0,o.useState)(!1),[l,r]=(0,o.useState)(null),{blocklet:a,actions:{refreshBlocklet:s}}=(0,Me.y0)(),{storageEndpoint:c}=function(){const[e,n]=(0,o.useState)(null),{blocklet:t}=(0,Me.y0)();return(0,o.useEffect)((()=>{n((0,qe.EJ)(t))}),[t]),{storageEndpoint:e}}(),{api:d}=(0,O.h6)();(0,ze.Z)((async()=>{try{if(i(!0),(0,Ge.isEmpty)(c))return void r(null);const e=await(0,qe.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:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:e}]}}),s()};(0,o.useEffect)((()=>{!async function(){if(!l)return;const e=await(0,qe.nU)(l.endpoint,l.name),n=(0,Ge.merge)(l,{name:e});r(n)}()}),[]);const m=Boolean(c&&l);return(0,N.jsx)(Ve,{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 Je(){return(0,o.useContext)(We)}Ke.propTypes={children:a.node.isRequired},Ke.defaultProps={};var He=t(43449),Ye=t(24558),Qe=t(13727),Xe=t(56184),$e=t(11819),en=t(67486);const nn={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 tn(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)($e.ZP,{open:l,anchorEl:a.current,onClose:()=>r(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:(0,N.jsx)(en.AI,{color:t,onChange:e=>{return n=e.hex,s.current=n,void i(n);var n}})})]});return n?p:c}function on(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)(V.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})}tn.propTypes=nn,on.propTypes=nn,on.defaultProps={componentProps:{}};var ln=t(49777),rn=t.n(ln),an=t(76818);function sn(e){let{editing:n,value:t,onChange:o,componentProps:i,...l}=e;const{blocklet:r}=i,a="auto"===t?(0,an.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:rn()({title:"Owner",issuer:(0,S.getDisplayName)(r),issuerDid:r.appDid,ownerName:"Your Name",ownerDid:r.appDid,preferredColor:t||"auto"})}}),(0,N.jsx)(tn,{...l,editing:n,value:n?a:t,onChange:o,componentProps:i})]})}sn.propTypes={...nn,componentProps:s().shape({blocklet:s().object.isRequired}).isRequired},sn.defaultProps={};var cn,dn=t(37382),pn=t(19197);const mn={input:on,color:tn,passport:sn,uploader:e=>(0,N.jsx)(pn.Z,{...e.componentProps})};function un(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)(hn,{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:mn[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)(He.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)(w.Z,{size:24}):(0,N.jsx)(Xe.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)(Qe.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)(Ye.Z,{})})})]})]},n)}))})}un.propTypes={schema:s().array.isRequired,loading:s().bool,onChange:s().func.isRequired,value:s().object,defaultValue:s().object,style:s().object,disabled:s().bool},un.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const hn=(0,r.Z)(dn.Z)(cn||(cn=(0,l.Z)([""])));var fn=t(90845),xn=t(50438),gn=t(6352),yn=t.n(gn),vn=t(88577),bn=t(28018),jn=t.n(bn),kn=t(80676),Zn=t(45005);function Cn(e){let{meta:n,onCancel:t,mode:l,handlePaySuccess:r}=e;const{t:a,locale:s}=(0,i.PE)(),{info:c}=(0,O.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{kn.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:kn.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:kn.od.create({baseURL:yn()(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)(vn.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,jn()((()=>kn.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]})}Cn.propTypes={...Zn.$7,handlePaySuccess:s().func,mode:s().oneOf(["verify","purchase"]).isRequired},Cn.defaultProps={handlePaySuccess:()=>{}};const wn=(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)(Zn.AP,{action:l,onNext:null,onSelect:c})}):(0,N.jsx)(Cn,{...i,mode:l})}));wn.propTypes={mode:s().oneOf(["both","verify","purchase"]).isRequired,ref:s().any},wn.defaultProps={ref:{}};const Rn=wn;var En=t(35110),Sn=t(35966);function Tn(e){let{...n}=e;return(0,N.jsx)(R.Z,{className:"bottom-button",variant:"contained",color:"primary",...n})}var Pn,In,Un=t(96366);function Nn(){let{key:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{key:"sm"};const n=(0,Un.Z)();return(0,ge.Z)(n.breakpoints.down(e))}function Dn(e){let{blocklet:n,onStartNow:t,children:o,disabled:l}=e;const{t:r}=(0,i.PE)(),a=Nn();return!n||(0,F.bg)(n.meta)?(0,N.jsx)(Bn,{children:o}):(0,N.jsxs)(Ln,{isMobile:a,children:[(0,N.jsx)(Tn,{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})]})}Dn.propTypes={blocklet:s().object,onStartNow:s().func,children:s().any,disabled:s().bool},Dn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Bn=(0,r.Z)(d.Z)(Pn||(Pn=(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"))),Ln=(0,r.Z)(d.Z)(In||(In=(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 An=t(94494),On=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,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"})]})]})};function Fn(){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)(On,{style:{width:200,height:250}}),(0,N.jsx)(Ie.Z,{marginTop:"24px",marginBottom:"24px",children:e("storage.spaces.connect.providerForStorage")})]})})}On.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},Fn.propTypes={};const Mn=Fn;var Gn=t(19654),zn=t(85836),qn=t(69972),Wn=t(47595),Vn=t(60939),_n=t(72443),Kn=t.n(_n);function Jn(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)(Wn.default,{})}),(0,N.jsx)(Vn.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(Kn()(o)))}finally{c(!1)}},onCancel:e=>d(e,!1)})]})}Jn.propTypes={onDeleteSpace:s().func,spaceGateway:s().shape({name:s().string.isRequired,url:s().string.isRequired,protected:s().bool}).isRequired},Jn.defaultProps={onDeleteSpace:()=>{}};const Hn=Jn;var Yn,Qn=function(e){return(0,N.jsx)("svg",{...e,children:(0,N.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};function Xn(e){let{spaceGateway:n,connected:t,onDisconnect:o,...l}=e;const r=Nn(),{t:a}=(0,i.PE)();return(0,N.jsxs)($n,{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)(zn.Z,{alt:n.did,src:(0,qe.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)(Ie.Z,{color:t?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:n.name}),(0,N.jsx)(Gn.Z,{label:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Qn,{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)(Ie.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)(Hn,{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)(Te.default,{className:"selected-icon"})})]})}Qn.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Xn.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},Xn.defaultProps={connected:!1,onDisconnect:()=>{}};const $n=(0,r.Z)(d.Z)(Yn||(Yn=(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"]))),et=Xn;const nt=function(){const{t:e}=(0,i.PE)(),{spaceGateway:n,settingStorageEndpoint:t}=Je();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)(Ie.Z,{fontSize:"1.2rem",fontWeight:"bold",children:e("storage.spaces.connected.title")})}),(0,N.jsx)(d.Z,{children:(0,N.jsx)(et,{style:{marginTop:"12px"},spaceGateway:n,connected:!0,onDisconnect:()=>t(null)},n.endpoint)})]})};var tt=t(55372),ot=t(17682),it=t(11663);function lt(e){let{onConnect:n,...t}=e;const{blocklet:l}=(0,Me.y0)(),{info:r}=(0,O.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,it.Z)({blocklet:l}),v=(0,F.yP)(r),{storageEndpoint:b}=Je(),[j,k]=(0,o.useState)({open:!1,action:"connect-to-did-spaces",checkTimeout:3e5,prefix:"/api/did",checkFn:kn.od.create({baseURL:yn()(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)(Ie.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)(Ie.Z,{gutterBottom:!0,children:a("storage.spaces.authorize.success")})},onClose:()=>{C((e=>({...e,open:!1})))}}),E=async e=>{let{did:t,name:o,endpoint:i}=e;const l=await(0,qe.Z3)(i);if(!await(0,qe.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}))),!Be()(e.spaceGateway))return void await E(n(e.spaceGateway));const t=n(e.endpoint),o=e.space?n(e.space):{};await E({endpoint:t,did:(0,qe.LQ)(t),name:"DID Space",...o})}),0)},P=async()=>{try{u(!0);const e=await(0,qe.Z3)(c),n=(0,qe.ag)(e),t=new URL(e).searchParams.get("spaceDid");if(!await(0,qe.w2)(n))throw new Error(a("storage.spaces.gateway.add.invalidUrl"));C((e=>({...e,open:!0,prefix:yn()(n,"space/api/did"),baseUrl:new URL(n).origin,checkFn:kn.od.create({baseURL:yn()(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)(ot.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)(ot.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)(Ie.Z,{sx:{fontWeight:"bold",textTransform:"none"},children:a(b?"storage.spaces.connect.useWalletReconnect":"storage.spaces.connect.useWallet")})}),(0,N.jsx)(vn.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)(vn.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)(R.Z,{onClick:e=>{e.stopPropagation(),f(!1)},color:"inherit",children:a("common.cancel")}),(0,N.jsxs)(R.Z,{onClick:P,color:"primary",disabled:m||!c,variant:"contained",autoFocus:!0,children:[m&&(0,N.jsx)(w.Z,{size:16}),a("common.confirm")]})]}),children:[(0,N.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,N.jsx)(tt.Z,{component:"div",children:(0,N.jsx)(Ie.Z,{component:"div",children:(0,N.jsx)(V.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)(Ze.Z,{type:"error",style:{width:"100%"},children:x})]})]})}lt.propTypes={onConnect:a.func},lt.defaultProps={onConnect:()=>{}};const rt=lt;var at;function st(e){var n;let{blockletMeta:t,onEndpointUpdate:i}=e;const l=Nn(),{blocklet:r}=(0,Me.y0)(),{updateSpaceGateway:a,loading:s,hasStorageEndpoint:c}=Je();return(0,o.useEffect)((()=>{null===i||void 0===i||i()}),[r]),s?(0,N.jsx)(Sn.Z,{relative:"parent",children:(0,N.jsx)(w.Z,{})}):(0,N.jsxs)(ct,{children:[(0,N.jsx)(d.Z,{width:l?"360px":"720px",children:c?(0,N.jsx)(nt,{}):(0,N.jsx)(Mn,{})}),"required"===(null===t||void 0===t||null===(n=t.capabilities)||void 0===n?void 0:n.didSpace)&&(0,N.jsx)(Dn,{mt:8,children:(0,N.jsx)(rt,{onConnect:a})})]})}st.propTypes={blockletMeta:s().any.isRequired,onEndpointUpdate:a.func},st.defaultProps={onEndpointUpdate:()=>{}};const ct=(0,r.Z)(An.Z)(at||(at=(0,l.Z)(["\n height: 100%;\n overflow-y: auto;\n padding-bottom: 32px;\n overflow-x: hidden;\n"]))),dt=st;var pt,mt=t(49390),ut=t(67654),ht=t(45485),ft=t(45820);function xt(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,O.h6)(),{blocklet:m}=(0,Me.y0)(),[u,h]=(0,o.useState)(!1),f=(0,o.useRef)(null),[x,g]=(0,o.useState)(),[y,v]=(0,ut.Z)(s||"tmp"),[b,j]=s?[y,v]:[x,g],{storeList:k,teamDid:Z}=(0,F.dX)({fromBlocklet:p,blocklet:m,nodeInfo:d}),C=Fe()([...a.map((e=>({...e,protected:!0}))),...k],"url"),w=b&&C.find((e=>b===e.url))||C[0];return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(gt,{children:[(0,N.jsx)(R.Z,{ref:f,color:"primary","data-cy":"add-component-select-store",endIcon:(0,N.jsx)(mt.Z,{color:"primary"}),onClick:()=>{h(!0)},style:{padding:"0 2px"},children:(0,N.jsx)(Ie.Z,{color:"primary",children:w.name})}),(0,N.jsx)(Ie.Z,{color:"primary",children:r})]}),(0,N.jsxs)(V.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:w,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===C||void 0===C?void 0:C.map((e=>(0,N.jsx)(fe.Z,{sx:{width:"400px",maxWidth:"90vw"},value:e,"data-cy":e.url,children:(0,N.jsx)(ft.Z,{teamDid:Z,store:e,onDelete:()=>{var n;b===e.url&&j(null===(n=C[0])||void 0===n?void 0:n.url)}})},e.url))),!(0,ke.isInServerlessMode)(d)&&(0,N.jsx)(ht.Z,{disabled:t,storeList:C,teamDid:Z,onAdd:e=>{j(e)}})]}),l({currentRegistry:w})]})}xt.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}))},xt.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const gt=r.Z.div(pt||(pt=(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 yt,vt=t(38898),bt=t(71569),jt=t(52439),kt=t(44040),Zt=t(44727);const Ct=(e,n)=>yn()(n,"/blocklets/".concat(e.did)),wt=e=>{let{blocklet:n,attribute:t,value:o}=e;return n._formatted?n._formatted[t]:o},Rt=e=>e.inStore&&!1===(0,S.isFreeBlocklet)(e);function Et(e){let{blocklet:n,blocklets:t,handleButtonClick:l,endpoint:r}=e;const{t:a}=(0,i.PE)();let s=yn()(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=Rt(n)?a("common.purchase"):a("blocklet.component.choose");return(0,N.jsx)(vt.Z,{href:Ct(n,r),style:{color:"initial",textDecoration:"none"},onClick:e=>!!e.currentTarget.contains(e.target)||(e.preventDefault(),!1),target:"_blank",children:(0,N.jsx)(Tt,{title:wt({blocklet:n,attribute:"title",value:n.title||n.name}),did:n.did,description:wt({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)(Zt.Kk,{children:(0,N.jsx)(R.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)(w.Z,{size:16,style:{marginRight:3}}),p]}):p},n.did)})})})})}function St(e){let{handleButtonClick:n,handleSearchSelect:t,storeUrl:l,handleBlockletRender:r,extraFilter:a,serverVersion:s,resourceType:c,resourceDid:d,showResourcesSwitch:p,...m}=e;const{locale:u}=(0,i.PE)(),[h,f]=(0,o.useState)(!1),[x,g]=(0,o.useState)({}),y=l;return(0,o.useEffect)((()=>{g({showResources:!0,resourceType:c,resourceDid:d})}),[y,c,d]),(0,o.useEffect)((()=>{f(!0),g({showResources:!0,resourceType:c,resourceDid:d})}),[]),(0,N.jsx)(jt.ErrorBoundary,{FallbackComponent:bt.H,resetKeys:[y],children:(0,N.jsx)("div",{...m,children:h&&(0,N.jsx)(kt.Z,{showResourcesSwitch:p,blockletRender:e=>{const t={...e,handleButtonClick:n,endpoint:y};return r({...e,defaultRender:(0,N.jsx)(Et,{...t})})},baseSearch:!0,endpoint:y,locale:u,onFilterChange:e=>{g(e)},onSearchSelect:t,filters:x,extraFilter:a,serverVersion:s,fetchCategoryDelay:500})})})}Et.propTypes={blocklet:s().object.isRequired,blocklets:s().array,handleButtonClick:s().func,endpoint:s().string},Et.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]},St.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,showResourcesSwitch:s().bool},St.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0};const Tt=(0,r.Z)(Zt.ZP)(yt||(yt=(0,l.Z)(["\n .ms-highlight {\n color: ",";\n }\n"])),(e=>e.theme.palette.primary.main));var Pt,It,Ut=t(63902);const Nt=(0,o.forwardRef)(((e,n)=>{let{meta:t,isMobile:l,onStepChange:r}=e;const{steps:a,activeStep:s,setActiveStepByKey:c,setActiveStepByIndex:d}=(0,Re.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)(Lt,{component:"div",className:l?"mobileStyle":"",sx:{height:"calc(100% - 56px)"},children:(0,N.jsx)(Ut.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)(Bt,{children:null!==u&&void 0!==u&&u.body&&"function"===typeof u.body?u.body():u.body})})})}));Nt.propTypes={meta:s().any,onStepChange:s().func.isRequired,isMobile:s().bool.isRequired},Nt.defaultProps={meta:null};const Dt=e=>e.isMobile?"\n height: calc(100vh - 56px - 64px - 48px);\n ":"",Bt=r.Z.div(Pt||(Pt=(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"]))),Lt=(0,r.Z)(d.Z)(It||(It=(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=>Dt(e)),(e=>Dt(e))),At=Nt;var Ot,Ft,Mt,Gt,zt;const qt=e=>e.inStore&&!1===(0,S.isFreeBlocklet)(e),Wt=e=>{var n;return[K.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,K.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(null===e||void 0===e||null===(n=e.capabilities)||void 0===n?void 0:n.didSpace)},Vt=e=>{var n;return(null===e||void 0===e||null===(n=e.configs)||void 0===n||null===(n=n.find((e=>e.key===K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===n?void 0:n.value)||null},_t=e=>(e.environments||[]).some((e=>e.required)),Kt=(e,n)=>null===e||void 0===e?void 0:e.some((e=>e.required&&!n[e.key])),Jt=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})},Ht=function(){let{componentDid:e,timeout:n=1e3,manual:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};setTimeout((()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:t},"*")}),n)};function Yt(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,showResourcesSwitch:v,showFromUrl:b,enableRunBackground:j}=e;const k=(0,Ce.Fg)(),{t:Z,locale:C}=(0,i.PE)(),[E,P]=(0,o.useState)(!1),[I,U]=(0,o.useState)(null),[D,B]=(0,o.useState)(""),[L,A]=(0,o.useState)(""),{api:M,ws:{useSubscription:G},inService:z,info:q}=(0,O.h6)(),{blocklet:W,actions:{refreshBlocklet:_}}=(0,Me.y0)(),[J,H]=(0,o.useState)(null),[Y,Q]=(0,o.useState)(!1),X={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[$,ee]=(0,o.useState)(X),[ne,te]=(0,o.useState)(0),oe=(0,o.useRef)({}),ie=(0,o.useRef)({}),re=(0,o.useRef)({}),ae=(0,ge.Z)((e=>e.breakpoints.down("md"))),se=(0,ve.useParams)(),[ce,de]=(0,o.useState)(!0),{meta:pe}=oe.current,me=e=>ee((n=>({...n,...e})));(0,o.useEffect)((()=>{if($.pathPrefix){const{errMsg:e}=De({...$,pathPrefix:$.pathPrefix,locale:C});B(e)}}),[$.pathPrefix]),(0,o.useEffect)((()=>{0===ne&&ee(X)}),[ne]);const ue=()=>{var e;const n=null!==(e=Vt(W))&&void 0!==e?e:"";me({didSpaceEndpoint:n})},he=()=>{var e;return null!==oe&&void 0!==oe&&null!==(e=oe.current)&&void 0!==e&&e.meta?(0,S.getDisplayName)(oe.current):""},fe=e=>{const n=t=>{me({installResultProps:{variant:"error",title:he(),subTitle:e,footer:(0,N.jsx)(R.Z,{className:"bottom-button",disabled:t,"data-cy":"retry-install-component",onClick:async()=>{n(!0),await Ue(oe.current.installInput)},children:(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t&&(0,N.jsx)(w.Z,{size:16,style:{marginRight:8}}),Z("common.retry")]})})}})};n()},ye=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===W||void 0===W||null===(o=W.meta)||void 0===o?void 0:o.did)&&e(n)};G(K.BlockletEvents.statusChange,ye((e=>{if(e.status===K.BlockletStatus.upgrading)me({installResultProps:{variant:"success",title:he(),subTitle:Z("blocklet.component.installSuccessTip")}}),Ht({componentDid:se.componentDid});const n=Vt(W);me((e=>({...e,didSpaceEndpoint:n})))})),[null===W||void 0===W||null===(n=W.meta)||void 0===n?void 0:n.did]),G(K.BlockletEvents.downloadFailed,ye((()=>{fe(Z("blocklet.component.installComponentError"))})),[null===W||void 0===W||null===(t=W.meta)||void 0===t?void 0:t.did]),G(K.BlockletEvents.installFailed,ye((()=>{fe(Z("blocklet.component.installComponentError"))})),[null===W||void 0===W||null===(l=W.meta)||void 0===l?void 0:l.did]);const be=()=>{P(!1),ee({}),oe.current={},p()},Ie=e=>((null===W||void 0===W?void 0:W.children)||[]).some((n=>n.meta.did===e)),Ue=async e=>{var n,t;const{pathPrefix:o,bundleDid:i,title:l,componentName:r="",componentDid:a=""}=$,{configs:s=[],registryUrl:c,inStore:d,inputUrl:p,dist:m}=(null===(n=oe.current)||void 0===n?void 0:n.meta)||{},u=null===(t=oe.current)||void 0===t?void 0:t.downloadTokenList,h=d?(0,F.Rn)(c,i,m):p;P(!0);const f={rootDid:W.meta.did,url:h,mountPoint:le()(o),title:l,name:r,did:a,onlyRequired:!ce,...$.hasEnvironmentsStep&&s.length>0?{configs:s.map((e=>({...e,value:$.configsValue[e.key]||""})))}:{},...u?{downloadTokenList:u}:{},...e};try{if(await M.installComponent({input:f}),c){const{teamDid:e,storeList:n}=(0,F.dX)({fromBlocklet:z,nodeInfo:q,blocklet:W}),{isNew:t,decoded:o}=(0,F.bQ)(c,n);t&&await M.addBlockletStore({input:{teamDid:e,url:o}})}me({installResultProps:{}}),_({showError:!1,attachRuntimeInfo:!1})}catch(x){const e=(0,F.Z)(x);T.Z.error(e),console.error("installComponent error: ",x),fe(e)}finally{P(!1),oe.current.installInput=f}},De=e=>({errMsg:(0,En.Rw)({params:{...e,did:e.bundleDid},blocklets:[W],blocklet:W,locale:C})}),Le=async e=>{var n,t;const{errMsg:o}=De({...$,locale:C});B(o),ne===ze.length-2&&await Ue(e),null===(n=ie.current)||void 0===n||null===(t=n.setActiveStepByIndex)||void 0===t||t.call(n,(e=>e+1))},Oe=()=>{var e,n;null===(e=ie.current)||void 0===e||null===(n=e.setActiveStepByIndex)||void 0===n||n.call(e,(e=>e-1))},Ge=e=>{var n,t;let{chooseParams:o=oe.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=W.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:Ae()(t)?"":t}}}));oe.current={...o,meta:{...r,configs:f,registryUrl:a,inStore:s,inputUrl:c}};let x={};if(l){const e=[W],n=f||[],t=[],o=Fe()(Ne()([...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:!!K.BLOCKLET_CONFIGURABLE_KEY[t]}}));x={...x,configsList:r,configsValue:l,hasMissRequiredConfigs:Kt(r,l)}}const g=W.children.some((e=>"/"===e.mountPoint)),y=u.find((e=>e.meta.bundleDid===d)),v=W.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=oe.current.meta)||void 0===b||null===(b=b.environments)||void 0===b?void 0:b.length)>0}}const j=qt(oe.current.meta),k=Wt(oe.current.meta),Z=Vt(W);me({bundleDid:d,componentDid:h,...x,hasRequiredEnvironments:_t(oe.current.meta),requirePurchase:j,didSpaceIsRequiredSetup:k,didSpaceEndpoint:Z}),l&&j&&(()=>{const{pathPrefix:e,bundleDid:n,title:t,componentName:o="",componentDid:i=""}=$,{meta:l={}}=oe.current||{},{registryUrl:r,inStore:a,inputUrl:s,dist:c}=l,d=a?(0,F.Rn)(r,n,c):s;H({meta:l,installOpts:{type:"component",rootDid:W.meta.did,mountPoint:e,url:d,title:t,name:o,did:i}})})()};(0,o.useEffect)((()=>{y&&0===ne&&(Ge({chooseParams:{blocklets:[y],meta:y,registryUrl:y.homepage,inStore:!0},isInit:!0}),me({showFromUrlDialog:!1}),Le())}),[y,ne]);const ze=[{key:"selectComponent",name:Z("blocklet.component.selectComponent"),body:(0,N.jsxs)(Xt,{sx:{width:400},component:"div",children:[b&&$.showFromUrlDialog&&(0,N.jsx)(xn.Z,{mode:"component",onCancel:()=>{me({showFromUrlDialog:!1})},onSuccess:e=>{let{meta:n,inputUrl:t,inStore:o,registryUrl:i}=e;Ge({chooseParams:{meta:n,inputUrl:t,inStore:o,registryUrl:i},isInit:!0}),me({showFromUrlDialog:!1}),Le()},handleText:{title:Z("blocklet.component.addComponentTip.fromUrl"),confirm:Z("blocklet.component.choose")}}),(0,N.jsx)(xt,{stores:u,extra:(0,ke.isInServerlessMode)(q)?null:b?(0,N.jsxs)(R.Z,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{me({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[(0,N.jsx)(xe.Z,{style:{fontSize:20,marginRight:4}})," ",Z("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:E,onChange:()=>{ee({}),oe.current={}},storageKey:x,children:e=>{let{currentRegistry:n}=e;return(0,N.jsx)(St,{showResourcesSwitch:v,serverVersion:null===q||void 0===q?void 0:q.version,style:ae?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:n.url,resourceType:h,resourceDid:f,handleButtonClick:e=>{Ge({chooseParams:{...e,inStore:!0},isInit:!0})},handleBlockletRender:e=>{let{blocklet:n,defaultRender:t}=e;const o=(null===$||void 0===$?void 0:$.bundleDid)&&(null===$||void 0===$?void 0:$.bundleDid)===(null===n||void 0===n?void 0:n.did),i=(e=>{const n=((null===W||void 0===W?void 0:W.children)||[]).find((n=>n.meta.bundleDid===e.did));if(n){try{const t=n.meta.version,o=e.version;if(je().gt(o,t))return"upgrade"}catch{return"install"}return"disable"}return"install"})(n);return"disable"===i?(0,N.jsxs)(eo,{style:{cursor:"not-allowed",backgroundColor:k.palette.grey[100]},title:Z("blocklet.component.installed"),children:[(0,N.jsx)("div",{className:"install-container",children:(0,N.jsx)(Te.default,{className:"install-icon"})}),(0,N.jsx)("div",{className:"installed-blocklet",style:{marginLeft:16,pointerEvents:"none"},children:t})]}):(0,N.jsxs)(eo,{children:["upgrade"===i?(0,N.jsx)("div",{className:"upgrade-container",children:(0,N.jsx)(Pe.Z,{className:"upgrade-icon"})}):null,o&&(0,N.jsx)("div",{className:"check-container",children:(0,N.jsx)(Te.default,{className:"check-icon"})}),(0,N.jsx)("div",{className:o?"choose-blocklet":"",style:{marginLeft:16},children:t})]})}})}})]}),cancel:"embed"===m?void 0:Z("common.cancel"),confirm:Jt({params:$,blocklet:W,t:Z}),onCancel:be,onConfirm:()=>{Le()}},{key:"agreement",name:Z("launchBlocklet.introduction"),body:(0,N.jsxs)(Xt,{component:"div",className:"agreement-wrapper",children:[(0,N.jsx)(Se.Z,{title:Z("launchBlocklet.introduction"),subTitle:Z("blocklet.component.addComponentTip.introduction")}),(0,N.jsx)(fn.Z,{meta:pe,onClickNext:Le,installRelated:ce,onChangeInstallRelated:de,handleDescEle:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:Z("blocklet.component.addComponentTip.".concat($.requirePurchase?"isPurchase":"isFree"),{name:he()})}})}),(0,N.jsx)("p",{children:Z("blocklet.component.addComponentTip.belowInformation")})]})})]}),cancel:Z(y?"common.cancel":"common.pre"),confirm:Z("launchBlocklet.next"),onCancel:y?be:Oe,onConfirm:()=>{Q(!1),Le()}},pe&&$.requirePurchase&&{key:"purchase",name:(0,N.jsxs)(N.Fragment,{children:[Z("common.verifyNFT"),(0,N.jsx)(He.Z,{})]}),body:(0,N.jsxs)(Xt,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(2===(null===(r=re.current)||void 0===r||null===(a=r.getCurrentStep)||void 0===a?void 0:a.call(r))||Y)&&(0,N.jsx)($t,{title:Z("common.verifyNFT"),subTitle:Z("blocklet.component.addComponentTip.verifyNFT")}),Be()($.purchaseResultProps)?J&&(0,N.jsx)(Rn,{ref:re,meta:J.meta,mode:$.componentDid?"verify":"both",onCancel:e=>{Q(!1),me({purchaseResultProps:{variant:"error",title:he(),subTitle:e,style:{paddingTop:120},footer:(0,N.jsx)(R.Z,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{me({purchaseResultProps:{}})},children:Z("common.retry")})}})},installOpts:J.installOpts,handlePaySuccess:e=>{let{downloadTokenList:n}=e;oe.current.downloadTokenList=n,Q(!1),Le()}}):(0,N.jsx)("div",{className:"flex-align-center flex-justify-center",children:(0,N.jsx)(Ee.Z,{...$.purchaseResultProps})})]}),disabled:2===(null===(s=re.current)||void 0===s||null===(c=s.getCurrentStep)||void 0===c?void 0:c.call(s))||Y,cancel:Z("common.pre"),confirm:Z("common.next"),onConfirm:()=>{"function"===typeof re.current.onNext&&(re.current.onNext(),Q(!0))},onCancel:()=>{Oe()}},(0,S.hasStartEngine)(pe)&&!Ie(pe.did)&&{key:"config",name:Z("common.config"),error:D,body:(0,N.jsxs)(Xt,{component:"div",children:[(0,N.jsx)($t,{title:Z("common.config"),subTitle:Z("blocklet.component.addComponentTip.config")}),(0,N.jsx)(V.Z,{label:Z("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:L||Z("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:$.pathPrefix,onChange:e=>{const n=e.target.value;me({pathPrefix:n}),A(Z("common.slugifyHint",{value:(0,F.LN)(n)}))}}),!!D&&(0,N.jsx)(Ze.Z,{type:"error",style:{width:"100%",marginTop:8},children:D})]}),cancel:Z("common.pre"),confirm:Z("common.next"),onCancel:Oe,onConfirm:()=>{Le()}},pe&&!Ie(pe.did)&&(null===$||void 0===$?void 0:$.hasEnvironmentsStep)&&{key:"environment",name:(0,N.jsxs)(N.Fragment,{children:[Z("common.environment")," ",$.hasRequiredEnvironments&&(0,N.jsx)(He.Z,{})]}),disabled:!!I||(null===$||void 0===$?void 0:$.hasMissRequiredConfigs),body:()=>(0,N.jsxs)(Xt,{component:"div",children:[(0,N.jsx)($t,{title:Z("common.environment"),subTitle:Z("blocklet.component.addComponentTip.environment")}),(0,N.jsx)(un,{style:{marginTop:-12,width:"100%"},schema:$.configsList,defaultValue:$.configsValue,onChange:(e,n)=>{let{action:t,currentItem:o,allValues:i}=n;"confirm"===t&&me({hasMissRequiredConfigs:Kt($.configsList,i),configsValue:i}),"edit"===t?U(o):["cancel","confirm"].includes(t)&&U(null)}})]}),cancel:Z("common.pre"),confirm:Z("common.next"),onCancel:Oe,onConfirm:Le},pe&&!Ie(pe.did)&&(null===$||void 0===$?void 0:$.didSpaceIsRequiredSetup)&&{key:"didSpace",name:(0,N.jsxs)(N.Fragment,{children:[Z("blocklet.component.didSpaceConfig")," ","required"===$.didSpaceIsRequiredSetup&&(0,N.jsx)(He.Z,{})]}),disabled:(null===$||void 0===$?void 0:$.didSpaceIsRequiredSetup)&&!$.didSpaceEndpoint,body:()=>(0,N.jsx)(Ke,{children:(0,N.jsxs)(Xt,{component:"div",children:[(0,N.jsx)($t,{title:Z("blocklet.component.didSpaceConfig"),subTitle:Z("blocklet.component.didSpaceConfigTip")}),(0,N.jsx)(d.Z,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:(0,N.jsx)(dt,{blockletMeta:oe.current.meta,onNext:()=>{Le()},onEndpointUpdate:ue})})]})}),cancel:Z("common.pre"),confirm:Z("common.next"),onCancel:Oe,onConfirm:Le},{key:"install",name:Ie(null===pe||void 0===pe?void 0:pe.did)?Z("common.upgrade"):Z("common.install"),disabled:!j&&Be()($.installResultProps),loading:!j&&Be()($.installResultProps),body:(0,N.jsx)(Xt,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Be()($.installResultProps)?(0,N.jsx)(we.Z,{message:(0,N.jsx)(no,{children:Z(j?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):(0,N.jsx)("div",{style:{marginTop:120},children:(0,N.jsx)(Ee.Z,{...$.installResultProps})})}),confirm:Z("common.complete"),onConfirm:()=>{Ht({timeout:0,componentDid:se.componentDid,manual:!0}),be(),setTimeout((()=>{const e=document.getElementsByClassName("dashboard-main")[0];e&&(e.scrollTop=e.scrollHeight)}),200)}}].filter((e=>e)),qe=ze[ne]||{};return W?(0,N.jsxs)(Qt,{sx:ae?{width:"100%",height:window.innerHeight}:{width:"100%",height:g?"72vh":"100vh"},children:[(0,N.jsx)(Re.W,{steps:ze,mode:"memory",children:(0,N.jsx)(At,{ref:ie,meta:pe,isMobile:ae,onStepChange:e=>{te(e)}})}),(0,N.jsxs)(d.Z,{className:"action-bar",children:[qe.cancel&&(0,N.jsx)(R.Z,{onClick:e=>{e.stopPropagation(),qe.onCancel()},disabled:ne===ze.length-2&&E,color:"inherit",children:qe.cancel||Z("common.cancel")}),qe.confirm&&(0,N.jsx)(R.Z,{onClick:e=>{e.stopPropagation(),qe.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:E||("boolean"===typeof qe.disabled?qe.disabled:!(!E&&!qe.error&&$.bundleDid)||ne>1&&!$.pathPrefix),variant:"contained",autoFocus:!0,title:qe.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 qe.loading?qe.loading:E)&&(0,N.jsx)(w.Z,{style:{marginRight:8},size:16}),qe.confirm]})})]})]}):null}Yt.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,showResourcesSwitch:s().bool,showFromUrl:s().bool,enableRunBackground:s().bool},Yt.defaultProps={onClose:()=>{},mode:"normal",stores:[],resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0};const Qt=(0,r.Z)(d.Z)(Ot||(Ot=(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"]))),Xt=(0,r.Z)(Ie.Z)(Ft||(Ft=(0,l.Z)(["\n width: 100%;\n height: 100%;\n"]))),$t=(0,r.Z)(Se.Z)(Mt||(Mt=(0,l.Z)(["\n margin-bottom: 24px;\n"]))),eo=r.Z.div(Gt||(Gt=(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 .install-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 .install-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 .upgrade-container {\n position: absolute;\n right: 6px;\n top: 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\n .upgrade-icon {\n position: relative;\n z-index: 2;\n margin: 0 1px 1px 0;\n font-size: 24px;\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),(e=>e.theme.palette.common.white),(e=>e.theme.palette.grey[300]),(e=>e.theme.palette.grey[300]),(e=>e.theme.palette.primary.main)),no=r.Z.div(zt||(zt=(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 to;function oo(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,O.h6)(),c=()=>{o(!1)};return t?(0,N.jsx)(io,{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)(Yt,{selectedMeta:l,onClose:c,storageKey:s?ye.K_:ye.WC})}):null}oo.propTypes={selectedMeta:s().object,showDialog:s().bool.isRequired,setShowDialog:s().func.isRequired,blocklet:s().object.isRequired},oo.defaultProps={selectedMeta:null};const io=(0,r.Z)(z.ZP)(to||(to=(0,l.Z)(["\n .MuiDialogContent-root {\n }\n"])));function lo(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)(oo,{showDialog:r,setShowDialog:a,blocklet:n})]})}lo.propTypes={children:s().any,blocklet:s().object.isRequired},lo.defaultProps={children:null};var ro=t(10032);const ao=e=>e.children.filter((e=>e.meta.interfaces.find((e=>e.type===K.BLOCKLET_INTERFACE_TYPE_WEB))));function so(e){let{params:n,setParams:t,setError:l,serviceTypes:r}=e;const{t:a}=(0,i.PE)(),{blocklet:s}=(0,Me.y0)(),c=s.meta.did,d=ao(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)(V.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)(V.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)(V.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)(V.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)(V.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)(V.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)(V.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)(V.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 co(e){let{children:n}=e;const{t:t}=(0,i.PE)(),{api:l}=(0,O.h6)(),{blocklet:r}=(0,Me.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)(Ie.Z,{component:"div",children:[(0,N.jsx)(V.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,En.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)(so,{params:e,setParams:e=>{o(null);(0,En.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,En.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)(w.Z,{size:16}):(0,N.jsx)(xe.Z,{style:{fontSize:18,marginRight:5}}),t("router.rule.add.title")]}),c&&(0,N.jsx)(ro.Z,{title:c.title,description:c.description,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel,color:"primary"})]})}so.propTypes={params:s().object,serviceTypes:s().array,setParams:s().func,setError:s().func},so.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:()=>{}},co.propTypes={children:s().any},co.defaultProps={children:null};var po=t(82434),mo=t.n(po),uo=t(3257),ho=t.n(uo),fo=t(62681),xo=t(18067),go=t(21164),yo=t(53777),vo=t(27773),bo=t(94552),jo=t(5140);function ko(e){let{id:n,from:t,children:l}=e;const{t:r}=(0,i.PE)(),{api:a}=(0,O.h6)(),{blocklet:s}=(0,Me.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)(w.Z,{size:16}):(0,N.jsx)(vo.default,{style:{fontSize:18,marginRight:5}}),r("router.rule.delete.title")]}),p&&(0,N.jsx)(jo.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 Zo(e){var n,t;let{id:l,from:r,to:a,children:s}=e;const{t:c}=(0,i.PE)(),{api:d}=(0,O.h6)(),{blocklet:p}=(0,Me.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)(Ie.Z,{component:"div",children:[(0,N.jsx)(V.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)(so,{params:e,setParams:e=>{(0,En.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,En.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)(w.Z,{size:16}):(0,N.jsx)(G.default,{style:{fontSize:18,marginRight:5}}),c("router.rule.update.title")]}),h&&(0,N.jsx)(ro.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 Co(e){const{locale:n}=(0,i.PE)(),{blocklet:t,recommendedDomain:o}=(0,Me.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)(bo.Z,{})})}),(0,N.jsx)(Zo,{...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)(ko,{...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)(vo.default,{})})}})]})}ko.propTypes={id:s().string.isRequired,from:s().object.isRequired,children:s().any},ko.defaultProps={children:null},Zo.propTypes={id:s().string.isRequired,from:s().object.isRequired,to:s().object.isRequired,children:s().any},Zo.defaultProps={children:null},Co.propTypes={isProtected:s().bool},Co.defaultProps={isProtected:!1};var wo=t(56048);function Ro(e){let{group:n,...t}=e;return n?(0,N.jsx)(wo.Z,{type:"reverse",...t,children:n}):null}function Eo(e){let{domain:n,isHttps:t,toUrl:o}=e;const i=t?"https":"http";let l=o;return mo()(l)||(l="".concat(i,"://").concat(n).concat(o)),(0,N.jsx)(vt.Z,{href:l,target:"_blank",style:{fontSize:14},underline:"hover",children:o},l)}function So(e){let{hasPermission:n}=e;const{t:t,locale:o}=(0,i.PE)(),l=(0,Un.Z)(),{blocklet:r,recommendedDomain:a}=(0,Me.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)(go.Z,{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)(xo.Z,{style:{fill:l.palette.text.disabled}})})})}):(0,N.jsx)(Co,{...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)(fo.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)(Eo,{domain:a,toUrl:e.to.url}),e.to.type===C.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,N.jsx)(Eo,{domain:a,toUrl:e.to.url}),e.to.type===C.ROUTING_RULE_TYPES.COMPONENT&&(0,N.jsx)(Ro,{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)(vt.Z,{href:(0,F.Sk)(a,e.from.pathPrefix,(0,F.f0)(r,o)),target:"_blank",style:{fontSize:16},underline:"hover",children:ho()(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)(yo.Z,{},"divider")]}))}Ro.propTypes={group:s().string.isRequired},Eo.propTypes={domain:s().string.isRequired,toUrl:s().string.isRequired,isHttps:s().bool},Eo.defaultProps={isHttps:!1},So.propTypes={hasPermission:s().bool},So.defaultProps={hasPermission:!1};const To=(0,M.V)(So,"mutate_blocklets"),Po=(0,M.V)(So,"",F.Wf);function Io(e){const{inService:n}=(0,O.h6)();return n?(0,N.jsx)(Po,{...e}):(0,N.jsx)(To,{...e})}var Uo=t(9218);const No=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 Do,Bo=t(83407),Lo=t(34966),Ao=t(32207),Oo=t(55498),Fo=t(57156),Mo=t.n(Fo),Go=t(30746),zo=t(26362),qo=t(82594),Wo=t(65140),Vo=t(20783);function _o(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)(Ie.Z,{component:"div",children:[(0,N.jsx)(Ie.Z,{gutterBottom:!0,children:d("blocklet.action.removeComponentDescription")}),(0,N.jsxs)(Vo.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)(Wo.Z,{}),label:d("blocklet.action.removeComponentKeepData")}),(0,N.jsx)(k.Z,{value:"complete",control:(0,N.jsx)(Wo.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)(Ko,{size:"small",disabled:x,onClick:()=>g,"data-cy":"delete-component-btn",children:(0,N.jsx)(vo.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)(ro.Z,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}_o.propTypes={component:s().object.isRequired,remove:s().func,onCancel:s().func,disabled:s().bool,showConfirm:s().bool,hideBtn:s().bool,tip:s().string},_o.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const Ko=(0,r.Z)(f.Z)(Do||(Do=(0,l.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"])));var Jo,Ho=t(22754),Yo=t(98451);function Qo(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?Yo.Z:Ho.Z,x=(0,N.jsx)(Xo,{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)(ro.Z,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel},"connect")]}Qo.propTypes={component:s().object.isRequired,onStart:s().func,onStop:s().func,disabled:s().bool,tip:s().string},Qo.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const Xo=(0,r.Z)(f.Z)(Jo||(Jo=(0,l.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"])));var $o=t(60501),ei=t(64886),ni=t(2078),ti=t.n(ni),oi=t(19778);function ii(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)(oi.Z,{type:"success",children:ti()(t.source)},"source"),"registry"===t.source&&(0,N.jsx)(vt.Z,{href:yn()(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")})]})}ii.propTypes={sourceInfo:s().shape({source:s().string,deployedFrom:s().string}),blocklet:s().object},ii.defaultProps={sourceInfo:{},blocklet:{}};var li=t(40736);function ri(e){let{blocklet:n,checkUpgrade:t,hasPermission:l,...r}=e;const{api:a}=(0,O.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,K.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)(wo.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)(w.Z,{size:16}):(0,N.jsx)(li.Z,{style:{fontSize:16,color:"red"}})})}),!!p&&(0,N.jsx)(T.Z,{variant:"error",message:p,onClose:()=>m("")}),x&&(0,N.jsx)(ro.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)(wo.Z,{...r,children:n.meta.version})}ri.propTypes={blocklet:s().object.isRequired,checkUpgrade:s().bool,hasPermission:s().bool},ri.defaultProps={checkUpgrade:!1,hasPermission:!1};const ai=(0,M.V)(ri,"mutate_blocklets"),si=(0,M.V)(ri,"",F.Wf);function ci(e){const{inService:n}=(0,O.h6)();return n?(0,N.jsx)(si,{...e}):(0,N.jsx)(ai,{...e})}var di,pi;const mi=e=>{var n;return!(null!==e&&void 0!==e&&null!==(n=e.meta)&&void 0!==n&&n.group)},ui=(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)(wo.Z,{children:e.version})}]:[],hi=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}},fi=(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(" / ")};function xi(e){var n,t;let{blocklet:l,depth:r,componentInfo:a,app:s,onClose:u}=e;const{t:h,locale:f}=(0,o.useContext)(i.RD),{deletingBlocklets:x}=(0,P.K)();let{status:g}=l;1===r&&x.includes(l.meta.did)&&(g="deleting");const y="/".concat(l.mountPoint||"/").replace(/\/+/g,"/"),v=a?hi(a):{},b=a?[{name:h("common.name"),value:(0,S.getDisplayName)(a,!0)},{name:h("common.version"),value:(0,N.jsx)(ci,{blocklet:a,checkUpgrade:!1})},{name:h("common.status"),value:(0,N.jsx)(Go.Z,{isResource:mi(l),status:g,source:a.source,progress:l.progress})},"running"===l.status?{name:h("blocklet.startedAt"),value:(0,F.B2)(l.startedAt,f)}:null,"running"!==l.status?{name:h("blocklet.stoppedAt"),value:(0,F.B2)(l.stoppedAt,f)}:null,l.installedAt?{name:h("blocklet.installedAt"),value:(0,F.B2)(l.installedAt,f)}:null,(0,S.hasStartEngine)(l.meta)?{name:h("common.mountPoint"),value:y}:null,a.meta.group?{name:h("common.group"),value:(0,N.jsx)(wo.Z,{type:"success",children:a.meta.group})}:null,{name:h("blocklet.overview.source"),value:(0,N.jsx)(ii,{sourceInfo:v,blocklet:l})},{name:h("blocklet.overview.deployedFrom"),value:v.deployedFrom||"-"},{name:h("common.did"),value:(0,N.jsx)(qn.Z,{did:a.meta.did,showQrcode:!0})},{name:h("common.author"),value:(0,F.rq)(a.meta.author)},{name:h("common.engine"),value:ui(a.engine,h).map((e=>{let{name:n,value:t}=e;return(0,N.jsx)(ei.Z,{style:{marginBottom:4},nameWidth:120,name:n,children:t},n)}))},null!==(n=l.dependents)&&void 0!==n&&n.length?{name:h("common.dependents"),value:(0,N.jsx)(d.Z,{children:l.dependents.map((e=>(0,N.jsx)(d.Z,{children:"".concat(fi(e.id,s)," ").concat(e.required?"(".concat(h("common.required"),")"):"")},e.id)))})}:null,null!==(t=l.meta.resources)&&void 0!==t&&t.length?{name:h("common.resource"),value:l.meta.resources.join(", ")}:null].filter(Boolean):[];return a?(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{u(null)},children:(0,N.jsxs)(d.Z,{paddingY:1.5,children:[(0,N.jsx)(m.Z,{children:h("common.componentBasicInfo")}),(0,N.jsx)(p.Z,{children:(j=b,j.map((e=>e.name===h("common.did")||e.name===h("blocklet.appId")?(0,N.jsx)(ei.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>e.name,children:e.value},e.name):(0,N.jsx)(ei.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name))))})]},"dialog-wrapper")},"base-info-dialog"):null;var j}xi.propTypes={blocklet:s().object.isRequired,depth:s().number,app:s().object,componentInfo:s().object,onClose:s().func.isRequired},xi.defaultProps={depth:0,app:null,componentInfo:null};(0,r.Z)(Bo.Z)(di||(di=(0,l.Z)(["\n .BaseBadge-badge {\n top: ","px;\n right: ","px;\n }\n"])),(e=>8*e.top||6),(e=>8*e.right||6)),(0,r.Z)(d.Z)(pi||(pi=(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 gi,yi;const vi=e=>{var n;return!(null!==e&&void 0!==e&&null!==(n=e.meta)&&void 0!==n&&n.group)},bi=(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(" / ")};function ji(e){var n,t,l;let{blocklet:r,ancestors:a,depth:s,onRemove:c,onStart:p,onStop:m,onRestart:u,getComponentUrl:h,app:x}=e;const{t:y}=(0,o.useContext)(i.RD),[b,j]=(0,o.useState)(),[k,Z]=(0,o.useState)(!1),[C,w]=(0,o.useState)(!1),[R,E]=(0,o.useState)(null),{deletingBlocklets:T}=(0,P.K)();let{status:I}=r;1===s&&T.includes(r.meta.did)&&(I="deleting");const U="/".concat(r.mountPoint||"/").replace(/\/+/g,"/"),D=h(U),B=(0,S.isInProgress)(x.status),L=(0,S.isInProgress)(r.status);let A="";if(B||L||1===s&&T.includes(r.meta.did))A=y("blocklet.component.tip.stopBlocklet");else if(null!==(n=r.dependents)&&void 0!==n&&n.length){const e=r.dependents.filter((e=>e.required));if(e.length){const n=e.map((e=>bi(e.id,x)));A=y("blocklet.component.tip.requiredBy",{name:n.join(", ")})}}return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Zi,{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)(zo.Z,{blocklet:r,ancestors:a}),(0,N.jsxs)(d.Z,{ml:"16px",children:[(0,N.jsxs)(d.Z,{className:"component-header",onClick:()=>j(r),children:[(0,N.jsx)(d.Z,{className:"component-name",children:(0,S.getDisplayName)(r,!0)}),(0,N.jsx)(d.Z,{className:"component-version",children:null===r||void 0===r||null===(t=r.meta)||void 0===t?void 0:t.version})]}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:["unknown"!==I&&(0,N.jsx)(Go.Z,{style:{marginLeft:4},status:I,source:r.source,progress:r.progress}),(0,N.jsx)(qo.Z,{style:{marginLeft:4},mode:r.mode||""}),!(null===(l=r.dependents)||void 0===l||!l.length)&&(0,N.jsx)(v.Z,{title:["".concat(y("common.dependents"),": "),r.dependents.map((e=>(0,N.jsx)(d.Z,{pl:1,children:"".concat(bi(e.id,x)," ").concat(e.required?"(".concat(y("common.required"),")"):"")},e.id)))],children:(0,N.jsx)(d.Z,{display:"flex",color:"primary.main",ml:1,children:(0,N.jsx)(Oo.JO,{icon:"octicon:package-dependents-16"})})})]})]})]},r),(0,S.hasStartEngine)(r.meta)&&(0,N.jsx)(d.Z,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,N.jsx)("a",{target:"_blank",href:D,rel:"noopener noreferrer",title:D,children:(0,N.jsx)(d.Z,{maxWidth:400,sx:{color:"secondary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:Mo()(U)})})},U),(0,N.jsx)("div",{style:{flex:1}}),(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,S.hasStartEngine)(r.meta)&&(0,N.jsx)(v.Z,{title:y("common.visit"),children:(0,N.jsx)("a",{target:"_blank",href:D,rel:"noopener noreferrer",children:(0,N.jsx)(f.Z,{size:"small",children:(0,N.jsx)(bo.Z,{})})})}),(0,N.jsx)(ue,{blocklet:r,ancestors:a,children:e=>{let{open:n}=e;return(0,N.jsx)(v.Z,{title:y("common.config"),children:(0,N.jsx)(ki,{color:"error",badgeContent:"",variant:"dot",invisible:!(0,S.getComponentMissingConfigs)(r,a[0]).length,children:(0,N.jsx)(f.Z,{onClick:n,size:"small",children:(0,N.jsx)(g.Z,{})})})},"config")}}),(0,N.jsx)(Qo,{blocklet:x,component:r,onStart:p,onStop:m,disabled:!["starting","stopping"].includes(x.status)&&(0,S.isInProgress)(x.status)}),(0,N.jsx)($o.Z,{"data-cy":"component-actions",actions:[(0,S.hasStartEngine)(r.meta)?{icon:(0,N.jsx)(Lo.Z,{}),text:y("common.detail"),onClick:()=>{j(r)}}:null,!vi(r)&&{icon:(0,N.jsx)(Ao.default,{}),text:y("common.restart"),onClick:()=>{E({title:"".concat(y("common.restart")," ").concat(r.meta.title),description:y("blocklet.action.restartDescription"),confirm:y("blocklet.action.confirmRestart"),cancel:y("common.cancel"),onConfirm:async()=>{w(!0),await u(r),w(!1)},onCancel:()=>E(null)})},disabled:C||B||L||"running"!==r.status},{icon:(0,N.jsx)(vo.default,{}),text:y("common.delete"),onClick:()=>{Z(!0)},disabled:B||L||!!A,tip:A}].filter(Boolean)})]},"actions")]},"group-not-gateway-box"),(0,N.jsx)(yo.Z,{},"line"),(0,N.jsx)(xi,{componentInfo:b,onClose:j,blocklet:r,app:x,depth:s}),(0,N.jsx)(_o,{blocklet:x,component:r,remove:async function(){w(!0);try{await c(...arguments)}catch{}w(!1),Z(!1)},onCancel:()=>Z(!1),hideBtn:!0,showConfirm:k},"delete-component"),R&&(0,N.jsx)(ro.Z,{title:R.title,description:R.description,confirm:R.confirm,cancel:R.cancel,params:R.params,onConfirm:R.onConfirm,onCancel:R.onCancel},"confirm-setting")]})}ji.propTypes={blocklet:s().object.isRequired,ancestors:s().array,depth:s().number,onRemove:s().func,onStart:s().func,onStop:s().func,onRestart:s().func,getComponentUrl:s().func,app:s().object},ji.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const ki=(0,r.Z)(Bo.Z)(gi||(gi=(0,l.Z)(["\n .BaseBadge-badge {\n top: ","px;\n right: ","px;\n }\n"])),(e=>8*e.top||6),(e=>8*e.right||6)),Zi=(0,r.Z)(d.Z)(yi||(yi=(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 Ci,wi=t(56556);function Ri(e){let{meta:n,dependencies:t,logoUrl:o,setInstallComponentMeta:l}=e;const r=(0,O.h6)(),{t:a}=(0,i.PE)();return(0,N.jsxs)(Ei,{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)(Oo.JO,{icon:"octicon:package-dependents-16"})})})]}),(0,N.jsx)("div",{style:{flex:1}}),(0,N.jsx)(wi.Z,{onClick:()=>{l(n)},startIcon:(0,N.jsx)(Oo.JO,{icon:"ph:download-simple-bold"}),children:a("common.install")})]}),(0,N.jsx)(yo.Z,{class:"line"},"line")]})}Ri.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}))},Ri.defaultProps={logoUrl:"",dependencies:[]};const Ei=(0,r.Z)(Zi)(Ci||(Ci=(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 Si,Ti,Pi;function Ii(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,O.h6)(),{addDeletingDid:L,removeDeletingDid:A,matchDeletingDid:G}=(0,P.K)(),[z,q]=(0,o.useState)(!1),[W,V]=(0,o.useState)(null),[_,K]=(0,o.useState)(null),[J,H]=(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})),V({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)),A(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))}};(0,Uo.Z)(te);const ae=No({blocklet:t,scrollToComponent:!0}),se=Y||ae;return(0,N.jsxs)(Ui,{component:"div",...a,children:[(0,N.jsxs)(Ni,{display:"flex",children:[(0,N.jsxs)(Di,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[null!==ne&&void 0!==ne&&ne.length?"".concat(s("common.components")," (").concat(ne.length,")"):"".concat(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)(ki,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!$,children:(0,N.jsxs)(R.Z,{disabled:z||(0,S.isInProgress)(t.status),color:"secondary",onClick:()=>{te()},"data-cy":"check-for-updates",children:[(0,N.jsx)(d.Z,{ml:.5,mr:.5,display:"flex",children:z?(0,N.jsx)(w.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)(co,{children:e=>{let{open:n}=e;return(0,N.jsxs)(R.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)(lo,{blocklet:t,serverVersion:D.version,children:e=>{let{open:n}=e;return(0,N.jsxs)(R.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)(ji,{blocklet:t,app:t,onRemove:oe,onStart:ie,onStop:le,onRestart:re,getComponentUrl:r},"0-".concat(t.meta.did)),t.children.map((e=>(0,N.jsx)(ji,{depth:1,blocklet:e,ancestors:[t],app:t,onRemove:oe,onStart:ie,onStop:le,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)(Zi,{children:(0,N.jsx)(Ri,{setInstallComponentMeta:Q,...e})},e.meta.did)))]}):(0,N.jsx)(d.Z,{mt:8,children:(0,N.jsx)(E.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)(Io,{})}),!!W&&(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:W.list.map((e=>(0,N.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,N.jsx)(j.Z,{checked:W.checks[e.groupId],onChange:n=>((e,n)=>{const{checked:t}=e.target;V((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)(R.Z,{onClick:()=>{V(null)},children:s("common.cancel")}),(0,N.jsxs)(R.Z,{onClick:e=>{e.stopPropagation(),(async()=>{if(!z)try{q(!0);const e=Object.keys(W.checks).filter((e=>W.checks[e])),n={updateId:W.params.updateId,rootDid:t.meta.did,selectedComponents:e};await I.upgradeComponents({input:n}),q(!1),V(null),ee(null)}catch(e){q(!1),T.Z.error((0,F.Z)(e))}})()},color:"primary",disabled:z||!W.hasChecks,variant:"contained",autoFocus:!0,children:[z&&(0,N.jsx)(w.Z,{size:16}),s("common.update")]})]})]})}),!!_&&(0,N.jsx)(c.Z,{open:!0,fullWidth:!0,onClose:()=>K(!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:J,onChange:e=>H(!!e.target.checked)}),label:s("blocklet.component.showContainer")})})})]})}),(0,N.jsx)(oo,{selectedMeta:se,blocklet:t,showDialog:!!se,setShowDialog:()=>Q(null)})]})}Ii.propTypes={blocklet:s().object.isRequired,onUpdate:s().func,getComponentUrl:s().func},Ii.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Ui=r.Z.div(Si||(Si=(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"]))),Ni=(0,r.Z)(d.Z)(Ti||(Ti=(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"))),Di=(0,r.Z)(d.Z)(Pi||(Pi=(0,l.Z)(["\n "," {\n width: 100%;\n justify-content: space-between;\n }\n"])),(e=>e.theme.breakpoints.down("sm")));var Bi=t(89487);function Li(e){const{locale:n}=(0,o.useContext)(i.RD),{blocklet:t,recommendedDomain:l}=(0,Bi.y0)();return(0,N.jsx)(Ii,{blocklet:t,getComponentUrl:e=>(0,F.vH)({blocklet:t,domain:{value:l},mountPoint:e,params:(0,F.f0)(t,n)}),...e})}Li.defaultProps={}},44543:(e,n,t)=>{const o=t(57156);e.exports=(e,n)=>o(e)===o(n)},67444:(e,n,t)=>{const{NODE_MODES:o}=t(35432);e.exports={isInServerlessMode:function(){let{mode:e,previousMode:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e===o.SERVERLESS||n===o.SERVERLESS}}},60501:(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)([""])))},90845:(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),w=t(22324);const R=function(e){const{api:n}=(0,w.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 E;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:w}=R(o),E=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:[w?(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:E,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:w})]})}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(E||(E=(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")))},26362:(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(22324),p=t(64387);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:[]}},53777:(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:""}},50438:(e,n,t)=>{"use strict";t.d(n,{Z:()=>R});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(88577),x=t(68420),g=t(28726),y=t(88574),v=t(38242),b=t(22324),j=t(48208),k=t(64387),Z=t(47791),C=t(69972),w=t(96266);function R(e){let{defaultUrl:n,onCancel:t,onSuccess:i,onError:l,mode:R,handleText:E}=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,A]=(0,o.useState)(n),[O,F]=(0,o.useState)(n?1:0),[M,G]=(0,o.useState)(B),[z,q]=(0,o.useState)(!1),[W,V]=(0,o.useState)({}),_="component"===R,K=!!_||!n,J=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),V({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&&J()}),[n]);const H=[{name:D("common.name"),value:(0,v.getDisplayName)({meta:M},!0)},{name:D("common.version"),value:M.version},{name:D("common.did"),value:(0,w.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,w.jsx)(c.Z,{component:"div",children:(0,w.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),A(e.target.value)},disabled:P,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),J(),F(1))}})}),cancel:D("common.cancel"),confirm:D("common.next"),onCancel:t,onConfirm:()=>{J(),F(1)}},{label:D("blocklet.fromUrl.step1"),body:P?(0,w.jsx)("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:(0,w.jsx)(a.Z,{})}):M.did?(0,w.jsx)("div",{style:{paddingLeft:"10%"},children:H.map((e=>e.name===D("common.did")?(0,w.jsx)(h.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>D("common.did"),children:e.value},e.name):(0,w.jsx)(h.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)))}):null,cancel:D(K?"common.pre":"common.cancel"),confirm:(null===E||void 0===E?void 0:E.confirm)||D("blocklet.fromUrl.confirm"),onCancel:()=>{K?F((e=>e-1)):t()},onConfirm:()=>{(()=>{if(_)return i({meta:M,...W}),void t();I(!0),q(!0)})()}}],Q=Y[O];return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(r.ZP,{title:(null===E||void 0===E?void 0:E.title)||D("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Q.onCancel(),showCloseButton:0===O,disableEscapeKeyDown:!0,open:!0,actions:(0,w.jsxs)(w.Fragment,{children:[Q.cancel&&(0,w.jsx)(g.Z,{onClick:e=>{e.stopPropagation(),N(null),Q.onCancel()},color:"inherit",children:Q.cancel||D("common.cancel")}),(0,w.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===O&&(0,w.jsx)(a.Z,{size:16}),Q.confirm]})]}),children:[K&&(0,w.jsx)(p.Z,{alternativeLabel:!0,activeStep:O,children:Y.map((e=>{let{label:n}=e;return(0,w.jsx)(m.Z,{children:(0,w.jsx)(u.Z,{children:n})},n)}))}),(0,w.jsx)(s.Z,{component:"div",style:{marginTop:24},children:Q.body}),!!U&&(0,w.jsx)(y.Z,{type:"error",style:{width:"100%",marginTop:8},children:U})]}),M&&z&&(0,w.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,...W}),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)}})]})}R.propTypes={defaultUrl:l().string,onCancel:l().func.isRequired,onSuccess:l().func.isRequired,onError:l().func,mode:l().oneOf(["install","component"]),handleText:l().object},R.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}}},19197:(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(2613),t.e(1294),t.e(4804)]).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"])))},82594:(e,n,t)=>{"use strict";t.d(n,{Z:()=>a});var o=t(55898),i=t.n(o),l=t(56048),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}},35110:(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}}},30629:(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(43449),u=t(37382),h=t(90651),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[w,R]=(0,o.useState)(!1),[E,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),R(!1)}},D=w?(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:w?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.Z,{"data-cy":"schema-form-item-confirm",onClick:N,disabled:t||E,size:"large",children:E?(0,f.jsx)(s.Z,{size:24}):(0,f.jsx)(d.Z,{})}),(0,f.jsx)(p.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{U(T),R(!1)},disabled:t||E,size:"large",children:(0,f.jsx)(c.default,{})})]}):(0,f.jsx)(h.Z,{triggers:k,onEnterEdit:()=>R(!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}},37382:(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")))},90651:(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:[]}},43449:(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))},94494:(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")))},12816:(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}},28039:(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"])))}}]);
@@ -1,2 +0,0 @@
1
- /*! For license information please see 2613.4592208a.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[2613],{87806:(e,t,i)=>{"use strict";t.Z=void 0;(o=i(5057))&&o.__esModule;var o,n=i(96266);function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){s(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function s(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var o=i.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var l=function(e){return(0,n.jsx)("svg",a(a({},e),{},{children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 10a6.75 6.75 0 1 1 13.5 0 6.75 6.75 0 0 1-13.5 0zM10 1.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5zM8.03 6.97a.75.75 0 0 0-1.06 1.06l5 5a.75.75 0 1 0 1.06-1.06l-5-5z"})}))};l.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},l.displayName="revoke";t.Z=l},62613:(e,t,i)=>{"use strict";i.d(t,{qY:()=>I,YZ:()=>Ce});i(1192),i(2484),i(5873),i(79787);var o=i(96266),n=i(47220),r=i(76223),a=i(68420),s=i(11337),l=i(43907),c=i(55498),d=i(13727),u=i(72113),p=i(7469),m=i(25228),f=i(39948),b=i(67680),E=i(99360),w=i(55898),h=i.n(w),_=i(5057),g=i(56556);function v(e){let{optionalComponent:t,index:i,installStatus:n,hasPermission:a,t:s}=e;const l="stopped"===n||"running"===n;return(0,o.jsxs)(f.Z,{children:[0===i?null:(0,o.jsx)(f.Z,{sx:{width:"100%",height:"1px",backgroundColor:r.E.gray6}}),(0,o.jsxs)(f.Z,{sx:{padding:"20px 24px",paddingTop:.5,marginTop:2,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[(0,o.jsx)("img",{style:{width:60,height:60,minWidth:60,minHeight:60},src:t.logoUrl,alt:t.meta.title}),(0,o.jsxs)(f.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",marginLeft:2},children:[(0,o.jsxs)(f.Z,{sx:{fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var e;return null===(e=t.meta)||void 0===e||e.did,void window.open(null===t||void 0===t?void 0:t.storeUrl,"_blank")},children:[t.meta.title,(0,o.jsxs)(f.Z,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[t.meta.version,(0,o.jsx)(c.JO,{className:"link-icon",icon:"fluent:open-20-filled",style:{color:r.E.primaryBase,fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.3s"}})]})]}),(0,o.jsx)(f.Z,{sx:{marginTop:0,opacity:.7},children:t.meta.description}),(0,o.jsx)(f.Z,{sx:{display:a?"flex":"none",flexDirection:"row",gap:1},children:n?(0,o.jsx)(f.Z,{sx:{marginTop:2,opacity:.7},children:l?(0,o.jsx)(g.Z,{variant:"contained",onClick:()=>{window.location.reload()},children:s("componentInstallerRefresh")},"refresh"):(0,o.jsx)(g.Z,{disabled:!0,sx:{color:"#333"},startIcon:(0,o.jsx)(c.JO,{icon:"line-md:loading-loop",style:{color:"#333",fontSize:16}}),variant:"contained",children:n},"status")}):(0,o.jsx)(g.Z,{sx:{marginTop:2},variant:"contained",className:"button",onClick:()=>{var e;return null===(e=t.meta)||void 0===e||e.did,void window.open(null===t||void 0===t?void 0:t.installUrl,"_blank")},children:s("componentInstallerInstall")},"install")}),l?(0,o.jsx)(f.Z,{sx:{marginTop:2,opacity:.7},children:s("componentInstallerSuccessInstalled")}):null]})]})]})}v.propTypes={t:h().func.isRequired,optionalComponent:h().object.isRequired,index:h().number.isRequired,installStatus:h().string,hasPermission:h().bool.isRequired},v.defaultProps={installStatus:""};const T={zh:{componentInstallerTitle:"\u7f3a\u5c11\u7ec4\u4ef6",componentInstallerInstall:"\u5b89\u88c5",componentInstallerClose:"\u5173\u95ed",componentInstallerRefresh:"\u91cd\u8f7d\u9875\u9762",componentInstallerSuccessInstalled:"\u5b89\u88c5\u6210\u529f\uff0c\u8bf7\u91cd\u8f7d\u9875\u9762\u67e5\u770b\u53d8\u5316\u3002",componentInstallerSuggestions:"\u8bf7\u8054\u7cfb\u7cfb\u7edf\u7ba1\u7406\u5458\u5b89\u88c5\u8be5\u7ec4\u4ef6\u3002",componentInstallerNoDefinedInBlockletYML:"\u7ec4\u4ef6\u672a\u5728 blocklet.yml \u4e2d\u5b9a\u4e49"},en:{componentInstallerTitle:"Missing component",componentInstallerInstall:"Install",componentInstallerClose:"Close",componentInstallerRefresh:"Refresh",componentInstallerSuccessInstalled:"Successfully installed, please refresh the page to see the changes.",componentInstallerSuggestions:"Please contact the system administrator to install the component.",componentInstallerNoDefinedInBlockletYML:"The component is not defined in blocklet.yml"}};var x=i(74958),S=i(2842);const O=e=>"string"===typeof e?new Set(e.split(";;")):new Set(e);const R=function(e){let{did:t,onInstalled:i,onError:o}=e;const n=Array.isArray(t)?t.join(";;"):t,[r,a]=(0,_.useState)({}),s=(0,_.useRef)({onInstalled:i,onError:o});s.current={onInstalled:i,onError:o};const{optionalComponents:l,componentMountPoints:c}=window.blocklet,d=(0,_.useMemo)((()=>{var e;if(!l||!l.length)return[];const t=O(n),i=l.filter((e=>t.has(e.meta.did)));return null===(e=i?s.current.onError:s.current.onInstalled)||void 0===e||e(i),i}),[n,l]),u=(0,_.useMemo)((()=>{if(d.length)return!0;const e=O(n);return(c||[]).find((t=>e.has(t.did)))}),[d,c,n]);return d.forEach((e=>{e.storeUrl=(0,S.xn)(e.meta.homepage,"blocklets",e.meta.did),e.installUrl=(0,S.xn)(window.blocklet.appUrl,x.Bu,"/admin/components?install-component=".concat(e.meta.did))})),(0,_.useEffect)((()=>{const e=e=>{var t,i;if(e.origin===window.blocklet.appUrl&&"component-installer"===(null===(t=e.data)||void 0===t?void 0:t.kind)&&null!==(i=e.data)&&void 0!==i&&null!==(i=i.blocklet)&&void 0!==i&&i.children){var o;let t=!1;const i=O(n);null===(o=e.data)||void 0===o||null===(o=o.blocklet)||void 0===o||o.children.forEach((e=>{var o;i.has(null===(o=e.meta)||void 0===o?void 0:o.did)&&(t=!0,a((t=>{var i;return{...t,[null===(i=e.meta)||void 0===i?void 0:i.did]:e.status||"waiting"}})))})),t||a({})}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[n]),{optComponents:d,installed:!d.length&&u,installStatus:r,setInstallStatus:a,definedInBlockletYML:u}};function y(e){let{warnIcon:t,did:i,noPermissionMute:w,onInstalled:h,onError:g,children:x,closeByOutSize:S,onClose:O,fallback:y,disabled:I,roles:k=["owner","admin"]}=e;const{locale:N}=(0,a.PE)(),A=(0,E.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.I)(T,e,N,"en",t)})),{installed:L,optComponents:C,installStatus:P,definedInBlockletYML:D}=R({did:i,onInstalled:h,onError:g}),j=(0,_.useContext)(n.B3),M=()=>{null===O||void 0===O||O(!1)};return I?x:(0,o.jsx)(l.Z,{session:null===j||void 0===j?void 0:j.session,roles:k,children:e=>{let{hasPermission:n}=e;return L?x:w&&!n?y||null:"function"===typeof x?(0,o.jsxs)(o.Fragment,{children:[y,x({hasPermission:n,optComponents:C,installStatus:P})]}):(0,o.jsxs)(o.Fragment,{children:[y,(0,o.jsx)(u.d,{onClickAway:e=>{e.preventDefault(),e.stopPropagation(),S&&M()},children:(0,o.jsx)(p.Z,{in:!0,timeout:350,children:(0,o.jsx)(m.Z,{variant:"outlined",sx:{position:"fixed",top:20,right:20,zIndex:3e3,borderRadius:3,width:400,maxWidth:"90vw",borderColor:r.E.lineStep,border:"0 !important",fontSize:"14px",textAlign:"left",boxShadow:"0px 8px 16px 0px ".concat(r.E.gray6,", 0px 0px 0px 1px ").concat(r.E.gray6)},children:D?(0,o.jsxs)(f.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,o.jsxs)(f.Z,{sx:{padding:"20px 24px",marginLeft:0,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},children:[t||(0,o.jsx)(c.JO,{icon:"mdi:warning-box",style:{color:"yellowgreen",fontSize:24}}),(0,o.jsx)(f.Z,{sx:{marginLeft:1,fontSize:"16px",fontWeight:"bold"},children:A("componentInstallerTitle")}),(0,o.jsx)(f.Z,{sx:{flex:1}}),O?(0,o.jsx)(b.Z,{variant:"outlined",className:"button",onClick:M,children:(0,o.jsx)(d.default,{})}):null]}),(0,o.jsx)(f.Z,{sx:{width:"100%",height:"1px",backgroundColor:r.E.gray6}}),(0,o.jsx)(f.Z,{sx:{maxHeight:"70vh",overflowY:"auto"},children:C.map(((e,t)=>{var i,r;return(0,o.jsx)(v,{t:A,hasPermission:n,index:t,optionalComponent:e,installStatus:P[null===(i=e.meta)||void 0===i?void 0:i.did]},(null===(r=e.meta)||void 0===r?void 0:r.did)||t)}))}),n?null:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(f.Z,{sx:{width:"100%",height:"1px",backgroundColor:r.E.gray6}}),(0,o.jsx)(f.Z,{sx:{padding:"20px 24px"},children:(0,o.jsx)(f.Z,{sx:{opacity:1},children:A("componentInstallerSuggestions")})})]})]}):(0,o.jsxs)(f.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,o.jsxs)(f.Z,{sx:{padding:"20px 24px",marginLeft:0,display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"flex-start"},children:[t||(0,o.jsx)(c.JO,{icon:"mdi:warning-box",style:{color:"yellowgreen",fontSize:24}}),(0,o.jsx)(f.Z,{sx:{marginLeft:1,fontSize:"16px",fontWeight:"bold"},children:A("componentInstallerTitle")}),(0,o.jsx)(f.Z,{sx:{flex:1}}),O?(0,o.jsx)(b.Z,{variant:"outlined",className:"button",onClick:M,children:(0,o.jsx)(d.default,{})}):null]}),(0,o.jsx)(f.Z,{sx:{width:"100%",height:"1px",backgroundColor:r.E.gray6}}),(0,o.jsxs)(f.Z,{sx:{padding:"20px 24px",marginTop:0},children:[A("componentInstallerNoDefinedInBlockletYML"),": ",i]})]})})})})]})}})}function I(e){return window.blocklet?(0,o.jsx)(y,{...e}):e.children}y.propTypes={disabled:h().bool,warnIcon:h().node,did:h().oneOfType([h().string,h().arrayOf(h().string)]).isRequired,noPermissionMute:h().bool,onInstalled:h().func,onError:h().func,children:h().any.isRequired,closeByOutSize:h().bool,onClose:h().func,fallback:h().node,roles:h().array},y.defaultProps={disabled:!1,warnIcon:null,noPermissionMute:!1,onInstalled:null,onError:null,closeByOutSize:!1,onClose:null,fallback:null,roles:["owner","admin"]},I.propTypes={...y.propTypes,children:h().any.isRequired},I.defaultProps={...y.defaultProps};i(28018),i(94464),i(25710),i(28726);var k=i(13128);i(71569),i(25842);i(60251);var N=i(95712);i(47685),i(72966),i(92706);i(23939);var A=i(49384);i(21998);i(94457);var L=i(26538),C=i.n(L),P=i(87806);function D(e){let{passport:t,user:i,color:n,width:r,icon:s,children:l,createPassportSvg:c,...d}=e;const{t:u}=(0,a.PE)();return(0,o.jsxs)(f.Z,{...d,sx:{display:"flex",alignItems:"center",...null===d||void 0===d?void 0:d.sx},children:[(0,o.jsx)(f.Z,{className:"passport-item__display",dangerouslySetInnerHTML:{__html:c({title:t.title||t.name,issuer:t.issuer&&t.issuer.name,issuerDid:t.issuer&&t.issuer.id,ownerName:i.fullName,ownerDid:i.did,ownerAvatarUrl:i.avatar,revoked:t.revoked,preferredColor:n,width:r})}}),(0,o.jsxs)(f.Z,{className:"passport-item__body",sx:{p:0,ml:3,mt:0},children:[(0,o.jsxs)(f.Z,{className:"passport-item__title",sx:{display:"flex",alignItems:"center",fontWeight:400,fontSize:"16px",lineHeight:1.1875,color:"#222222"},children:[C()(t.title),(0,o.jsxs)(f.Z,{className:"passport-item__status-icon",sx:{svg:{fill:"#bfbfbf",height:"1.2em",marginLeft:"0.4em"}},children:[s,t.revoked&&(0,o.jsx)(P.Z,{})]})]}),t.expirationDate&&(0,o.jsx)(f.Z,{className:"passport-item__title",sx:{display:"flex",alignItems:"center",fontWeight:400,fontSize:"16px",lineHeight:1.1875,color:"#222222"},children:u("team.passport.validUntil",{date:t.expirationDate})}),l]})]})}D.propTypes={passport:h().any.isRequired,user:h().any.isRequired,color:h().string.isRequired,createPassportSvg:h().func.isRequired,icon:h().any,children:h().any,width:h().number},D.defaultProps={icon:null,children:null,width:150};i(30278),i(76818);const j=(0,_.createContext)({}),{Provider:M,Consumer:B}=j;i(82790),i(86229),i(82434),i(14506),i(16967);var U=i(36738);function F(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)e[o]=i[o]}return e}var K=function e(t,i){function o(e,o,n){if("undefined"!==typeof document){"number"===typeof(n=F({},i,n)).expires&&(n.expires=new Date(Date.now()+864e5*n.expires)),n.expires&&(n.expires=n.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var a in n)n[a]&&(r+="; "+a,!0!==n[a]&&(r+="="+n[a].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+r}}return Object.create({set:o,get:function(e){if("undefined"!==typeof document&&(!arguments.length||e)){for(var i=document.cookie?document.cookie.split("; "):[],o={},n=0;n<i.length;n++){var r=i[n].split("="),a=r.slice(1).join("=");try{var s=decodeURIComponent(r[0]);if(o[s]=t.read(a,s),e===s)break}catch(l){}}return e?o[e]:o}},remove:function(e,t){o(e,"",F({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,F({},this.attributes,t))},withConverter:function(t){return e(F({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Z=i(10458),z=i.n(Z),H=Object.defineProperty,W=(e,t,i)=>(((e,t,i)=>{t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!==typeof t?t+"":t,i),i);class q{constructor(e){let{api:t}=e;W(this,"api"),this.api=t}async getUserPublicInfo(e){let{did:t}=e;const{data:i}=await this.api.get("/api/user",{params:{did:t}});return i}async getUserPrivacyConfig(e){let{did:t}=e;const{data:i}=await this.api.get("/api/user/privacy/config",{params:{did:t}});return i}async saveUserPrivacyConfig(e){const{data:t}=await this.api.post("/api/user/privacy/config",e);return t}async getUserNotificationConfig(){const{data:e}=await this.api.get("/api/user/notification/config");return e}async saveUserNotificationConfig(e){const{data:t}=await this.api.post("/api/user/notification/config",e);return t}async testNotificationWebhook(e){const{data:t}=await this.api.put("/api/user/notification/webhook",e);return t}async getProfileUrl(e){let{did:t,locale:i}=e;const o="".concat(U.WELLKNOWN_SERVICE_PATH_PREFIX,"/user");return(0,S.jb)(o,{did:t,locale:i})}async logout(e){let{visitorId:t}=e;const{data:i}=await this.api.post("/api/user/logout",{visitorId:t});return i}}class V{getSessionToken(){return K.get(U.SESSION_TOKEN_STORAGE_KEY)}setSessionToken(e){K.set(U.SESSION_TOKEN_STORAGE_KEY,e)}removeSessionToken(){K.remove(U.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(U.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(e){localStorage.setItem(U.REFRESH_TOKEN_STORAGE_KEY,e)}removeRefreshToken(){localStorage.removeItem(U.REFRESH_TOKEN_STORAGE_KEY)}}var G=Object.defineProperty,Y=(e,t,i)=>(((e,t,i)=>{t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!==typeof t?t+"":t,i),i);class X{constructor(e){let{api:t}=e;Y(this,"api"),this.api=t}async getUserSessions(e){let{did:t}=e;const{data:i}=await this.api.get("/api/user-session",{params:{userDid:t}});return i}}const J="1.16.26",$=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((t=>{setTimeout((()=>{t()}),e)}))},Q=e=>"Bearer ".concat(encodeURIComponent(e)),ee=()=>localStorage.getItem("__visitor_id");async function te(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;e.metaData.endTime=+new Date;const{startTime:i,endTime:o}=e.metaData,n=o-i;n<t&&await $(t-n),delete e.metaData}const ie=(e,t)=>{const i={...null===e||void 0===e?void 0:e.headers,"x-blocklet-js-sdk-version":J},o=ee();[void 0,null].includes(o)||(i["x-blocklet-visitor-id"]=o);const n=Z.create({...e,headers:i});return null!==t&&void 0!==t&&t.lazy&&(n.interceptors.request.use((e=>(e.metaData={startTime:+new Date},e)),(e=>Promise.reject(e))),n.interceptors.response.use((async e=>(await te(e.config,null===t||void 0===t?void 0:t.lazyTime),e)),(async e=>(await te(e.response.config,null===t||void 0===t?void 0:t.lazyTime),Promise.reject(e))))),n};function oe(e,t,i){let{getSessionToken:o,setSessionToken:n,removeSessionToken:r,getRefreshToken:a,setRefreshToken:s,removeRefreshToken:l,onRefreshTokenError:c,onRefreshTokenSuccess:d}=e,u=null;const p=ie({timeout:3e4,...t},i);return p.interceptors.request.use((async e=>{if(!K.get(U.SESSION_TOKEN_STORAGE_KEY)){const t=o();t&&(e.headers.authorization=Q(t))}return u&&await u,e}),(e=>Promise.reject(e))),p.interceptors.response.use((e=>e),(async e=>{var t;const i=e.config;if(i.headers={...null===i||void 0===i?void 0:i.headers},401===(null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.status)&&!i._retry){i._retry=!0;try{u||(u=async function(e){if(!e)throw new Error("Refresh token not found");const t=ie({baseURL:U.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:1e4,headers:{authorization:Q(e)}}),{data:i}=await t.post("/api/did/refreshSession");return i}(a()));const e=await u;return n(e.nextToken),s(e.nextRefreshToken),"function"===typeof d&&d(e),p(i)}catch(o){return r(),l(),"function"===typeof c&&c(o),Promise.reject(e)}finally{u=null}}return Promise.reject(e)})),p}var ne=Object.defineProperty,re=(e,t,i)=>(((e,t,i)=>{t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!==typeof t?t+"":t,i),i);const ae=new class{constructor(){re(this,"api"),re(this,"user"),re(this,"userSession"),re(this,"token");const e=new V,t=oe({getSessionToken:e.getSessionToken,setSessionToken:e.setSessionToken,removeSessionToken:e.removeSessionToken,getRefreshToken:e.getRefreshToken,setRefreshToken:e.setRefreshToken,removeRefreshToken:e.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},{baseURL:U.WELLKNOWN_SERVICE_PATH_PREFIX});this.user=new q({api:t}),this.userSession=new X({api:t}),this.token=e,this.api=t}};var se=i(71171),le=(i(35966),i(33518));i(88577),i(75506);z().defaults.timeout=1e4;z().create();i.p;i(22256);i.p;var ce;(0,le.Z)(f.Z)(ce||(ce=(0,se.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"])));var de;(0,le.Z)(f.Z)(de||(de=(0,se.Z)(["\n height: 100%;\n overflow-y: auto;\n"])));var ue=i(75760),pe=i(79366),me=i(93066),fe=i(62219),be=i.n(fe),Ee=i(35833),we=i.n(Ee),he=i(14520);class _e extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const ge=e=>void 0===globalThis.DOMException?new _e(e):new DOMException(e),ve=e=>{const t=void 0===e.reason?ge("This operation was aborted."):e.reason;return t instanceof Error?t:ge(t)};const Te=Symbol("skip");async function xe(e,t){return async function(e,t){let{concurrency:i=Number.POSITIVE_INFINITY,stopOnError:o=!0,signal:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(((r,a)=>{if(void 0===e[Symbol.iterator]&&void 0===e[Symbol.asyncIterator])throw new TypeError("Expected `input` to be either an `Iterable` or `AsyncIterable`, got (".concat(typeof e,")"));if("function"!==typeof t)throw new TypeError("Mapper function is required");if(!Number.isSafeInteger(i)&&i!==Number.POSITIVE_INFINITY||!(i>=1))throw new TypeError("Expected `concurrency` to be an integer from 1 and up or `Infinity`, got `".concat(i,"` (").concat(typeof i,")"));const s=[],l=[],c=new Map;let d=!1,u=!1,p=!1,m=0,f=0;const b=void 0===e[Symbol.iterator]?e[Symbol.asyncIterator]():e[Symbol.iterator](),E=e=>{d=!0,u=!0,a(e)};n&&(n.aborted&&E(ve(n)),n.addEventListener("abort",(()=>{E(ve(n))})));const w=async()=>{if(u)return;const e=await b.next(),i=f;if(f++,e.done){if(p=!0,0===m&&!u){if(!o&&l.length>0)return void E(new AggregateError(l));if(u=!0,0===c.size)return void r(s);const e=[];for(const[t,i]of s.entries())c.get(t)!==Te&&e.push(i);r(e)}}else m++,(async()=>{try{const o=await e.value;if(u)return;const n=await t(o,i);n===Te&&c.set(i,n),s[i]=n,m--,await w()}catch(n){if(o)E(n);else{l.push(n),m--;try{await w()}catch(n){E(n)}}}})()};(async()=>{for(let t=0;t<i;t++){try{await w()}catch(e){E(e);break}if(p||d)break}})()}))}(e,(e=>e()),t)}var Se=i(75239),Oe=i(11750),Re=i(19654);function ye(e){let{user:t,sessionUser:i}=e;const n=(0,me.Z)((()=>{var e;return null===(e=(null===t||void 0===t?void 0:t.passports)||[])||void 0===e?void 0:e.find((e=>e.name===i.role))}),[null===t||void 0===t?void 0:t.passports,null===i||void 0===i?void 0:i.role]);return(0,o.jsxs)(f.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,o.jsx)(N.Z,{size:40,variant:"circle",shape:"circle",src:i.avatar,did:i.did,sx:{flexShrink:0}}),(0,o.jsxs)(f.Z,{sx:{flex:1,overflow:"hidden"},children:[(0,o.jsxs)(f.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,o.jsx)(Se.Z,{title:i.fullName,children:(0,o.jsx)(Oe.Z,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:i.fullName})}),(0,o.jsx)(Re.Z,{label:(null===n||void 0===n?void 0:n.title)||(null===n||void 0===n?void 0:n.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:r.E.textBase,borderColor:r.E.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),(0,o.jsx)(Se.Z,{title:i.email,children:(0,o.jsx)(Oe.Z,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.email})})]})]})}const Ie={zh:{confirm:"\u786e\u8ba4",cancel:"\u53d6\u6d88",visitorId:"\u8bbe\u5907\u6807\u8bc6",deviceType:"\u8bbe\u5907\u7c7b\u578b",platform:"\u64cd\u4f5c\u7cfb\u7edf",walletOS:"\u94b1\u5305\u7c7b\u578b",role:"\u89d2\u8272",fullname:"\u59d3\u540d",email:"\u90ae\u7bb1",avatar:"\u5934\u50cf",user:"\u7528\u6237",createdAt:"\u9996\u6b21\u6d3b\u52a8\u65f6\u95f4",updatedAt:"\u6700\u8fd1\u6d3b\u52a8\u65f6\u95f4",lastLoginIp:"\u6700\u8fd1\u6d3b\u52a8\u5730\u5740",actions:"\u64cd\u4f5c",logoutAll:"\u6ce8\u9500\u6240\u6709\u4f1a\u8bdd",logoutAllTips:"\u4e0d\u4f1a\u6ce8\u9500\u5f53\u524d\u4f1a\u8bdd",logout:"\u6ce8\u9500",currentSession:"\u5f53\u524d\u4f1a\u8bdd",unknown:"\u672a\u77e5",expired:"\u5df2\u8fc7\u671f",remove:"\u5220\u9664",logoutThisSession:"\u6ce8\u9500\u6307\u5b9a\u4f1a\u8bdd",logoutThisSessionConfirm:"\u786e\u5b9a\u8981\u6ce8\u9500\u6b64\u4f1a\u8bdd\u5417?",logoutAllSession:"\u6ce8\u9500\u6240\u6709\u4f1a\u8bdd",logoutAllSessionConfirm:"\u786e\u5b9a\u8981\u6ce8\u9500\u6240\u6709\u4f1a\u8bdd\u5417?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},ke="Reserved IP",Ne="ip-region-cache";async function Ae(e){let t="",i={};try{const e=localStorage.getItem(Ne);e&&(i=JSON.parse(e))}catch{i={}}if(i[e])t=i[e];else{try{t=await async function(e){const t="https://api.ip.sb/geoip/".concat(e),i=await fetch(t),o=await i.json();let n="";return o.error?o.reserved&&(n=ke):n=[o.country,o.region,o.city].filter(Boolean).join("/"),n}(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!t)try{t=await async function(e){const t="https://ipapi.co/".concat(e,"/json/"),i=await fetch(t),o=await i.json();let n="";return o.error?o.reserved&&(n=ke):n=[o.country_name,o.region,o.city].filter(Boolean).join("/"),n}(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(t){const o=Object.keys(i);o.length>100&&delete i[o[0]],i[e]&&delete i[e],i[e]=t,localStorage.setItem(Ne,JSON.stringify(i))}return t}const Le=e=>new(we())(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[we().BROWSER.NAME,we().BROWSER.VERSION]]}).getResult();function Ce(e){let{user:t,showAction:i=!0,showUser:n=!0}=e;const r=(0,he.OP)(),{locale:l}=(0,a.PE)(),{confirmApi:c,confirmHolder:d}=(0,k.N4)(),u=(0,E.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.I)(Ie,e,l,"en",t)})),p=(0,E.Z)((async()=>{let e=null===t||void 0===t?void 0:t.userSessions;e||(e=await ae.userSession.getUserSessions({did:t.did}));try{var i;const t=null===(i=e)||void 0===i?void 0:i.map(((e,t)=>[t,e.lastLoginIp])).filter((e=>!!e[1])),o=null===t||void 0===t?void 0:t.map((e=>e[1])),n=await async function(e){return Promise.all(e.map((e=>Ae(e))))}(o);for(let i=0;i<n.length;i++){const o=n[i],r=t[i];e[r[0]].ipRegion=o}}catch(n){console.warn("Failed to convert ip to region"),console.error(n)}const o=(new Date).getTime();return be()(e,(e=>e.visitorId===r?-1:o-new Date(e.updatedAt).getTime()))})),m=(0,pe.Z)(p),b=(0,me.Z)((()=>m.data||[]),[m.data]),w=(0,me.Z)((()=>b.reduce(((e,t)=>(e[t.lastLoginIp]=t.ipRegion,e)),{})),[b]),h=(0,E.Z)((e=>{let{visitorId:t}=e;c.open({title:u("logoutThisSession"),content:u("logoutThisSessionConfirm"),confirmButtonText:u("confirm"),cancelButtonText:u("cancel"),onConfirm:async()=>{await ae.user.logout({visitorId:t}),m.refresh(),c.close()}})})),_=(0,me.Z)((()=>b.filter((e=>e.visitorId!==r))),[b]),v=(0,E.Z)((()=>{c.open({title:u("logoutAllSession"),content:u("logoutAllSessionConfirm"),confirmButtonText:u("confirm"),cancelButtonText:u("cancel"),onConfirm:async()=>{const e=_.map((e=>()=>ae.user.logout({visitorId:e.visitorId})));await xe(e,{concurrency:3,stopOnError:!1}),m.refresh(),c.close()}})})),T=[];i&&T.push((0,o.jsx)(Se.Z,{title:u("logoutAllTips"),children:(0,o.jsx)(g.Z,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:v,disabled:0===_.length,children:u("logoutAll")})},"logoutAll"));const x=(0,me.Z)((()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600})),[]),S=[{label:u("platform"),name:"platform",options:{customBodyRenderLite:e=>{var t,i;const n=b[e],r=Le(n.ua);return(0,o.jsx)(f.Z,{children:[null===(t=r.os)||void 0===t?void 0:t.name,null===(i=r.os)||void 0===i?void 0:i.version].filter(Boolean).join("/")||u("unknown")})}}},{label:u("deviceType"),name:"deviceType",options:{customBodyRenderLite:e=>{var t,i;const n=b[e],r=Le(n.ua);return(0,o.jsx)(f.Z,{children:[null===(t=r.browser)||void 0===t?void 0:t.name,null===(i=r.browser)||void 0===i?void 0:i.version].filter(Boolean).join("/")||u("unknown")})}}},{label:u("walletOS"),name:"walletOS",options:{customBodyRenderLite:e=>{var t;const i=b[e];return(0,o.jsx)(f.Z,{children:(null===(t=i.extra)||void 0===t?void 0:t.walletOS)||u("unknown")})}}},n&&{label:u("user"),name:"user",options:{customBodyRenderLite:e=>{const i=b[e];return(0,o.jsx)(f.Z,{sx:{minWidth:150,maxWidth:250},children:(0,o.jsx)(ye,{sessionUser:i.user,user:t})})}}},{label:u("createdAt"),name:"createdAt",options:{customBodyRenderLite:e=>{const t=b[e];return t.createdAt?(0,o.jsx)(A.Z,{value:t.createdAt,relativeRange:2592e5,locale:l}):u("unknown")}}},{label:u("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:e=>{const t=b[e];return"expired"===t.status?u("expired"):(0,o.jsx)(A.Z,{value:t.updatedAt,relativeRange:2592e5,locale:l})}}},{label:u("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:e=>{const t=b[e];return(0,o.jsx)(f.Z,{children:w[t.lastLoginIp]?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Oe.Z,{variant:"body2",children:w[t.lastLoginIp]}),(0,o.jsx)(Oe.Z,{variant:"body2",color:"grey",children:t.lastLoginIp||u("unknown")})]}):(0,o.jsx)(Oe.Z,{children:t.lastLoginIp||u("unknown")})})}}},i&&{label:u("actions"),name:"actions",options:{customBodyRenderLite:e=>{const t=b[e];return(0,o.jsx)(f.Z,{children:(0,o.jsx)(g.Z,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:r===t.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>h({visitorId:t.visitorId}),children:"expired"===t.status?u("remove"):r===t.visitorId?u("currentSession"):u("logout")})})}}}].filter(Boolean);return(0,o.jsxs)(f.Z,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[d,(0,o.jsx)(ue.Z,{locale:l,data:b,columns:S,customButtons:T,options:x,loading:m.loading})]})}i(21764),i(25125),i(13573),i(8708),i(54198)},36738:e=>{const t=Object.freeze({AUTH:"auth",AUTH_SERVICE:"@abtnode/auth-service"}),i=Object.freeze({AUTH_SERVICE:"/.service/".concat(t.AUTH_SERVICE)}),o=Object.freeze({OWNER:"owner",ADMIN:"admin",MEMBER:"member",GUEST:"guest"}),n=Object.freeze({...o,CI:"ci",CERTIFICATE:"certificate",BLOCKLET_OWNER:"blocklet-owner",BLOCKLET_ADMIN:"blocklet-admin",BLOCKLET_MEMBER:"blocklet-member",BLOCKLET_SDK:"blocklet-sdk",EXTERNAL_BLOCKLET_CONTROLLER:"external-blocklet-controller",EXTERNAL_BLOCKLETS_MANAGER:"external-blocklets-manager"}),r=[n.BLOCKLET_OWNER,n.BLOCKLET_ADMIN,n.BLOCKLET_MEMBER,n.BLOCKLET_SDK],a={roles:Object.freeze([{name:n.OWNER,title:"Owner",description:"Has full administrative access to the Blocklet Server",passport:!0},{name:n.ADMIN,title:"Admin",description:"Has full permissions to manage blocklet and Blocklet Server such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates, manage blocklet team, manage node integrations and access keys, upgrade node to a new version",passport:!0},{name:n.MEMBER,title:"Member",description:"Has permissions to manage blocklets, such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates",passport:!0},{name:n.GUEST,title:"Guest",description:"Has all read permissions on Blocklet Server",passport:!0},{name:n.CI,title:"CI",description:"Deploy blocklet to Blocklet Server",passport:!0,noHuman:!0},{name:n.CERTIFICATE,title:"Certificate",description:"Manage https certificates for blocklets on the Blocklet Server",passport:!0,noHuman:!0},{name:n.BLOCKLET_OWNER,title:"Blocklet Owner"},{name:n.BLOCKLET_ADMIN,title:"Blocklet Admin"},{name:n.BLOCKLET_MEMBER,title:"Blocklet Member"},{name:n.BLOCKLET_SDK,title:"Blocklet SDK"},{name:n.EXTERNAL_BLOCKLET_CONTROLLER,title:"External Blocklet Controller"},{name:n.EXTERNAL_BLOCKLETS_MANAGER,title:"External Blocklets Manager",description:"Manage external blocklets in the Blocklet Server",passport:!0,noHuman:!0},{name:t.AUTH_SERVICE,title:"Auth Service"}]),permissions:Object.freeze([{name:"query_node",description:"View node data, include dashboard and node settings, log stream for both Blocklet Server and blocklets"},{name:"mutate_node",description:"Change node settings, upgrade node to a new version"},{name:"query_session",description:"Get data from a long running session"},{name:"mutate_session",description:"Start/update/end a long running session"},{name:"query_accessKey",description:"View access keys for Blocklet Server"},{name:"mutate_accessKey",description:"Manage access keys for Blocklet Server, such as create/update/delete"},{name:"query_team",description:"View team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"mutate_team",description:"Manage team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"query_blocklets",description:"View store and installed blocklets, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklets",description:"Perform state changing actions on blocklets, such as install/upgrade/config/start/stop/remove"},{name:"query_router",description:"View sites, URL mapping and certificates in service gateway"},{name:"mutate_router",description:"Manage sites, URL mapping and certificates in service gateway"},{name:"query_certificate",description:"View certificates in service gateway"},{name:"mutate_certificate",description:"Manage certificates in service gateway"},{name:"query_notification",description:"View notifications"},{name:"mutate_notification",description:"Manage notifications, such as mark notifications as read"},{name:"query_webhook",description:"View integrations"},{name:"mutate_webhook",description:"Manage integrations"},{name:"query_blocklet",description:"View a blocklet, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklet",description:"Perform state changing actions on a blocklet, such as upgrade/config/start/stop"}]),grants:Object.freeze({[n.GUEST]:["query_blocklets","query_router","query_webhook","query_notification","query_team","query_accessKey","query_node","query_session"],[n.MEMBER]:[n.GUEST,"mutate_blocklets","mutate_router","mutate_notification","mutate_session"],[n.ADMIN]:[n.MEMBER,"mutate_team","mutate_webhook","mutate_accessKey","mutate_node","mutate_certificate"],[n.OWNER]:[o.ADMIN],[n.CI]:["query_blocklets","mutate_blocklets"],[n.CERTIFICATE]:["query_certificate","mutate_certificate"],[n.BLOCKLET_SDK]:["query_team","mutate_team","query_blocklet"],[n.BLOCKLET_OWNER]:[n.BLOCKLET_ADMIN],[n.BLOCKLET_ADMIN]:[n.BLOCKLET_MEMBER,"mutate_team","mutate_blocklet","mutate_notification"],[n.BLOCKLET_MEMBER]:["query_team","query_blocklet","query_notification"],[n.EXTERNAL_BLOCKLET_CONTROLLER]:["query_blocklets","mutate_blocklets"],[n.EXTERNAL_BLOCKLETS_MANAGER]:["query_blocklets","mutate_blocklets"]})},s=864e5,l="https://store.blocklet.dev",c="https://dev.store.blocklet.dev",d=Object.freeze({DERIVED:"derived",WALLET:"wallet"}),u=Object.freeze({created:0,selected:10,connected:20,paid:30,nftMinted:35,allocated:40,consuming:46,installed:50,expired:60,terminated:70,timeout:80,transferred:90});e.exports=Object.freeze({NODE_MODES:Object.freeze({PRODUCTION:"production",DEBUG:"debug",MAINTENANCE:"maintenance",SERVERLESS:"serverless"}),DEFAULT_DESCRIPTION:"Web Interface to manage your Blocklet Server",NODE_MAINTAIN_PROGRESS:Object.freeze({SETUP:"setup",INSTALLING:"installing",VERIFYING:"verifying",RESTARTING:"restarting",CLEANUP:"cleanup",COMPLETE:"complete",ROLLBACK:"rollback"}),VC_TYPE_BLOCKLET_PURCHASE:"BlockletPurchaseCredential",VC_TYPE_NODE_PASSPORT:"ABTNodePassport",VC_TYPE_GENERAL_PASSPORT:"NFTPassport",NFT_TYPE_SERVER_OWNERSHIP:"BlockletServerOwnershipNFT",NFT_TYPE_SERVERLESS:"BlockletServerServerlessNFT",NODE_PACKAGE_NAME:"@abtnode/cli",NODE_COMMAND_NAME:"abtnode",NODE_DATA_DIR_NAME:"_abtnode",USER_AVATAR_DIR:"/.assets/avatar",USER_AVATAR_URL_PREFIX:"bn://avatar",USER_AVATAR_PATH_PREFIX:"/user/avatar",PROCESS_NAME_DAEMON:"abt-node-daemon",PROCESS_NAME_PROXY:"abt-node-db-hub",PROCESS_NAME_UPDATER:"abt-node-updater",PROCESS_NAME_SERVICE:"abt-node-service",PROCESS_NAME_ROUTER:"abt-node-router",PROCESS_NAME_LOG_ROTATE:"abt-node-log-rotate",PROCESS_NAME_EVENT_HUB:"abt-node-event-hub",NODE_REGISTER_URL:"https://install.arcblock.io/",WEB_WALLET_URL:"https://web.abtwallet.io",BLOCKLET_STORE_URL:l,BLOCKLET_STORE_URL_DEV:c,BLOCKLET_STORE_API_PREFIX:"/api",BLOCKLET_STORE_API_BLOCKLET_PREFIX:"/api/blocklets",BLOCKLET_STORE_META_PATH:"/api/store.json",BLOCKLET_STORE:{id:"zNKqX7D8ZAYa77HgzpoFfnV3BFbcmSRrE9aT",name:"Official Store",description:"ArcBlock official blocklet registry",url:l,logoUrl:"/logo.png",maintainer:"arcblock"},BLOCKLET_STORE_DEV:{id:"zNKmfUatDhzfMVACfr3u97eqndj8f1yXXw3m",name:"Dev Store",description:"ArcBlock dev registry that contains demo and example blocklets",url:c,maintainer:"arcblock",logoUrl:"/logo.png"},APP_STRUCT_VERSION:"2",DEFAULT_DID_REGISTRY:"https://registry.abtnet.io",DEFAULT_SLP_DOMAIN:"slp.abtnet.io",DEFAULT_DID_DOMAIN:"did.abtnet.io",DEFAULT_IP_DOMAIN:"*.ip.abtnet.io",DEFAULT_IP_DOMAIN_SUFFIX:"ip.abtnet.io",DEFAULT_WILDCARD_CERT_HOST:"https://releases.arcblock.io/",DEFAULT_NFT_DOMAIN_URL:"https://domain.didlabs.org/",DEFAULT_CERTIFICATE_EMAIL:"certs@arcblock.io",CONFIG_FILENAME:"config.yml",CONFIG_FILENAME_OLD:"abtnode.yml",CONFIG_FOLDER_NAME:".blocklet-server",CONFIG_FOLDER_NAME_OLD:".abtnode",EXPORTED_FOLDER_NAME:"exported_blocklet_server",StatusCode:Object.freeze({ok:0,blocklet_not_found:1,blocklet_not_purchased:2,forbidden:403,internal:500,timeout:504}),IP:new RegExp("-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}"),DOMAIN_FOR_IP_SITE:"",DOMAIN_FOR_IP_SITE_REGEXP:"~^\\d+.\\d+.\\d+.\\d+$",DOMAIN_FOR_DEFAULT_SITE:"*",DOMAIN_FOR_INTERNAL_SITE:"127.0.0.1",NAME_FOR_WELLKNOWN_SITE:"wellknown",WELLKNOWN_PATH_PREFIX:"/.well-known",WELLKNOWN_ACME_CHALLENGE_PREFIX:"/.well-known/acme-challenge",WELLKNOWN_DID_RESOLVER_PREFIX:"/.well-known/did.json",WELLKNOWN_PING_PREFIX:"/.well-known/ping",WELLKNOWN_ANALYTICS_PREFIX:"/.well-known/analytics",WELLKNOWN_SERVICE_PATH_PREFIX:"/.well-known/service",WELLKNOWN_BLOCKLET_ADMIN_PATH:"/.well-known/service/admin",WELLKNOWN_BLOCKLET_HEALTH_PATH:"/.well-known/service/health",WELLKNOWN_BLOCKLET_LOGO_PATH:"/.well-known/service/blocklet/logo",SLOT_FOR_IP_DNS_SITE:"888-888-888-888",DEFAULT_ADMIN_PATH:"/admin",WELLKNOWN_SERVER_ADMIN_PATH:"/.well-known/server/admin",DEFAULT_SERVICE_PATH:"/.abtnode/service",DEFAULT_HTTP_PORT:80,DEFAULT_HTTPS_PORT:443,MAX_UPLOAD_FILE_SIZE:500,DEFAULT_DAEMON_PORT:8089,MAX_NGINX_WORKER_CONNECTIONS:10240,BLOCKLET_PROXY_PATH_PREFIX:"/.blocklet/proxy",BLOCKLET_SITE_GROUP_SUFFIX:".blocklet-domain-group",DAY_IN_MS:s,DAEMON_MAX_MEM_LIMIT_IN_MB:800,PROXY_MAX_MEM_LIMIT_IN_MB:800,BLOCKLET_MAX_MEM_LIMIT_IN_MB:800,CERTIFICATE_EXPIRES_OFFSET:864e6,ROUTING_RESPONSE_TYPES:[{text:"Plain Text",value:"text/plain"},{text:"JSON",value:"application/json"},{text:"XML",value:"application/xml"},{text:"HTML Document",value:"text/html"},{text:"YAML",value:"application/x-yaml"},{text:"TOML",value:"application/toml"},{text:"CSS",value:"text/css"},{text:"JavaScript",value:"application/javascript"},{text:"CSV",value:"text/csv"},{text:"Markdown",value:"text/markdown"},{text:"SVG",value:"image/svg+xml"}],ROUTING_RULE_TYPES:Object.freeze({NONE:"none",DAEMON:"daemon",SERVICE:"service",BLOCKLET:"blocklet",REDIRECT:"redirect",GENERAL_REWRITE:"rewrite",GENERAL_PROXY:"general_proxy",DIRECT_RESPONSE:"direct_response",COMPONENT:"component"}),ROLES:o,SERVER_ROLES:n,BLOCKLET_ROLES:r,isBlockletRole:e=>e&&r.includes(e),AUTH_CERT_TYPE:{USER:"user",OWNERSHIP_NFT:"ownership_nft",BLOCKLET_USER:"blocklet_user",BLOCKLET_CONTROLLER:"blocklet_controller"},RBAC_CONFIG:a,genPermissionName:function(e){return"".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"access","_").concat(e.replace("_","-"))},PASSPORT_STATUS:{VALID:"valid",REVOKED:"revoked"},NODE_SERVICES:t,NODE_SERVICES_PREFIX:i,DISK_ALERT_THRESHOLD_PERCENT:80,EVENTS:{NOTIFICATION_CREATE:"notification.create",NOTIFICATION_BLOCKLET_CREATE:"notification.blockletCreate",ROUTING_UPDATED:"routing.updated",NODE_UPDATED:"node.updated",NODE_MAINTAIN_PROGRESS:"node.upgrade.progress",NODE_STARTED:"node.started",NODE_STOPPED:"node.stopped",NODE_ADDED_OWNER:"node.addedOwner",NODE_RUNTIME_INFO:"node.runtimeInfo",BLOCKLETS_RUNTIME_INFO:"node.blockletsRuntimeInfo",DOMAIN_STATUS:"domain.status",CERT_ADDED:"cert.added",CERT_ISSUED:"cert.issued",CERT_UPDATED:"cert.updated",CERT_REMOVED:"cert.removed",CERT_ERROR:"cert.error",RELOAD_GATEWAY:"gateway.reload"},WHO_CAN_ACCESS:{OWNER:"owner",INVITED:"invited",ALL:"all"},WHO_CAN_ACCESS_PREFIX_ROLES:"roles:",GATEWAY_REQ_LIMIT:Object.freeze({min:10,max:100}),STORE_DETAIL_PAGE_PATH_PREFIX:"/blocklets",MAX_USER_PAGE_SIZE:100,SERVER_STATUS:{RUNNING:1,STOPPED:2,START_FROM_CRASH:3},LOG_RETAIN_IN_DAYS:60,BLOCKLET_INSTALL_TYPE:{STORE:"store",URL:"url",DEV:"dev",CREATE:"create",RESTORE:"restore"},ROUTER_CACHE_GROUPS:{blockletProxy:{minSize:"1m",maxSize:"2g",period:"30d"}},MAIN_CHAIN_ENDPOINT:"https://main.abtnetwork.io/api/",USER_TYPE:d,SERVER_CACHE_TTL:3e5,BLOCKLET_CACHE_TTL:36e5,SESSION_CACHE_TTL:3600,SESSION_TTL:604800,BACKUPS:{STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:7200}},CHECK_UPDATE:{STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:7200}},MONITOR_HISTORY_LENGTH:8640,MONITOR_RECORD_INTERVAL_SEC:10,INSTALL_ACTIONS:{INSTALL:"install",INSTALL_COMPONENT:"installComponent",UPGRADE_COMPONENT:"upgradeComponent"},COPYRIGHT_OWNER:"ArcBlock",FEDERATED:{SYNC_LIMIT:3},SESSION_TOKEN_STORAGE_KEY:"login_token",REFRESH_TOKEN_STORAGE_KEY:"refresh_token",LAUNCH_SESSION_STATUS:u,UNOWNED_DID:"z".repeat(35),STUDIO_CONNECTED_STORE:"studio_connected_store"})},30278:(e,t,i)=>{var o=i(31104),n=i(43676);e.exports=function(e,t){return e&&e.length?n(e,o(t,2)):[]}},94166:function(e,t,i){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)},n=this&&this.__rest||function(e,t){var i={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(i[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(i[o[n]]=e[o[n]])}return i};t.__esModule=!0;var r=i(5057),a=i(18294),s=i(49266);t.default=function(e){var t=e.delay,i=void 0===t?0:t,l=e.type,c=void 0===l?"text":l,d=e.color,u=void 0===d?"#CDCDCD":d,p=e.rows,m=void 0===p?3:p,f=e.ready,b=e.firstLaunchOnly,E=e.children,w=e.className,h=e.showLoadingAnimation,_=e.customPlaceholder,g=n(e,["delay","type","color","rows","ready","firstLaunchOnly","children","className","showLoadingAnimation","customPlaceholder"]),v=r.useState(f),T=v[0],x=v[1],S=r.useRef(null);return r.useEffect((function(){b||!T||f?f&&(S.current&&window.clearTimeout(S.current),T||x(!0)):i&&i>0?S.current=window.setTimeout((function(){x(!1)}),i):x(!1)}),[b,T,f,i]),r.useEffect((function(){return function(){S.current&&window.clearTimeout(S.current)}}),[]),T?E:function(){var e=h?s.joinClassNames("show-loading-animation",w):w;if(_&&r.isValidElement(_)){var t=s.joinClassNames(_.props.className,e);return r.cloneElement(_,{className:t})}if(_)return _;var i=a[c];return r.createElement(i,o({},g,{color:u,rows:m,className:e}))}()}},22256:(e,t,i)=>{"use strict";var o=i(94166);t.Z=o.default},98392:function(e,t,i){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};t.__esModule=!0;var n=i(5057),r=i(49354),a=i(12208),s=i(49266),l={display:"flex"};t.default=function(e){var t=e.className,i=e.style,c=e.color,d=e.rows;return n.createElement("div",{className:s.joinClassNames("media-block",t),style:o(o({},l),i)},n.createElement(a.default,{color:c,style:{minHeight:55,width:55,minWidth:55,marginRight:10}}),n.createElement(r.default,{color:c,rows:d}))}},16102:function(e,t,i){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};t.__esModule=!0;var n=i(5057),r=i(49266);t.default=function(e){var t=e.className,i=e.style,a={backgroundColor:e.color,width:"100%",height:"100%",marginRight:10};return n.createElement("div",{className:r.joinClassNames("rect-shape",t),style:o(o({},a),i)})}},12208:function(e,t,i){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};t.__esModule=!0;var n=i(5057),r=i(49266);t.default=function(e){var t=e.className,i=e.style,a={backgroundColor:e.color,borderRadius:"500rem",width:"100%",height:"100%"};return n.createElement("div",{className:r.joinClassNames("round-shape",t),style:o(o({},a),i)})}},49354:function(e,t,i){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};t.__esModule=!0;var n=i(5057),r=i(13672),a=i(49266),s={width:"100%"},l=[97,100,94,90,98,95,98,40];t.default=function(e){var t=e.rows,i=e.lineSpacing,c=e.color,d=e.style,u=e.className,p=e.widths,m=void 0===p?l:p,f=function(e){return{maxHeight:100/(2*t-1)+"%",width:m[(e+m.length)%m.length]+"%"}};return n.createElement("div",{className:a.joinClassNames("text-block",u),style:o(o({},s),d)},Array.apply(null,Array(t)).map((function(e,t){return n.createElement(r.default,{color:c,style:f(t),lineSpacing:0!==t?i:0,key:t})})))}},13672:function(e,t,i){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};t.__esModule=!0;var n=i(5057),r=i(49266);t.default=function(e){var t=e.className,i=e.maxHeight,a=e.color,s=e.lineSpacing,l=void 0===s?"0.7em":s,c=e.style,d={maxHeight:i,width:"100%",height:"1em",backgroundColor:a,marginTop:l};return n.createElement("div",{className:r.joinClassNames("text-row",t),style:o(o({},d),c)})}},18294:(e,t,i)=>{"use strict";t.__esModule=!0,t.media=t.text=t.rect=t.round=t.textRow=t.MediaBlock=t.TextBlock=t.RectShape=t.RoundShape=t.TextRow=void 0;var o=i(13672);t.TextRow=o.default;var n=i(12208);t.RoundShape=n.default;var r=i(16102);t.RectShape=r.default;var a=i(49354);t.TextBlock=a.default;var s=i(98392);t.MediaBlock=s.default,t.textRow=o.default,t.round=n.default,t.rect=r.default,t.text=a.default,t.media=s.default},49266:(e,t)=>{"use strict";t.__esModule=!0,t.joinClassNames=void 0,t.joinClassNames=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return e})).join(" ")}},35833:function(e,t,i){var o;!function(n,r){"use strict";var a="function",s="undefined",l="object",c="string",d="major",u="model",p="name",m="type",f="vendor",b="version",E="architecture",w="console",h="mobile",_="tablet",g="smarttv",v="wearable",T="embedded",x="Amazon",S="Apple",O="ASUS",R="BlackBerry",y="Browser",I="Chrome",k="Firefox",N="Google",A="Huawei",L="LG",C="Microsoft",P="Motorola",D="Opera",j="Samsung",M="Sharp",B="Sony",U="Xiaomi",F="Zebra",K="Facebook",Z="Chromium OS",z="Mac OS",H=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},W=function(e,t){return typeof e===c&&-1!==q(t).indexOf(q(e))},q=function(e){return e.toLowerCase()},V=function(e,t){if(typeof e===c)return e=e.replace(/^\s\s*/,""),typeof t===s?e:e.substring(0,500)},G=function(e,t){for(var i,o,n,s,c,d,u=0;u<t.length&&!c;){var p=t[u],m=t[u+1];for(i=o=0;i<p.length&&!c&&p[i];)if(c=p[i++].exec(e))for(n=0;n<m.length;n++)d=c[++o],typeof(s=m[n])===l&&s.length>0?2===s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,d):this[s[0]]=s[1]:3===s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=d?d.replace(s[1],s[2]):r:this[s[0]]=d?s[1].call(this,d,s[2]):r:4===s.length&&(this[s[0]]=d?s[3].call(this,d.replace(s[1],s[2])):r):this[s]=d||r;u+=2}},Y=function(e,t){for(var i in t)if(typeof t[i]===l&&t[i].length>0){for(var o=0;o<t[i].length;o++)if(W(t[i][o],e))return"?"===i?r:i}else if(W(t[i],e))return"?"===i?r:i;return e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[b,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[b,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,b],[/opios[\/ ]+([\w\.]+)/i],[b,[p,D+" Mini"]],[/\bopr\/([\w\.]+)/i],[b,[p,D]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[b,[p,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,b],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[b,[p,"UC"+y]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[b,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[b,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[b,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[b,[p,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[b,[p,"Smart Lenovo "+y]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+y],b],[/\bfocus\/([\w\.]+)/i],[b,[p,k+" Focus"]],[/\bopt\/([\w\.]+)/i],[b,[p,D+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[b,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[b,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[b,[p,D+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[b,[p,"MIUI "+y]],[/fxios\/([-\w\.]+)/i],[b,[p,k]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 "+y]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 "+y],b],[/samsungbrowser\/([\w\.]+)/i],[b,[p,j+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],b],[/metasr[\/ ]?([\d\.]+)/i],[b,[p,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[p,"Sogou Mobile"],b],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[p,b],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,K],b],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[p,b],[/\bgsa\/([\w\.]+) .*safari\//i],[b,[p,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[b,[p,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[b,[p,I+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,I+" WebView"],b],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[b,[p,"Android "+y]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,b],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[b,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[b,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[b,Y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[p,b],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],b],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[b,[p,k+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[p,b],[/(cobalt)\/([\w\.]+)/i],[p,[b,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[E,"amd64"]],[/(ia32(?=;))/i],[[E,q]],[/((?:i[346]|x)86)[;\)]/i],[[E,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[E,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[E,"armhf"]],[/windows (ce|mobile); ppc;/i],[[E,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[E,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[E,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[E,q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[f,j],[m,_]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[f,j],[m,h]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[f,S],[m,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[f,S],[m,_]],[/(macintosh);/i],[u,[f,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[f,M],[m,h]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[f,A],[m,_]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[f,A],[m,h]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[f,U],[m,h]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[f,U],[m,_]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[f,"OPPO"],[m,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[f,"Vivo"],[m,h]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[f,"Realme"],[m,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[f,P],[m,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[f,P],[m,_]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[f,L],[m,_]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[f,L],[m,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[f,"Lenovo"],[m,_]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[f,"Nokia"],[m,h]],[/(pixel c)\b/i],[u,[f,N],[m,_]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[f,N],[m,h]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[f,B],[m,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[f,B],[m,_]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[f,"OnePlus"],[m,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[f,x],[m,_]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[f,x],[m,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,f,[m,_]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[f,R],[m,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[f,O],[m,_]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[f,O],[m,h]],[/(nexus 9)/i],[u,[f,"HTC"],[m,_]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[u,/_/g," "],[m,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[f,"Acer"],[m,_]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[f,"Meizu"],[m,h]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[f,"Ulefone"],[m,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,u,[m,h]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,u,[m,_]],[/(surface duo)/i],[u,[f,C],[m,_]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[f,"Fairphone"],[m,h]],[/(u304aa)/i],[u,[f,"AT&T"],[m,h]],[/\bsie-(\w*)/i],[u,[f,"Siemens"],[m,h]],[/\b(rct\w+) b/i],[u,[f,"RCA"],[m,_]],[/\b(venue[\d ]{2,7}) b/i],[u,[f,"Dell"],[m,_]],[/\b(q(?:mv|ta)\w+) b/i],[u,[f,"Verizon"],[m,_]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[f,"Barnes & Noble"],[m,_]],[/\b(tm\d{3}\w+) b/i],[u,[f,"NuVision"],[m,_]],[/\b(k88) b/i],[u,[f,"ZTE"],[m,_]],[/\b(nx\d{3}j) b/i],[u,[f,"ZTE"],[m,h]],[/\b(gen\d{3}) b.+49h/i],[u,[f,"Swiss"],[m,h]],[/\b(zur\d{3}) b/i],[u,[f,"Swiss"],[m,_]],[/\b((zeki)?tb.*\b) b/i],[u,[f,"Zeki"],[m,_]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],u,[m,_]],[/\b(ns-?\w{0,9}) b/i],[u,[f,"Insignia"],[m,_]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[f,"NextBook"],[m,_]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],u,[m,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],u,[m,h]],[/\b(ph-1) /i],[u,[f,"Essential"],[m,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[f,"Envizen"],[m,_]],[/\b(trio[-\w\. ]+) b/i],[u,[f,"MachSpeed"],[m,_]],[/\btu_(1491) b/i],[u,[f,"Rotor"],[m,_]],[/(shield[\w ]+) b/i],[u,[f,"Nvidia"],[m,_]],[/(sprint) (\w+)/i],[f,u,[m,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,C],[m,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[f,F],[m,_]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[f,F],[m,h]],[/smart-tv.+(samsung)/i],[f,[m,g]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,j],[m,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,L],[m,g]],[/(apple) ?tv/i],[f,[u,S+" TV"],[m,g]],[/crkey/i],[[u,I+"cast"],[f,N],[m,g]],[/droid.+aft(\w+)( bui|\))/i],[u,[f,x],[m,g]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[f,M],[m,g]],[/(bravia[\w ]+)( bui|\))/i],[u,[f,B],[m,g]],[/(mitv-\w{5}) bui/i],[u,[f,U],[m,g]],[/Hbbtv.*(technisat) (.*);/i],[f,u,[m,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,V],[u,V],[m,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,u,[m,w]],[/droid.+; (shield) bui/i],[u,[f,"Nvidia"],[m,w]],[/(playstation [345portablevi]+)/i],[u,[f,B],[m,w]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[f,C],[m,w]],[/((pebble))app/i],[f,u,[m,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[f,S],[m,v]],[/droid.+; (glass) \d/i],[u,[f,N],[m,v]],[/droid.+; (wt63?0{2,3})\)/i],[u,[f,F],[m,v]],[/(quest( 2| pro)?)/i],[u,[f,K],[m,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[m,T]],[/(aeobc)\b/i],[u,[f,x],[m,T]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[m,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[m,_]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,_]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,h]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[b,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[b,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,b],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[b,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,b],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[p,[b,Y,X]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,Y,X],[p,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[b,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,z],[b,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[b,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,b],[/\(bb(10);/i],[b,[p,R]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[b,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[b,[p,k+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[b,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[b,[p,"watchOS"]],[/crkey\/([\d\.]+)/i],[b,[p,I+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,Z],b],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,b],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],b],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,b]]},$=function(e,t){if(typeof e===l&&(t=e,e=r),!(this instanceof $))return new $(e,t).getResult();var i=typeof n!==s&&n.navigator?n.navigator:r,o=e||(i&&i.userAgent?i.userAgent:""),w=i&&i.userAgentData?i.userAgentData:r,g=t?function(e,t){var i={};for(var o in e)t[o]&&t[o].length%2===0?i[o]=t[o].concat(e[o]):i[o]=e[o];return i}(J,t):J,v=i&&i.userAgent==o;return this.getBrowser=function(){var e,t={};return t[p]=r,t[b]=r,G.call(t,o,g.browser),t[d]=typeof(e=t[b])===c?e.replace(/[^\d\.]/g,"").split(".")[0]:r,v&&i&&i.brave&&typeof i.brave.isBrave==a&&(t[p]="Brave"),t},this.getCPU=function(){var e={};return e[E]=r,G.call(e,o,g.cpu),e},this.getDevice=function(){var e={};return e[f]=r,e[u]=r,e[m]=r,G.call(e,o,g.device),v&&!e[m]&&w&&w.mobile&&(e[m]=h),v&&"Macintosh"==e[u]&&i&&typeof i.standalone!==s&&i.maxTouchPoints&&i.maxTouchPoints>2&&(e[u]="iPad",e[m]=_),e},this.getEngine=function(){var e={};return e[p]=r,e[b]=r,G.call(e,o,g.engine),e},this.getOS=function(){var e={};return e[p]=r,e[b]=r,G.call(e,o,g.os),v&&!e[p]&&w&&"Unknown"!=w.platform&&(e[p]=w.platform.replace(/chrome os/i,Z).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(e){return o=typeof e===c&&e.length>500?V(e,500):e,this},this.setUA(o),this};$.VERSION="1.0.37",$.BROWSER=H([p,b,d]),$.CPU=H([E]),$.DEVICE=H([u,f,m,w,h,g,_,v,T]),$.ENGINE=$.OS=H([p,b]),typeof t!==s?(e.exports&&(t=e.exports=$),t.UAParser=$):i.amdO?(o=function(){return $}.call(t,i,t,e))===r||(e.exports=o):typeof n!==s&&(n.UAParser=$);var Q=typeof n!==s&&(n.jQuery||n.Zepto);if(Q&&!Q.ua){var ee=new $;Q.ua=ee.getResult(),Q.ua.get=function(){return ee.getUA()},Q.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var i in t)Q.ua[i]=t[i]}}}("object"===typeof window?window:this)}}]);