@abtnode/webapp 1.16.18-beta-aa01bd8e → 1.16.18-beta-bb4ebacc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/build/asset-manifest.json +39 -37
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/static/js/{4906.d04533b8.chunk.js → 1005.3f7c0424.chunk.js} +1 -1
- package/build/static/js/1037.654af9cb.chunk.js +1 -0
- package/build/static/js/1294.cb3fda7d.chunk.js +1 -0
- package/build/static/js/{1366.da5d2cf5.chunk.js → 1366.9080fc67.chunk.js} +2 -2
- package/build/static/js/1371.5b72f904.chunk.js +1 -0
- package/build/static/js/2264.08437c82.chunk.js +1 -0
- package/build/static/js/{2334.66fda96c.chunk.js → 2334.f691dca3.chunk.js} +1 -1
- package/build/static/js/253.c833bb6a.chunk.js +1 -0
- package/build/static/js/271.1e33a8f2.chunk.js +1 -0
- package/build/static/js/{2960.92d5ffcc.chunk.js → 2960.1e86e38b.chunk.js} +1 -1
- package/build/static/js/3389.5c09050b.chunk.js +1 -0
- package/build/static/js/3826.95a31ac8.chunk.js +2 -0
- package/build/static/js/4404.5c817ece.chunk.js +1 -0
- package/build/static/js/{4448.240f547f.chunk.js → 4448.347d2a50.chunk.js} +1 -1
- package/build/static/js/{4471.caa42ecd.chunk.js → 4471.bd184c41.chunk.js} +1 -1
- package/build/static/js/{4775.509db813.chunk.js → 4775.83ce25f4.chunk.js} +1 -1
- package/build/static/js/506.56bf49a1.chunk.js +1 -0
- package/build/static/js/5672.f4575992.chunk.js +1 -0
- package/build/static/js/{5804.911e6040.chunk.js → 5804.d39dd5d0.chunk.js} +1 -1
- package/build/static/js/6511.4138727a.chunk.js +1 -0
- package/build/static/js/6783.980e9326.chunk.js +2 -0
- package/build/static/js/6791.f49bd0e6.chunk.js +1 -0
- package/build/static/js/6931.18e6aef9.chunk.js +1 -0
- package/build/static/js/{6950.31fcc9dd.chunk.js → 6950.71452861.chunk.js} +1 -1
- package/build/static/js/6960.8b12dfb5.chunk.js +1 -0
- package/build/static/js/7018.e5975bdd.chunk.js +1 -0
- package/build/static/js/7150.78354536.chunk.js +1 -0
- package/build/static/js/{7657.8813e576.chunk.js → 7657.1a626c13.chunk.js} +2 -2
- package/build/static/js/7674.9ec70731.chunk.js +1 -0
- package/build/static/js/{7913.fbdbed84.chunk.js → 7913.0cf3724f.chunk.js} +1 -1
- package/build/static/js/{8219.a1b28886.chunk.js → 8219.b3d4f806.chunk.js} +1 -1
- package/build/static/js/8382.fa53a8cc.chunk.js +1 -0
- package/build/static/js/{6277.ee67bb5d.chunk.js → 8499.95468c53.chunk.js} +2 -2
- package/build/static/js/8499.95468c53.chunk.js.LICENSE.txt +5 -0
- package/build/static/js/8973.dc41b1d3.chunk.js +1 -0
- package/build/static/js/9031.01d3ab20.chunk.js +1 -0
- package/build/static/js/{9041.cfebb881.chunk.js → 9041.1ee0f39d.chunk.js} +1 -1
- package/build/static/js/{9249.d1ca2237.chunk.js → 9249.38caee59.chunk.js} +1 -1
- package/build/static/js/main.28ff8680.js +2 -0
- package/package.json +1 -1
- package/build/static/js/1037.f44aa36c.chunk.js +0 -1
- package/build/static/js/1294.19517674.chunk.js +0 -1
- package/build/static/js/1371.0adf8110.chunk.js +0 -1
- package/build/static/js/2264.da57cd26.chunk.js +0 -1
- package/build/static/js/2452.2a023741.chunk.js +0 -1
- package/build/static/js/2529.cc831e53.chunk.js +0 -1
- package/build/static/js/3137.d1066178.chunk.js +0 -1
- package/build/static/js/3389.1c91b9ad.chunk.js +0 -1
- package/build/static/js/3826.851c759a.chunk.js +0 -2
- package/build/static/js/4362.fdb74d3c.chunk.js +0 -1
- package/build/static/js/6412.63fec4d6.chunk.js +0 -1
- package/build/static/js/6511.61a2310a.chunk.js +0 -1
- package/build/static/js/6931.d6fc838c.chunk.js +0 -1
- package/build/static/js/6960.69ccbf07.chunk.js +0 -1
- package/build/static/js/8059.cf139637.chunk.js +0 -1
- package/build/static/js/8212.06eb9697.chunk.js +0 -1
- package/build/static/js/8382.d8202fef.chunk.js +0 -1
- package/build/static/js/875.af5cb0ea.chunk.js +0 -1
- package/build/static/js/8815.974f28df.chunk.js +0 -2
- package/build/static/js/8815.974f28df.chunk.js.LICENSE.txt +0 -14
- package/build/static/js/8973.055296e0.chunk.js +0 -1
- package/build/static/js/main.78c7d5e0.js +0 -2
- /package/build/static/js/{1366.da5d2cf5.chunk.js.LICENSE.txt → 1366.9080fc67.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{3826.851c759a.chunk.js.LICENSE.txt → 3826.95a31ac8.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{6277.ee67bb5d.chunk.js.LICENSE.txt → 6783.980e9326.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7657.8813e576.chunk.js.LICENSE.txt → 7657.1a626c13.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.78c7d5e0.js.LICENSE.txt → main.28ff8680.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[1037],{81037:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return $r}});var r=t(33028),o=t(5057),i=t(68420),a=t(68079),l=t(59740),c=t(71171),s=t(32723),u=t(34795),d=t(96234),p=t(33518),m=t(55898),f=t.n(m),h=t(37541),x=t(39948),v=t(7278),g=t(6838),Z=t(87971),b=t(99194),y=t(67680),k=t(44919),j=t(10697),C=t(48037),P=t(34966),E=t(94552),w=t(55402),R=t(75239),T=t(48086),S=t(88092),_=t(32207),U=t(35258),N=t(27773),I=t(26174),L=t(36554),D=t(55498),O=t(35432),B=t(44846),F=t(64886),q=t(28726),z=t(25710),A=t(38242),G=t(57156),W=t.n(G),M=t(86229),K=t(87363),V=t(17450),Y=t(22228),H=t(6352),X=t.n(H),$=t(2078),J=t.n($),Q=t(19778),ee=t(38898),ne=t(96266);function te(e){var n,t=e.sourceInfo,r=e.blocklet,a=(0,o.useContext)(i.RD).t;return(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(Q.Z,{type:"success",children:J()(t.source)},"source"),"registry"===t.source&&(0,ne.jsx)(ee.Z,{href:X()(t.deployedFrom,"blocklets",(null===r||void 0===r||null===(n=r.meta)||void 0===n?void 0:n.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:a("blocklet.overview.viewInStore")})]})}te.propTypes={sourceInfo:f().shape({source:f().string,deployedFrom:f().string}),blocklet:f().object},te.defaultProps={sourceInfo:{},blocklet:{}};var re=t(81010),oe=t(40736),ie=t(76811),ae=t(70461),le=t(58238),ce=t(14491),se=t(63406),ue=["blocklet","checkUpgrade","hasPermission"];function de(e){var n=e.blocklet,t=e.checkUpgrade,a=e.hasPermission,c=(0,l.Z)(e,ue),p=(0,le.h6)().api,m=(0,o.useContext)(i.RD).t,f=(0,o.useState)(!1),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=(0,o.useState)(""),Z=(0,d.Z)(g,2),b=Z[0],k=Z[1],j=(0,o.useState)(null),C=(0,d.Z)(j,2),P=C[0],E=C[1],w=(0,o.useState)(null),T=(0,d.Z)(w,2),S=T[0],_=T[1];(0,o.useEffect)((function(){E(null),t&&(n.mode,ie.BLOCKLET_MODES.DEVELOPMENT)}),[n,t]);var U=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,t={did:n.meta.did,version:P.version,storeUrl:P.registryUrl||""},e.next=5,(0,ce._v)(2e3);case 5:return e.next=7,p.upgradeBlocklet({input:t});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),M.Z.error("Blocklet upgrade failed: ".concat((0,ce.Z)(e.t0)));case 12:return e.prev=12,v(!1),_(null),e.finish(12);case 16:case"end":return e.stop()}}),e,null,[[1,9,12,16]])})));return function(){return e.apply(this,arguments)}}(),N={title:"".concat(m("common.upgrade")," ").concat(m("common.blocklet")," ").concat((0,A.getDisplayName)(n)),description:m("blocklet.action.upgradeDescription"),confirm:m("blocklet.action.confirmUpgrade"),cancel:m("common.cancel"),onConfirm:U,onCancel:function(){v(!1),_(null)}};return a&&P&&!(0,A.isInProgress)(n.status)?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Y.Z,(0,r.Z)((0,r.Z)({},c),{},{children:n.meta.version})),(0,ne.jsx)(R.Z,{title:m("common.updateAvailable",{version:P.version}),children:(0,ne.jsx)(y.Z,{size:"small",style:{marginLeft:8},disabled:x,onClick:function(){return _(N)},children:x?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(oe.Z,{style:{fontSize:16,color:"red"}})})}),!!b&&(0,ne.jsx)(M.Z,{variant:"error",message:b,onClose:function(){return k("")}}),S&&(0,ne.jsx)(ae.Z,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]}):(0,ne.jsx)(Y.Z,(0,r.Z)((0,r.Z)({},c),{},{children:n.meta.version}))}de.propTypes={blocklet:f().object.isRequired,checkUpgrade:f().bool,hasPermission:f().bool},de.defaultProps={checkUpgrade:!1,hasPermission:!1};var pe=(0,se.V)(de,"mutate_blocklets"),me=(0,se.V)(de,"",ce.Wf);function fe(e){return(0,le.h6)().inService?(0,ne.jsx)(me,(0,r.Z)({},e)):(0,ne.jsx)(pe,(0,r.Z)({},e))}var he,xe,ve=t(80378),ge=t(32349),Ze=t(76667),be=t(13128),ye=t(94464),ke=t(28358),je=t(47020),Ce=t(93938),Pe=t(50185),Ee=t(35918),we=t(74782),Re=t(55419),Te=function(e,n){var t=e.description;return(Object.values(ie.CHAIN_PROP_MAP).includes(e.key)||(0,A.isEnvShareable)(e))&&(t=t?"".concat(t," (").concat(n("blocklet.config.sharedToAllComponents"),")"):n("blocklet.config.sharedToAllComponents")),t&&(0,ne.jsx)("div",{style:{marginLeft:12},children:t})},Se=function(e,n){var 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((function(n){return n.name===e.key}))||!n.children.every((function(n){return!n.meta.environments.find((function(n){return n.name===e.key}))})))||e.custom};function _e(e){var n=e.blocklet,t=e.ancestors,l=(0,le.h6)(),c=l.inService,d=(0,o.useContext)(i.RD).t,p=[].concat((0,a.Z)(t.map((function(e){return e.meta.did}))),[n.meta.did]),m=function(){return M.Z.success(d("blocklet.config.changedTip"))},f=function(e){return Se(e,n,t)};if((0,ce.wS)(n.status))return null;if("unknown"===n.status&&(0,ce.wS)(n.status))return null;var h=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.key.trim()&&n.value.trim()){e.next=3;break}return M.Z.error(d("blocklet.config.environment.keyValueRequired")),e.abrupt("return");case 3:if(!n.key.startsWith("BLOCKLET_")&&!n.key.startsWith("COMPONENT_")){e.next=6;break}return M.Z.error(d("blocklet.config.environment.invalidKey")),e.abrupt("return");case 6:return n.custom=!0,e.next=9,l.api.configBlocklet({input:{did:p,configs:[n]}});case 9:"ok"===(t=e.sent).code&&m(t.blocklet);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),x=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(r,o){var i,a,c;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.required||r.key.trim()&&r.value.trim()){e.next=3;break}return M.Z.error(d("blocklet.config.environment.keyValueRequired")),e.abrupt("return");case 3:if(!r.key.startsWith("BLOCKLET_")||ie.BLOCKLET_CONFIGURABLE_KEY[r.key]){e.next=6;break}return M.Z.error(d("blocklet.config.environment.invalidKey")),e.abrupt("return");case 6:if(r.key!==ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){e.next=11;break}if(!(i=(0,ce.I)(r))){e.next=11;break}return M.Z.error(i),e.abrupt("return");case 11:if(a=[r],r.key===o.key){e.next=17;break}if(Se(r,n,t)){e.next=16;break}return M.Z.error("Only key of custom env can be changed"),e.abrupt("return");case 16:a.push({key:o.key,custom:!0});case 17:return e.prev=17,e.next=20,l.api.configBlocklet({input:{did:p,configs:a}});case 20:"ok"===(c=e.sent).code&&m(c.blocklet),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(17),M.Z.error((0,ce.Z)(e.t0));case 27:case"end":return e.stop()}}),e,null,[[17,24]])})));return function(n,t){return e.apply(this,arguments)}}(),v=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(r){var o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.required){e.next=3;break}return M.Z.error(d("blocklet.config.environment.deleteForbidden")),e.abrupt("return");case 3:if(Se(r,n,t)){e.next=6;break}return M.Z.error("Only key of custom env can be changed"),e.abrupt("return");case 6:return e.next=8,l.api.configBlocklet({input:{did:p,configs:[{key:r.key,custom:!0}]}});case 8:"ok"===(o=e.sent).code&&m(o.blocklet);case 10:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),g=(n.configs||[]).filter((function(e){return!ie.BLOCKLET_CONFIGURABLE_KEY[e.key]})),Z=(0,A.getSharedConfigObj)(t[0],n),b=(0,A.getComponentMissingConfigs)(n,t[0]),y=g.map((function(e){return(0,r.Z)((0,r.Z)({},e),{},{value:Object.values(ie.CHAIN_PROP_MAP).includes(e.key)&&Object.keys(Z).includes(e.key)?Z[e.key]:Z[e.key]||e.value})})),k=y.some((function(e){return e.key&&e.key.startsWith("BWA_")})),j={onRowAdd:h,onRowUpdate:x,onRowDelete:v,isDeletable:f};return(0,ne.jsxs)(Ne,{children:[!!b.length&&(0,ne.jsx)(Ce.Z,{severity:"error",style:{marginTop:24},children:d("blocklet.config.missingRequired")}),k&&(0,ne.jsx)(Ce.Z,{severity:"info",children:d("blocklet.config.environment.tip")}),(0,ne.jsx)(se.Z,{permission:c?"":"mutate_blocklets",role:c?ce.Wf:[],children:function(e){return(0,ne.jsx)(we.Z,{className:"config-table",children:(0,ne.jsx)(ke.ZP,{title:(0,ne.jsx)("h4",{children:d("common.environment")}),columns:[{title:d("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:function(e){return(0,ne.jsx)(Pe.Z,{value:e.value,style:{color:e.required&&!e.value?"#ff4436":"#222222",fontWeight:e.required?"bold":"normal"},children:e.key})},editComponent:function(e){var n=e.value,t=e.rowData,r=e.onChange;return(0,ne.jsx)(Ie,{children:(0,ne.jsx)(je.Z,{fullWidth:!0,size:"small",disabled:!1===f(t),value:n,onChange:function(e){return r(e.target.value)},variant:"outlined",label:"Key",placeholder:d("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:d("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:function(e){return e.value?e.secure?"******":(0,ne.jsx)(Pe.Z,{unstyled:!0,value:e.value,style:{wordBreak:"break-all"},children:e.value}):null},editComponent:function(e){var n=e.value,t=e.rowData,r=e.onChange;return(0,ne.jsxs)(Ie,{children:[(0,ne.jsx)(je.Z,{fullWidth:!0,size:"small",value:"__encrypted__"===n?"":n,onChange:function(e){return r(e.target.value)},variant:"outlined",label:d("common.value"),placeholder:d("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Te(t,d)]})}}],icons:(0,r.Z)((0,r.Z)({},Re.Z),Ee.Z),options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:d("common.actions")},body:{emptyDataSourceMessage:d("common.noData")}},data:y,editable:e?j:{}})})}})]})}_e.propTypes={blocklet:f().object.isRequired,ancestors:f().array},_e.defaultProps={ancestors:[]};var Ue,Ne=p.Z.div(he||(he=(0,c.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"])),(function(e){return e.theme.breakpoints.values.sm})),Ie=p.Z.div(xe||(xe=(0,c.Z)(["\n height: 60px;\n"]))),Le=t(45239),De=t.n(Le),Oe=t(28641),Be=["blocklet","ancestors","hasPermission"];function Fe(e){var n=e.blocklet,t=e.ancestors,a=e.hasPermission,c=(0,l.Z)(e,Be),p=(0,i.PE)().t,m=(0,le.h6)().api,f=!t.length,h=f?n.meta.did:t.map((function(e){return e.meta.did}))[0],v=(0,o.useState)(""),g=(0,d.Z)(v,2),Z=g[0],b=g[1],y=(0,o.useState)(""),k=(0,d.Z)(y,2),j=k[0],C=k[1],P=Z||!a;if(!h)return null;if("unknown"===n.status&&(0,ce.wS)(n.status))return null;var E=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){var r;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.prev=1,r={rootDid:h,mountPoint:De()(t)},f||(r.did=n.meta.did),e.next=6,m.updateComponentMountPoint({input:r});case 6:return b(!1),e.abrupt("return",!0);case 10:throw e.prev=10,e.t0=e.catch(1),b(!1),e.t0.message=(0,ce.Z)(e.t0),M.Z.error(e.t0.message),e.t0;case 16:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(n){return e.apply(this,arguments)}}();return(0,ne.jsx)(We,(0,r.Z)((0,r.Z)({component:"div"},c),{},{children:(0,ne.jsx)(x.Z,{mt:3,children:(0,ne.jsx)(Oe.Z,{label:p("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:Z||P,loading:Z,required:!0,initialValue:n.mountPoint,onSubmit:E,onChange:function(e){C(p("common.slugifyHint",{value:(0,ce.LN)(e)}))},helperText:j,formatterBeforeSubmit:function(e){return De()(e)}})})}))}var qe=(0,se.V)(Fe,"mutate_blocklets"),ze=(0,se.V)(Fe,"",ce.Wf);function Ae(e){return(0,le.h6)().inService?(0,ne.jsx)(ze,(0,r.Z)({},e)):(0,ne.jsx)(qe,(0,r.Z)({},e))}Fe.propTypes={blocklet:f().object.isRequired,ancestors:f().array,hasPermission:f().bool},Fe.defaultProps={ancestors:[],hasPermission:!1};var Ge,We=p.Z.div(Ue||(Ue=(0,c.Z)([""])));function Me(e){var n=e.blocklet,t=e.ancestors,r=e.children,a=(0,o.useState)(""),l=(0,d.Z)(a,2),c=l[0],s=l[1],u=(0,i.PE)().t,p=!!t.length,m=(0,o.useState)("settings"),f=(0,d.Z)(m,2),h=f[0],v=f[1],g=p?(0,A.getDisplayName)(n,!0):u("blocklet.component.container");if((0,ce.wS)(n.status))return null;if("unknown"===n.status&&(0,ce.wS)(n.status))return null;var Z=function(e){e.stopPropagation(),s(!0)},b={settings:{label:u("blocklet.component.setting"),value:"settings",component:(0,ne.jsx)(Ae,{blocklet:n,ancestors:t})},environments:{label:u("common.environment"),value:"environments",component:(0,ne.jsx)(_e,{blocklet:n,ancestors:t})}},k=Object.values(b).map((function(e){return{label:e.label,value:e.value}})),j=b[h]||b.settings;return["function"===typeof r?r({open:Z}):(0,ne.jsx)(y.Z,{onClick:Z,"data-cy":"action-config-component",children:(0,ne.jsx)(Ze.default,{})}),c&&(0,ne.jsx)(Ve,{open:!0,fullWidth:!0,maxWidth:"md",title:g,onClose:function(){s(!1)},PaperProps:{style:{minHeight:"auto"}},children:p?(0,ne.jsxs)(x.Z,{mt:1,children:[(0,ne.jsx)(ye.Z,{tabs:k,current:h,onChange:function(e){v(e)},scrollButtons:"auto"}),j.component]}):(0,ne.jsx)(_e,{blocklet:n,ancestors:t})})]}Me.propTypes={blocklet:f().object.isRequired,ancestors:f().array,children:f().any},Me.defaultProps={ancestors:[],children:null};var Ke,Ve=(0,p.Z)(be.ZP)(Ge||(Ge=(0,c.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"]))),Ye=t(11750),He=t(65140),Xe=t(87916);function $e(e){var n=e.component,t=e.remove,a=e.disabled,l=e.tip,c=e.showConfirm,p=e.hideBtn,m=e.onCancel,f=(0,o.useContext)(i.RD).t,h=(0,o.useState)(!1),x=(0,d.Z)(h,2),v=x[0],g=x[1],Z=(0,o.useState)(null),b=(0,d.Z)(Z,2),y=b[0],k=b[1],j=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.next=3,t(n.component,n.removeType);case 3:g(!1),k(null);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),C=a||v,P=function(){k({title:"".concat(f("common.delete")," ").concat(n.meta.title||n.meta.name),description:function(e,n){return(0,ne.jsxs)(Ye.Z,{component:"div",children:[(0,ne.jsx)(Ye.Z,{gutterBottom:!0,children:f("blocklet.action.removeComponentDescription")}),(0,ne.jsxs)(Xe.Z,{name:"removeType",value:e.removeType,onChange:function(t){return n((0,r.Z)((0,r.Z)({},e),{},{removeType:t.target.value}))},children:[(0,ne.jsx)(I.Z,{value:"keepData",control:(0,ne.jsx)(He.Z,{}),label:f("blocklet.action.removeComponentKeepData")}),(0,ne.jsx)(I.Z,{value:"complete",control:(0,ne.jsx)(He.Z,{}),label:f("blocklet.action.removeComponentComplete")})]})]})},confirm:f("common.confirm"),cancel:f("common.cancel"),params:{component:n,removeType:"keepData"},onConfirm:j,onCancel:function(){k(null),m()}})};(0,o.useEffect)((function(){c?P():(g(!1),k(null))}),[c]);var E=(0,ne.jsx)(Qe,{size:"small",disabled:C,onClick:function(){return P},"data-cy":"delete-component-btn",children:(0,ne.jsx)(N.default,{disabled:C})}),w=(0,ne.jsx)(R.Z,{title:l||f("common.delete"),children:(0,ne.jsx)("span",{children:E})});return(0,ne.jsxs)(ne.Fragment,{children:[!p&&w,y&&(0,ne.jsx)(ae.Z,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]})}$e.propTypes={component:f().object.isRequired,remove:f().func,onCancel:f().func,disabled:f().bool,showConfirm:f().bool,hideBtn:f().bool,tip:f().string},$e.defaultProps={remove:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:function(){},tip:""};var Je,Qe=(0,p.Z)(y.Z)(Ke||(Ke=(0,c.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"]))),en=t(22754),nn=t(98451);function tn(e){var n=e.component,t=e.onStart,r=e.onStop,a=e.disabled,l=e.tip,c=(0,o.useContext)(i.RD).t,p=(0,o.useState)(!1),m=(0,d.Z)(p,2),f=m[0],h=m[1],x=(0,o.useState)(),v=(0,d.Z)(x,2),g=v[0],Z=v[1],b=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.prev=1,e.next=4,t(n);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),M.Z.error(e.t0.message);case 9:h(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.prev=1,e.next=4,r(n);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),M.Z.error(e.t0.message);case 9:h(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),k=a||f,j=["starting","running","stopping"].includes(n.status),C=j?nn.Z:en.Z,P=(0,ne.jsx)(rn,{disabled:k,onClick:function(){var e;j?Z({title:"".concat(c("common.stop")," ").concat(null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.title),description:c("blocklet.action.stopComponentDescription"),confirm:c("blocklet.action.confirmStop"),cancel:c("common.cancel"),onConfirm:function(){return Z(null),y()},onCancel:function(){return Z(null)}}):b()},"data-cy":"".concat(j?"stop":"start","-component-btn"),children:(0,ne.jsx)(C,{disabled:k})});return[(0,ne.jsx)(R.Z,{title:l||c("common.".concat(j?"stop":"start")),children:(0,ne.jsx)("span",{children:P})},"btn"),g&&(0,ne.jsx)(ae.Z,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel},"connect")]}tn.propTypes={component:f().object.isRequired,onStart:f().func,onStop:f().func,disabled:f().bool,tip:f().string},tn.defaultProps={onStart:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),onStop:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),disabled:!1,tip:""};var rn=(0,p.Z)(y.Z)(Je||(Je=(0,c.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"]))),on=t(74286),an=t(74490),ln=t(33271),cn=t(72904),sn=t(5952),un=t(85493),dn=t(30278),pn=t.n(dn),mn=t(79077),fn=t.n(mn),hn=t(75506),xn=t.n(hn),vn=t(3785),gn=t.n(vn),Zn=t(2660),bn=t(42876),yn=t(63902),kn=t(51703),jn=t(88574),Cn=t(35266),Pn=t(55309),En=t(29054),wn=t(56666),Rn=t(24558),Tn=t(13727),Sn=t(56184),_n=t(11819),Un=t(67486),Nn={description:f().string,editing:f().bool,onChange:f().func,required:f().bool,value:f().any,componentProps:f().object,render:f().func,renderFormItem:f().func};function In(e){var n=e.editing,t=e.value,r=e.onChange,i=(0,o.useState)(!1),a=(0,d.Z)(i,2),l=a[0],c=a[1],s=(0,o.useRef)(),u=(0,o.useRef)(t);(0,o.useEffect)((function(){var e=null;return n&&(e=setTimeout((function(){c(!0)}),50)),function(){clearTimeout(e)}}),[n]);var p=function(e){u.current=e,r(e)},m=(0,ne.jsx)(x.Z,{className:"form-item-input slot",px:1,children:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[t,"auto"!==t&&(0,ne.jsx)("div",{style:{marginLeft:4,backgroundColor:t,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=(0,ne.jsxs)(x.Z,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:function(){c(!1),r(u.current)},children:[(0,ne.jsx)(x.Z,{display:"flex",alignItems:"center",onClick:function(){return c(!0)},children:(0,ne.jsx)("div",{ref:s,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,ne.jsx)(_n.ZP,{open:l,anchorEl:s.current,onClose:function(){return c(!1)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:(0,ne.jsx)(Un.AI,{color:t,onChange:function(e){return p(e.hex)}})})]});return n?f:m}In.propTypes=Nn;var Ln=["editing","description","value","onChange","componentProps"];function Dn(e){var n=e.editing,t=e.description,i=e.value,a=e.onChange,c=e.componentProps,s=(0,l.Z)(e,Ln),u=c.placeholder,d=(0,o.useRef)(i),p=function(e){d.current=e,a(e)};return n?(0,ne.jsx)(je.Z,(0,r.Z)({style:{flex:1},fullWidth:!0,value:i,onChange:function(e){e.persist(),p(e.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:t||u,onKeyDown:function(e){"Enter"===e.key&&a(d.current,"confirm")}},s)):(0,ne.jsx)(x.Z,{px:1,className:"form-item-input slot",children:i})}Dn.propTypes=Nn,Dn.defaultProps={componentProps:{}};var On=t(49777),Bn=t.n(On),Fn=t(76818),qn=["editing","value","onChange","componentProps"];function zn(e){var n=e.editing,t=e.value,o=e.onChange,i=e.componentProps,a=(0,l.Z)(e,qn),c=i.blocklet,s="auto"===t?(0,Fn.getPassportColorFromDid)(c.appDid):t;return(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Bn()({title:"Owner",issuer:(0,A.getDisplayName)(c),issuerDid:c.appDid,ownerName:"Your Name",ownerDid:c.appDid,preferredColor:t||"auto"})}}),(0,ne.jsx)(In,(0,r.Z)((0,r.Z)({},a),{},{editing:n,value:n?s:t,onChange:o,componentProps:i}))]})}zn.propTypes=(0,r.Z)((0,r.Z)({},Nn),{},{componentProps:f().shape({blocklet:f().object.isRequired}).isRequired}),zn.defaultProps={};var An,Gn=t(35406),Wn=t(11875);function Mn(e){var n=e.schema,t=e.loading,i=e.value,a=e.defaultValue,l=e.onChange,c=e.style,s=e.disabled,u="[object Object]"===Object.prototype.toString.call(i),p=(0,o.useState)(null),m=(0,d.Z)(p,2),f=m[0],h=m[1],v=(0,o.useState)(u?i:a),g=(0,d.Z)(v,2),Z=g[0],b=g[1],k=(0,o.useRef)();function j(e,n,t){var o=e.key,i=e.secure,a=Z[o]!==n,c=(0,r.Z)((0,r.Z)({},Z),{},(0,wn.Z)({},o,n));a&&b(c),l((0,wn.Z)({},o,n),{allValues:c,action:t,currentItem:e}),"confirm"===t&&i&&b((0,r.Z)((0,r.Z)({},Z),{},(0,wn.Z)({},o,"__encrypted__"))),["confirm","cancel"].includes(t)?C(null):C(e)}function C(e){if(e)return k.current=Z[e.key],void h(e);k.current=null,h(null)}return(0,ne.jsx)(Kn,{className:"form",style:c,children:null===n||void 0===n?void 0:n.map((function(e){var n=e.key,o=e.description,a=e.required,l=e.hidden,c=void 0!==l&&l,d=e.componentProps,p=void 0===d?{}:d;if(c)return null;var m=!(!f||n!==f.key),h=function(e,n){var t=n.editing,r=void 0!==t&&t,o=e.key,a=u?i[o]:Z[o];return"__encrypted__"===a?r?"":"******":a}(e,{editing:m}),v=function(e,n){var t=n.editing,r=void 0!==t&&t,o=e.componentType,i=void 0===o?"input":o,a=e.render,l=e.renderFormItem;return r&&l?l:!r&&a?a:{input:Dn,color:In,passport:zn}[null===i||void 0===i?void 0:i.toLowerCase()]}(e,{editing:m}),g={inputProps:{"data-cy":"schema-form-item-component"},key:n,description:o,editing:m,value:h,onChange:function(n){return j(e,n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"change")},componentProps:p};return(0,ne.jsxs)(x.Z,{className:"form-item",children:[(0,ne.jsxs)(x.Z,{className:"form-item-label",style:{color:a&&!h?"#ff0000":"#333"},children:[o,a&&(0,ne.jsx)(Gn.Z,{})]}),(0,ne.jsxs)(x.Z,{className:"form-item-body",children:[(0,ne.jsx)(x.Z,{className:"form-item-input",children:(0,ne.jsx)(v,(0,r.Z)({},g))}),(0,ne.jsx)(x.Z,{className:"form-item-action",children:m?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(y.Z,{"data-cy":"schema-form-item-confirm",onClick:function(){j(e,h,"confirm")},disabled:s||t,size:"large",children:t?(0,ne.jsx)(B.Z,{size:24}):(0,ne.jsx)(Sn.Z,{})}),(0,ne.jsx)(y.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){j(e,k.current,"cancel")},disabled:s||t,size:"large",children:(0,ne.jsx)(Tn.default,{})})]}):(0,ne.jsx)(y.Z,{"data-cy":"schema-form-item-edit",onClick:function(){j(e,Z[n],"edit")},disabled:s||f,size:"large",children:(0,ne.jsx)(Rn.Z,{})})})]})]},n)}))})}Mn.propTypes={schema:f().array.isRequired,loading:f().bool,onChange:f().func.isRequired,value:f().object,defaultValue:f().object,style:f().object,disabled:f().bool},Mn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};var Kn=(0,p.Z)(Wn.Z)(An||(An=(0,c.Z)([""]))),Vn=t(49983),Yn=t(28018),Hn=t.n(Yn),Xn=t(60344),$n=t(73170),Jn=["mode"];function Qn(e){var n=e.meta,t=e.onCancel,a=e.mode,l=e.handlePaySuccess,c=(0,i.PE)(),p=c.t,m=c.locale,f=(0,le.h6)().info,h=(0,ce.yP)(f),x=(0,o.useState)(null),v=(0,d.Z)(x,2),g=v[0],Z=v[1],b=new URL(null===n||void 0===n?void 0:n.registryUrl).origin,y=(0,A.getDisplayName)({meta:n}),k=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n,r){var o,i,c,d,m;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=function(e){return Hn()((function(){return Xn.hi.get(e).then(function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var t,r;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.data,r=null===t||void 0===t?void 0:t.downloadTokenList,"succeed"!==t.status){e.next=12;break}if(!r||!r.length){e.next=8;break}return e.next=6,o({downloadTokenList:r});case 6:e.next=11;break;case 8:return e.next=10,i(p("blocklet.component.missDownloadTokenTip"));case 10:case 11:case 16:return e.abrupt("return",!0);case 12:if("error"!==t.status){e.next=17;break}return console.error("vc error: ",t),e.next=16,i(null===t||void 0===t?void 0:t.error);case 17:return e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}())}),{interval:1e3})},o=function(e){var n=e.downloadTokenList;l({downloadTokenList:n})},i=function(e){M.Z.error(e),t(e)},"purchase"!==a||!g){e.next=9;break}return d=(0,ce.Pi)(g),m=d.statusUrl,e.next=7,c(m);case 7:e.next=11;break;case 9:return e.next=11,o({downloadTokenList:n.downloadTokenList&&r(n.downloadTokenList)});case 11:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}();if((0,o.useEffect)((function(){if("purchase"===a){var e=new URL(b);e.pathname="/api/did/verify-purchase-blocklet/token",e.searchParams.set("serverDid",f.did),e.searchParams.set("blockletDid",null===n||void 0===n?void 0:n.did);try{Xn.hi.get(e.href).then((function(e){var n=e.data,t="".concat(n.url);Z(t)}))}catch(t){console.error("get next workflow url error: ",t)}}return function(){Z(null)}}),[a]),"purchase"===a&&!g)return"";var j={verify:{action:"verify-purchase-blocklet",checkFn:Xn.od.create({baseURL:b}).get,extraParams:{serverDid:f.did,blockletDid:null===n||void 0===n?void 0:n.did},messages:{title:p("store.purchase.verify.auth.title",{name:y}),scan:p("store.purchase.verify.auth.scan"),confirm:p("store.purchase.verify.auth.confirm"),success:p("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Xn.od.create({baseURL:X()(b,"/store")}).get,extraParams:{factory:n.nftFactory,nw:g},messages:{title:p("store.purchase.auth.title",{name:y}),scan:p("store.purchase.auth.scan"),confirm:p("store.purchase.auth.confirm"),success:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("p",{children:p("store.purchase.auth.success")}),(0,ne.jsx)("p",{children:p("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return(0,ne.jsx)(Vn.Z,(0,r.Z)({open:!0,locale:m,popup:!1,saveConnect:!1,className:"connect",baseUrl:b,onSuccess:k,cancelWhenScanned:t,onClose:t,checkTimeout:3e5,webWalletUrl:h,disableClose:!0,showDownload:!1},j[a]))}Qn.propTypes=(0,r.Z)((0,r.Z)({},$n.$7),{},{handlePaySuccess:f().func,mode:f().oneOf(["verify","purchase"]).isRequired}),Qn.defaultProps={handlePaySuccess:function(){}};var et=(0,o.forwardRef)((function(e,n){var t=e.mode,i=(0,l.Z)(e,Jn),a=(0,o.useState)("both"!==t?t:"verify"),c=(0,d.Z)(a,2),s=c[0],u=c[1],p=(0,o.useState)("both"!==t?2:1),m=(0,d.Z)(p,2),f=m[0],h=m[1],x=function(){s&&2!==f&&h(2)};return(0,o.useImperativeHandle)(n,(function(){return{onNext:x,getCurrentStep:function(){return f}}})),1===f?(0,ne.jsx)("div",{style:{maxWidth:520},children:(0,ne.jsx)($n.AP,{action:s,onNext:null,onSelect:function(e){e!==s&&u(e)}})}):(0,ne.jsx)(Qn,(0,r.Z)((0,r.Z)({},i),{},{mode:s}))}));et.propTypes={mode:f().oneOf(["both","verify","purchase"]).isRequired,ref:f().any},et.defaultProps={ref:{}};var nt,tt=et,rt=t(51233),ot=t(31440),it=t(61813),at=t(49390),lt=t(67654),ct=t(22714),st=t(45170);function ut(e){var n=e.onChange,t=e.loading,l=e.children,c=e.extra,s=e.stores,u=e.storageKey,p=(0,i.PE)().t,m=(0,le.h6)(),f=m.info,h=m.inService,x=(0,En.y0)().blocklet,v=(0,o.useState)(!1),g=(0,d.Z)(v,2),Z=g[0],b=g[1],y=(0,o.useRef)(null),k=(0,o.useState)(),j=(0,d.Z)(k,2),C=j[0],P=j[1],E=(0,lt.Z)(u||"tmp"),w=(0,d.Z)(E,2),R=w[0],T=w[1],S=u?[R,T]:[C,P],_=(0,d.Z)(S,2),U=_[0],N=_[1],I=(0,ce.dX)({fromBlocklet:h,blocklet:x,nodeInfo:f}),L=I.storeList,D=I.teamDid,B=pn()([].concat((0,a.Z)(s.map((function(e){return(0,r.Z)((0,r.Z)({},e),{},{protected:!0})}))),(0,a.Z)(L)),"url"),F=U&&B.find((function(e){return U===e.url}))||B[0],z=f.mode===O.NODE_MODES.SERVERLESS;return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsxs)(pt,{children:[(0,ne.jsx)(q.Z,{ref:y,color:"secondary","data-cy":"add-component-select-store",endIcon:(0,ne.jsx)(at.Z,{color:"secondary"}),onClick:function(){b(!0)},style:{padding:"0 2px"},children:(0,ne.jsx)(Ye.Z,{color:"secondary",children:F.name})}),(0,ne.jsx)(Ye.Z,{color:"secondary",children:c})]}),(0,ne.jsxs)(je.Z,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:p("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:F,autoFocus:!0,onChange:function(e){var t=e.target.value;N(t.url),n(t)},SelectProps:{open:Z,MenuProps:{anchorEl:y.current},renderValue:function(e){return null===e||void 0===e?void 0:e.name},onClose:function(){b(!1)}},style:{display:"none"},margin:"normal",children:[null===B||void 0===B?void 0:B.map((function(e){return(0,ne.jsx)(an.Z,{value:e,"data-cy":e.url,children:(0,ne.jsx)(st.Z,{teamDid:D,store:e,onDelete:function(){var n;U===e.url&&N(null===(n=B[0])||void 0===n?void 0:n.url)}})},e.url)})),!z&&(0,ne.jsx)(ct.Z,{disabled:t,storeList:B,teamDid:D,onAdd:function(e){N(e)}})]}),l({currentRegistry:F})]})}ut.propTypes={onChange:f().func,loading:f().bool,children:f().any.isRequired,extra:f().node,storageKey:f().string,stores:f().arrayOf(f().shape({name:f().string.isRequired,url:f().string.isRequired}))},ut.defaultProps={onChange:function(){},loading:!1,extra:"",stores:[],storageKey:""};var dt,pt=p.Z.div(nt||(nt=(0,c.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"])),(function(e){return e.theme.palette.common.black})),mt=t(71569),ft=t(52439),ht=t(77121),xt=t(44727),vt=["handleButtonClick","handleSearchSelect","storeUrl","handleBlockletRender","extraFilter","serverVersion","resourceType"],gt=function(e,n){return X()(n,"/blocklets/".concat(e.did))},Zt=function(e){var n=e.blocklet,t=e.attribute,r=e.value;return n._formatted?n._formatted[t]:r},bt=function(e){return e.inStore&&!1===(0,A.isFreeBlocklet)(e)};function yt(e){var n=e.blocklet,t=e.blocklets,r=e.handleButtonClick,a=e.endpoint,l=(0,i.PE)().t,c=X()(a,(0,ce.lk)(n.did,n.logo||"")),p=(0,o.useState)(!1),m=(0,d.Z)(p,2),f=m[0],h=m[1],x=bt(n)?l("common.purchase"):l("blocklet.component.choose"),v=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(o){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.preventDefault(),o.stopPropagation(),e.prev=2,h(!0),e.next=6,r({meta:n,registryUrl:a,blocklets:t});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),M.Z.error(e.t0.message);case 11:return e.prev=11,h(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[2,8,11,14]])})));return function(n){return e.apply(this,arguments)}}();return(0,ne.jsx)(ee.Z,{href:gt(n,a),style:{color:"initial",textDecoration:"none"},onClick:function(e){return!!e.currentTarget.contains(e.target)||(e.preventDefault(),!1)},target:"_blank",children:(0,ne.jsx)(Ct,{title:Zt({blocklet:n,attribute:"title",value:n.title||n.name}),did:n.did,description:Zt({blocklet:n,attribute:"description",value:n.description}),cover:n.logo?c:"",version:n.version,button:(0,ne.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,ne.jsx)(xt.Kk,{children:(0,ne.jsx)(q.Z,{onClick:v,size:"small",disabled:f,variant:"outlined",color:"primary","data-cy":"install-blocklet",children:f?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(B.Z,{size:16,style:{marginRight:3}}),x]}):x},n.did)})})})})}function kt(e){var n=e.handleButtonClick,t=e.handleSearchSelect,a=e.storeUrl,c=e.handleBlockletRender,s=e.extraFilter,u=e.serverVersion,p=e.resourceType,m=(0,l.Z)(e,vt),f=(0,i.PE)().locale,h=(0,o.useState)(!1),x=(0,d.Z)(h,2),v=x[0],g=x[1],Z=(0,o.useState)({}),b=(0,d.Z)(Z,2),y=b[0],k=b[1],j=a;return(0,o.useEffect)((function(){k({resourceType:p})}),[j,p]),(0,o.useEffect)((function(){g(!0),k({resourceType:p})}),[]),(0,ne.jsx)(ft.ErrorBoundary,{FallbackComponent:mt.H,resetKeys:[j],children:(0,ne.jsx)("div",(0,r.Z)((0,r.Z)({},m),{},{children:v&&(0,ne.jsx)(ht.Z,{blockletRender:function(e){var t=(0,r.Z)((0,r.Z)({},e),{},{handleButtonClick:n,endpoint:j});return c((0,r.Z)((0,r.Z)({},e),{},{defaultRender:(0,ne.jsx)(yt,(0,r.Z)({},t))}))},baseSearch:!0,endpoint:j,locale:f,onFilterChange:function(e){k(e)},onSearchSelect:t,filters:y,extraFilter:s,serverVersion:u,fetchCategoryDelay:500})}))})}yt.propTypes={blocklet:f().object.isRequired,blocklets:f().array,handleButtonClick:f().func,endpoint:f().string},yt.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]},kt.propTypes={storeUrl:f().string.isRequired,handleButtonClick:f().func,handleSearchSelect:f().func,handleBlockletRender:f().func,extraFilter:f().func,serverVersion:f().string,resourceType:f().string},kt.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:""};var jt,Ct=(0,p.Z)(xt.ZP)(dt||(dt=(0,c.Z)(["\n .ms-highlight {\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main})),Pt=t(10458),Et=t.n(Pt),wt=t(65873),Rt=t(82434),Tt=t.n(Rt),St=t(2478),_t=t(42761),Ut=t(62681),Nt=t(44067),It=t(3182),Lt=t(75953),Dt=t(73545),Ot=["onSelect","endpoint","gatewayUrl","loading","size","helperText"],Bt=[{value:"https://www.didspaces.com/app",label:"Prod DID Spaces",avatar:"P"},{value:"https://storage.staging.abtnet.io/app",label:"Staging DID Spaces",avatar:"S"}],Ft=(0,It.D)();function qt(e){var n=e.onSelect,t=e.endpoint,c=e.gatewayUrl,s=e.loading,u=e.size,p=e.helperText,m=(0,l.Z)(e,Ot),f=(0,lt.Z)("did-space-gateway-list",Bt),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=(0,o.useState)(c||Bt[0].value),Z=(0,d.Z)(g,2),b=Z[0],y=Z[1],k=(0,i.PE)().t,j=(0,Dt.T)().api;return(0,o.useEffect)((function(){b&&!x.find((function(e){return e.value===b}))&&j.get(X()(b,"/__blocklet__.js?type=json")).then((function(e){v([].concat((0,a.Z)(x),[{value:b,label:e.data.appName}]))})).catch((function(e){console.error(e),M.Z.error("Can not add this gateway, please check the url and try again")}))}),[b]),(0,ne.jsx)(zt,(0,r.Z)((0,r.Z)({},m),{},{freeSolo:!0,selectOnFocus:!0,clearOnBlur:!0,handleHomeEndKeys:!0,value:b,options:x,onChange:function(e,n){if(n)if("string"===typeof n){var t=x.find((function(e){return e.label===n}));t&&y(t.value)}else n.inputValue?y(n.inputValue):n.value&&y(n.value)},getOptionLabel:function(e){return"string"===typeof e?e:e.inputValue?e.inputValue:e.label},renderOption:function(e,n){return(0,ne.jsxs)(St.ZP,(0,r.Z)((0,r.Z)({},e),{},{children:[(0,ne.jsx)(_t.Z,{children:(0,ne.jsx)(Ut.Z,{children:n.avatar})}),(0,ne.jsx)(Nt.Z,{primary:n.label,secondary:n.value})]}),n.value)},filterOptions:function(e,n){var t=Ft(e,n);n.inputValue&&Tt()(n.inputValue)&&(e.some((function(e){return n.inputValue===e.value}))||t.push({value:n.inputValue,label:"Add new gateway"}));return t},renderInput:function(e){return(0,ne.jsx)(je.Z,(0,r.Z)((0,r.Z)({},e),{},{helperText:p,label:k("storage.spaces.label"),size:u,InputProps:(0,r.Z)((0,r.Z)({},e.InputProps),{},{type:"search",endAdornment:(0,ne.jsx)(q.Z,{variant:"contained",onClick:function(){return n(b)},size:"small",loading:s,disable:s,sx:{position:"absolute",right:0,display:"flex",justifyContent:"center",alignItems:"center",width:"100px",height:"100%"},children:k(t?"storage.spaces.reconnect":"storage.spaces.connect.now")})})}))}}))}var zt=(0,p.Z)(Lt.Z)(jt||(jt=(0,c.Z)(["\n height: 40px;\n width: 100%;\n max-width: 720px;\n "," {\n width: 75%;\n }\n input.MuiInputBase-input {\n max-width: calc(100% - 80px);\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}));qt.propTypes={onSelect:f().func.isRequired,endpoint:f().string,loading:f().bool,size:f().string,helperText:f().string,gatewayUrl:f().string},qt.defaultProps={endpoint:void 0,loading:!1,size:"small",helperText:"",gatewayUrl:""};var At=qt,Gt=["onConnect"];var Wt=(0,o.forwardRef)((function(e,n){var t=e.onConnect,a=(0,l.Z)(e,Gt),c=(0,le.h6)(),p=c.api,m=c.info.did,f=(0,o.useContext)(i.RD),h=f.t,x=f.locale,v=(0,En.y0)(),g=v.blocklet,Z=v.actions.refreshBlocklet,b=(0,o.useState)(""),y=(0,d.Z)(b,2),k=y[0],j=y[1],C=(0,o.useMemo)((function(){var e,n,t,r;return{endpoint:(null===g||void 0===g||null===(e=g.environments)||void 0===e||null===(n=e.find((function(e){return e.key===ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===n?void 0:n.value)||"",gatewayUrl:(null===g||void 0===g||null===(t=g.environments)||void 0===t||null===(r=t.find((function(e){return e.key===ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACES_URL})))||void 0===r?void 0:r.value)||""}}),[g]),P=(0,A.getAppName)(g),E=(0,A.getAppDescription)(g),w=function(e){var n,t,r,o=null===e||void 0===e||null===(n=e.site)||void 0===n||null===(t=n.domainAliases)||void 0===t||null===(r=t.sort((function(e,n){return e.accessibility.accessible&&n.accessibility.accessible?+e.isProtected-+n.isProtected:+n.accessibility.accessible-+e.accessibility.accessible})))||void 0===r?void 0:r.map((function(e){var n,t=null!==e&&void 0!==e&&null!==(n=e.domainStatus)&&void 0!==n&&n.isHttps?"https://":"http://",r=null===e||void 0===e?void 0:e.value;return"".concat(t).concat(r)})).filter(Boolean),i=null===o||void 0===o?void 0:o[0];return{appUrl:i,isReady:Boolean(i)}}(g),R=w.appUrl,T=w.isReady;function S(e,n){return _.apply(this,arguments)}function _(){return(_=(0,u.Z)((0,s.Z)().mark((function e(n,t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.configBlocklet({input:{did:[n],configs:[{key:ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACES_URL,value:k},{key:ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:t}]}}).then((function(){M.Z.success(h("storage.spaces.connect.succeeded",x))})).catch((function(e){console.error(e),M.Z.error(e.message)}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var U=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n,o){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(g.meta.did,o(n.endpoint));case 2:setTimeout((function(){D((function(e){return(0,r.Z)((0,r.Z)({},e),{},{open:!1})})),null===t||void 0===t||t(),Z()}),3e3);case 3:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),N=(0,o.useState)({open:!1}),I=(0,d.Z)(N,2),L=I[0],D=I[1];return(0,o.useEffect)((function(){D((function(e){return(0,r.Z)((0,r.Z)({},e),{},{messages:{title:h("storage.spaces.authorize.title",{appName:P}),scan:h("storage.spaces.authorize.scan",{appName:P}),confirm:"",success:(0,ne.jsx)(Ye.Z,{gutterBottom:!0,children:h("storage.spaces.authorize.success")})}})}))}),[P,x,h]),(0,o.useImperativeHandle)(n,(function(){return{getEndpoint:function(){return C.endpoint},getGatewayUrl:function(){return C.gatewayUrl}}})),(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(At,(0,r.Z)((0,r.Z)((0,r.Z)({},a),C),{},{onSelect:function(e){(0,wt.isEmpty)(e)?M.Z.error(h("storage.spaces.addressCannotEmpty",x)):(j(e),D((function(n){return(0,r.Z)((0,r.Z)({},n),{},{action:"one-click-authorization",checkTimeout:3e5,prefix:X()(e,"space/api/did"),baseUrl:new URL(e).origin,checkFn:Et().create({baseURL:X()(e,"space")}).get,extraParams:{appDid:g.appDid,appName:P,appDescription:E,scopes:"list:object read:object write:object",appUrl:R,referrer:window.location.href,nodeDid:m},onClose:function(){D((function(e){return(0,r.Z)((0,r.Z)({},e),{},{open:!1})}))},open:!0})})))},loading:!T})),(0,ne.jsx)(Vn.Z,{forceConnected:!1,saveConnect:!1,prefix:L.prefix,open:L.open,popup:!0,action:L.action,baseUrl:L.baseUrl,checkFn:L.checkFn,onSuccess:U,onClose:L.onClose,checkTimeout:L.checkTimeout,extraParams:L.extraParams,messages:L.messages,locale:x})]})}));Wt.propTypes={onConnect:f().func},Wt.defaultProps={onConnect:function(){}};var Mt,Kt,Vt,Yt,Ht,Xt,$t,Jt=Wt,Qt=["name","validation"],er=["default","key"],nr=function(e){return e.inStore&&!1===(0,A.isFreeBlocklet)(e)},tr=function(e){var n;return null===e||void 0===e||null===(n=e.capabilities)||void 0===n?void 0:n.didSpace},rr=function(e){var n,t;return(null===e||void 0===e||null===(n=e.configs)||void 0===n||null===(t=n.find((function(e){return e.key===ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===t?void 0:t.value)||null},or=function(e){return(e.environments||[]).some((function(e){return e.required}))},ir=function(e,n){return null===e||void 0===e?void 0:e.some((function(e){return e.required&&!n[e.key]}))},ar=function(e){var n=e.params,t=e.blocklet,r=e.t,o=n.title||n.name;return o?r(((null===t||void 0===t?void 0:t.children)||[]).find((function(e){return e.meta.bundleDid===n.bundleDid}))?"blocklet.component.upgradeNext":"blocklet.component.addNext",{name:o}):r("common.next")},lr=(0,o.forwardRef)((function(e,n){var t=e.meta,a=e.isMobile,l=e.onStepChange,c=(0,kn.s)(),s=c.steps,u=c.activeStep,d=c.setActiveStepByKey,p=c.setActiveStepByIndex,m=(0,i.PE)(),f=m.t,h=m.locale,x=s[u];return(0,o.useEffect)((function(){l(u)}),[l,u]),(0,o.useImperativeHandle)(n,(function(){return{setActiveStepByKey:d,setActiveStepByIndex:p}})),(0,ne.jsx)(hr,{component:"div",className:a?"mobileStyle":"",sx:{height:"100%"},children:(0,ne.jsx)(yn.Z,{locale:h,blockletMeta:(0,r.Z)({title:" "},t),pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?(0,ce.aZ)({did:t.did,baseUrl:t.registryUrl,logoPath:t.logo}):null,stepTip:f("blocklet.component.add"),children:(0,ne.jsx)(mr,{children:null!==x&&void 0!==x&&x.body&&"function"===typeof x.body?x.body():x.body})})})}));lr.propTypes={meta:f().any,onStepChange:f().func.isRequired,isMobile:f().bool.isRequired},lr.defaultProps={meta:null};var cr=function(e){window.parent.postMessage({event:"component.installed",componentDid:e},"*")};function sr(e){var n,t,c,p,m,f,h,v=e.onClose,g=e.mode,Z=e.stores,b=e.resourceType,y=e.storageKey,k=(0,i.PE)(),j=k.t,C=k.locale,P=(0,o.useState)(!1),E=(0,d.Z)(P,2),w=E[0],R=E[1],T=(0,o.useState)(null),S=(0,d.Z)(T,2),_=S[0],U=S[1],N=(0,o.useState)(""),I=(0,d.Z)(N,2),L=I[0],D=I[1],F=(0,o.useState)(""),z=(0,d.Z)(F,2),G=z[0],W=z[1],K=(0,le.h6)(),V=K.api,Y=K.ws.useSubscription,H=K.inService,X=K.info,$=(0,En.y0)(),J=$.blocklet,Q=$.actions.refreshBlocklet,ee=(0,o.useState)(null),te=(0,d.Z)(ee,2),re=te[0],oe=te[1],ae=(0,o.useState)(!1),se=(0,d.Z)(ae,2),ue=se[0],de=se[1],pe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceCapability:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},me=(0,o.useState)(pe),fe=(0,d.Z)(me,2),he=fe[0],xe=fe[1],ve=(0,o.useState)(0),ge=(0,d.Z)(ve,2),Ze=ge[0],be=ge[1],ye=(0,o.useRef)({}),ke=(0,o.useRef)({}),Ce=(0,o.useRef)({}),Pe=(0,cn.Z)((function(e){return e.breakpoints.down("md")})),Ee=(0,un.useParams)(),we=ye.current.meta,Re=(ke.current||{}).setActiveStepByIndex,Te=X.mode===O.NODE_MODES.SERVERLESS,Se=function(e){return xe((function(n){return(0,r.Z)((0,r.Z)({},n),e)}))};(0,o.useEffect)((function(){if(he.pathPrefix){var e=Oe((0,r.Z)((0,r.Z)({},he),{},{pathPrefix:he.pathPrefix,locale:C})).errMsg;D(e)}}),[he.pathPrefix]),(0,o.useEffect)((function(){0===Ze&&xe(pe)}),[Ze]);var _e=function(){var e;return null!==ye&&void 0!==ye&&null!==(e=ye.current)&&void 0!==e&&e.meta?(0,A.getDisplayName)(ye.current):""},Ue=function(e){!function n(t){Se({installResultProps:{variant:"error",title:_e(),subTitle:e,footer:(0,ne.jsx)(q.Z,{className:"bottom-button",disabled:t,"data-cy":"retry-install-component",onClick:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,Le(ye.current.installInput);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),children:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[t&&(0,ne.jsx)(B.Z,{size:16,style:{marginRight:8}}),j("common.retry")]})})}})}()},Ne=function(e){return function(n){var t,r;((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===J||void 0===J||null===(r=J.meta)||void 0===r?void 0:r.did)&&e(n)}};Y(ie.BlockletEvents.statusChange,Ne((function(e){if(e.status===ie.BlockletStatus.upgrading)Se({installResultProps:{variant:"success",title:_e(),subTitle:j("blocklet.component.installSuccessTip")}}),cr(Ee.componentDid)})),[null===J||void 0===J||null===(n=J.meta)||void 0===n?void 0:n.did]),Y(ie.BlockletEvents.downloadFailed,Ne((function(){Ue(j("blocklet.component.installComponentError"))})),[null===J||void 0===J||null===(t=J.meta)||void 0===t?void 0:t.did]),Y(ie.BlockletEvents.installFailed,Ne((function(){Ue(j("blocklet.component.installComponentError"))})),[null===J||void 0===J||null===(c=J.meta)||void 0===c?void 0:c.did]);var Ie=function(){R(!1),xe({}),ye.current={},v()},Le=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var t,o,i,a,l,c,u,d,p,m,f,h,x,v,g,Z,b,y,k,j,C,P,E,w,T;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=he.pathPrefix,a=he.bundleDid,l=he.title,c=he.componentName,u=void 0===c?"":c,d=he.componentDid,p=void 0===d?"":d,m=(null===(t=ye.current)||void 0===t?void 0:t.meta)||{},f=m.configs,h=void 0===f?[]:f,x=m.registryUrl,v=m.inStore,g=m.inputUrl,Z=null===(o=ye.current)||void 0===o?void 0:o.downloadTokenList,b=v?(0,ce.Rn)(x,a):g,R(!0),y=(0,r.Z)((0,r.Z)((0,r.Z)({rootDid:J.meta.did,url:b,mountPoint:De()(i),title:l,name:u,did:p},he.hasEnvironmentsStep&&h.length>0?{configs:h.map((function(e){return(0,r.Z)((0,r.Z)({},e),{},{value:he.configsValue[e.key]||""})}))}:{}),Z?{downloadTokenList:Z}:{}),n),e.prev=6,e.next=9,V.installComponent({input:y});case 9:if(!x){e.next=15;break}if(k=(0,ce.dX)({fromBlocklet:H,nodeInfo:X,blocklet:J}),j=k.teamDid,C=k.storeList,P=(0,ce.bQ)(x,C),E=P.isNew,w=P.decoded,!E){e.next=15;break}return e.next=15,V.addBlockletStore({input:{teamDid:j,url:w}});case 15:Se({installResultProps:{}}),Q({showError:!1,attachRuntimeInfo:!1}),e.next=25;break;case 19:e.prev=19,e.t0=e.catch(6),T=(0,ce.Z)(e.t0),M.Z.error(T),console.error("installComponent error: ",e.t0),Ue(T);case 25:return e.prev=25,R(!1),ye.current.installInput=y,e.finish(25);case 29:case"end":return e.stop()}}),e,null,[[6,19,25,29]])})));return function(n){return e.apply(this,arguments)}}(),Oe=function(e){return{errMsg:(0,rt.Rw)({params:(0,r.Z)((0,r.Z)({},e),{},{did:e.bundleDid}),blocklets:[J],blocklet:J,locale:C})}},Be=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var t,o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Oe((0,r.Z)((0,r.Z)({},he),{},{locale:C})),o=t.errMsg,D(o),Ze!==ze.length-2){e.next=5;break}return e.next=5,Le(n);case 5:Re((function(e){return e+1}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Fe=function(){Re((function(e){return e-1}))},qe=function(e){var n,t,o=e.chooseParams,i=void 0===o?ye.current:o,c=e.componentDid,s=e.isInit,u=void 0!==s&&s,d=i.meta,p=i.registryUrl,m=i.inStore,f=i.inputUrl,h=d.did,x=d.title,v=d.name,g=((null===(n=J.settings)||void 0===n?void 0:n.children)||[]).filter((function(e){return"deleted"===e.status&&e.meta.bundleDid===h})),Z=c||"",b=null===(t=d.environments)||void 0===t?void 0:t.map((function(e){var n=e.name,t=e.validation,o=(0,l.Z)(e,Qt),i={validation:gn()(t)?"":t};return(0,r.Z)((0,r.Z)({},o),{},{key:n},i)}));ye.current=(0,r.Z)((0,r.Z)({},i),{},{meta:(0,r.Z)((0,r.Z)({},d),{},{configs:b,registryUrl:p,inStore:m,inputUrl:f})});var y={};if(u){var k=[J],j=b||[],C=pn()(fn()([].concat((0,a.Z)(j),[])),"key").filter((function(e){return!!e.key})).sort((function(e,n){return e.required&&!n.required?-1:n.required&&!e.required?1:0})),P=(0,A.getSharedConfigObj)(k[0],{configs:C}),E={},w=C.map((function(e){var n=e.default,t=e.key,o=(0,l.Z)(e,er);return E[t]=P[t]||n,(0,r.Z)((0,r.Z)({},o),{},{key:t,hidden:!!ie.BLOCKLET_CONFIGURABLE_KEY[t]})}));y=(0,r.Z)((0,r.Z)({},y),{},{configsList:w,configsValue:E,hasMissRequiredConfigs:ir(w,E)})}var R,T,S=J.children.some((function(e){return"/"===e.mountPoint})),_=g.find((function(e){return e.meta.bundleDid===h}));_?y=(0,r.Z)((0,r.Z)({},y),{},{pathPrefix:_.mountPoint||"",title:x||"",componentName:_.meta.name,hasEnvironmentsStep:!1}):y=(0,r.Z)((0,r.Z)({},y),{},{pathPrefix:S?"/".concat(De()(x)||De()(v)):"/",title:x||"",componentName:"",hasEnvironmentsStep:(null===(R=ye.current.meta)||void 0===R||null===(T=R.environments)||void 0===T?void 0:T.length)>0});var U=nr(ye.current.meta),N=tr(ye.current.meta),I=rr(J);Se((0,r.Z)((0,r.Z)({bundleDid:h,componentDid:Z},y),{},{hasRequiredEnvironments:or(ye.current.meta),requirePurchase:U,didSpaceCapability:N,didSpaceEndpoint:I})),u&&U&&function(){var e=he.pathPrefix,n=he.bundleDid,t=he.title,r=he.componentName,o=void 0===r?"":r,i=he.componentDid,a=void 0===i?"":i,l=(ye.current||{}).meta,c=void 0===l?{}:l,s=c.registryUrl,u=c.inStore,d=c.inputUrl,p=u?(0,ce.Rn)(s,n):d;oe({meta:c,installOpts:{type:"component",rootDid:J.meta.did,mountPoint:e,url:p,title:t,name:o,did:a}})}()},ze=[{key:"selectComponent",name:j("blocklet.component.selectComponent"),body:(0,ne.jsxs)(pr,{component:"div",children:[he.showFromUrlDialog&&(0,ne.jsx)(it.Z,{mode:"component",onCancel:function(){Se({showFromUrlDialog:!1})},onSuccess:function(e){var n=e.meta,t=e.inputUrl,r=e.inStore,o=e.registryUrl;qe({chooseParams:{meta:n,inputUrl:t,inStore:r,registryUrl:o},isInit:!0}),Se({showFromUrlDialog:!1}),Be()},handleText:{title:j("blocklet.component.addComponentTip.fromUrl"),confirm:j("blocklet.component.choose")}}),(0,ne.jsx)(ut,{stores:Z,extra:Te?null:(0,ne.jsxs)(q.Z,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:function(){Se({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[(0,ne.jsx)(ln.Z,{style:{fontSize:20,marginRight:4}})," ",j("blocklet.component.addComponentTip.fromUrl")," "]}),loading:w,onChange:function(){xe({}),ye.current={}},storageKey:y,children:function(e){var n=e.currentRegistry;return(0,ne.jsx)(kt,{serverVersion:null===X||void 0===X?void 0:X.version,style:Pe?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:n.url,resourceType:b,handleButtonClick:function(e){qe({chooseParams:(0,r.Z)((0,r.Z)({},e),{},{inStore:!0}),isInit:!0})},handleBlockletRender:function(e){var n=e.blocklet,t=e.defaultRender,r=(null===he||void 0===he?void 0:he.bundleDid)&&(null===he||void 0===he?void 0:he.bundleDid)===(null===n||void 0===n?void 0:n.did);return(0,ne.jsxs)(vr,{children:[r&&(0,ne.jsx)("div",{className:"check-container",children:(0,ne.jsx)(bn.default,{className:"check-icon"})}),(0,ne.jsx)("div",{className:r?"choose-blocklet":"",style:{marginLeft:16},children:t})]})}})}})]}),cancel:"embed"===g?void 0:j("common.cancel"),confirm:ar({params:he,blocklet:J,t:j}),onCancel:Ie,onConfirm:function(){Be()}},{key:"agreement",name:j("launchBlocklet.introduction"),body:(0,ne.jsxs)(pr,{component:"div",className:"agreement-wrapper",children:[(0,ne.jsx)(Zn.Z,{title:j("launchBlocklet.introduction"),subTitle:j("blocklet.component.addComponentTip.introduction")}),(0,ne.jsx)(ot.Z,{meta:we,onClickNext:Be,handleDescEle:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("p",{children:(0,ne.jsx)("div",{dangerouslySetInnerHTML:{__html:j("blocklet.component.addComponentTip.".concat(he.requirePurchase?"isPurchase":"isFree"),{name:_e()})}})}),(0,ne.jsx)("p",{children:j("blocklet.component.addComponentTip.belowInformation")})]})})]}),cancel:j("common.pre"),confirm:j("launchBlocklet.next"),onCancel:Fe,onConfirm:function(){de(!1),Be()}},we&&he.requirePurchase&&{key:"purchase",name:(0,ne.jsxs)(ne.Fragment,{children:[j("common.verifyNFT"),(0,ne.jsx)(Gn.Z,{})]}),body:(0,ne.jsxs)(pr,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(2===(null===(p=Ce.current)||void 0===p||null===(m=p.getCurrentStep)||void 0===m?void 0:m.call(p))||ue)&&(0,ne.jsx)(xr,{title:j("common.verifyNFT"),subTitle:j("blocklet.component.addComponentTip.verifyNFT")}),xn()(he.purchaseResultProps)?re&&(0,ne.jsx)(tt,{ref:Ce,meta:re.meta,mode:he.componentDid?"verify":"both",onCancel:function(e){de(!1),Se({purchaseResultProps:{variant:"error",title:_e(),subTitle:e,style:{paddingTop:120},footer:(0,ne.jsx)(q.Z,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:function(){Se({purchaseResultProps:{}})},children:j("common.retry")})}})},installOpts:re.installOpts,handlePaySuccess:function(e){var n=e.downloadTokenList;ye.current.downloadTokenList=n,de(!1),Be()}}):(0,ne.jsx)("div",{className:"flex-align-center flex-justify-center",children:(0,ne.jsx)(Pn.Z,(0,r.Z)({},he.purchaseResultProps))})]}),disabled:2===(null===(f=Ce.current)||void 0===f||null===(h=f.getCurrentStep)||void 0===h?void 0:h.call(f))||ue,cancel:j("common.pre"),confirm:j("common.next"),onConfirm:function(){"function"===typeof Ce.current.onNext&&(Ce.current.onNext(),de(!0))},onCancel:function(){Fe()}},(0,A.hasStartEngine)(we)&&{key:"config",name:j("common.config"),error:L,body:(0,ne.jsxs)(pr,{component:"div",children:[(0,ne.jsx)(xr,{title:j("common.config"),subTitle:j("blocklet.component.addComponentTip.config")}),(0,ne.jsx)(je.Z,{label:j("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:G||j("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:he.pathPrefix,onChange:function(e){var n=e.target.value;Se({pathPrefix:n}),W(j("common.slugifyHint",{value:(0,ce.LN)(n)}))}}),!!L&&(0,ne.jsx)(jn.Z,{type:"error",style:{width:"100%",marginTop:8},children:L})]}),cancel:j("common.pre"),confirm:j("common.next"),onCancel:Fe,onConfirm:function(){Be()}},we&&(null===he||void 0===he?void 0:he.hasEnvironmentsStep)&&{key:"environment",name:(0,ne.jsxs)(ne.Fragment,{children:[j("common.environment")," ",he.hasRequiredEnvironments&&(0,ne.jsx)(Gn.Z,{})]}),disabled:!!_||(null===he||void 0===he?void 0:he.hasMissRequiredConfigs),body:function(){return(0,ne.jsxs)(pr,{component:"div",children:[(0,ne.jsx)(xr,{title:j("common.environment"),subTitle:j("blocklet.component.addComponentTip.environment")}),(0,ne.jsx)(Mn,{style:{marginTop:-12,width:"100%"},schema:he.configsList,defaultValue:he.configsValue,onChange:function(e,n){var t=n.action,r=n.currentItem,o=n.allValues;"confirm"===t&&Se({hasMissRequiredConfigs:ir(he.configsList,o),configsValue:o}),"edit"===t?U(r):["cancel","confirm"].includes(t)&&U(null)}})]})},cancel:j("common.pre"),confirm:j("common.next"),onCancel:Fe,onConfirm:Be},we&&(null===he||void 0===he?void 0:he.didSpaceCapability)&&{key:"didSpace",name:(0,ne.jsxs)(ne.Fragment,{children:[j("blocklet.component.didSpaceConfig")," ","required"===he.didSpaceCapability&&(0,ne.jsx)(Gn.Z,{})]}),disabled:"required"===he.didSpaceCapability&&!he.didSpaceEndpoint,body:function(){return(0,ne.jsxs)(pr,{component:"div",children:[(0,ne.jsx)(xr,{title:j("blocklet.component.didSpaceConfig"),subTitle:j("blocklet.component.didSpaceConfigTip")}),(0,ne.jsx)(x.Z,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:(0,ne.jsx)(Jt,{sx:{"& .MuiFormHelperText-root":{wordBreak:"break-all"}},helperText:he.didSpaceEndpoint&&j("blocklet.component.didSpaceConnected",{endpoint:he.didSpaceEndpoint}),onConnect:function(){Be()}})})]})},cancel:j("common.pre"),confirm:j("common.next"),onCancel:Fe,onConfirm:Be},{key:"install",name:j("common.install"),disabled:!1,loading:!1,body:(0,ne.jsx)(pr,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:xn()(he.installResultProps)?(0,ne.jsx)(Cn.Z,{message:(0,ne.jsx)(gr,{children:j("blocklet.component.installingCanCloseWindowTip")}),increaseSpeed:.3,messageLoop:!1}):(0,ne.jsx)("div",{style:{marginTop:120},children:(0,ne.jsx)(Pn.Z,(0,r.Z)({},he.installResultProps))})}),confirm:j("common.complete"),onConfirm:function(){cr(Ee.componentDid),Ie(),setTimeout((function(){var e=document.getElementsByClassName("dashboard-main")[0];e&&(e.scrollTop=e.scrollHeight)}),200)}}].filter((function(e){return e})),Ae=ze[Ze]||{};return J?(0,ne.jsxs)(dr,{sx:Pe?{width:"100%",height:window.innerHeight}:{width:"100%",height:"embed"===g?"100vh":"72vh"},children:[(0,ne.jsx)(kn.W,{steps:ze,mode:"memory",children:(0,ne.jsx)(lr,{ref:ke,meta:we,isMobile:Pe,onStepChange:function(e){be(e)}})}),(0,ne.jsxs)(x.Z,{className:"action-bar",children:[Ae.cancel&&(0,ne.jsx)(q.Z,{onClick:function(e){e.stopPropagation(),Ae.onCancel()},disabled:Ze===ze.length-2&&w,color:"inherit",children:Ae.cancel||j("common.cancel")}),Ae.confirm&&(0,ne.jsx)(q.Z,{onClick:function(e){e.stopPropagation(),Ae.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:w||("boolean"===typeof Ae.disabled?Ae.disabled:!(!w&&!Ae.error&&he.bundleDid)||Ze>1&&!he.pathPrefix),variant:"contained",autoFocus:!0,title:Ae.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[("boolean"===typeof Ae.loading?Ae.loading:w)&&(0,ne.jsx)(B.Z,{style:{marginRight:8},size:16}),Ae.confirm]})})]})]}):null}sr.propTypes={onClose:f().func,mode:f().oneOf(["normal","embed"]),stores:f().arrayOf(f().string),resourceType:f().string,storageKey:f().string},sr.defaultProps={onClose:function(){},mode:"normal",stores:[],resourceType:"",storageKey:""};var ur,dr=(0,p.Z)(x.Z)(Mt||(Mt=(0,c.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"]))),pr=(0,p.Z)(Ye.Z)(Kt||(Kt=(0,c.Z)(["\n width: 100%;\n height: 100%;\n"]))),mr=p.Z.div(Vt||(Vt=(0,c.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"]))),fr=function(e){return e.isMobile?"\n height: calc(100vh - 56px - 64px - 48px);\n ":""},hr=(0,p.Z)(x.Z)(Yt||(Yt=(0,c.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"])),(function(e){return"mobileStyle"===e.className?"\n & > div{\n height: 100%;\n }\n .root-header {\n .app-name-content {\n display: none;\n }\n }\n\n\n\n // content-panel\n .root-header + div{\n padding-top: 0;\n position: relative;\n & > div {\n padding-top: 0;\n }\n }\n\n header + div {\n padding-top: 0;\n }\n\n header {\n .header-title {\n margin-left: 0;\n }\n\n .header-title-name {\n max-width: 100% !important;\n }\n }\n ":"\n position: relative;\n .root-header {\n z-index: auto !important;\n position: fixed !important;\n }\n & > div {\n height: 100%;\n width: 100%;\n max-width: 100%;\n & > div {\n max-height: unset !important;\n max-width: 100%;\n & > div {\n // left-panel\n &:first-child {\n padding: 0;\n width: 25%;\n min-width: 240px;\n & > div:first-child {\n display: none;\n }\n // step\n & > div:last-child {\n // margin-top: 32px;\n margin-top: 0;\n }\n }\n // right-panel\n &:last-child {\n padding-top: 0;\n padding-right: 0px;\n overflow-y: auto;\n .app-content {\n padding: 0 0 24px 0;\n }\n .button-container {\n padding-right: 0;\n }\n }\n }\n }\n }\n\n "}),(function(e){return fr(e)}),(function(e){return fr(e)})),xr=(0,p.Z)(Zn.Z)(Ht||(Ht=(0,c.Z)(["\n margin-bottom: 24px;\n"]))),vr=p.Z.div(Xt||(Xt=(0,c.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"])),(function(e){return e.theme.palette.common.white}),(function(e){return e.theme.palette.primary.main}),(function(e){return e.theme.palette.primary.main})),gr=p.Z.div($t||($t=(0,c.Z)(["\n color: ",";\n .msg-before {\n display: inline-block;\n color: #aaa;\n font-size: 14px;\n margin-right: 6px;\n }\n"])),(function(e){return e.theme.palette.primary.main}));function Zr(e){var n=e.blocklet,t=e.children,r=(0,i.PE)().t,a=(0,o.useState)(!1),l=(0,d.Z)(a,2),c=l[0],s=l[1],u=(0,cn.Z)((function(e){return e.breakpoints.down("md")})),p=(0,le.h6)().inService,m=function(){s(!1)},f=function(e){e.stopPropagation(),s(!0)};return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof t?t({open:f}):(0,ne.jsxs)(an.Z,{onClick:f,className:"component-action","data-cy":"action-add-component",children:[(0,ne.jsx)(ln.Z,{style:{fontSize:18,marginRight:5}}),r("blocklet.component.add")]}),c&&(0,ne.jsx)(br,{title:r("blocklet.component.addWithName",{name:(0,A.getDisplayName)(n)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:u?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:function(e,n){"backdropClick"!==n&&m()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:(0,ne.jsx)(sr,{onClose:m,storageKey:p?sn.K:sn.W})})]})}Zr.propTypes={children:f().any,blocklet:f().object.isRequired},Zr.defaultProps={children:null};var br=(0,p.Z)(be.ZP)(ur||(ur=(0,c.Z)(["\n .MuiDialogContent-root {\n }\n"]))),yr=function(e){return e.children.filter((function(e){return e.meta.interfaces.find((function(e){return e.type===ie.BLOCKLET_INTERFACE_TYPE_WEB}))}))};function kr(e){var n=e.params,t=e.setParams,a=e.setError,l=e.serviceTypes,c=(0,i.PE)().t,s=(0,En.y0)().blocklet,u=s.meta.did,p=yr(s),m=(0,o.useState)([]),f=(0,d.Z)(m,2),h=f[0],x=f[1],v={301:c("common.redirectPermanently"),302:c("common.redirectTemporary"),307:c("common.redirectTemporary"),308:c("common.redirectPermanently")};return(0,o.useEffect)((function(){if(n.type===O.ROUTING_RULE_TYPES.COMPONENT&&n.componentId){var e=p.find((function(e){return e.meta.did===n.componentId})),o=(0,A.findWebInterface)(e.meta),i=(Array.isArray(null===o||void 0===o?void 0:o.pageGroups)?o.pageGroups:[]).map((function(e){return{value:e,label:"".concat(e," pages")}}));i.length&&i.unshift({value:"",label:"All pages"}),x(i),n.pageGroup&&!1===i.find((function(e){return e.value===n.pageGroup}))&&t((0,r.Z)((0,r.Z)({},n),{},{pageGroups:""}))}}),[n.componentId,n.type]),(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(je.Z,{select:!0,label:c("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:n.type,onChange:function(e){a(""),t((0,r.Z)((0,r.Z)({},n),{},{type:e.target.value,did:e.target.value===O.ROUTING_RULE_TYPES.BLOCKLET?u:"",__disableConfirm:!1}))},style:{marginBottom:32},SelectProps:{},children:l.map((function(e){var n=e.name,t=e.value;return(0,ne.jsx)(an.Z,{value:t,children:n},t)}))}),n.type===O.ROUTING_RULE_TYPES.REDIRECT&&[(0,ne.jsx)(je.Z,{select:!0,label:c("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:n.redirectCode,onChange:function(e){return t((0,r.Z)((0,r.Z)({},n),{},{redirectCode:e.target.value}))},style:{marginBottom:32},SelectProps:{},children:Object.keys(v).map((function(e){return(0,ne.jsx)(an.Z,{value:e,children:"".concat(v[e]," - ").concat(e)},e)}))},"redirectCode"),(0,ne.jsx)(je.Z,{label:c("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"redirect-url-input",fullWidth:!0,value:n.url,helperText:c("router.urlHelperText"),style:{marginBottom:32},onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{url:e.target.value,__disableConfirm:!e.target.value.trim()})),e.target.value.trim()?a(""):a(c("router.validation.redirectUrlRequired"))}},"redirectUrl")],n.type===O.ROUTING_RULE_TYPES.COMPONENT&&[(0,ne.jsx)(je.Z,{select:!0,label:c("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:n.componentId,onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{componentId:e.target.value}))},style:{marginBottom:32},SelectProps:{},children:p.map((function(e){return(0,ne.jsx)(an.Z,{value:e.meta.did,selected:e.meta.did===n.componentId,children:(0,A.getDisplayName)(e,!0)},e.meta.did)}))},"componentId"),h.length?(0,ne.jsx)(je.Z,{select:!0,label:c("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:n.pageGroup,helperText:c("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{pageGroup:e.target.value}))},SelectProps:{},children:h.map((function(e){return(0,ne.jsx)(an.Z,{value:e.value,selected:e.value===n.pageGroup,children:e.label},e.label)}))},"pageGroup"):null].filter(Boolean),n.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,ne.jsx)(je.Z,{label:c("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:n.url,helperText:c("router.urlHelperText"),style:{marginBottom:32},onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{url:e.target.value,__disableConfirm:!e.target.value.trim()})),e.target.value.trim()?a(""):a(c("router.validation.rewriteUrlRequired"))}},"url")]})}function jr(e){var n=e.children,t=(0,i.PE)().t,a=(0,le.h6)().api,l=(0,En.y0)().blocklet,c=(0,o.useState)(!1),p=(0,d.Z)(c,2),m=p[0],f=p[1],h=(0,o.useState)(null),x=(0,d.Z)(h,2),v=x[0],g=x[1],Z=l.meta.did,b=l.site.id,y=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var r,o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,rt.fX)(n,t);case 3:if(!(r=e.sent)){e.next=6;break}throw r;case 6:return f(!0),o={from:{pathPrefix:De()(n.pathPrefix)},to:{type:n.type}},n.type===O.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=n.url.trim(),o.to.redirectCode=n.redirectCode),n.type===O.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=Z,o.to.componentId=n.componentId,o.to.pageGroup=n.pageGroup),n.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=De()(n.url)),e.next=13,a.addRoutingRule({input:{id:b,rule:o,teamDid:Z}});case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),M.Z.error(e.t0.message);case 18:return e.prev=18,f(!1),g(null),e.finish(18);case 22:case"end":return e.stop()}}),e,null,[[0,15,18,22]])})));return function(n){return e.apply(this,arguments)}}(),k={title:t("router.rule.add.title"),description:function(e,n,o){return(0,ne.jsxs)(Ye.Z,{component:"div",children:[(0,ne.jsx)(je.Z,{label:t("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix","data-cy":"path-prefix-input",fullWidth:!0,autoFocus:!0,helperText:e.pathPrefixHint||t("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:function(i){var a=!1,c=(0,rt.Rw)({params:(0,r.Z)((0,r.Z)({},e),{},{pathPrefix:i.target.value}),blocklets:[l]});o(c),e.type===O.ROUTING_RULE_TYPES.BLOCKLET&&c&&(a=!0),e.type!==O.ROUTING_RULE_TYPES.REDIRECT||e.url||(a=!0),e.type!==O.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(a=!0),i.target.value.trim()||(a=!0,o(t("router.validation.pathPrefixRequired"))),a||o("");var s=t("common.slugifyHint",{value:(0,ce.LN)(i.target.value)});n((0,r.Z)((0,r.Z)({},e),{},{pathPrefix:i.target.value,pathPrefixHint:s,__disableConfirm:a}))}}),(0,ne.jsx)(kr,{params:e,setParams:function(e){o(null),(0,rt.fX)(e,t)?n((0,r.Z)((0,r.Z)({},e),{},{__disableConfirm:!0})):n((0,r.Z)({},e))},setError:o})]})},confirm:t("router.rule.add.confirm"),cancel:t("common.cancel"),params:{did:"",pathPrefix:"",type:O.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,__disableConfirm:!0},onConfirm:y,onCancel:function(){f(!1),g(null)}},j=function(e){e.stopPropagation(),g(k)};return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof n?n({loading:m,open:j}):(0,ne.jsxs)(an.Z,{onClick:j,className:"rule-action","data-cy":"action-add-rule",children:[m?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(ln.Z,{style:{fontSize:18,marginRight:5}}),t("router.rule.add.title")]}),v&&(0,ne.jsx)(ae.Z,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel,color:"primary"})]})}kr.propTypes={params:f().object,serviceTypes:f().array,setParams:f().func,setError:f().func},kr.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:O.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:O.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:O.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Component - Pass traffic to blocklet component",value:O.ROUTING_RULE_TYPES.COMPONENT}],setParams:function(){},setError:function(){}},jr.propTypes={children:f().any},jr.defaultProps={children:null};var Cr=t(96366),Pr=t(18067),Er=t(71363);function wr(e){var n=e.id,t=e.from,r=e.children,a=(0,i.PE)().t,l=(0,le.h6)().api,c=(0,En.y0)().blocklet,p=(0,o.useState)(!1),m=(0,d.Z)(p,2),f=m[0],h=m[1],x=(0,o.useState)(null),v=(0,d.Z)(x,2),g=v[0],Z=v[1],b=c.meta.did,y=c.site.id,k=t.pathPrefix,j=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.prev=1,e.next=4,l.deleteRoutingRule({input:{id:y,ruleId:n,teamDid:b}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),M.Z.error(e.t0.message);case 9:return e.prev=9,Z(null),h(!1),e.finish(9);case 13:case"end":return e.stop()}}),e,null,[[1,6,9,13]])})));return function(){return e.apply(this,arguments)}}(),C={keyName:k,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:"<b>".concat(k,"</b>")}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:k}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:j,onCancel:function(){h(!1),Z(null)}},P=function(e){e.stopPropagation(),Z(C)};return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof r?r({loading:f,open:P}):(0,ne.jsxs)(an.Z,{onClick:P,className:"rule-action","data-cy":"action-delete-rule",children:[f?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(N.default,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),g&&(0,ne.jsx)(Er.Z,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}function Rr(e){var n=e.id,t=e.from,a=e.to,l=e.children,c=(0,i.PE)().t,p=(0,le.h6)().api,m=(0,En.y0)().blocklet,f=(0,o.useState)(!1),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=(0,o.useState)(null),Z=(0,d.Z)(g,2),b=Z[0],y=Z[1],k=m.meta.did,j=m.site.id,C=t.pathPrefix,P=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){var r,o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,rt.fX)(t,c);case 3:if(!(r=e.sent)){e.next=6;break}throw r;case 6:return v(!0),o={id:n,from:{pathPrefix:De()(t.pathPrefix)},to:{type:t.type}},t.type===O.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=t.url,o.to.redirectCode=t.redirectCode),t.type===O.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=k,o.to.componentId=t.componentId,o.to.pageGroup=t.pageGroup),t.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=De()(t.url)),e.next=13,p.updateRoutingRule({input:{id:j,rule:o,teamDid:k}});case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),M.Z.error(e.t0.message);case 18:return e.prev=18,v(!1),y(null),e.finish(18);case 22:case"end":return e.stop()}}),e,null,[[0,15,18,22]])})));return function(n){return e.apply(this,arguments)}}(),E={title:c("router.rule.update.title"),description:function(e,n,t){return(0,ne.jsxs)(Ye.Z,{component:"div",children:[(0,ne.jsx)(je.Z,{label:c("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix","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:function(o){var i=!1;e.type!==O.ROUTING_RULE_TYPES.REDIRECT||e.url||(i=!0),e.type!==O.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(i=!0),o.target.value.trim()||(i=!0,t(c("router.validation.pathPrefixRequired"))),i||t("");var a=c("common.slugifyHint",{value:(0,ce.LN)(o.target.value)});n((0,r.Z)((0,r.Z)({},e),{},{pathPrefix:o.target.value,helperText:a,__disableConfirm:i}))}}),(0,ne.jsx)(kr,{params:e,setParams:function(e){(0,rt.fX)(e,c)?n((0,r.Z)((0,r.Z)({},e),{},{__disableConfirm:!0})):n((0,r.Z)({},e))},setError:t})]})},confirm:c("router.rule.update.confirm"),cancel:c("router.rule.update.cancel"),color:"primary",params:{did:a.did||"",pathPrefix:"/"===C?C:C.replace(/^\/+/,"").replace(/\/+$/,""),type:a.type||O.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:a.redirectCode||302,componentId:a.componentId||"",pageGroup:a.pageGroup||"",url:a.url||"",__disableConfirm:!1},onConfirm:P,onCancel:function(){v(!1),y(null)}},w=function(e){e.stopPropagation(),y(E)};return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof l?l({loading:x,open:w}):(0,ne.jsxs)(an.Z,{onClick:w,className:"rule-action","data-cy":"action-update-rule",children:[x?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(Ze.default,{style:{fontSize:18,marginRight:5}}),c("router.rule.update.title")]}),b&&(0,ne.jsx)(ae.Z,{title:b.title,description:b.description,confirm:b.confirm,color:b.color,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel})]})}function Tr(e){var n=(0,i.PE)().locale,t=(0,En.y0)(),o=t.blocklet,a=t.recommendedDomain,l=(0,ce.Sk)(a,e.from.pathPrefix,(0,ce.f0)(o,n));return(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)("a",{target:"_blank",href:l,rel:"noopener noreferrer",title:l,children:(0,ne.jsx)(y.Z,{size:"small",children:(0,ne.jsx)(E.Z,{})})}),(0,ne.jsx)(Rr,(0,r.Z)((0,r.Z)({},e),{},{children:function(n){var t=n.open;return(0,ne.jsx)(y.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-update-rule",children:(0,ne.jsx)(C.Z,{})})}})),(0,ne.jsx)(wr,(0,r.Z)((0,r.Z)({},e),{},{children:function(n){var t=n.open;return(0,ne.jsx)(y.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-delete-rule",children:(0,ne.jsx)(N.default,{})})}}))]})}wr.propTypes={id:f().string.isRequired,from:f().object.isRequired,children:f().any},wr.defaultProps={children:null},Rr.propTypes={id:f().string.isRequired,from:f().object.isRequired,to:f().object.isRequired,children:f().any},Rr.defaultProps={children:null},Tr.propTypes={isProtected:f().bool},Tr.defaultProps={isProtected:!1};var Sr=["group"];function _r(e){var n=e.group,t=(0,l.Z)(e,Sr);return n?(0,ne.jsx)(Y.Z,(0,r.Z)((0,r.Z)({type:"reverse"},t),{},{children:n})):null}function Ur(e){var n=e.domain,t=e.isHttps,r=e.toUrl,o=t?"https":"http",i=r;return Tt()(i)||(i="".concat(o,"://").concat(n).concat(r)),(0,ne.jsx)(ee.Z,{href:i,target:"_blank",style:{fontSize:14},underline:"hover",children:r},i)}function Nr(e){var n=e.hasPermission,t=(0,i.PE)(),o=t.t,a=t.locale,l=(0,Cr.Z)(),c=(0,En.y0)(),s=c.blocklet,u=c.recommendedDomain;return s.site.rules.filter((function(e){return e.to.type!==O.ROUTING_RULE_TYPES.BLOCKLET})).map((function(e){var t=null,i=null;e.to.type===O.ROUTING_RULE_TYPES.NONE?t="404":e.to.type===O.ROUTING_RULE_TYPES.REDIRECT?t=e.to.redirectCode:e.to.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE?t="R":e.to.type===O.ROUTING_RULE_TYPES.COMPONENT&&(i=s.children.find((function(n){return n.meta.did===e.to.componentId})),t="C");var c=e.isProtected?(0,ne.jsx)(R.Z,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:(0,ne.jsx)("span",{children:(0,ne.jsx)(y.Z,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:(0,ne.jsx)(Pr.Z,{style:{fill:l.palette.text.disabled}})})})}):(0,ne.jsx)(Tr,(0,r.Z)({},e));return[(0,ne.jsxs)(x.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)(x.Z,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,ne.jsx)(x.Z,{width:28}),"object"===typeof t?t:(0,ne.jsx)(Ut.Z,{children:t}),(0,ne.jsxs)(x.Z,{ml:2,children:[(0,ne.jsxs)(x.Z,{style:{color:"#222",fontSize:16},children:[e.to.type===O.ROUTING_RULE_TYPES.NONE&&o("common.page404"),e.to.type===O.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),e.to.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),e.to.type===O.ROUTING_RULE_TYPES.COMPONENT&&(0,A.getDisplayName)(i,!0)]}),(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[e.to.type===O.ROUTING_RULE_TYPES.REDIRECT&&(0,ne.jsx)(Ur,{domain:u,toUrl:e.to.url}),e.to.type===O.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,ne.jsx)(Ur,{domain:u,toUrl:e.to.url}),e.to.type===O.ROUTING_RULE_TYPES.COMPONENT&&(0,ne.jsx)(_r,{group:e.to.pageGroup})]})]})]}),(0,ne.jsx)(x.Z,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,ne.jsx)(ee.Z,{href:(0,ce.Sk)(u,e.from.pathPrefix,(0,ce.f0)(s,a)),target:"_blank",style:{fontSize:16},underline:"hover",children:e.from.pathPrefix})},e.from.pathPrefix),(0,ne.jsx)(x.Z,{children:n&&(0,ne.jsx)("div",{style:{textAlign:"right"},children:c})},"actions")]},"rule"),(0,ne.jsx)(on.Z,{},"divider")]}))}_r.propTypes={group:f().string.isRequired},Ur.propTypes={domain:f().string.isRequired,toUrl:f().string.isRequired,isHttps:f().bool},Ur.defaultProps={isHttps:!1},Nr.propTypes={hasPermission:f().bool},Nr.defaultProps={hasPermission:!1};var Ir=(0,se.V)(Nr,"mutate_blocklets"),Lr=(0,se.V)(Nr,"",ce.Wf);function Dr(e){return(0,le.h6)().inService?(0,ne.jsx)(Lr,(0,r.Z)({},e)):(0,ne.jsx)(Ir,(0,r.Z)({},e))}var Or,Br,Fr,qr=t(92726),zr=["blocklet","onUpdate","getComponentUrl"],Ar=function(e,n){return e?[{name:n("common.name"),value:e.displayName},{name:n("common.description"),value:e.description},{name:n("common.version"),value:(0,ne.jsx)(Y.Z,{children:e.version})}]:[]},Gr=function(e){var n=e.source,t=e.deployedFrom,r=e.bundleSource;return n?{source:n,deployedFrom:t}:r?r.url?{source:"url",deployedFrom:t||Array.isArray(r.url)?r.url[0]:r.url}:r.store?{source:"registry",deployedFrom:t||Array.isArray(r.store)?r.store[0]:r.store}:{}:{source:"upload",deployedFrom:t}},Wr=function(e,n){for(var t=e.split("/").slice(1),r=n,o=0,i=[];r&&o<t.length;){var a=r.children.find((function(e){return e.meta.did===t[o]}));r=a,o++,a&&i.push(a.meta.title)}return i.join(" / ")};function Mr(e){var n,t,r,a,l=e.blocklet,c=e.ancestors,p=e.depth,m=e.onRemove,f=e.onStart,Z=e.onStop,b=e.onRestart,k=e.onReload,j=e.getComponentUrl,w=e.app,T=(0,o.useContext)(i.RD),S=T.t,I=T.locale,L=(0,o.useState)(),O=(0,d.Z)(L,2),B=O[0],q=O[1],z=(0,o.useState)(!1),G=(0,d.Z)(z,2),M=G[0],H=G[1],X=(0,o.useState)(!1),$=(0,d.Z)(X,2),J=$[0],Q=$[1],ee=(0,o.useState)(null),oe=(0,d.Z)(ee,2),ie=oe[0],le=oe[1],se=(0,K.K)().deletingBlocklets,ue=l.status;1===p&&se.includes(l.meta.did)&&(ue="deleting");var de,pe="/".concat(l.mountPoint||"/").replace(/\/+/g,"/"),me=j(pe),he=B?Gr(B):{},xe=B?[{name:S("common.name"),value:(0,A.getDisplayName)(B,!0)},{name:S("common.version"),value:(0,ne.jsx)(fe,{blocklet:B,checkUpgrade:!1})},{name:S("common.status"),value:(0,ne.jsx)(re.Z,{status:ue,source:B.source})},"running"===l.status?{name:S("blocklet.startedAt"),value:(0,ce.B2)(l.startedAt,I)}:null,"running"!==l.status?{name:S("blocklet.stoppedAt"),value:(0,ce.B2)(l.stoppedAt,I)}:null,l.installedAt?{name:S("blocklet.installedAt"),value:(0,ce.B2)(l.installedAt,I)}:null,(0,A.hasStartEngine)(l.meta)?{name:S("common.mountPoint"),value:pe}:null,B.meta.group?{name:S("common.group"),value:(0,ne.jsx)(Y.Z,{type:"success",children:B.meta.group})}:null,{name:S("blocklet.overview.source"),value:(0,ne.jsx)(te,{sourceInfo:he,blocklet:l})},{name:S("blocklet.overview.deployedFrom"),value:he.deployedFrom||"-"},{name:S("common.did"),value:(0,ne.jsx)(V.Z,{did:B.meta.did})},{name:S("common.author"),value:(0,ce.rq)(B.meta.author)},{name:S("common.engine"),value:Ar(B.engine,S).map((function(e){var n=e.name,t=e.value;return(0,ne.jsx)(F.Z,{style:{marginBottom:4},nameWidth:120,name:n,children:t},n)}))},null!==(n=l.dependents)&&void 0!==n&&n.length?{name:S("common.dependents"),value:(0,ne.jsx)(x.Z,{children:l.dependents.map((function(e){return(0,ne.jsx)(x.Z,{children:"".concat(Wr(e.id,w)," ").concat(e.required?"(".concat(S("common.required"),")"):"")})}))})}:null,null!==(t=l.meta.resources)&&void 0!==t&&t.length?{name:S("common.resource"),value:l.meta.resources.join(", ")}:null].filter(Boolean):[],Ze=(0,A.isInProgress)(w.status),be=(0,A.isInProgress)(l.status),ye="";if(Ze||be||1===p&&se.includes(l.meta.did))ye=S("blocklet.component.tip.stopBlocklet");else if(null!==(r=l.dependents)&&void 0!==r&&r.length){var ke=l.dependents.filter((function(e){return e.required}));if(ke.length){var je=ke.map((function(e){return Wr(e.id,w)}));ye=S("blocklet.component.tip.requiredBy",{name:je.join(", ")})}}return[(0,ne.jsxs)(Vr,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)(x.Z,{pl:2,width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,ne.jsx)(ve.Z,{blocklet:l,ancestors:c}),(0,ne.jsxs)(x.Z,{ml:"16px",children:[(0,ne.jsx)(x.Z,{className:"component-name",onClick:function(){return q(l)},children:(0,A.getDisplayName)(l,!0)}),(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(fe,{blocklet:l,checkUpgrade:!1}),(0,ne.jsx)(ge.Z,{style:{marginLeft:4},mode:l.mode||""}),"unknown"!==ue&&(0,ne.jsx)(re.Z,{style:{marginLeft:4},status:ue,source:l.source}),!(null===(a=l.dependents)||void 0===a||!a.length)&&(0,ne.jsx)(R.Z,{title:["".concat(S("common.dependents"),": "),l.dependents.map((function(e){return(0,ne.jsx)(x.Z,{pl:1,children:"".concat(Wr(e.id,w)," ").concat(e.required?"(".concat(S("common.required"),")"):"")})}))],children:(0,ne.jsx)(x.Z,{display:"flex",color:"primary.main",ml:1,children:(0,ne.jsx)(D.JO,{icon:"octicon:package-dependents-16"})})})]})]})]},l),(0,A.hasStartEngine)(l.meta)&&(0,ne.jsx)(x.Z,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,ne.jsx)("a",{target:"_blank",href:me,rel:"noopener noreferrer",title:me,children:(0,ne.jsx)(x.Z,{maxWidth:400,sx:{color:"secondary.main",fontSize:18,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:W()(pe)})})},pe),(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,A.hasStartEngine)(l.meta)&&(0,ne.jsx)(R.Z,{title:S("common.visit"),children:(0,ne.jsx)("a",{target:"_blank",href:me,rel:"noopener noreferrer",children:(0,ne.jsx)(y.Z,{size:"small",children:(0,ne.jsx)(E.Z,{})})})}),(0,A.hasStartEngine)(l.meta)&&(0,ne.jsx)(Me,{blocklet:l,ancestors:c,children:function(e){var n=e.open;return(0,ne.jsx)(R.Z,{title:S("common.config"),children:(0,ne.jsx)(Kr,{color:"error",badgeContent:"",variant:"dot",invisible:!(0,A.getComponentMissingConfigs)(l,c[0]).length,children:(0,ne.jsx)(y.Z,{onClick:n,size:"small",children:(0,ne.jsx)(C.Z,{})})})},"config")}}),(0,ne.jsx)(tn,{blocklet:w,component:l,onStart:f,onStop:Z,disabled:!["starting","stopping"].includes(w.status)&&(0,A.isInProgress)(w.status)}),(0,ne.jsx)(qr.Z,{"data-cy":"component-actions",actions:[(0,A.hasStartEngine)(l.meta)?{icon:(0,ne.jsx)(P.Z,{}),text:S("common.detail"),onClick:function(){q(l)}}:null,{icon:(0,ne.jsx)(_.default,{}),text:S("common.restart"),onClick:function(){le({title:"".concat(S("common.restart")," ").concat(l.meta.title),description:S("blocklet.action.restartDescription"),confirm:S("blocklet.action.confirmRestart"),cancel:S("common.cancel"),onConfirm:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(!0),e.next=3,b(l);case 3:Q(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),onCancel:function(){return le(null)}})},disabled:Ze||be||"running"!==l.status},{icon:(0,ne.jsx)(U.Z,{}),text:S("common.reload"),onClick:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(!0),e.next=3,k(l);case 3:Q(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),disabled:J||Ze||be||"running"!==l.status},{icon:(0,ne.jsx)(N.default,{}),text:S("common.delete"),onClick:function(){H(!0)},disabled:Ze||be||!!ye,tip:ye}].filter(Boolean)})]},"actions")]},"group-not-gateway-box"),(0,ne.jsx)(on.Z,{depth:2}),!!B&&(0,ne.jsx)(h.Z,{open:!0,fullWidth:!0,maxWidth:"md",onClose:function(){q(null)},children:(0,ne.jsxs)(x.Z,{paddingY:1.5,children:[(0,ne.jsx)(g.Z,{children:S("common.componentBasicInfo")}),(0,ne.jsx)(v.Z,{children:(de=xe,de.map((function(e){return e.name===S("common.did")||e.name===S("blocklet.appId")?(0,ne.jsx)(F.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:function(){return e.name},children:e.value},e.name):(0,ne.jsx)(F.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)})))})]},"dialog-wrapper")},"base-info-dialog"),(0,ne.jsx)($e,{blocklet:w,component:l,remove:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var n=arguments;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(!0),e.prev=1,e.next=4,m.apply(void 0,n);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:Q(!1),H(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),onCancel:function(){return H(!1)},hideBtn:!0,showConfirm:M}),ie&&(0,ne.jsx)(ae.Z,{title:ie.title,description:ie.description,confirm:ie.confirm,cancel:ie.cancel,params:ie.params,onConfirm:ie.onConfirm,onCancel:ie.onCancel})]}Mr.propTypes={blocklet:f().object.isRequired,ancestors:f().array,depth:f().number,onRemove:f().func,onStart:f().func,onStop:f().func,onRestart:f().func,onReload:f().func,getComponentUrl:f().func,app:f().object},Mr.defaultProps={ancestors:[],depth:0,onRemove:function(){},onStart:function(){},onStop:function(){},onRestart:function(){},onReload:function(){},getComponentUrl:function(){return window.location.origin},app:null};var Kr=(0,p.Z)(j.Z)(Or||(Or=(0,c.Z)(["\n .BaseBadge-badge {\n top: ","px;\n right: ","px;\n }\n"])),(function(e){return 8*e.top||6}),(function(e){return 8*e.right||6})),Vr=(0,p.Z)(x.Z)(Br||(Br=(0,c.Z)(["\n .component-name {\n color: #222;\n font-size: 16px;\n cursor: pointer;\n }\n"])));function Yr(e){var n=e.blocklet,t=(e.onUpdate,e.getComponentUrl),c=(0,l.Z)(e,zr),p=(0,o.useContext)(i.RD).t,m=(0,le.h6)(),f=m.api,j=m.inService,P=m.info,E=(0,K.K)(),_=E.addDeletingDid,U=E.removeDeletingDid,N=E.matchDeletingDid,D=(0,o.useState)(!1),F=(0,d.Z)(D,2),G=F[0],W=F[1],V=(0,o.useState)(null),Y=(0,d.Z)(V,2),H=Y[0],X=Y[1],$=(0,o.useState)(null),J=(0,d.Z)($,2),Q=J[0],ee=J[1],te=(0,o.useState)(!1),re=(0,d.Z)(te,2),oe=re[0],ie=re[1],ae=n&&n.structVersion!==O.APP_STRUCT_VERSION,ue=(0,o.useState)(!1),de=(0,d.Z)(ue,2),pe=de[0],me=de[1],fe=(0,a.Z)(n.children)||[];"gateway"!==n.meta.group&&fe.unshift(n),N(fe.map((function(e){return e.meta.did})));var he=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var t,r,o,i,a;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!G){e.next=2;break}return e.abrupt("return");case 2:return W(!0),e.prev=3,e.next=6,f.checkComponentsForUpdates({input:{did:n.meta.did}});case 6:if(e.t0=e.sent.preUpdateInfo,e.t0){e.next=9;break}e.t0={};case 9:if(t=e.t0,r=t.updateId,o=t.updateList,W(!1),r){e.next=16;break}return M.Z.info(p("blocklet.component.noUpdate")),e.abrupt("return");case 16:i=[],(0,A.forEachChildSync)(n,(function(e,n){var t=n.id,r=n.ancestors,a=o.find((function(e){return e.id===t}));if(a){var l=r.slice(1).concat(e).map((function(e){return e.meta.title||e.meta.name})).join(" / "),c=(r[1]||e).meta.did;i.push({groupId:c,name:l,version:e.meta.version,newVersion:a.meta.version})}})),a={},i.forEach((function(e){a[e.groupId]?e.disabled=!0:a[e.groupId]=!0})),X({params:{updateId:r},list:i,checks:a,hasChecks:!0}),e.next=27;break;case 23:e.prev=23,e.t1=e.catch(3),W(!1),M.Z.error((0,ce.Z)(e.t1));case 27:case"end":return e.stop()}}),e,null,[[3,23]])})));return function(){return e.apply(this,arguments)}}(),xe=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var t,r;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!G){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,W(!0),t=Object.keys(H.checks).filter((function(e){return H.checks[e]})),r={updateId:H.params.updateId,rootDid:n.meta.did,selectedComponents:t},e.next=8,f.upgradeComponents({input:r});case 8:W(!1),X(null),me(null),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(2),W(!1),M.Z.error((0,ce.Z)(e.t0));case 17:case"end":return e.stop()}}),e,null,[[2,13]])})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t,r){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _(t.meta.did),e.prev=1,e.next=4,f.deleteComponent({input:{did:t.meta.did,keepData:"keepData"===r,rootDid:n.meta.did}});case 4:return e.next=6,(0,ce._v)(800);case 6:e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),M.Z.error((0,ce.Z)(e.t0)),U(t.meta.did);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(n,t){return e.apply(this,arguments)}}(),ge=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f.startBlocklet({input:{did:n.meta.did,componentDids:[t.meta.did]}});case 3:return e.next=5,(0,ce._v)(800);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),M.Z.error((0,ce.Z)(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n){return e.apply(this,arguments)}}(),Ze=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f.stopBlocklet({input:{did:n.meta.did,componentDids:[t.meta.did]}});case 3:return e.next=5,(0,ce._v)(800);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),M.Z.error((0,ce.Z)(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n){return e.apply(this,arguments)}}(),be=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f.restartBlocklet({input:{did:n.meta.did,componentDids:[t.meta.did]}});case 3:return e.next=5,(0,ce._v)(800);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),M.Z.error((0,ce.Z)(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n){return e.apply(this,arguments)}}(),ye=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(t){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f.reloadBlocklet({input:{did:n.meta.did,componentDids:[t.meta.did]}});case 3:return e.next=5,(0,ce._v)(800);case 5:M.Z.success(p("blocklet.reloadSuccess")),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),M.Z.error((0,ce.Z)(e.t0));case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(n){return e.apply(this,arguments)}}();return(0,ne.jsxs)(Hr,(0,r.Z)((0,r.Z)({component:"div"},c),{},{children:[(0,ne.jsxs)(x.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)("div",{className:"title",children:[p("common.components"),!ae&&(0,ne.jsx)(se.Z,{permission:j?"":"mutate_blocklets",role:j?ce.Wf:[],children:(0,ne.jsx)(Kr,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!pe,children:(0,ne.jsxs)(q.Z,{disabled:G||(0,A.isInProgress)(n.status),color:"secondary",onClick:function(){he()},"data-cy":"check-for-updates",children:[(0,ne.jsx)(x.Z,{mr:.5,display:"flex",children:G?(0,ne.jsx)(B.Z,{size:16}):(0,ne.jsx)(b.Z,{style:{fontSize:"1em"}})}),p("blocklet.component.checkUpdateTitle")]})})})]}),(0,ne.jsx)(se.Z,{permission:j?"":"mutate_blocklets",role:j?ce.Wf:[],children:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(jr,{children:function(e){var t=e.open;return(0,ne.jsxs)(q.Z,{disabled:G||(0,A.isInProgress)(n.status),variant:"text",color:"primary","data-cy":"add-rule",onClick:t,children:[(0,ne.jsx)(k.Z,{style:{fontSize:"1.3em",marginRight:4}}),p("router.rule.add.title")]})}}),!ae&&(0,ne.jsx)(Zr,{blocklet:n,serverVersion:P.version,children:function(e){var t=e.open;return(0,ne.jsxs)(q.Z,{disabled:G||(0,A.isInProgress)(n.status),variant:"text",color:"primary","data-cy":"add-component",onClick:t,children:[(0,ne.jsx)(k.Z,{style:{fontSize:"1.3em",marginRight:4}}),p("blocklet.component.add")]})}}),!ae&&(0,ne.jsx)(Me,{blocklet:n,ancestors:[],children:function(e){var n=e.open;return(0,ne.jsx)(R.Z,{title:"".concat(p("blocklet.component.container")).concat(p("common.config")),children:(0,ne.jsx)(y.Z,{onClick:n,size:"small",color:"primary",children:(0,ne.jsx)(C.Z,{style:{fontSize:18}})})},"config")}})]})})]}),fe&&fe.length?(0,ne.jsxs)(x.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},children:["gateway"!==n.meta.group&&(0,ne.jsx)(Mr,{blocklet:n,app:n,onRemove:ve,onStart:ge,onStop:Ze,onReload:ye,onRestart:be,getComponentUrl:t},"0-".concat(n.meta.did)),n.children.map((function(e){return(0,ne.jsx)(Mr,{depth:1,blocklet:e,ancestors:[n],app:n,onRemove:ve,onStart:ge,onStop:Ze,onReload:ye,onRestart:be,getComponentUrl:t},"1-".concat(e.meta.did))}))]},"top-blocklet-".concat(n.meta.did)):(0,ne.jsx)(x.Z,{mt:8,children:(0,ne.jsx)(z.Z,{children:p("blocklet.component.noComponent")})}),!!n.site.rules.length&&(0,ne.jsx)(x.Z,{mt:0,ml:{xs:"-16px",md:"-28px"},children:(0,ne.jsx)(Dr,{})}),!!H&&(0,ne.jsx)(h.Z,{open:!0,fullWidth:!0,children:(0,ne.jsxs)(x.Z,{paddingY:1.5,children:[(0,ne.jsx)(g.Z,{children:p("blocklet.component.updateTitle")}),(0,ne.jsx)(x.Z,{component:v.Z,py:4,children:H.list.map((function(e){return(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(S.Z,{checked:H.checks[e.groupId],onChange:function(n){return function(e,n){var t=e.target.checked;X((function(e){var o=Object.entries(e.checks).reduce((function(e,r){var o=(0,d.Z)(r,2),i=o[0],a=o[1];return e[i]=n===i?t:a,e}),{}),i=Object.values(o).includes(!0);return(0,r.Z)((0,r.Z)({},e),{},{checks:o,hasChecks:i})}))}(n,e.groupId)},style:{marginLeft:e.disabled?16:0},defaultChecked:!0,disabled:e.disabled}),(0,ne.jsxs)(x.Z,{flexGrow:1,mt:3,children:[(0,ne.jsx)(x.Z,{item:!0,xs:8,children:e.name}),e.version&&(0,ne.jsxs)(w.ZP,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[(0,ne.jsx)(w.ZP,{item:!0,xs:3,children:e.version}),(0,ne.jsx)(w.ZP,{item:!0,xs:1,children:(0,ne.jsx)(T.Z,{style:{fontSize:"0.9em"}})}),(0,ne.jsx)(w.ZP,{item:!0,xs:3,children:(0,ne.jsx)(x.Z,{color:"secondary.main",children:e.newVersion})})]})]},"".concat(e.name,"-").concat(e.newVersion))]})}))}),(0,ne.jsxs)(Z.Z,{style:{padding:"8px 24px 24px"},children:[(0,ne.jsx)(q.Z,{onClick:function(){X(null)},children:p("common.cancel")}),(0,ne.jsxs)(q.Z,{onClick:function(e){e.stopPropagation(),xe()},color:"primary",disabled:G||!H.hasChecks,variant:"contained",autoFocus:!0,children:[G&&(0,ne.jsx)(B.Z,{size:16}),p("common.update")]})]})]})}),!!Q&&(0,ne.jsx)(h.Z,{open:!0,fullWidth:!0,onClose:function(){return ee(!1)},children:(0,ne.jsxs)(x.Z,{paddingY:1.5,children:[(0,ne.jsx)(g.Z,{children:p("common.configuration")}),(0,ne.jsx)(v.Z,{children:(0,ne.jsx)(x.Z,{py:2,children:(0,ne.jsx)(I.Z,{control:(0,ne.jsx)(L.Z,{checked:oe,onChange:function(e){return ie(!!e.target.checked)}}),label:p("blocklet.component.showContainer")})})})]})})]}))}Yr.propTypes={blocklet:f().object.isRequired,onUpdate:f().func,getComponentUrl:f().func},Yr.defaultProps={onUpdate:function(){},getComponentUrl:function(){return window.location.origin}};var Hr=p.Z.div(Fr||(Fr=(0,c.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"]))),Xr=t(13671);function $r(e){var n=(0,o.useContext)(i.RD).locale,t=(0,Xr.y0)(),a=t.blocklet,l=t.recommendedDomain;return(0,ne.jsx)(Yr,(0,r.Z)({blocklet:a,getComponentUrl:function(e){return(0,ce.vH)({blocklet:a,domain:{value:l},mountPoint:e,params:(0,ce.f0)(a,n)})}},e))}$r.defaultProps={}},44543:function(e,n,t){var r=t(57156);e.exports=function(e,n){return r(e)===r(n)}},92726:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var r,o=t(71171),i=t(32723),a=t(34795),l=t(33028),c=t(96234),s=t(59740),u=t(5057),d=t(55898),p=t.n(d),m=t(33518),f=t(67680),h=t(61533),x=t(74490),v=t(45267),g=t(46954),Z=t(44067),b=t(96266),y=["actions","size"],k=["icon","text","onClick","disabled"];function j(e){var n=e.actions,t=e.size,r=(0,s.Z)(e,y),o=(0,u.useState)(null),d=(0,c.Z)(o,2),p=d[0],m=d[1],j=Boolean(p),P=function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}m(null)};return(0,b.jsxs)(C,(0,l.Z)((0,l.Z)({},r),{},{children:[(0,b.jsx)(f.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"actions-menu-icon",onClick:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}m(e.currentTarget)},size:t,children:(0,b.jsx)(v.Z,{})}),(0,b.jsx)(h.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:p,keepMounted:!0,open:j,onClose:P,PaperProps:{},children:n.map((function(e,n){if("function"===typeof e)return e({close:P});var t=e.icon,r=e.text,o=e.onClick,c=e.disabled,d=void 0!==c&&c,p=(0,s.Z)(e,k);return(0,u.createElement)(x.Z,(0,l.Z)((0,l.Z)({},p),{},{disabled:d,dense:!0,onClick:function(){var e=(0,a.Z)((0,i.Z)().mark((function e(n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o(n);case 2:P();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),key:n,"data-cy":"actions-menu-".concat(n)}),(0,b.jsx)(g.Z,{style:{minWidth:24,marginRight:8},children:t}),(0,b.jsx)(Z.Z,{primary:r}))}))})]}))}j.propTypes={actions:p().array,size:p().oneOf(["small","medium","large"])},j.defaultProps={actions:[],size:"small"};var C=m.Z.div(r||(r=(0,o.Z)([""])))},31440:function(e,n,t){"use strict";t.d(n,{Z:function(){return v}});var r,o=t(71171),i=t(55898),a=t.n(i),l=t(85493),c=t(33518),s=t(68420),u=t(40265),d=t(44566),p=t(33028),m=t(33665),f=t(35432),h=t(96266);function x(e){var n=Object.assign({},((0,m.Z)(e),e));return(0,h.jsxs)("div",(0,p.Z)((0,p.Z)({},n),{},{style:{width:"100%"},children:[(0,h.jsx)("h3",{children:"End User License Agreement for Application"}),(0,h.jsxs)("p",{children:["Blocklet Server License Agreement ",f.COPYRIGHT_OWNER," version 2020-08-28"]}),(0,h.jsx)("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),(0,h.jsx)("p",{children:"\u6682\u65e0"})]}))}function v(e){var n=e.meta,t=e.onClickNext,r=e.handleDescEle,o=(0,l.useNavigate)(),i=(0,s.PE)(),a=i.t,c=i.locale,p=t||function(){o("/launch-blocklet/install".concat(window.location.search))};return(0,h.jsxs)(g,{children:[(0,h.jsx)("div",{className:"app-content",children:(0,h.jsx)("div",{className:"agreement",children:(0,h.jsx)("div",{className:"agreement-content",children:(0,h.jsx)(d.Z,{blockletMeta:{data:n},locale:c,handleDescEle:r})})})}),(0,h.jsx)("div",{className:"button-container","data-cy":"agree-all",children:(0,h.jsx)(u.Z,{onContinue:p,description:(0,h.jsx)(x,{}),texts:{listenName:a("launchBlocklet.license"),buttonNext:a("launchBlocklet.next")}})})]})}v.propTypes={meta:a().object.isRequired,onClickNext:a().func,handleDescEle:a().node},v.defaultProps={onClickNext:null,handleDescEle:""};var g=c.Z.div(r||(r=(0,o.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n flex: 1;\n .app-content {\n padding: 2px 24px 24px;\n "," {\n padding-top: 10px;\n }\n width: 100%;\n flex: 1;\n letter-spacing: normal;\n }\n .agreement {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n border: 1px solid ",";\n border-radius: 12px;\n "," {\n margin-top: 24px;\n }\n "," {\n margin-top: 16px;\n }\n .agreement-content {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n font-size: 14px;\n overflow-y: auto;\n "," {\n padding: 0 24px;\n }\n "," {\n padding: 0 16px;\n }\n &:after {\n display: block;\n content: '';\n height: 24px;\n }\n }\n }\n .button-container {\n padding-top: 24px;\n padding-bottom: 34px;\n "," {\n padding-right: 24px;\n margin-left: auto;\n }\n "," {\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.palette.grey[100]}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}))},80378:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var r=t(33028),o=t(59740),i=t(55898),a=t.n(i),l=t(62681),c=t(72333),s=t(6352),u=t.n(s),d=t(35432),p=t(58238),m=t(14491);var f=t(96266),h=["blocklet","style","size","ancestors"];function x(e){var n=e.blocklet,t=e.style,i=e.size,a=e.ancestors,s=(0,o.Z)(e,h),x=(0,p.h6)(),v=function(e){var n,t=e.blocklet,r=e.ancestors,o=void 0===r?[]:r,i=(0,p.h6)(),a=i.inService,l="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,m.XN)(null===t||void 0===t?void 0:t.status)?"~":""),c=a?u()(m.zn,d.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",l):u()(i.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)c=u()(t.deployedFrom,(0,m.lk)(t.meta.bundleDid,t.meta.logo),l);else{var s=window.env.apiPrefix||"/",f=o.concat(t),h=a?f.slice(1):f;c=u()(s,"/blocklet/logo-bundle".concat(h.map((function(e){return"/".concat(e.meta.did)})).join("")),l)}return{logoUrl:c,inService:a}}({blocklet:n,ancestors:a}),g=v.logoUrl,Z=v.inService,b=s.variant,y=Z?function(){}:function(e){e.target.src="".concat(x.imgPrefix,"/blocklet.png")},k=(0,f.jsx)("img",{src:g,onError:y,alt:n.meta.name,style:{width:i}});return n.meta.logo||(k=(0,f.jsx)(c.Z,{did:n.meta.did||"",responsive:!0})),(0,f.jsx)(l.Z,(0,r.Z)((0,r.Z)({variant:b||"square",style:Object.assign({backgroundColor:"transparent",width:i,height:i,borderRadius:10},t)},s),{},{children:k}))}x.propTypes={blocklet:a().object.isRequired,style:a().object,size:a().oneOfType([a().number,a().string]),ancestors:a().array},x.defaultProps={style:{},size:40,ancestors:[]}},74286:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(55898),o=t.n(r),i=t(39948),a=t(96266);function l(e){var n=e.depth;return(0,a.jsx)(i.Z,{ml:Math.max(2*(n-1),0),sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}l.propTypes={depth:o().number},l.defaultProps={depth:1}},61813:function(e,n,t){"use strict";t.d(n,{Z:function(){return S}});var r=t(33028),o=t(32723),i=t(34795),a=t(96234),l=t(5057),c=t(55898),s=t.n(c),u=t(13128),d=t(44846),p=t(55372),m=t(11750),f=t(47020),h=t(20870),x=t(31089),v=t(71767),g=t(64886),Z=t(49983),b=t(68420),y=t(28726),k=t(88574),j=t(38242),C=t(58238),P=t(73545),E=t(14491),w=t(4651),R=t(17450),T=t(96266);function S(e){var n=e.defaultUrl,t=e.onCancel,c=e.onSuccess,s=e.onError,S=e.mode,_=e.handleText,U=(0,C.h6)().api,N=(0,P.T)().api,I=(0,l.useState)(!1),L=(0,a.Z)(I,2),D=L[0],O=L[1],B=(0,l.useState)(""),F=(0,a.Z)(B,2),q=F[0],z=F[1],A=(0,b.PE)().t,G={dist:{}},W=(0,l.useState)(n),M=(0,a.Z)(W,2),K=M[0],V=M[1],Y=(0,l.useState)(n?1:0),H=(0,a.Z)(Y,2),X=H[0],$=H[1],J=(0,l.useState)(G),Q=(0,a.Z)(J,2),ee=Q[0],ne=Q[1],te=(0,l.useState)(!1),re=(0,a.Z)(te,2),oe=re[0],ie=re[1],ae=(0,l.useState)({}),le=(0,a.Z)(ae,2),ce=le[0],se=le[1],ue="component"===S,de=!!ue||!n,pe=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(){var n,t,r,i,a,l;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ne(G),z(null),O(!0),e.prev=3,n=decodeURIComponent(K.trim()),e.prev=5,new URL(n),e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(5),new Error("Invalid URL");case 12:return e.next=14,U.getBlockletMetaFromUrl({input:{url:n}});case 14:t=e.sent,r=t.meta,i=t.inStore,a=t.registryUrl,ne(r),se({inStore:i,registryUrl:a,inputUrl:K.trim()}),e.next=28;break;case 22:e.prev=22,e.t1=e.catch(3),console.error(e.t1),l="Blocklet Install failed: ".concat((0,E.Z)(e.t1)),z(l),s(e.t1);case 28:return e.prev=28,O(!1),e.finish(28);case 31:case"end":return e.stop()}}),e,null,[[3,22,28,31],[5,9]])})));return function(){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){n&&pe()}),[n]);var me=[{name:A("common.name"),value:(0,j.getDisplayName)({meta:ee},!0)},{name:A("common.version"),value:ee.version},{name:A("common.did"),value:(0,T.jsx)(R.Z,{did:ee.did})},{name:A("common.author"),value:(0,E.rq)(ee.author)},{name:A("blocklet.dist.downloadLink"),value:ee.dist.tarball}],fe=[{label:A("blocklet.fromUrl.step0"),body:(0,T.jsx)(m.Z,{component:"div",children:(0,T.jsx)(f.Z,{label:A("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,style:{marginBottom:32},margin:"dense",helperText:A("blocklet.fromUrl.description"),value:K,onChange:function(e){z(null),V(e.target.value)},disabled:D,onKeyPress:function(e){"Enter"===e.key&&(e.preventDefault(),pe(),$(1))}})}),cancel:A("common.cancel"),confirm:A("common.next"),onCancel:t,onConfirm:function(){pe(),$(1)}},{label:A("blocklet.fromUrl.step1"),body:D?(0,T.jsx)("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:(0,T.jsx)(d.Z,{})}):ee.did?(0,T.jsx)("div",{style:{paddingLeft:"10%"},children:me.map((function(e){return e.name===A("common.did")?(0,T.jsx)(g.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:function(){return A("common.did")},children:e.value},e.name):(0,T.jsx)(g.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)}))}):null,cancel:A(de?"common.pre":"common.cancel"),confirm:(null===_||void 0===_?void 0:_.confirm)||A("blocklet.fromUrl.confirm"),onCancel:function(){de?$((function(e){return e-1})):t()},onConfirm:function(){!function(){if(ue)return c((0,r.Z)({meta:ee},ce)),void t();O(!0),ie(!0)}()}}],he=fe[X];return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(u.ZP,{title:(null===_||void 0===_?void 0:_.title)||A("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:function(){return he.onCancel()},showCloseButton:0===X,disableEscapeKeyDown:!0,open:!0,actions:(0,T.jsxs)(T.Fragment,{children:[he.cancel&&(0,T.jsx)(y.Z,{onClick:function(e){e.stopPropagation(),z(null),he.onCancel()},color:"inherit",children:he.cancel||A("common.cancel")}),(0,T.jsxs)(y.Z,{onClick:function(e){e.stopPropagation(),he.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:D||!K||q,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[D&&0===X&&(0,T.jsx)(d.Z,{size:16}),he.confirm]})]}),children:[de&&(0,T.jsx)(h.Z,{alternativeLabel:!0,activeStep:X,children:fe.map((function(e){var n=e.label;return(0,T.jsx)(x.Z,{children:(0,T.jsx)(v.Z,{children:n})},n)}))}),(0,T.jsx)(p.Z,{component:"div",style:{marginTop:24},children:he.body}),!!q&&(0,T.jsx)(k.Z,{type:"error",style:{width:"100%",marginTop:8},children:q})]}),ee&&oe&&(0,T.jsx)(Z.Z,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:N.get,checkTimeout:3e5,onSuccess:function(){O(!1),ie(!1),c((0,r.Z)({meta:ee},ce)),t()},extraParams:{title:ee.title,wt:(0,w.iK)(ee),blockletMetaUrl:decodeURIComponent(K.trim())},messages:{title:A("setup.keyPair.title"),scan:A("setup.keyPair.scan"),confirm:A("setup.keyPair.confirm"),success:A("setup.keyPair.success")},onClose:function(){O(!1),ie(!1)}})]})}S.propTypes={defaultUrl:s().string,onCancel:s().func.isRequired,onSuccess:s().func.isRequired,onError:s().func,mode:s().oneOf(["install","component"]),handleText:s().object},S.defaultProps={onError:function(){},defaultUrl:"",mode:"install",handleText:{}}},32349:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var r=t(33028),o=t(59740),i=t(55898),a=t.n(i),l=t(22228),c=t(96266),s=["mode"];function u(e){var n=e.mode,t=(0,o.Z)(e,s);return"development"===n?(0,c.jsx)(l.Z,(0,r.Z)((0,r.Z)({type:"primary"},t),{},{children:"DEV"})):null}u.propTypes={mode:a().string.isRequired}},51233:function(e,n,t){"use strict";t.d(n,{Rw:function(){return u},fX:function(){return s},sf:function(){return d}});var r=t(35432),o=t(44543),i=t.n(o),a=t(76811),l=t(32828),c=function(e,n){if(e.type===r.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===r.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(n("router.validation.didRequired"));return null},s=function(e,n){var t=c(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")))},u=function(e){var n=e.params,t=e.blocklets,r=e.blocklet,o=e.locale,c=void 0===o?"en":o;if(r){var s=(r.children||[]).find((function(e){return(0,l.default)(e.meta)&&i()(e.mountPoint,n.pathPrefix)}));if("gateway"!==r.meta.group&&"/"===n.pathPrefix&&(s="/"),s)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")}[c]}var u=t.find((function(e){return e.meta.did===n.did}));if(!u)return"";var d=u.meta.interfaces.find((function(e){return"web"===e.type}));return d&&d.prefix!==a.BLOCKLET_DYNAMIC_PATH_PREFIX&&n.pathPrefix!==d.prefix?{zh:"\u8be5 blocklet \u53ea\u80fd\u6302\u8f7d\u5728 ".concat(d.prefix),en:"This blocklet can only be mounted on ".concat(d.prefix)}[c]:""},d=function(e){if(!e||"string"!==typeof e)return e;var n=e.trim();try{return(n=n.toLowerCase()).startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n}catch(t){return console.error("format domain failed",t),n}}},28641:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var r=t(33028),o=t(32723),i=t(34795),a=t(96234),l=t(59740),c=t(5057),s=t(55898),u=t.n(s),d=t(39948),p=t(47020),m=t(44846),f=t(13727),h=t(56184),x=t(67680),v=t(35406),g=t(11875),Z=t(95890),b=t(96266),y=["label","disabled","required","initialValue","onChange","placeholder","style","onSubmit","secure","triggers","formatterBeforeSubmit"],k=function(e,n,t){return null===e&&n&&t?"******":e?n?"******":e:""};function j(e){var n=e.label,t=e.disabled,s=e.required,u=e.initialValue,j=e.onChange,C=e.placeholder,P=e.style,E=e.onSubmit,w=e.secure,R=e.triggers,T=e.formatterBeforeSubmit,S=(0,l.Z)(e,y),_=(0,c.useState)(!1),U=(0,a.Z)(_,2),N=U[0],I=U[1],L=(0,c.useState)(!1),D=(0,a.Z)(L,2),O=D[0],B=D[1],F=(0,c.useState)(w&&"__encrypted__"===u?null:u),q=(0,a.Z)(F,2),z=q[0],A=q[1],G=(0,c.useState)(z),W=(0,a.Z)(G,2),M=W[0],K=W[1],V=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(){var n;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.prev=1,e.next=4,E(M);case 4:!1===e.sent?K(z):(n=M,"function"===typeof T&&(n=T(M)),K(n),A(n)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),K(z);case 11:return e.prev=11,B(!1),I(!1),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[1,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),Y=function(e){K(e),j(e)},H=N?(0,b.jsx)(p.Z,(0,r.Z)({style:{flex:1},fullWidth:!0,value:M,onChange:function(e){Y(e.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:C,onKeyDown:function(e){"Enter"===e.key&&V()},disabled:t,type:w?"password":"text"},S)):(0,b.jsx)(d.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:k(M,w,u)});return(0,b.jsx)(g.Z,{className:"form",style:P,children:(0,b.jsxs)(d.Z,{className:"form-item",children:[(0,b.jsxs)(d.Z,{className:"form-item-label",children:[n,s&&(0,b.jsx)(v.Z,{})]}),(0,b.jsxs)(d.Z,{className:"form-item-body",children:[(0,b.jsx)(d.Z,{className:"form-item-input",children:H}),(0,b.jsx)(d.Z,{className:"form-item-action",children:N?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x.Z,{"data-cy":"schema-form-item-confirm",onClick:V,disabled:t||O,size:"large",children:O?(0,b.jsx)(m.Z,{size:24}):(0,b.jsx)(h.Z,{})}),(0,b.jsx)(x.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){K(z),I(!1)},disabled:t||O,size:"large",children:(0,b.jsx)(f.default,{})})]}):(0,b.jsx)(Z.Z,{triggers:R,onEnterEdit:function(){return I(!0)},disabled:t})})]})]})})}j.propTypes={style:u().object,onSubmit:u().func,onChange:u().func,label:u().string,initialValue:u().string,placeholder:u().string,required:u().bool,disabled:u().bool,secure:u().bool,triggers:u().array,formatterBeforeSubmit:u().func},j.defaultProps={style:{},onSubmit:function(){},onChange:function(){},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},11875:function(e,n,t){"use strict";var r,o=t(71171),i=t(33518),a=t(39948);n.Z=(0,i.Z)(a.Z)(r||(r=(0,o.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"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}))},95890:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var r=t(96234),o=t(5057),i=t(55898),a=t.n(i),l=t(24558),c=t(67680),s=t(56556),u=t(49127),d=t(49390),p=t(37200),m=t(25228),f=t(24202),h=t(74490),x=t(1733),v=t(96266);function g(e){var n=e.triggers,t=e.onEnterEdit,i=e.disabled,a=o.useRef(null),g=o.useState(!1),Z=(0,r.Z)(g,2),b=Z[0],y=Z[1];return 0===n.length?(0,v.jsx)(c.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,v.jsx)(l.Z,{})}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(u.Z,{variant:"outlined",ref:a,"aria-label":"split button",children:[(0,v.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:i,size:"large",children:(0,v.jsx)(l.Z,{})}),(0,v.jsx)(s.Z,{size:"small","aria-controls":b?"split-button-menu":void 0,"aria-expanded":b?"true":void 0,onClick:function(){y((function(e){return!e}))},children:(0,v.jsx)(d.Z,{})})]}),(0,v.jsx)(f.Z,{sx:{zIndex:9999},open:b,anchorEl:a.current,role:void 0,placement:"bottom-end",children:(0,v.jsx)(m.Z,{children:(0,v.jsx)(p.d,{onClickAway:function(e){a.current&&a.current.contains(e.target)||y(!1)},children:(0,v.jsx)(x.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((function(e){return(0,v.jsx)(h.Z,{onClick:function(){return n=e.handler,y(!1),void n();var n},children:e.title},e.key)}))})})})})]})}g.propTypes={triggers:a().arrayOf(a().shape({key:a().string.isRequired,title:a().string.isRequired,handler:a().func.isRequired})),onEnterEdit:a().func.isRequired,disabled:a().bool.isRequired},g.defaultProps={triggers:[]}},35406:function(e,n,t){"use strict";var r,o=t(71171),i=t(33518).Z.span(r||(r=(0,o.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(function(e){return e.theme.palette.error.main}));n.Z=i},35918:function(e,n,t){"use strict";var r=t(44919),o=t(42876),i=t(27773),a=t(11997),l=t(93734),c=t(76667),s=t(39293),u=t(36903),d=t(3422),p=t(92273),m=t(72906),f=t(57201),h=t(49390),x=t(33225),v=t(30770);n.Z={Add:r.Z,Check:o.default,Delete:i.default,Edit:c.default,Clear:a.default,DetailPanel:p.default,Filter:s.Z,FirstPage:u.default,LastPage:d.default,NextPage:p.default,PreviousPage:m.default,Search:f.default,ResetSearch:a.default,SortArrow:h.Z,Export:l.default,ThirdStateCheck:x.default,ViewColumn:v.default}},74782:function(e,n,t){"use strict";var r,o=t(71171),i=t(33518).Z.div(r||(r=(0,o.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"])));n.Z=i}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[1294],{63838:function(e,r,t){t.d(r,{Z:function(){return p}});var n=t(27812),a=t(67120),o=t(89141),i=t(41168),l=t(5057),u=t(78590),c=t(50482),f=t.n(c),d=function(e,r,t){var n,a,o=(0,l.useRef)(),i=(0,l.useRef)(0);n=r,a=o.current,void 0===n&&(n=[]),void 0===a&&(a=[]),f()(n,a)||(o.current=r,i.current+=1),(0,u.Z)(e,[i.current],t)},s={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:/(mac|iphone|ipod|ipad)/i.test("undefined"!==typeof navigator?null===navigator||void 0===navigator?void 0:navigator.platform:"")?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},h={ctrl:function(e){return e.ctrlKey},shift:function(e){return e.shiftKey},alt:function(e){return e.altKey},meta:function(e){return"keyup"===e.type?s.meta.includes(e.keyCode):e.metaKey}};function v(e,r,t){var a,i;if(!e.key)return!1;if((0,o.hj)(r))return e.keyCode===r;var l=r.split("."),u=0;try{for(var c=(0,n.__values)(l),f=c.next();!f.done;f=c.next()){var d=f.value,v=h[d],g=s[d.toLowerCase()];(v&&v(e)||g&&g===e.keyCode)&&u++}}catch(p){a={error:p}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(a)throw a.error}}return t?u===l.length&&function(e){var r=Object.keys(h).reduce((function(r,t){return h[t](e)?r+1:r}),0);return[16,17,18,91,92].includes(e.keyCode)?r:r+1}(e)===l.length:u===l.length}var g=["keydown"];var p=function(e,r,t){var l=t||{},u=l.events,c=void 0===u?g:u,f=l.target,s=l.exactMatch,h=void 0!==s&&s,p=l.useCapture,m=void 0!==p&&p,y=(0,a.Z)(r),b=(0,a.Z)(e);d((function(){var e,r,t,a=(0,i.n)(f,window);if(a){var l=function(e){var r,t=function(e,r){return(0,o.mf)(e)?e:(0,o.HD)(e)||(0,o.hj)(e)?function(t){return v(t,e,r)}:Array.isArray(e)?function(t){return e.some((function(e){return v(t,e,r)}))}:function(){return Boolean(e)}}(b.current,h);if(t(e))return null===(r=y.current)||void 0===r?void 0:r.call(y,e)};try{for(var u=(0,n.__values)(c),d=u.next();!d.done;d=u.next()){var s=d.value;null===(t=null===a||void 0===a?void 0:a.addEventListener)||void 0===t||t.call(a,s,l,m)}}catch(g){e={error:g}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}return function(){var e,r,t;try{for(var o=(0,n.__values)(c),i=o.next();!i.done;i=o.next()){var u=i.value;null===(t=null===a||void 0===a?void 0:a.removeEventListener)||void 0===t||t.call(a,u,l,m)}}catch(f){e={error:f}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}}}}),[c],f)}},56977:function(e,r,t){var n=t(24921);function a(e){if("string"!==typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function o(e,r){for(var t,n="",a=0,o=-1,i=0,l=0;l<=e.length;++l){if(l<e.length)t=e.charCodeAt(l);else{if(47===t)break;t=47}if(47===t){if(o===l-1||1===i);else if(o!==l-1&&2===i){if(n.length<2||2!==a||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",a=0):a=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=l,i=0;continue}}else if(2===n.length||1===n.length){n="",a=0,o=l,i=0;continue}r&&(n.length>0?n+="/..":n="..",a=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),a=l-o-1;o=l,i=0}else 46===t&&-1!==i?++i:i=-1}return n}var i={resolve:function(){for(var e,r="",t=!1,i=arguments.length-1;i>=-1&&!t;i--){var l;i>=0?l=arguments[i]:(void 0===e&&(e=n.cwd()),l=e),a(l),0!==l.length&&(r=l+"/"+r,t=47===l.charCodeAt(0))}return r=o(r,!t),t?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(a(e),0===e.length)return".";var r=47===e.charCodeAt(0),t=47===e.charCodeAt(e.length-1);return 0!==(e=o(e,!r)).length||r||(e="."),e.length>0&&t&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return a(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var t=arguments[r];a(t),t.length>0&&(void 0===e?e=t:e+="/"+t)}return void 0===e?".":i.normalize(e)},relative:function(e,r){if(a(e),a(r),e===r)return"";if((e=i.resolve(e))===(r=i.resolve(r)))return"";for(var t=1;t<e.length&&47===e.charCodeAt(t);++t);for(var n=e.length,o=n-t,l=1;l<r.length&&47===r.charCodeAt(l);++l);for(var u=r.length-l,c=o<u?o:u,f=-1,d=0;d<=c;++d){if(d===c){if(u>c){if(47===r.charCodeAt(l+d))return r.slice(l+d+1);if(0===d)return r.slice(l+d)}else o>c&&(47===e.charCodeAt(t+d)?f=d:0===d&&(f=0));break}var s=e.charCodeAt(t+d);if(s!==r.charCodeAt(l+d))break;47===s&&(f=d)}var h="";for(d=t+f+1;d<=n;++d)d!==n&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+r.slice(l+f):(l+=f,47===r.charCodeAt(l)&&++l,r.slice(l))},_makeLong:function(e){return e},dirname:function(e){if(a(e),0===e.length)return".";for(var r=e.charCodeAt(0),t=47===r,n=-1,o=!0,i=e.length-1;i>=1;--i)if(47===(r=e.charCodeAt(i))){if(!o){n=i;break}}else o=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)},basename:function(e,r){if(void 0!==r&&"string"!==typeof r)throw new TypeError('"ext" argument must be a string');a(e);var t,n=0,o=-1,i=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,u=-1;for(t=e.length-1;t>=0;--t){var c=e.charCodeAt(t);if(47===c){if(!i){n=t+1;break}}else-1===u&&(i=!1,u=t+1),l>=0&&(c===r.charCodeAt(l)?-1===--l&&(o=t):(l=-1,o=u))}return n===o?o=u:-1===o&&(o=e.length),e.slice(n,o)}for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===o&&(i=!1,o=t+1);return-1===o?"":e.slice(n,o)},extname:function(e){a(e);for(var r=-1,t=0,n=-1,o=!0,i=0,l=e.length-1;l>=0;--l){var u=e.charCodeAt(l);if(47!==u)-1===n&&(o=!1,n=l+1),46===u?-1===r?r=l:1!==i&&(i=1):-1!==r&&(i=-1);else if(!o){t=l+1;break}}return-1===r||-1===n||0===i||1===i&&r===n-1&&r===t+1?"":e.slice(r,n)},format:function(e){if(null===e||"object"!==typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,r){var t=r.dir||r.root,n=r.base||(r.name||"")+(r.ext||"");return t?t===r.root?t+n:t+e+n:n}("/",e)},parse:function(e){a(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var t,n=e.charCodeAt(0),o=47===n;o?(r.root="/",t=1):t=0;for(var i=-1,l=0,u=-1,c=!0,f=e.length-1,d=0;f>=t;--f)if(47!==(n=e.charCodeAt(f)))-1===u&&(c=!1,u=f+1),46===n?-1===i?i=f:1!==d&&(d=1):-1!==i&&(d=-1);else if(!c){l=f+1;break}return-1===i||-1===u||0===d||1===d&&i===u-1&&i===l+1?-1!==u&&(r.base=r.name=0===l&&o?e.slice(1,u):e.slice(l,u)):(0===l&&o?(r.name=e.slice(1,i),r.base=e.slice(1,u)):(r.name=e.slice(l,i),r.base=e.slice(l,u)),r.ext=e.slice(i,u)),l>0?r.dir=e.slice(0,l-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[1371],{58854:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return u}});var o=t(85493),r=t(80576),a=t(51177),i=t(74490),l=t(43077),d=t(13644),c=t(75793),s=t(96266);function u(){var e=(0,o.useNavigate)(),n=(0,o.useParams)().name,t=void 0===n?"abtnode":n,u=(0,c.h6)().info,p=u.routing.provider,v=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr"]},{id:"blocklet-services",name:"Blocklet Services",types:["info","access","stdout","stderr"]}];if(p){var g="Service Gateway(".concat(p,")");v.push({id:"service-gateway-".concat(p),name:g,types:["error","access"]})}var f=(0,s.jsx)(r.Z,{sx:{minWidth:240},children:(0,s.jsx)(a.Z,{value:t,onChange:function(n){e("/logs/".concat(n.target.value))},size:"small",children:v.map((function(e){return(0,s.jsx)(i.Z,{value:e.id,children:e.name},e.id)}))})}),m=v.find((function(e){return e.id===t}))||v[0];return(0,s.jsx)(l.l,{name:m.name,logId:m.id,types:m.types,prepend:f,postpend:(0,s.jsx)(d.Z,{id:u.did,name:"blocklet-server"})},m.id)}},24460:function(e,n,t){var o=t(93845);e.exports=function(e){return o((e||"").replace(/^[@./-]/,"").replace(/[@./_]/g,"-"))}},13644:function(e,n,t){"use strict";t.d(n,{Z:function(){return C}});var o=t(32723),r=t(34795),a=t(96234),i=t(5057),l=t(55898),d=t.n(l),c=t(1577),s=t.n(c),u=t(39948),p=t(63878),v=t(80576),g=t(51177),f=t(74490),m=t(44846),h=t(28726),b=t(68420),x=t(13128),Z=t(24460),y=t.n(Z),w=t(86229),j=t(58238),B=t(96266),R=[1,7];function C(e){var n=e.id,t=e.name,l=(0,b.PE)().t,d=(0,j.h6)(),c=d.restApi,Z=d.inService,C=(0,i.useState)(!1),k=(0,a.Z)(C,2),z=k[0],E=k[1],S=(0,i.useState)(!1),T=(0,a.Z)(S,2),P=T[0],W=T[1],D=(0,i.useState)(1),F=(0,a.Z)(D,2),M=F[0],N=F[1],I=function(){var e=(0,r.Z)((0,o.Z)().mark((function e(){var r,a,i,l;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!P){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,W(!0),r=Z?"":"/".concat(n),e.next=7,c.get("/download/log".concat(r,"?days=").concat(M),{responseType:"blob"});case 7:a=e.sent,i=URL.createObjectURL(a.data),(l=document.createElement("a")).href=i,l.setAttribute("download","".concat(y()(t||n),".").concat(s()().format("YYYYMMDDHHmmss"),".log.zip")),document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(i),W(!1),E(!1),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(2),W(!1),w.Z.error(e.t0.message);case 24:case"end":return e.stop()}}),e,null,[[2,20]])})));return function(){return e.apply(this,arguments)}}();return[(0,B.jsx)(u.Z,{display:"flex",alignItems:"center",style:{gap:16},children:(0,B.jsxs)(h.Z,{"data-cy":"download-logs",variant:"outlined",onClick:function(){return E(!0)},disabled:P,children:[P?(0,B.jsx)(m.Z,{size:16}):(0,B.jsx)(p.Z,{fontSize:"small",style:{transform:"translateY(2px)"}}),(0,B.jsx)(u.Z,{ml:.5,children:l("common.download")})]})}),z&&(0,B.jsx)(x.ZP,{open:!0,onClose:function(){E(!1)},disableEscapeKeyDown:!0,title:l("common.download"),PaperProps:{style:{minHeight:"auto"}},actions:(0,B.jsxs)(h.Z,{"data-cy":"download-logs",variant:"outlined",onClick:function(){return I()},disabled:P,children:[P&&(0,B.jsx)(m.Z,{size:16}),(0,B.jsx)(u.Z,{ml:.5,children:l("common.confirm")})]}),children:(0,B.jsx)(u.Z,{mb:2,display:"flex",justifyContent:"center",children:(0,B.jsx)(v.Z,{size:"small",fullWidth:!0,children:(0,B.jsx)(g.Z,{value:M,onChange:function(e){N(e.target.value)},children:R.map((function(e){return(0,B.jsx)(f.Z,{value:e,children:l("log.lastDays.".concat(e))},e)}))})})})})]}C.propTypes={id:d().string.isRequired,name:d().string},C.defaultProps={name:""}},43077:function(e,n,t){"use strict";t.d(n,{l:function(){return B}});var o=t(71171),r=t(33028),a=t(96234),i=t(59740),l=t(5057),d=t(33518),c=t(55898),s=t.n(c),u=t(56556),p=t(49127),v=t(72904),g=t(9746),f=t(12726),m=t(14491);var h,b,x=function(){var e=(0,l.useState)(+new Date),n=(0,a.Z)(e,2),t=n[0],o=n[1];return(0,f.Z)((function(){o(+new Date)}),1e3),(0,m.mr)(t,"MMMM Do YYYY, h:mm:ss a")},Z=t(58238),y=t(96266),w=["name","logId","types","defaultTypeIndex","initialData","prepend","postpend","onTypeChange"],j=["logFile"];function B(e){var n=e.name,t=e.logId,o=e.types,d=e.defaultTypeIndex,c=e.initialData,s=e.prepend,g=e.postpend,f=e.onTypeChange,m=(0,i.Z)(e,w),h=(0,Z.h6)().ws.useSubscription,b={info:"Info",error:"Error",access:"Access",stdout:"stdout",stderr:"stderr"},x=(0,v.Z)((function(e){return e.breakpoints.down("md")})),j=(0,l.useState)(o[d||0]),B=(0,a.Z)(j,2),k=B[0],z=B[1],E=(0,l.useState)(),S=(0,a.Z)(E,2),T=S[0],P=S[1],W=(0,l.useRef)({});return(0,l.useEffect)((function(){o.forEach((function(e){var t=W.current[e];t&&(t.write("Collecting ".concat(e," logs for ").concat(n,"...")),t.write("\r\n\r\n"),c.forEach((function(e){return t.write(e)})))}))}),[]),h("log.".concat(t),(function(e){T||P(e.logFiles||{});var n=W.current[e.level];n&&(n.write(e.data.replace(/.\n/g,(function(e){return"\r\n"===e?e:"".concat(e[0],"\r\n\r\n")}))),n.write("\r\n\r\n"))}),[]),(0,y.jsxs)(R,(0,r.Z)((0,r.Z)({},m),{},{children:[(0,y.jsxs)("div",{className:"log-terminal-group-head",children:[(0,y.jsxs)("div",{className:"log-terminal-group-head-start",children:[s,(0,y.jsx)(p.Z,{variant:"outlined",size:x?"small":"medium",children:o.map((function(e){var n=e===k?{variant:"contained"}:{};return(0,y.jsx)(u.Z,(0,r.Z)((0,r.Z)({},n),{},{onClick:function(){z(e),f(e)},children:b[e]}),e)}))})]}),(0,y.jsx)("div",{className:"log-terminal-group-head-end",children:g})]}),(0,y.jsx)("div",{className:"log-terminal-group-terminals",children:o.map((function(e){return(0,y.jsx)(C,{ref:function(n){W.current[e]=n},logFile:null===T||void 0===T?void 0:T[e],style:{visibility:e===k?"visible":"hidden"}},e)}))})]}))}B.propTypes={name:s().string.isRequired,logId:s().string.isRequired,types:s().arrayOf(s().string),defaultTypeIndex:s().number,initialData:s().arrayOf(s().string),prepend:s().node,postpend:s().node,onTypeChange:s().func},B.defaultProps={types:["error","info","access","stdout","stderr"],defaultTypeIndex:0,initialData:[],prepend:null,postpend:null,onTypeChange:function(){}};var R=d.Z.div(h||(h=(0,o.Z)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n .log-terminal-group-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-bottom: 16px;\n }\n\n .log-terminal-group-head-start {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: 16px;\n "," {\n flex-direction: column;\n align-items: start;\n }\n }\n\n .log-terminal-group-head-end {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: 16px;\n "," {\n flex-direction: column;\n align-items: start;\n }\n }\n .log-terminal-group-terminals {\n flex: 1;\n position: relative;\n overflow: hidden;\n > * {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")})),C=(0,l.forwardRef)((function(e,n){var t=e.logFile,o=(0,i.Z)(e,j);return(0,y.jsxs)(k,(0,r.Z)((0,r.Z)({},o),{},{children:[(0,y.jsxs)("div",{className:"log-terminal-top",children:[(0,y.jsx)(x,{}),t&&(0,y.jsx)("span",{children:t})]}),(0,y.jsx)("div",{className:"log-terminal-container",style:{position:"relative"},children:(0,y.jsx)(g.Z,{ref:n,style:{width:"100%",boxSizing:"border-box",height:"100%"},options:{theme:{background:"#2C313C",foreground:"#EEEEEE"}}})})]}))}));C.propTypes={logFile:s().string},C.defaultProps={logFile:""};var k=d.Z.div(b||(b=(0,o.Z)(["\n height: 100%;\n display: flex;\n flex-direction: column;\n .log-terminal-top {\n flex: 0 0 auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n padding: 8px;\n font-size: 14px;\n color: aquamarine;\n background: darkgray;\n word-break: break-word;\n }\n .log-terminal-container {\n flex: 1;\n height: 100%;\n padding: 8px;\n overflow: hidden;\n background: #2c313c;\n }\n\n .xterm-viewport::-webkit-scrollbar {\n width: 10px;\n }\n .xterm-viewport::-webkit-scrollbar-track {\n opacity: 0;\n }\n .xterm-viewport::-webkit-scrollbar-thumb {\n min-height: 20px;\n background-color: #ffffff20;\n }\n"])))},49127:function(e,n,t){"use strict";t.d(n,{Z:function(){return w}});var o=t(56666),r=t(31461),a=t(7896),i=t(5057),l=t(9978),d=t(91213),c=t(66685);var s=t(6285),u=t(62773),p=t(42908),v=t(31821),g=t(18561);function f(e){return(0,g.Z)("MuiButtonGroup",e)}var m=(0,v.Z)("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","vertical","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]),h=t(17681),b=t(27258),x=t(96266),Z=["children","className","color","component","disabled","disableElevation","disableFocusRipple","disableRipple","fullWidth","orientation","size","variant"],y=(0,u.ZP)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:function(e,n){var t=e.ownerState;return[(0,o.Z)({},"& .".concat(m.grouped),n.grouped),(0,o.Z)({},"& .".concat(m.grouped),n["grouped".concat((0,s.Z)(t.orientation))]),(0,o.Z)({},"& .".concat(m.grouped),n["grouped".concat((0,s.Z)(t.variant))]),(0,o.Z)({},"& .".concat(m.grouped),n["grouped".concat((0,s.Z)(t.variant)).concat((0,s.Z)(t.orientation))]),(0,o.Z)({},"& .".concat(m.grouped),n["grouped".concat((0,s.Z)(t.variant)).concat((0,s.Z)(t.color))]),(0,o.Z)({},"& .".concat(m.firstButton),n.firstButton),(0,o.Z)({},"& .".concat(m.lastButton),n.lastButton),(0,o.Z)({},"& .".concat(m.middleButton),n.middleButton),n.root,n[t.variant],!0===t.disableElevation&&n.disableElevation,t.fullWidth&&n.fullWidth,"vertical"===t.orientation&&n.vertical]}})((function(e){var n,t=e.theme,r=e.ownerState;return(0,a.Z)({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius},"contained"===r.variant&&{boxShadow:(t.vars||t).shadows[2]},r.disableElevation&&{boxShadow:"none"},r.fullWidth&&{width:"100%"},"vertical"===r.orientation&&{flexDirection:"column"},(n={},(0,o.Z)(n,"& .".concat(m.grouped),(0,a.Z)({minWidth:40,"&:hover":(0,a.Z)({},"contained"===r.variant&&{boxShadow:"none"})},"contained"===r.variant&&{boxShadow:"none"})),(0,o.Z)(n,"& .".concat(m.firstButton,",& .").concat(m.middleButton),(0,a.Z)({},"horizontal"===r.orientation&&{borderTopRightRadius:0,borderBottomRightRadius:0},"vertical"===r.orientation&&{borderBottomRightRadius:0,borderBottomLeftRadius:0},"text"===r.variant&&"horizontal"===r.orientation&&(0,o.Z)({borderRight:t.vars?"1px solid rgba(".concat(t.vars.palette.common.onBackgroundChannel," / 0.23)"):"1px solid ".concat("light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")},"&.".concat(m.disabled),{borderRight:"1px solid ".concat((t.vars||t).palette.action.disabled)}),"text"===r.variant&&"vertical"===r.orientation&&(0,o.Z)({borderBottom:t.vars?"1px solid rgba(".concat(t.vars.palette.common.onBackgroundChannel," / 0.23)"):"1px solid ".concat("light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")},"&.".concat(m.disabled),{borderBottom:"1px solid ".concat((t.vars||t).palette.action.disabled)}),"text"===r.variant&&"inherit"!==r.color&&{borderColor:t.vars?"rgba(".concat(t.vars.palette[r.color].mainChannel," / 0.5)"):(0,c.Fq)(t.palette[r.color].main,.5)},"outlined"===r.variant&&"horizontal"===r.orientation&&{borderRightColor:"transparent"},"outlined"===r.variant&&"vertical"===r.orientation&&{borderBottomColor:"transparent"},"contained"===r.variant&&"horizontal"===r.orientation&&(0,o.Z)({borderRight:"1px solid ".concat((t.vars||t).palette.grey[400])},"&.".concat(m.disabled),{borderRight:"1px solid ".concat((t.vars||t).palette.action.disabled)}),"contained"===r.variant&&"vertical"===r.orientation&&(0,o.Z)({borderBottom:"1px solid ".concat((t.vars||t).palette.grey[400])},"&.".concat(m.disabled),{borderBottom:"1px solid ".concat((t.vars||t).palette.action.disabled)}),"contained"===r.variant&&"inherit"!==r.color&&{borderColor:(t.vars||t).palette[r.color].dark},{"&:hover":(0,a.Z)({},"outlined"===r.variant&&"horizontal"===r.orientation&&{borderRightColor:"currentColor"},"outlined"===r.variant&&"vertical"===r.orientation&&{borderBottomColor:"currentColor"})})),(0,o.Z)(n,"& .".concat(m.lastButton,",& .").concat(m.middleButton),(0,a.Z)({},"horizontal"===r.orientation&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},"vertical"===r.orientation&&{borderTopRightRadius:0,borderTopLeftRadius:0},"outlined"===r.variant&&"horizontal"===r.orientation&&{marginLeft:-1},"outlined"===r.variant&&"vertical"===r.orientation&&{marginTop:-1})),n))})),w=i.forwardRef((function(e,n){var t=(0,p.Z)({props:e,name:"MuiButtonGroup"}),o=t.children,c=t.className,u=t.color,v=void 0===u?"primary":u,g=t.component,m=void 0===g?"div":g,w=t.disabled,j=void 0!==w&&w,B=t.disableElevation,R=void 0!==B&&B,C=t.disableFocusRipple,k=void 0!==C&&C,z=t.disableRipple,E=void 0!==z&&z,S=t.fullWidth,T=void 0!==S&&S,P=t.orientation,W=void 0===P?"horizontal":P,D=t.size,F=void 0===D?"medium":D,M=t.variant,N=void 0===M?"outlined":M,I=(0,r.Z)(t,Z),L=(0,a.Z)({},t,{color:v,component:m,disabled:j,disableElevation:R,disableFocusRipple:k,disableRipple:E,fullWidth:T,orientation:W,size:F,variant:N}),O=function(e){var n=e.classes,t=e.color,o=e.disabled,r=e.disableElevation,a=e.fullWidth,i=e.orientation,l=e.variant,c={root:["root",l,"vertical"===i&&"vertical",a&&"fullWidth",r&&"disableElevation"],grouped:["grouped","grouped".concat((0,s.Z)(i)),"grouped".concat((0,s.Z)(l)),"grouped".concat((0,s.Z)(l)).concat((0,s.Z)(i)),"grouped".concat((0,s.Z)(l)).concat((0,s.Z)(t)),o&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,d.Z)(c,f,n)}(L),Y=i.useMemo((function(){return{className:O.grouped,color:v,disabled:j,disableElevation:R,disableFocusRipple:k,disableRipple:E,fullWidth:T,size:F,variant:N}}),[v,j,R,k,E,T,F,N,O.grouped]),H=function(e){return i.Children.toArray(e).filter((function(e){return i.isValidElement(e)}))}(o),q=H.length,G=function(e){var n=0===e,t=e===q-1;return n&&t?"":n?O.firstButton:t?O.lastButton:O.middleButton};return(0,x.jsx)(y,(0,a.Z)({as:m,role:"group",className:(0,l.Z)(O.root,c),ref:n,ownerState:L},I,{children:(0,x.jsx)(h.Z.Provider,{value:Y,children:H.map((function(e,n){return(0,x.jsx)(b.Z.Provider,{value:G(n),children:e},n)}))})}))}))}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[2264],{73170:function(e,n,t){t.d(n,{$7:function(){return y},AP:function(){return Z}});var r=t(92877),i=t(55898),o=t.n(i),a=t(19577),c=t(2478),s=t(44067),l=t(46954),u=t(42507),d=t(40184),p=t(28726),m=t(76223),f=t(68420),h=t(96266),y={meta:o().object.isRequired,onCancel:o().func.isRequired},x=(0,r.Z)((function(){return{dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}}));function Z(e){var n=e.action,t=e.onSelect,r=e.onNext,i=x(),o=(0,f.PE)().t,y=[{action:"purchase",title:o("store.purchase.purchase.title"),description:o("store.purchase.purchase.description")},{action:"verify",title:o("store.purchase.verify.title"),description:o("store.purchase.verify.description")}];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(a.Z,{className:i.tabPanel,children:y.map((function(e){return(0,h.jsxs)(c.ZP,{button:!0,selected:n===e.action,onClick:function(){return t(e.action)},children:[(0,h.jsx)(l.Z,{className:i.iconRoot,children:"purchase"===e.action?(0,h.jsx)(u.Z,{style:{color:"purchase"===n?m.Z.primary.main:"#AAA",fontSize:32}}):(0,h.jsx)(d.Z,{style:{color:"verify"===n?m.Z.primary.main:"#AAA",fontSize:32}})}),(0,h.jsx)(s.Z,{primary:e.title,secondary:e.description})]},e.action)}))}),r&&(0,h.jsx)(p.Z,{fullWidth:!0,disabled:!n,variant:"contained",color:"primary",style:{marginTop:16},onClick:r,children:o("common.next")})]})}Z.propTypes={action:o().oneOf(["both","purchase","verify"]).isRequired,onSelect:o().func.isRequired,onNext:o().func.isRequired}},50185:function(e,n,t){t.d(n,{Z:function(){return p}});var r=t(33028),i=t(59740),o=t(5057),a=t(55898),c=t.n(a),s=t(12937),l=t(68420),u=t(96266),d=["children"];function p(e){var n=e.children,t=(0,i.Z)(e,d),a=(0,o.useContext)(l.RD).t;return(0,u.jsx)(s.Z,(0,r.Z)((0,r.Z)({tip:a("common.copyTip"),copiedTip:a("common.copiedTip")},t),{},{children:n}))}p.propTypes={children:c().any.isRequired}},71363:function(e,n,t){t.d(n,{Z:function(){return m}});var r=t(33028),i=t(55898),o=t.n(i),a=t(11750),c=t(47020),s=t(93938),l=t(68420),u=t(50185),d=t(70461),p=t(96266);function m(e){var n=e.title,t=e.description,i=e.confirmPlaceholder,o=e.cancel,m=e.confirm,f=e.params,h=e.onCancel,y=e.onConfirm,x=e.keyName,Z=(0,l.PE)().t,v={title:function(){return(0,p.jsxs)("div",{children:[n," (".concat(x,")")]})},description:function(e,n){return(0,p.jsxs)("div",{children:[(0,p.jsx)(s.Z,{severity:"warning",style:{width:"100%"},children:Z("common.notice")}),(0,p.jsx)("div",{style:{marginTop:24,marginBottom:24},dangerouslySetInnerHTML:{__html:t}}),(0,p.jsxs)("div",{style:{marginBottom:24},children:[Z("common.click"),"\uff1a",(0,p.jsx)(u.Z,{"data-cy":"click-copy",children:x})]}),(0,p.jsx)(a.Z,{component:"div",children:(0,p.jsx)(c.Z,{label:i,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:e.inputVal,onChange:function(t){var i;i=(0,r.Z)((0,r.Z)({},e),{},{inputVal:t.target.value,__disableConfirm:x!==t.target.value}),n((0,r.Z)((0,r.Z)({},i),{},{__disableConfirm:i.__disableConfirm}))}})})]})},confirm:m,cancel:o,onConfirm:y,onCancel:h,params:(0,r.Z)({inputVal:"",__disableConfirm:!0},f)};return(0,p.jsx)(d.Z,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})}m.propTypes={title:o().any.isRequired,keyName:o().any.isRequired,description:o().any.isRequired,confirmPlaceholder:o().any.isRequired,cancel:o().string,confirm:o().string,params:o().object,onCancel:o().func,onConfirm:o().func.isRequired},m.defaultProps={onCancel:function(){},cancel:"",confirm:"Confirm",params:{}}},22714:function(e,n,t){t.d(n,{Z:function(){return R}});var r=t(32723),i=t(34795),o=t(96234),a=t(5057),c=t(55898),s=t.n(c),l=t(92877),u=t(44846),d=t(13128),p=t(55372),m=t(11750),f=t(47020),h=t(2478),y=t(44919),x=t(68420),Z=t(28726),v=t(88574),g=t(58238),b=t(14491),j=t(96266),C=(0,l.Z)((function(e){return{addMenuItemRoot:{justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}}}));function R(e){var n=e.disabled,t=e.storeList,c=e.teamDid,s=e.onAdd,l=(0,g.h6)().api,R=(0,a.useState)(!1),k=(0,o.Z)(R,2),P=k[0],w=k[1],D=(0,a.useState)(!0),q=(0,o.Z)(D,2),S=q[0],N=q[1],T=(0,a.useState)(!1),_=(0,o.Z)(T,2),A=_[0],E=_[1],W=(0,a.useState)(""),F=(0,o.Z)(W,2),B=F[0],z=F[1],L=(0,a.useState)(""),H=(0,o.Z)(L,2),I=H[0],M=H[1],U=(0,x.PE)().t,V=C(),K=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var n,i,o,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(w(!0),e.prev=1,n=(0,b.bQ)(B,t),i=n.isNew,o=n.decoded,i){e.next=5;break}throw new Error(U("store.blockletRegistry.haveSameRegistry"));case 5:return e.next=7,l.addBlockletStore({input:{teamDid:c,url:o}});case 7:s(o),E(!1),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),a="".concat(U("store.blockletRegistry.addFailed")," ").concat((0,b.Z)(e.t0)),M(a);case 15:return e.prev=15,w(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,11,15,18]])})));return function(){return e.apply(this,arguments)}}();return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(h.ZP,{button:!0,disabled:n,className:V.addMenuItemRoot,onClick:function(){E(!0)},children:[(0,j.jsx)(y.Z,{font:!0}),(0,j.jsx)(m.Z,{variant:"inherit",children:U("store.blockletRegistry.addRegistry")})]}),(0,j.jsxs)(d.ZP,{title:U("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:A,onClose:function(){return E(!1)},PaperProps:{style:{minHeight:"auto"}},actions:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Z.Z,{onClick:function(e){e.stopPropagation(),E(!1)},color:"inherit",children:U("common.cancel")}),(0,j.jsxs)(Z.Z,{onClick:function(e){e.stopPropagation(),K()},color:"primary","data-cy":"install-blocklet-next-step",disabled:P||!B||S,variant:"contained",autoFocus:!0,children:[P&&(0,j.jsx)(u.Z,{size:16}),U("common.confirm")]})]}),children:[(0,j.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,j.jsx)(p.Z,{component:"div",children:(0,j.jsx)(m.Z,{component:"div",children:(0,j.jsx)(f.Z,{label:U("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:B,onChange:function(e){M(null);var n=!1;e.target.value.trim()||(n=!0),e.target.value.trim()||M(U("store.blockletRegistry.registryUrlEmpty")),z(e.target.value),N(n)},disabled:P,onKeyPress:function(e){"Enter"===e.key&&(e.preventDefault(),e.target.value.trim()?K():M(U("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!I&&(0,j.jsx)(v.Z,{type:"error",style:{width:"100%"},children:I})]})]})}R.propTypes={teamDid:s().string.isRequired,disabled:s().bool,storeList:s().array,onAdd:s().func},R.defaultProps={disabled:!1,storeList:[],onAdd:function(){}}},45170:function(e,n,t){t.d(n,{Z:function(){return R}});var r=t(92877),i=t(11750),o=t(83580),a=t(94552),c=t(67680),s=t(55898),l=t.n(s),u=t(32723),d=t(34795),p=t(96234),m=t(5057),f=t(96366),h=t(68420),y=t(47595),x=t(86229),Z=t(58238),v=t(71363),g=t(14491),b=t(96266);function j(e){var n=e.store,t=e.teamDid,r=e.onDelete,i=(0,Z.h6)().api,o=(0,h.PE)().t,a=(0,m.useState)(!1),s=(0,p.Z)(a,2),l=s[0],j=s[1],C=(0,m.useState)(null),R=(0,p.Z)(C,2),k=R[0],P=R[1],w=(0,f.Z)(),D=function(){var e=(0,d.Z)((0,u.Z)().mark((function e(){return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,j(!0),e.next=4,i.deleteBlockletStore({input:{teamDid:t,url:n.url}});case 4:r&&"function"===typeof r&&r(),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),x.Z.error("Remove Blocklet Store Error: ".concat((0,g.Z)(e.t0)));case 10:return e.prev=10,j(!1),P(null),e.finish(10);case 14:case"end":return e.stop()}}),e,null,[[0,7,10,14]])})));return function(){return e.apply(this,arguments)}}(),q={keyName:n.url,title:o("store.blockletRegistry.deleteRegistry"),description:o("store.blockletRegistry.deleteDesc",{name:"<b>".concat(n.url,"</b>"),color:w.palette.error.main}),confirmPlaceholder:o("store.blockletRegistry.confirmDesc",{name:n.url}),confirm:o("common.delConfirm"),cancel:o("common.cancel"),onConfirm:D,onCancel:function(){j(!1),P(null)}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(c.Z,{disabled:l,onClick:function(e){e.stopPropagation(),P(q)},size:"large",children:(0,b.jsx)(y.default,{})}),k&&(0,b.jsx)(v.Z,{keyName:k.keyName,title:k.title,description:k.description,confirmPlaceholder:k.confirmPlaceholder,confirm:k.confirm,cancel:k.cancel,params:k.params,onConfirm:k.onConfirm,onCancel:k.onCancel})]})}j.propTypes={teamDid:l().string.isRequired,store:l().object.isRequired,onDelete:l().func},j.defaultProps={onDelete:function(){}};var C=(0,r.Z)((function(){return{buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},menuName:{display:"flex",flexDirection:"column",marginRight:"100px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}}));function R(e){var n=e.teamDid,t=e.store,r=e.onDelete,s=C();return(0,b.jsxs)("div",{className:s.menuName,children:[(0,b.jsx)(i.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:t.name}),(0,b.jsx)(i.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(t.url)}),(0,b.jsxs)(o.Z,{children:[(0,b.jsx)(c.Z,{onClick:function(e){e.stopPropagation(),window.open(t.url)},size:"large",children:(0,b.jsx)(a.Z,{})}),!t.protected&&(0,b.jsx)(j,{store:t,onDelete:r,teamDid:n})]})]})}R.propTypes={teamDid:l().string.isRequired,store:l().shape({name:l().string.isRequired,url:l().string.isRequired,protected:l().bool}).isRequired,onDelete:l().func},R.defaultProps={onDelete:function(){}}},5952:function(e,n,t){t.d(n,{K:function(){return r},W:function(){return i}});var r="blocklet-add-component-registry",i="server-add-registry"}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[2452],{50482:function(e,r,t){var n=t(23800);e.exports=function(e,r){return n(e,r)}},95550:function(e,r,t){"use strict";t.d(r,{Qr:function(){return K},cI:function(){return Me}});var n=t(32723),a=t(34795),u=t(68079),i=t(41361),s=t(56666),o=t(33028),f=t(96234),l=t(59740),c=t(5057),d=["name"],v=["_f"],m=["_f"],y=function(e){return"checkbox"===e.type},h=function(e){return e instanceof Date},p=function(e){return null==e},b=function(e){return"object"===typeof e},g=function(e){return!p(e)&&!Array.isArray(e)&&b(e)&&!h(e)},x=function(e){return g(e)&&e.target?y(e.target)?e.target.checked:e.target.value:e},Z=function(e,r){return e.has(function(e){return e.substring(0,e.search(/\.\d+(\.|$)/))||e}(r))},k=function(e){var r=e.constructor&&e.constructor.prototype;return g(r)&&r.hasOwnProperty("isPrototypeOf")},_="undefined"!==typeof window&&"undefined"!==typeof window.HTMLElement&&"undefined"!==typeof document;function V(e){var r,t=Array.isArray(e);if(e instanceof Date)r=new Date(e);else if(e instanceof Set)r=new Set(e);else{if(_&&(e instanceof Blob||e instanceof FileList)||!t&&!g(e))return e;if(r=t?[]:{},Array.isArray(e)||k(e))for(var n in e)r[n]=V(e[n]);else r=e}return r}var A=function(e){return Array.isArray(e)?e.filter(Boolean):[]},S=function(e){return void 0===e},w=function(e,r,t){if(!r||!g(e))return t;var n=A(r.split(/[,[\].]+?/)).reduce((function(e,r){return p(e)?e:e[r]}),e);return S(n)||n===e?S(e[r])?t:e[r]:n},F={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},D={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},C="max",O="min",E="maxLength",U="minLength",T="pattern",j="required",L="validate",B=c.createContext(null),N=function(){return c.useContext(B)},M=function(e,r,t){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a={defaultValues:r._defaultValues},u=function(u){Object.defineProperty(a,u,{get:function(){var a=u;return r._proxyFormState[a]!==D.all&&(r._proxyFormState[a]=!n||D.all),t&&(t[a]=!0),e[a]}})};for(var i in e)u(i);return a},R=function(e){return g(e)&&!Object.keys(e).length},q=function(e,r,t,n){t(e);e.name;var a=(0,l.Z)(e,d);return R(a)||Object.keys(a).length>=Object.keys(r).length||Object.keys(a).find((function(e){return r[e]===(!n||D.all)}))},H=function(e){return Array.isArray(e)?e:[e]},P=function(e,r,t){return t&&r?e===r:!e||!r||e===r||H(e).some((function(e){return e&&(e.startsWith(r)||r.startsWith(e))}))};function W(e){var r=c.useRef(e);r.current=e,c.useEffect((function(){var t=!e.disabled&&r.current.subject&&r.current.subject.subscribe({next:r.current.next});return function(){t&&t.unsubscribe()}}),[e.disabled])}var I=function(e){return"string"===typeof e},G=function(e,r,t,n,a){return I(e)?(n&&r.watch.add(e),w(t,e,a)):Array.isArray(e)?e.map((function(e){return n&&r.watch.add(e),w(t,e)})):(n&&(r.watchAll=!0),t)};var $=function(e){return/^\w*$/.test(e)},Q=function(e){return A(e.replace(/["|']|\]/g,"").split(/\.|\[/))};function z(e,r,t){for(var n=-1,a=$(r)?[r]:Q(r),u=a.length,i=u-1;++n<u;){var s=a[n],o=t;if(n!==i){var f=e[s];o=g(f)||Array.isArray(f)?f:isNaN(+a[n+1])?{}:[]}e[s]=o,e=e[s]}return e}function J(e){var r=N(),t=e.name,n=e.control,a=void 0===n?r.control:n,u=e.shouldUnregister,i=Z(a._names.array,t),s=function(e){var r=N(),t=e||{},n=t.control,a=void 0===n?r.control:n,u=t.name,i=t.defaultValue,s=t.disabled,o=t.exact,l=c.useRef(u);l.current=u,W({disabled:s,subject:a._subjects.values,next:function(e){P(l.current,e.name,o)&&y(V(G(l.current,a._names,e.values||a._formValues,!1,i)))}});var d=c.useState(a._getWatch(u,i)),v=(0,f.Z)(d,2),m=v[0],y=v[1];return c.useEffect((function(){return a._removeUnmounted()})),m}({control:a,name:t,defaultValue:w(a._formValues,t,w(a._defaultValues,t,e.defaultValue)),exact:!0}),l=function(e){var r=N(),t=e||{},n=t.control,a=void 0===n?r.control:n,u=t.disabled,i=t.name,s=t.exact,l=c.useState(a._formState),d=(0,f.Z)(l,2),v=d[0],m=d[1],y=c.useRef(!0),h=c.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),p=c.useRef(i);return p.current=i,W({disabled:u,next:function(e){return y.current&&P(p.current,e.name,s)&&q(e,h.current,a._updateFormState)&&m((0,o.Z)((0,o.Z)({},a._formState),e))},subject:a._subjects.state}),c.useEffect((function(){return y.current=!0,h.current.isValid&&a._updateValid(!0),function(){y.current=!1}}),[a]),M(v,a,h.current,!1)}({control:a,name:t}),d=c.useRef(a.register(t,(0,o.Z)((0,o.Z)({},e.rules),{},{value:s})));return c.useEffect((function(){var e=a._options.shouldUnregister||u,r=function(e,r){var t=w(a._fields,e);t&&(t._f.mount=r)};if(r(t,!0),e){var n=V(w(a._options.defaultValues,t));z(a._defaultValues,t,n),S(w(a._formValues,t))&&z(a._formValues,t,n)}return function(){(i?e&&!a._state.action:e)?a.unregister(t):r(t,!1)}}),[t,a,i,u]),{field:{name:t,value:s,onChange:c.useCallback((function(e){return d.current.onChange({target:{value:x(e),name:t},type:F.CHANGE})}),[t]),onBlur:c.useCallback((function(){return d.current.onBlur({target:{value:w(a._formValues,t),name:t},type:F.BLUR})}),[t,a]),ref:function(e){var r=w(a._fields,t);r&&e&&(r._f.ref={focus:function(){return e.focus()},select:function(){return e.select()},setCustomValidity:function(r){return e.setCustomValidity(r)},reportValidity:function(){return e.reportValidity()}})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:function(){return!!w(l.errors,t)}},isDirty:{enumerable:!0,get:function(){return!!w(l.dirtyFields,t)}},isTouched:{enumerable:!0,get:function(){return!!w(l.touchedFields,t)}},error:{enumerable:!0,get:function(){return w(l.errors,t)}}})}}var K=function(e){return e.render(J(e))},X=function(e,r,t,n,a){return r?(0,o.Z)((0,o.Z)({},t[e]),{},{types:(0,o.Z)((0,o.Z)({},t[e]&&t[e].types?t[e].types:{}),{},(0,s.Z)({},n,a||!0))}):{}},Y=function e(r,t,n){var a,u=(0,i.Z)(n||Object.keys(r));try{for(u.s();!(a=u.n()).done;){var s=a.value,o=w(r,s);if(o){var f=o._f,c=(0,l.Z)(o,v);if(f&&t(f.name)){if(f.ref.focus){f.ref.focus();break}if(f.refs&&f.refs[0].focus){f.refs[0].focus();break}}else g(c)&&e(c,t)}}}catch(d){u.e(d)}finally{u.f()}},ee=function(e){return{isOnSubmit:!e||e===D.onSubmit,isOnBlur:e===D.onBlur,isOnChange:e===D.onChange,isOnAll:e===D.all,isOnTouch:e===D.onTouched}},re=function(e,r,t){return!t&&(r.watchAll||r.watch.has(e)||(0,u.Z)(r.watch).some((function(r){return e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))})))},te=function(e,r,t){var n=A(w(e,t));return z(n,"root",r[t]),z(e,t,n),e},ne=function(e){return"boolean"===typeof e},ae=function(e){return"file"===e.type},ue=function(e){return"function"===typeof e},ie=function(e){if(!_)return!1;var r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},se=function(e){return I(e)},oe=function(e){return"radio"===e.type},fe=function(e){return e instanceof RegExp},le={value:!1,isValid:!1},ce={value:!0,isValid:!0},de=function(e){if(Array.isArray(e)){if(e.length>1){var r=e.filter((function(e){return e&&e.checked&&!e.disabled})).map((function(e){return e.value}));return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!S(e[0].attributes.value)?S(e[0].value)||""===e[0].value?ce:{value:e[0].value,isValid:!0}:ce:le}return le},ve={isValid:!1,value:null},me=function(e){return Array.isArray(e)?e.reduce((function(e,r){return r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e}),ve):ve};function ye(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"validate";if(se(e)||Array.isArray(e)&&e.every(se)||ne(e)&&!e)return{type:t,message:se(e)?e:"",ref:r}}var he=function(e){return g(e)&&!fe(e)?e:{value:e,message:""}},pe=function(){var e=(0,a.Z)((0,n.Z)().mark((function e(r,t,a,u,i){var s,f,l,c,d,v,m,h,b,x,Z,k,_,V,A,F,D,B,N,M,q,H,P,W,G,$,Q,z,J,K,Y,ee,re,te,le,ce,ve,pe,be,ge,xe,Ze,ke,_e,Ve,Ae,Se,we;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=r._f,f=s.ref,l=s.refs,c=s.required,d=s.maxLength,v=s.minLength,m=s.min,h=s.max,b=s.pattern,x=s.validate,Z=s.name,k=s.valueAsNumber,_=s.mount,V=s.disabled,A=w(t,Z),_&&!V){e.next=4;break}return e.abrupt("return",{});case 4:if(F=l?l[0]:f,D=function(e){u&&F.reportValidity&&(F.setCustomValidity(ne(e)?"":e||""),F.reportValidity())},B={},N=oe(f),M=y(f),q=N||M,H=(k||ae(f))&&S(f.value)&&S(A)||ie(f)&&""===f.value||""===A||Array.isArray(A)&&!A.length,P=X.bind(null,Z,a,B),W=function(e,r,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:E,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:U,u=e?r:t;B[Z]=(0,o.Z)({type:e?n:a,message:u,ref:f},P(e?n:a,u))},!(i?!Array.isArray(A)||!A.length:c&&(!q&&(H||p(A))||ne(A)&&!A||M&&!de(l).isValid||N&&!me(l).isValid))){e.next=20;break}if(G=se(c)?{value:!!c,message:c}:he(c),$=G.value,Q=G.message,!$){e.next=20;break}if(B[Z]=(0,o.Z)({type:j,message:Q,ref:F},P(j,Q)),a){e.next=20;break}return D(Q),e.abrupt("return",B);case 20:if(H||p(m)&&p(h)){e.next=29;break}if(K=he(h),Y=he(m),p(A)||isNaN(A)?(re=f.valueAsDate||new Date(A),te=function(e){return new Date((new Date).toDateString()+" "+e)},le="time"==f.type,ce="week"==f.type,I(K.value)&&A&&(z=le?te(A)>te(K.value):ce?A>K.value:re>new Date(K.value)),I(Y.value)&&A&&(J=le?te(A)<te(Y.value):ce?A<Y.value:re<new Date(Y.value))):(ee=f.valueAsNumber||(A?+A:A),p(K.value)||(z=ee>K.value),p(Y.value)||(J=ee<Y.value)),!z&&!J){e.next=29;break}if(W(!!z,K.message,Y.message,C,O),a){e.next=29;break}return D(B[Z].message),e.abrupt("return",B);case 29:if(!d&&!v||H||!(I(A)||i&&Array.isArray(A))){e.next=39;break}if(ve=he(d),pe=he(v),be=!p(ve.value)&&A.length>+ve.value,ge=!p(pe.value)&&A.length<+pe.value,!be&&!ge){e.next=39;break}if(W(be,ve.message,pe.message),a){e.next=39;break}return D(B[Z].message),e.abrupt("return",B);case 39:if(!b||H||!I(A)){e.next=46;break}if(xe=he(b),Ze=xe.value,ke=xe.message,!fe(Ze)||A.match(Ze)){e.next=46;break}if(B[Z]=(0,o.Z)({type:T,message:ke,ref:f},P(T,ke)),a){e.next=46;break}return D(ke),e.abrupt("return",B);case 46:if(!x){e.next=80;break}if(!ue(x)){e.next=59;break}return e.next=50,x(A,t);case 50:if(_e=e.sent,!(Ve=ye(_e,F))){e.next=57;break}if(B[Z]=(0,o.Z)((0,o.Z)({},Ve),P(L,Ve.message)),a){e.next=57;break}return D(Ve.message),e.abrupt("return",B);case 57:e.next=80;break;case 59:if(!g(x)){e.next=80;break}Ae={},e.t0=(0,n.Z)().keys(x);case 62:if((e.t1=e.t0()).done){e.next=76;break}if(Se=e.t1.value,R(Ae)||a){e.next=66;break}return e.abrupt("break",76);case 66:return e.t2=ye,e.next=69,x[Se](A,t);case 69:e.t3=e.sent,e.t4=F,e.t5=Se,(we=(0,e.t2)(e.t3,e.t4,e.t5))&&(Ae=(0,o.Z)((0,o.Z)({},we),P(Se,we.message)),D(we.message),a&&(B[Z]=Ae)),e.next=62;break;case 76:if(R(Ae)){e.next=80;break}if(B[Z]=(0,o.Z)({ref:F},Ae),a){e.next=80;break}return e.abrupt("return",B);case 80:return D(!0),e.abrupt("return",B);case 82:case"end":return e.stop()}}),e)})));return function(r,t,n,a,u){return e.apply(this,arguments)}}();function be(e,r){var t=Array.isArray(r)?r:$(r)?[r]:Q(r),n=1===t.length?e:function(e,r){for(var t=r.slice(0,-1).length,n=0;n<t;)e=S(e)?n++:e[r[n++]];return e}(e,t),a=t.length-1,u=t[a];return n&&delete n[u],0!==a&&(g(n)&&R(n)||Array.isArray(n)&&function(e){for(var r in e)if(!S(e[r]))return!1;return!0}(n))&&be(e,t.slice(0,-1)),e}function ge(){var e=[];return{get observers(){return e},next:function(r){var t,n=(0,i.Z)(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;a.next&&a.next(r)}}catch(u){n.e(u)}finally{n.f()}},subscribe:function(r){return e.push(r),{unsubscribe:function(){e=e.filter((function(e){return e!==r}))}}},unsubscribe:function(){e=[]}}}var xe=function(e){return p(e)||!b(e)};function Ze(e,r){if(xe(e)||xe(r))return e===r;if(h(e)&&h(r))return e.getTime()===r.getTime();var t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length)return!1;for(var a=0,u=t;a<u.length;a++){var i=u[a],s=e[i];if(!n.includes(i))return!1;if("ref"!==i){var o=r[i];if(h(s)&&h(o)||g(s)&&g(o)||Array.isArray(s)&&Array.isArray(o)?!Ze(s,o):s!==o)return!1}}return!0}var ke=function(e){return"select-multiple"===e.type},_e=function(e){return oe(e)||y(e)},Ve=function(e){return ie(e)&&e.isConnected},Ae=function(e){for(var r in e)if(ue(e[r]))return!0;return!1};function Se(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=Array.isArray(e);if(g(e)||t)for(var n in e)Array.isArray(e[n])||g(e[n])&&!Ae(e[n])?(r[n]=Array.isArray(e[n])?[]:{},Se(e[n],r[n])):p(e[n])||(r[n]=!0);return r}function we(e,r,t){var n=Array.isArray(e);if(g(e)||n)for(var a in e)Array.isArray(e[a])||g(e[a])&&!Ae(e[a])?S(r)||xe(t[a])?t[a]=Array.isArray(e[a])?Se(e[a],[]):(0,o.Z)({},Se(e[a])):we(e[a],p(r)?{}:r[a],t[a]):t[a]=!Ze(e[a],r[a]);return t}var Fe=function(e,r){return we(e,r,Se(r))},De=function(e,r){var t=r.valueAsNumber,n=r.valueAsDate,a=r.setValueAs;return S(e)?e:t?""===e?NaN:e?+e:e:n&&I(e)?new Date(e):a?a(e):e};function Ce(e){var r=e.ref;if(!(e.refs?e.refs.every((function(e){return e.disabled})):r.disabled))return ae(r)?r.files:oe(r)?me(e.refs).value:ke(r)?(0,u.Z)(r.selectedOptions).map((function(e){return e.value})):y(r)?de(e.refs).value:De(S(r.value)?e.ref.value:r.value,e)}var Oe=function(e,r,t,n){var a,s={},o=(0,i.Z)(e);try{for(o.s();!(a=o.n()).done;){var f=a.value,l=w(r,f);l&&z(s,f,l._f)}}catch(c){o.e(c)}finally{o.f()}return{criteriaMode:t,names:(0,u.Z)(e),fields:s,shouldUseNativeValidation:n}},Ee=function(e){return S(e)?e:fe(e)?e.source:g(e)?fe(e.value)?e.value.source:e.value:e},Ue=function(e){return e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate)};function Te(e,r,t){var n=w(e,t);if(n||$(t))return{error:n,name:t};for(var a=t.split(".");a.length;){var u=a.join("."),i=w(r,u),s=w(e,u);if(i&&!Array.isArray(i)&&t!==u)return{name:t};if(s&&s.type)return{name:u,error:s};a.pop()}return{name:t}}var je=function(e,r,t,n,a){return!a.isOnAll&&(!t&&a.isOnTouch?!(r||e):(t?n.isOnBlur:a.isOnBlur)?!e:!(t?n.isOnChange:a.isOnChange)||e)},Le=function(e,r){return!A(w(e,r)).length&&be(e,r)},Be={mode:D.onSubmit,reValidateMode:D.onChange,shouldFocusError:!0};function Ne(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,f=(0,o.Z)((0,o.Z)({},Be),r),c={submitCount:0,isDirty:!1,isLoading:ue(f.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},d={},v=(g(f.defaultValues)||g(f.values))&&V(f.defaultValues||f.values)||{},b=f.shouldUnregister?{}:V(v),k={action:!1,mount:!1,watch:!1},C={mount:new Set,unMount:new Set,array:new Set,watch:new Set},O=0,E={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},U={values:ge(),array:ge(),state:ge()},T=r.resetOptions&&r.resetOptions.keepDirtyValues,j=ee(f.mode),L=ee(f.reValidateMode),B=f.criteriaMode===D.all,N=function(){var e=(0,a.Z)((0,n.Z)().mark((function e(r){var t;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!E.isValid&&!r){e.next=14;break}if(!f.resolver){e.next=9;break}return e.t1=R,e.next=5,$();case 5:e.t2=e.sent.errors,e.t0=(0,e.t1)(e.t2),e.next=12;break;case 9:return e.next=11,J(d,!0);case 11:e.t0=e.sent;case 12:(t=e.t0)!==c.isValid&&U.state.next({isValid:t});case 14:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),M=function(e){return E.isValidating&&U.state.next({isValidating:e})},q=function(e,r,t,n){var a=w(d,e);if(a){var u=w(b,e,S(t)?w(v,e):t);S(u)||n&&n.defaultChecked||r?z(b,e,r?u:Ce(a._f)):se(e,u),k.mount&&N()}},P=function(e,r,t,n,a){var u=!1,i=!1,s={name:e};if(!t||n){E.isDirty&&(i=c.isDirty,c.isDirty=s.isDirty=K(),u=i!==s.isDirty);var o=Ze(w(v,e),r);i=w(c.dirtyFields,e),o?be(c.dirtyFields,e):z(c.dirtyFields,e,!0),s.dirtyFields=c.dirtyFields,u=u||E.dirtyFields&&i!==!o}if(t){var f=w(c.touchedFields,e);f||(z(c.touchedFields,e,t),s.touchedFields=c.touchedFields,u=u||E.touchedFields&&f!==t)}return u&&a&&U.state.next(s),u?s:{}},W=function(t,n,a,u){var i,s=w(c.errors,t),f=E.isValid&&ne(n)&&c.isValid!==n;if(r.delayError&&a?(i=function(){return function(e,r){z(c.errors,e,r),U.state.next({errors:c.errors})}(t,a)},(e=function(e){clearTimeout(O),O=setTimeout(i,e)})(r.delayError)):(clearTimeout(O),e=null,a?z(c.errors,t,a):be(c.errors,t)),(a?!Ze(s,a):s)||!R(u)||f){var l=(0,o.Z)((0,o.Z)((0,o.Z)({},u),f&&ne(n)?{isValid:n}:{}),{},{errors:c.errors,name:t});c=(0,o.Z)((0,o.Z)({},c),l),U.state.next(l)}M(!1)},$=function(){var e=(0,a.Z)((0,n.Z)().mark((function e(r){return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.resolver(b,f.context,Oe(r||C.mount,d,f.criteriaMode,f.shouldUseNativeValidation)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),Q=function(){var e=(0,a.Z)((0,n.Z)().mark((function e(r){var t,a,u,s,o,f;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$();case 2:if(t=e.sent,a=t.errors,r){u=(0,i.Z)(r);try{for(u.s();!(s=u.n()).done;)o=s.value,(f=w(a,o))?z(c.errors,o,f):be(c.errors,o)}catch(n){u.e(n)}finally{u.f()}}else c.errors=a;return e.abrupt("return",a);case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),J=function(){var e=(0,a.Z)((0,n.Z)().mark((function e(r,t){var a,u,i,s,o,d,v,y=arguments;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=y.length>2&&void 0!==y[2]?y[2]:{valid:!0},e.t0=(0,n.Z)().keys(r);case 2:if((e.t1=e.t0()).done){e.next=23;break}if(u=e.t1.value,!(i=r[u])){e.next=21;break}if(s=i._f,o=(0,l.Z)(i,m),!s){e.next=17;break}return d=C.array.has(s.name),e.next=11,pe(i,b,B,f.shouldUseNativeValidation&&!t,d);case 11:if(!(v=e.sent)[s.name]){e.next=16;break}if(a.valid=!1,!t){e.next=16;break}return e.abrupt("break",23);case 16:!t&&(w(v,s.name)?d?te(c.errors,v,s.name):z(c.errors,s.name,v[s.name]):be(c.errors,s.name));case 17:if(e.t2=o,!e.t2){e.next=21;break}return e.next=21,J(o,t,a);case 21:e.next=2;break;case 23:return e.abrupt("return",a.valid);case 24:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),K=function(e,r){return e&&r&&z(b,e,r),!Ze(de(),v)},X=function(e,r,t){return G(e,C,(0,o.Z)({},k.mount?b:S(r)?v:I(e)?(0,s.Z)({},e,r):r),t,r)},se=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=w(d,e),a=r;if(n){var i=n._f;i&&(!i.disabled&&z(b,e,De(r,i)),a=ie(i.ref)&&p(r)?"":r,ke(i.ref)?(0,u.Z)(i.ref.options).forEach((function(e){return e.selected=a.includes(e.value)})):i.refs?y(i.ref)?i.refs.length>1?i.refs.forEach((function(e){return(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(a)?!!a.find((function(r){return r===e.value})):a===e.value)})):i.refs[0]&&(i.refs[0].checked=!!a):i.refs.forEach((function(e){return e.checked=e.value===a})):ae(i.ref)?i.ref.value="":(i.ref.value=a,i.ref.type||U.values.next({name:e,values:(0,o.Z)({},b)})))}(t.shouldDirty||t.shouldTouch)&&P(e,a,t.shouldTouch,t.shouldDirty,!0),t.shouldValidate&&ce(e)},oe=function e(r,t,n){for(var a in t){var u=t[a],i="".concat(r,".").concat(a),s=w(d,i);!C.array.has(r)&&xe(u)&&(!s||s._f)||h(u)?se(i,u,n):e(i,u,n)}},fe=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=w(d,e),u=C.array.has(e),i=V(r);z(b,e,i),u?(U.array.next({name:e,values:(0,o.Z)({},b)}),(E.isDirty||E.dirtyFields)&&n.shouldDirty&&U.state.next({name:e,dirtyFields:Fe(v,b),isDirty:K(e,i)})):!a||a._f||p(i)?se(e,i,n):oe(e,i,n),re(e,C)&&U.state.next((0,o.Z)({},c)),U.values.next({name:e,values:(0,o.Z)({},b)}),!k.mount&&t()},le=function(){var r=(0,a.Z)((0,n.Z)().mark((function r(t){var a,u,i,s,l,v,m,y,h,p,g,Z,k,_,V,A,S;return(0,n.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=t.target,u=a.name,i=!0,s=w(d,u),l=function(){return a.type?Ce(s._f):x(t)},!s){r.next=47;break}if(y=l(),h=t.type===F.BLUR||t.type===F.FOCUS_OUT,p=!Ue(s._f)&&!f.resolver&&!w(c.errors,u)&&!s._f.deps||je(h,w(c.touchedFields,u),c.isSubmitted,L,j),g=re(u,C,h),z(b,u,y),h?(s._f.onBlur&&s._f.onBlur(t),e&&e(0)):s._f.onChange&&s._f.onChange(t),Z=P(u,y,h,!1),k=!R(Z)||g,!h&&U.values.next({name:u,type:t.type,values:(0,o.Z)({},b)}),!p){r.next=18;break}return E.isValid&&N(),r.abrupt("return",k&&U.state.next((0,o.Z)({name:u},g?{}:Z)));case 18:if(!h&&g&&U.state.next((0,o.Z)({},c)),M(!0),!f.resolver){r.next=32;break}return r.next=23,$([u]);case 23:_=r.sent,V=_.errors,A=Te(c.errors,d,u),S=Te(V,d,A.name||u),v=S.error,u=S.name,m=R(V),r.next=46;break;case 32:return r.next=34,pe(s,b,B,f.shouldUseNativeValidation);case 34:if(r.t0=u,v=r.sent[r.t0],!(i=isNaN(y)||y===w(b,u,y))){r.next=46;break}if(!v){r.next=42;break}m=!1,r.next=46;break;case 42:if(!E.isValid){r.next=46;break}return r.next=45,J(d,!0);case 45:m=r.sent;case 46:i&&(s._f.deps&&ce(s._f.deps),W(u,m,v,Z));case 47:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}(),ce=function(){var e=(0,a.Z)((0,n.Z)().mark((function e(r){var t,u,i,l,v,m=arguments;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=m.length>1&&void 0!==m[1]?m[1]:{},l=H(r),M(!0),!f.resolver){e.next=11;break}return e.next=6,Q(S(r)?r:l);case 6:v=e.sent,u=R(v),i=r?!l.some((function(e){return w(v,e)})):u,e.next=21;break;case 11:if(!r){e.next=18;break}return e.next=14,Promise.all(l.map(function(){var e=(0,a.Z)((0,n.Z)().mark((function e(r){var t;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=w(d,r),e.next=3,J(t&&t._f?(0,s.Z)({},r,t):t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()));case 14:((i=e.sent.every(Boolean))||c.isValid)&&N(),e.next=21;break;case 18:return e.next=20,J(d);case 20:i=u=e.sent;case 21:return U.state.next((0,o.Z)((0,o.Z)((0,o.Z)({},!I(r)||E.isValid&&u!==c.isValid?{}:{name:r}),f.resolver||!r?{isValid:u}:{}),{},{errors:c.errors,isValidating:!1})),t.shouldFocus&&!i&&Y(d,(function(e){return e&&w(c.errors,e)}),r?l:C.mount),e.abrupt("return",i);case 24:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),de=function(e){var r=(0,o.Z)((0,o.Z)({},v),k.mount?b:{});return S(e)?r:I(e)?w(r,e):e.map((function(e){return w(r,e)}))},ve=function(e,r){return{invalid:!!w((r||c).errors,e),isDirty:!!w((r||c).dirtyFields,e),isTouched:!!w((r||c).touchedFields,e),error:w((r||c).errors,e)}},me=function(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,i.Z)(e?H(e):C.mount);try{for(n.s();!(r=n.n()).done;){var a=r.value;C.mount.delete(a),C.array.delete(a),t.keepValue||(be(d,a),be(b,a)),!t.keepError&&be(c.errors,a),!t.keepDirty&&be(c.dirtyFields,a),!t.keepTouched&&be(c.touchedFields,a),!f.shouldUnregister&&!t.keepDefaultValue&&be(v,a)}}catch(u){n.e(u)}finally{n.f()}U.values.next({values:(0,o.Z)({},b)}),U.state.next((0,o.Z)((0,o.Z)({},c),t.keepDirty?{isDirty:K()}:{})),!t.keepIsValid&&N()},ye=function e(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=w(d,r),a=ne(t.disabled);return z(d,r,(0,o.Z)((0,o.Z)({},n||{}),{},{_f:(0,o.Z)((0,o.Z)({},n&&n._f?n._f:{ref:{name:r}}),{},{name:r,mount:!0},t)})),C.mount.add(r),n?a&&z(b,r,t.disabled?void 0:w(b,r,Ce(n._f))):q(r,!0,t.value),(0,o.Z)((0,o.Z)((0,o.Z)({},a?{disabled:t.disabled}:{}),f.shouldUseNativeValidation?{required:!!t.required,min:Ee(t.min),max:Ee(t.max),minLength:Ee(t.minLength),maxLength:Ee(t.maxLength),pattern:Ee(t.pattern)}:{}),{},{name:r,onChange:le,onBlur:le,ref:function(e){function r(r){return e.apply(this,arguments)}return r.toString=function(){return e.toString()},r}((function(a){if(a){e(r,t),n=w(d,r);var i=S(a.value)&&a.querySelectorAll&&a.querySelectorAll("input,select,textarea")[0]||a,s=_e(i),l=n._f.refs||[];if(s?l.find((function(e){return e===i})):i===n._f.ref)return;z(d,r,{_f:(0,o.Z)((0,o.Z)({},n._f),s?{refs:[].concat((0,u.Z)(l.filter(Ve)),[i],(0,u.Z)(Array.isArray(w(v,r))?[{}]:[])),ref:{type:i.type,name:r}}:{ref:i})}),q(r,!1,void 0,i)}else(n=w(d,r,{}))._f&&(n._f.mount=!1),(f.shouldUnregister||t.shouldUnregister)&&(!Z(C.array,r)||!k.action)&&C.unMount.add(r)}))})},he=function(){return f.shouldFocusError&&Y(d,(function(e){return e&&w(c.errors,e)}),C.mount)},Ae=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=e||v,u=V(a),s=e&&!R(e)?u:v;if(n.keepDefaultValues||(v=a),!n.keepValues){if(n.keepDirtyValues||T){var f,l=(0,i.Z)(C.mount);try{for(l.s();!(f=l.n()).done;){var m=f.value;w(c.dirtyFields,m)?z(s,m,w(b,m)):fe(m,w(s,m))}}catch(A){l.e(A)}finally{l.f()}}else{if(_&&S(e)){var y,h=(0,i.Z)(C.mount);try{for(h.s();!(y=h.n()).done;){var p=y.value,g=w(d,p);if(g&&g._f){var x=Array.isArray(g._f.refs)?g._f.refs[0]:g._f.ref;if(ie(x)){var Z=x.closest("form");if(Z){Z.reset();break}}}}}catch(A){h.e(A)}finally{h.f()}}d={}}b=r.shouldUnregister?n.keepDefaultValues?V(v):{}:u,U.array.next({values:(0,o.Z)({},s)}),U.values.next({values:(0,o.Z)({},s)})}C={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!k.mount&&t(),k.mount=!E.isValid||!!n.keepIsValid,k.watch=!!r.shouldUnregister,U.state.next({submitCount:n.keepSubmitCount?c.submitCount:0,isDirty:n.keepDirty?c.isDirty:!(!n.keepDefaultValues||Ze(e,v)),isSubmitted:!!n.keepIsSubmitted&&c.isSubmitted,dirtyFields:n.keepDirtyValues?c.dirtyFields:n.keepDefaultValues&&e?Fe(v,e):{},touchedFields:n.keepTouched?c.touchedFields:{},errors:n.keepErrors?c.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},Se=function(e,r){return Ae(ue(e)?e(b):e,r)};return{control:{register:ye,unregister:me,getFieldState:ve,_executeSchema:$,_getWatch:X,_getDirty:K,_updateValid:N,_removeUnmounted:function(){var e,r=(0,i.Z)(C.unMount);try{for(r.s();!(e=r.n()).done;){var t=e.value,n=w(d,t);n&&(n._f.refs?n._f.refs.every((function(e){return!Ve(e)})):!Ve(n._f.ref))&&me(t)}}catch(a){r.e(a)}finally{r.f()}C.unMount=new Set},_updateFieldArray:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],u=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(n&&t){if(k.action=!0,u&&Array.isArray(w(d,e))){var i=t(w(d,e),n.argA,n.argB);a&&z(d,e,i)}if(u&&Array.isArray(w(c.errors,e))){var s=t(w(c.errors,e),n.argA,n.argB);a&&z(c.errors,e,s),Le(c.errors,e)}if(E.touchedFields&&u&&Array.isArray(w(c.touchedFields,e))){var o=t(w(c.touchedFields,e),n.argA,n.argB);a&&z(c.touchedFields,e,o)}E.dirtyFields&&(c.dirtyFields=Fe(v,b)),U.state.next({name:e,isDirty:K(e,r),dirtyFields:c.dirtyFields,errors:c.errors,isValid:c.isValid})}else z(b,e,r)},_getFieldArray:function(e){return A(w(k.mount?b:v,e,r.shouldUnregister?w(v,e,[]):[]))},_reset:Ae,_resetDefaultValues:function(){return ue(f.defaultValues)&&f.defaultValues().then((function(e){Se(e,f.resetOptions),U.state.next({isLoading:!1})}))},_updateFormState:function(e){c=(0,o.Z)((0,o.Z)({},c),e)},_subjects:U,_proxyFormState:E,get _fields(){return d},get _formValues(){return b},get _state(){return k},set _state(e){k=e},get _defaultValues(){return v},get _names(){return C},set _names(e){C=e},get _formState(){return c},set _formState(e){c=e},get _options(){return f},set _options(e){f=(0,o.Z)((0,o.Z)({},f),e)}},trigger:ce,register:ye,handleSubmit:function(e,r){return function(){var t=(0,a.Z)((0,n.Z)().mark((function t(a){var u,i,s,l;return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist()),u=V(b),U.state.next({isSubmitting:!0}),!f.resolver){t.next=13;break}return t.next=6,$();case 6:i=t.sent,s=i.errors,l=i.values,c.errors=s,u=l,t.next=15;break;case 13:return t.next=15,J(d);case 15:if(be(c.errors,"root"),!R(c.errors)){t.next=22;break}return U.state.next({errors:{}}),t.next=20,e(u,a);case 20:t.next=27;break;case 22:if(!r){t.next=25;break}return t.next=25,r((0,o.Z)({},c.errors),a);case 25:he(),setTimeout(he);case 27:U.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:R(c.errors),submitCount:c.submitCount+1,errors:c.errors});case 28:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},watch:function(e,r){return ue(e)?U.values.subscribe({next:function(t){return e(X(void 0,r),t)}}):X(e,r,!0)},setValue:fe,getValues:de,reset:Se,resetField:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(d,e)&&(S(r.defaultValue)?fe(e,w(v,e)):(fe(e,r.defaultValue),z(v,e,r.defaultValue)),r.keepTouched||be(c.touchedFields,e),r.keepDirty||(be(c.dirtyFields,e),c.isDirty=r.defaultValue?K(e,w(v,e)):K()),r.keepError||(be(c.errors,e),E.isValid&&N()),U.state.next((0,o.Z)({},c)))},clearErrors:function(e){e&&H(e).forEach((function(e){return be(c.errors,e)})),U.state.next({errors:e?c.errors:{}})},unregister:me,setError:function(e,r,t){var n=(w(d,e,{_f:{}})._f||{}).ref;z(c.errors,e,(0,o.Z)((0,o.Z)({},r),{},{ref:n})),U.state.next({name:e,errors:c.errors,isValid:!1}),t&&t.shouldFocus&&n&&n.focus&&n.focus()},setFocus:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=w(d,e),n=t&&t._f;if(n){var a=n.refs?n.refs[0]:n.ref;a.focus&&(a.focus(),r.shouldSelect&&a.select())}},getFieldState:ve}}function Me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=c.useRef(),t=c.useState({isDirty:!1,isValidating:!1,isLoading:ue(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:ue(e.defaultValues)?void 0:e.defaultValues}),n=(0,f.Z)(t,2),a=n[0],u=n[1];r.current||(r.current=(0,o.Z)((0,o.Z)({},Ne(e,(function(){return u((function(e){return(0,o.Z)({},e)}))}))),{},{formState:a}));var i=r.current.control;return i._options=e,W({subject:i._subjects.state,next:function(e){q(e,i._proxyFormState,i._updateFormState,!0)&&u((0,o.Z)({},i._formState))}}),c.useEffect((function(){e.values&&!Ze(e.values,i._defaultValues)?i._reset(e.values,i._options.resetOptions):i._resetDefaultValues()}),[e.values,i]),c.useEffect((function(){i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next((0,o.Z)({},i._formState))),i._removeUnmounted()})),r.current.formState=M(a,i),r.current}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[2529],{76667:function(t,o,e){var r=e(71600);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var n=r(e(56930)),a=e(96266),i=(0,n.default)((0,a.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Edit");o.default=i},99065:function(t,o,e){var r=e(71600);o.Z=void 0;var n=r(e(56930)),a=e(96266),i=(0,n.default)((0,a.jsx)("path",{d:"M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}),"VpnKey");o.Z=i},49127:function(t,o,e){e.d(o,{Z:function(){return x}});var r=e(56666),n=e(31461),a=e(7896),i=e(5057),d=e(9978),l=e(91213),u=e(66685);var c=e(6285),s=e(62773),v=e(42908),p=e(31821),f=e(18561);function g(t){return(0,f.Z)("MuiButtonGroup",t)}var b=(0,p.Z)("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","vertical","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]),h=e(17681),m=e(27258),Z=e(96266),B=["children","className","color","component","disabled","disableElevation","disableFocusRipple","disableRipple","fullWidth","orientation","size","variant"],R=(0,s.ZP)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:function(t,o){var e=t.ownerState;return[(0,r.Z)({},"& .".concat(b.grouped),o.grouped),(0,r.Z)({},"& .".concat(b.grouped),o["grouped".concat((0,c.Z)(e.orientation))]),(0,r.Z)({},"& .".concat(b.grouped),o["grouped".concat((0,c.Z)(e.variant))]),(0,r.Z)({},"& .".concat(b.grouped),o["grouped".concat((0,c.Z)(e.variant)).concat((0,c.Z)(e.orientation))]),(0,r.Z)({},"& .".concat(b.grouped),o["grouped".concat((0,c.Z)(e.variant)).concat((0,c.Z)(e.color))]),(0,r.Z)({},"& .".concat(b.firstButton),o.firstButton),(0,r.Z)({},"& .".concat(b.lastButton),o.lastButton),(0,r.Z)({},"& .".concat(b.middleButton),o.middleButton),o.root,o[e.variant],!0===e.disableElevation&&o.disableElevation,e.fullWidth&&o.fullWidth,"vertical"===e.orientation&&o.vertical]}})((function(t){var o,e=t.theme,n=t.ownerState;return(0,a.Z)({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius},"contained"===n.variant&&{boxShadow:(e.vars||e).shadows[2]},n.disableElevation&&{boxShadow:"none"},n.fullWidth&&{width:"100%"},"vertical"===n.orientation&&{flexDirection:"column"},(o={},(0,r.Z)(o,"& .".concat(b.grouped),(0,a.Z)({minWidth:40,"&:hover":(0,a.Z)({},"contained"===n.variant&&{boxShadow:"none"})},"contained"===n.variant&&{boxShadow:"none"})),(0,r.Z)(o,"& .".concat(b.firstButton,",& .").concat(b.middleButton),(0,a.Z)({},"horizontal"===n.orientation&&{borderTopRightRadius:0,borderBottomRightRadius:0},"vertical"===n.orientation&&{borderBottomRightRadius:0,borderBottomLeftRadius:0},"text"===n.variant&&"horizontal"===n.orientation&&(0,r.Z)({borderRight:e.vars?"1px solid rgba(".concat(e.vars.palette.common.onBackgroundChannel," / 0.23)"):"1px solid ".concat("light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")},"&.".concat(b.disabled),{borderRight:"1px solid ".concat((e.vars||e).palette.action.disabled)}),"text"===n.variant&&"vertical"===n.orientation&&(0,r.Z)({borderBottom:e.vars?"1px solid rgba(".concat(e.vars.palette.common.onBackgroundChannel," / 0.23)"):"1px solid ".concat("light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")},"&.".concat(b.disabled),{borderBottom:"1px solid ".concat((e.vars||e).palette.action.disabled)}),"text"===n.variant&&"inherit"!==n.color&&{borderColor:e.vars?"rgba(".concat(e.vars.palette[n.color].mainChannel," / 0.5)"):(0,u.Fq)(e.palette[n.color].main,.5)},"outlined"===n.variant&&"horizontal"===n.orientation&&{borderRightColor:"transparent"},"outlined"===n.variant&&"vertical"===n.orientation&&{borderBottomColor:"transparent"},"contained"===n.variant&&"horizontal"===n.orientation&&(0,r.Z)({borderRight:"1px solid ".concat((e.vars||e).palette.grey[400])},"&.".concat(b.disabled),{borderRight:"1px solid ".concat((e.vars||e).palette.action.disabled)}),"contained"===n.variant&&"vertical"===n.orientation&&(0,r.Z)({borderBottom:"1px solid ".concat((e.vars||e).palette.grey[400])},"&.".concat(b.disabled),{borderBottom:"1px solid ".concat((e.vars||e).palette.action.disabled)}),"contained"===n.variant&&"inherit"!==n.color&&{borderColor:(e.vars||e).palette[n.color].dark},{"&:hover":(0,a.Z)({},"outlined"===n.variant&&"horizontal"===n.orientation&&{borderRightColor:"currentColor"},"outlined"===n.variant&&"vertical"===n.orientation&&{borderBottomColor:"currentColor"})})),(0,r.Z)(o,"& .".concat(b.lastButton,",& .").concat(b.middleButton),(0,a.Z)({},"horizontal"===n.orientation&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},"vertical"===n.orientation&&{borderTopRightRadius:0,borderTopLeftRadius:0},"outlined"===n.variant&&"horizontal"===n.orientation&&{marginLeft:-1},"outlined"===n.variant&&"vertical"===n.orientation&&{marginTop:-1})),o))})),x=i.forwardRef((function(t,o){var e=(0,v.Z)({props:t,name:"MuiButtonGroup"}),r=e.children,u=e.className,s=e.color,p=void 0===s?"primary":s,f=e.component,b=void 0===f?"div":f,x=e.disabled,C=void 0!==x&&x,z=e.disableElevation,_=void 0!==z&&z,w=e.disableFocusRipple,y=void 0!==w&&w,S=e.disableRipple,E=void 0!==S&&S,M=e.fullWidth,T=void 0!==M&&M,W=e.orientation,k=void 0===W?"horizontal":W,j=e.size,L=void 0===j?"medium":j,N=e.variant,P=void 0===N?"outlined":N,V=(0,n.Z)(e,B),D=(0,a.Z)({},e,{color:p,component:b,disabled:C,disableElevation:_,disableFocusRipple:y,disableRipple:E,fullWidth:T,orientation:k,size:L,variant:P}),H=function(t){var o=t.classes,e=t.color,r=t.disabled,n=t.disableElevation,a=t.fullWidth,i=t.orientation,d=t.variant,u={root:["root",d,"vertical"===i&&"vertical",a&&"fullWidth",n&&"disableElevation"],grouped:["grouped","grouped".concat((0,c.Z)(i)),"grouped".concat((0,c.Z)(d)),"grouped".concat((0,c.Z)(d)).concat((0,c.Z)(i)),"grouped".concat((0,c.Z)(d)).concat((0,c.Z)(e)),r&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,l.Z)(u,g,o)}(D),O=i.useMemo((function(){return{className:H.grouped,color:p,disabled:C,disableElevation:_,disableFocusRipple:y,disableRipple:E,fullWidth:T,size:L,variant:P}}),[p,C,_,y,E,T,L,P,H.grouped]),F=function(t){return i.Children.toArray(t).filter((function(t){return i.isValidElement(t)}))}(r),$=F.length,G=function(t){var o=0===t,e=t===$-1;return o&&e?"":o?H.firstButton:e?H.lastButton:H.middleButton};return(0,Z.jsx)(R,(0,a.Z)({as:b,role:"group",className:(0,d.Z)(H.root,u),ref:o,ownerState:D},V,{children:(0,Z.jsx)(h.Z.Provider,{value:O,children:F.map((function(t,o){return(0,Z.jsx)(m.Z.Provider,{value:G(o),children:t},o)}))})}))}))},81256:function(t,o,e){e.d(o,{Z:function(){return i}});var r=e(27812),n=e(5057);function a(t,o,e){void 0===o&&(o=[]),void 0===e&&(e={loading:!1});var a=(0,n.useRef)(0),i=function(){var t=(0,n.useRef)(!1),o=(0,n.useCallback)((function(){return t.current}),[]);return(0,n.useEffect)((function(){return t.current=!0,function(){t.current=!1}}),[]),o}(),d=(0,n.useState)(e),l=d[0],u=d[1],c=(0,n.useCallback)((function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];var n=++a.current;return l.loading||u((function(t){return(0,r.__assign)((0,r.__assign)({},t),{loading:!0})})),t.apply(void 0,o).then((function(t){return i()&&n===a.current&&u({value:t,loading:!1}),t}),(function(t){return i()&&n===a.current&&u({error:t,loading:!1}),t}))}),o);return[l,c]}var i=function(t,o){void 0===o&&(o=[]);var e=(0,n.useState)(0),i=e[0],d=e[1],l=function(t,o){void 0===o&&(o=[]);var e=a(t,o,{loading:!0}),r=e[0],i=e[1];return(0,n.useEffect)((function(){i()}),[i]),r}(t,(0,r.__spreadArrays)(o,[i])),u=l.loading,c=(0,n.useCallback)((function(){u||d((function(t){return t+1}))}),(0,r.__spreadArrays)(o,[u]));return(0,r.__assign)((0,r.__assign)({},l),{retry:c})}},5609:function(t,o,e){e.d(o,{WU:function(){return u}});var r=["second","minute","hour","day","week","month","year"];var n=["\u79d2","\u5206\u949f","\u5c0f\u65f6","\u5929","\u5468","\u4e2a\u6708","\u5e74"];var a={},i=function(t,o){a[t]=o},d=[60,60,24,7,365/7/12,12];function l(t){return t instanceof Date?t:!isNaN(t)||/^\d+$/.test(t)?new Date(parseInt(t)):(t=(t||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(t))}var u=function(t,o,e){var r=function(t,o){return(+(o?l(o):new Date)-+l(t))/1e3}(t,e&&e.relativeDate);return function(t,o){for(var e=t<0?1:0,r=t=Math.abs(t),n=0;t>=d[n]&&n<d.length;n++)t/=d[n];return(t=Math.floor(t))>(0===(n*=2)?9:1)&&(n+=1),o(t,n,r)[e].replace("%s",t.toString())}(r,function(t){return a[t]||a.en_US}(o))};i("en_US",(function(t,o){if(0===o)return["just now","right now"];var e=r[Math.floor(o/2)];return t>1&&(e+="s"),[t+" "+e+" ago","in "+t+" "+e]})),i("zh_CN",(function(t,o){if(0===o)return["\u521a\u521a","\u7247\u523b\u540e"];var e=n[~~(o/2)];return[t+" "+e+"\u524d",t+" "+e+"\u540e"]}))}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[3137],{35258:function(t,o,e){"use strict";var a=e(71600);o.Z=void 0;var r=a(e(56930)),n=e(96266),i=(0,r.default)((0,n.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"}),"Autorenew");o.Z=i},70648:function(t,o,e){"use strict";var a=e(71600);o.Z=void 0;var r=a(e(56930)),n=e(96266),i=(0,r.default)((0,n.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"}),"Group");o.Z=i},22754:function(t,o,e){"use strict";var a=e(71600);o.Z=void 0;var r=a(e(56930)),n=e(96266),i=(0,r.default)((0,n.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");o.Z=i},49647:function(t,o,e){"use strict";var a=e(71600);o.Z=void 0;var r=a(e(56930)),n=e(96266),i=(0,r.default)((0,n.jsx)("path",{d:"M18 17H6v-2h12v2zm0-4H6v-2h12v2zm0-4H6V7h12v2zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20z"}),"Receipt");o.Z=i},32207:function(t,o,e){"use strict";var a=e(71600);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var r=a(e(56930)),n=e(96266),i=(0,r.default)((0,n.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"}),"Replay");o.default=i},17545:function(t,o,e){"use strict";var a=e(71600);o.Z=void 0;var r=a(e(56930)),n=e(96266),i=(0,r.default)((0,n.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");o.Z=i},98451:function(t,o,e){"use strict";var a=e(71600);o.Z=void 0;var r=a(e(56930)),n=e(96266),i=(0,r.default)((0,n.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");o.Z=i},49127:function(t,o,e){"use strict";e.d(o,{Z:function(){return R}});var a=e(56666),r=e(31461),n=e(7896),i=e(5057),c=e(9978),l=e(91213),d=e(66685);var s=e(6285),u=e(62773),v=e(42908),p=e(31821),f=e(18561);function h(t){return(0,f.Z)("MuiButtonGroup",t)}var m=(0,p.Z)("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","vertical","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]),Z=e(17681),g=e(27258),b=e(96266),x=["children","className","color","component","disabled","disableElevation","disableFocusRipple","disableRipple","fullWidth","orientation","size","variant"],z=(0,u.ZP)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:function(t,o){var e=t.ownerState;return[(0,a.Z)({},"& .".concat(m.grouped),o.grouped),(0,a.Z)({},"& .".concat(m.grouped),o["grouped".concat((0,s.Z)(e.orientation))]),(0,a.Z)({},"& .".concat(m.grouped),o["grouped".concat((0,s.Z)(e.variant))]),(0,a.Z)({},"& .".concat(m.grouped),o["grouped".concat((0,s.Z)(e.variant)).concat((0,s.Z)(e.orientation))]),(0,a.Z)({},"& .".concat(m.grouped),o["grouped".concat((0,s.Z)(e.variant)).concat((0,s.Z)(e.color))]),(0,a.Z)({},"& .".concat(m.firstButton),o.firstButton),(0,a.Z)({},"& .".concat(m.lastButton),o.lastButton),(0,a.Z)({},"& .".concat(m.middleButton),o.middleButton),o.root,o[e.variant],!0===e.disableElevation&&o.disableElevation,e.fullWidth&&o.fullWidth,"vertical"===e.orientation&&o.vertical]}})((function(t){var o,e=t.theme,r=t.ownerState;return(0,n.Z)({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius},"contained"===r.variant&&{boxShadow:(e.vars||e).shadows[2]},r.disableElevation&&{boxShadow:"none"},r.fullWidth&&{width:"100%"},"vertical"===r.orientation&&{flexDirection:"column"},(o={},(0,a.Z)(o,"& .".concat(m.grouped),(0,n.Z)({minWidth:40,"&:hover":(0,n.Z)({},"contained"===r.variant&&{boxShadow:"none"})},"contained"===r.variant&&{boxShadow:"none"})),(0,a.Z)(o,"& .".concat(m.firstButton,",& .").concat(m.middleButton),(0,n.Z)({},"horizontal"===r.orientation&&{borderTopRightRadius:0,borderBottomRightRadius:0},"vertical"===r.orientation&&{borderBottomRightRadius:0,borderBottomLeftRadius:0},"text"===r.variant&&"horizontal"===r.orientation&&(0,a.Z)({borderRight:e.vars?"1px solid rgba(".concat(e.vars.palette.common.onBackgroundChannel," / 0.23)"):"1px solid ".concat("light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")},"&.".concat(m.disabled),{borderRight:"1px solid ".concat((e.vars||e).palette.action.disabled)}),"text"===r.variant&&"vertical"===r.orientation&&(0,a.Z)({borderBottom:e.vars?"1px solid rgba(".concat(e.vars.palette.common.onBackgroundChannel," / 0.23)"):"1px solid ".concat("light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")},"&.".concat(m.disabled),{borderBottom:"1px solid ".concat((e.vars||e).palette.action.disabled)}),"text"===r.variant&&"inherit"!==r.color&&{borderColor:e.vars?"rgba(".concat(e.vars.palette[r.color].mainChannel," / 0.5)"):(0,d.Fq)(e.palette[r.color].main,.5)},"outlined"===r.variant&&"horizontal"===r.orientation&&{borderRightColor:"transparent"},"outlined"===r.variant&&"vertical"===r.orientation&&{borderBottomColor:"transparent"},"contained"===r.variant&&"horizontal"===r.orientation&&(0,a.Z)({borderRight:"1px solid ".concat((e.vars||e).palette.grey[400])},"&.".concat(m.disabled),{borderRight:"1px solid ".concat((e.vars||e).palette.action.disabled)}),"contained"===r.variant&&"vertical"===r.orientation&&(0,a.Z)({borderBottom:"1px solid ".concat((e.vars||e).palette.grey[400])},"&.".concat(m.disabled),{borderBottom:"1px solid ".concat((e.vars||e).palette.action.disabled)}),"contained"===r.variant&&"inherit"!==r.color&&{borderColor:(e.vars||e).palette[r.color].dark},{"&:hover":(0,n.Z)({},"outlined"===r.variant&&"horizontal"===r.orientation&&{borderRightColor:"currentColor"},"outlined"===r.variant&&"vertical"===r.orientation&&{borderBottomColor:"currentColor"})})),(0,a.Z)(o,"& .".concat(m.lastButton,",& .").concat(m.middleButton),(0,n.Z)({},"horizontal"===r.orientation&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},"vertical"===r.orientation&&{borderTopRightRadius:0,borderTopLeftRadius:0},"outlined"===r.variant&&"horizontal"===r.orientation&&{marginLeft:-1},"outlined"===r.variant&&"vertical"===r.orientation&&{marginTop:-1})),o))})),R=i.forwardRef((function(t,o){var e=(0,v.Z)({props:t,name:"MuiButtonGroup"}),a=e.children,d=e.className,u=e.color,p=void 0===u?"primary":u,f=e.component,m=void 0===f?"div":f,R=e.disabled,C=void 0!==R&&R,B=e.disableElevation,S=void 0!==B&&B,y=e.disableFocusRipple,w=void 0!==y&&y,k=e.disableRipple,j=void 0!==k&&k,M=e.fullWidth,L=void 0!==M&&M,P=e.orientation,E=void 0===P?"horizontal":P,V=e.size,O=void 0===V?"medium":V,W=e.variant,F=void 0===W?"outlined":W,H=(0,r.Z)(e,x),N=(0,n.Z)({},e,{color:p,component:m,disabled:C,disableElevation:S,disableFocusRipple:w,disableRipple:j,fullWidth:L,orientation:E,size:O,variant:F}),T=function(t){var o=t.classes,e=t.color,a=t.disabled,r=t.disableElevation,n=t.fullWidth,i=t.orientation,c=t.variant,d={root:["root",c,"vertical"===i&&"vertical",n&&"fullWidth",r&&"disableElevation"],grouped:["grouped","grouped".concat((0,s.Z)(i)),"grouped".concat((0,s.Z)(c)),"grouped".concat((0,s.Z)(c)).concat((0,s.Z)(i)),"grouped".concat((0,s.Z)(c)).concat((0,s.Z)(e)),a&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,l.Z)(d,h,o)}(N),G=i.useMemo((function(){return{className:T.grouped,color:p,disabled:C,disableElevation:S,disableFocusRipple:w,disableRipple:j,fullWidth:L,size:O,variant:F}}),[p,C,S,w,j,L,O,F,T.grouped]),_=function(t){return i.Children.toArray(t).filter((function(t){return i.isValidElement(t)}))}(a),I=_.length,q=function(t){var o=0===t,e=t===I-1;return o&&e?"":o?T.firstButton:e?T.lastButton:T.middleButton};return(0,b.jsx)(z,(0,n.Z)({as:m,role:"group",className:(0,c.Z)(T.root,d),ref:o,ownerState:N},H,{children:(0,b.jsx)(Z.Z.Provider,{value:G,children:_.map((function(t,o){return(0,b.jsx)(g.Z.Provider,{value:q(o),children:t},o)}))})}))}))},65140:function(t,o,e){"use strict";e.d(o,{Z:function(){return P}});var a=e(56666),r=e(31461),n=e(7896),i=e(5057),c=e(9978),l=e(91213),d=e(66685),s=e(39273),u=e(42908),v=e(57471),p=e(96266),f=(0,v.Z)((0,p.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),h=(0,v.Z)((0,p.jsx)("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),m=e(62773),Z=(0,m.ZP)("span",{shouldForwardProp:m.FO})({position:"relative",display:"flex"}),g=(0,m.ZP)(f)({transform:"scale(1)"}),b=(0,m.ZP)(h)((function(t){var o=t.theme,e=t.ownerState;return(0,n.Z)({left:0,position:"absolute",transform:"scale(0)",transition:o.transitions.create("transform",{easing:o.transitions.easing.easeIn,duration:o.transitions.duration.shortest})},e.checked&&{transform:"scale(1)",transition:o.transitions.create("transform",{easing:o.transitions.easing.easeOut,duration:o.transitions.duration.shortest})})}));var x=function(t){var o=t.checked,e=void 0!==o&&o,a=t.classes,r=void 0===a?{}:a,i=t.fontSize,c=(0,n.Z)({},t,{checked:e});return(0,p.jsxs)(Z,{className:r.root,ownerState:c,children:[(0,p.jsx)(g,{fontSize:i,className:r.background,ownerState:c}),(0,p.jsx)(b,{fontSize:i,className:r.dot,ownerState:c})]})},z=e(6285),R=e(26393),C=e(42903);var B=e(31821),S=e(18561);function y(t){return(0,S.Z)("MuiRadio",t)}var w=(0,B.Z)("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),k=["checked","checkedIcon","color","icon","name","onChange","size","className"],j=(0,m.ZP)(s.Z,{shouldForwardProp:function(t){return(0,m.FO)(t)||"classes"===t},name:"MuiRadio",slot:"Root",overridesResolver:function(t,o){var e=t.ownerState;return[o.root,"medium"!==e.size&&o["size".concat((0,z.Z)(e.size))],o["color".concat((0,z.Z)(e.color))]]}})((function(t){var o=t.theme,e=t.ownerState;return(0,n.Z)({color:(o.vars||o).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:o.vars?"rgba(".concat("default"===e.color?o.vars.palette.action.activeChannel:o.vars.palette[e.color].mainChannel," / ").concat(o.vars.palette.action.hoverOpacity,")"):(0,d.Fq)("default"===e.color?o.palette.action.active:o.palette[e.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==e.color&&(0,a.Z)({},"&.".concat(w.checked),{color:(o.vars||o).palette[e.color].main}),(0,a.Z)({},"&.".concat(w.disabled),{color:(o.vars||o).palette.action.disabled}))}));var M=(0,p.jsx)(x,{checked:!0}),L=(0,p.jsx)(x,{}),P=i.forwardRef((function(t,o){var e,a,d,s,v=(0,u.Z)({props:t,name:"MuiRadio"}),f=v.checked,h=v.checkedIcon,m=void 0===h?M:h,Z=v.color,g=void 0===Z?"primary":Z,b=v.icon,x=void 0===b?L:b,B=v.name,S=v.onChange,w=v.size,P=void 0===w?"medium":w,E=v.className,V=(0,r.Z)(v,k),O=(0,n.Z)({},v,{color:g,size:P}),W=function(t){var o=t.classes,e=t.color,a=t.size,r={root:["root","color".concat((0,z.Z)(e)),"medium"!==a&&"size".concat((0,z.Z)(a))]};return(0,n.Z)({},o,(0,l.Z)(r,y,o))}(O),F=i.useContext(C.Z),H=f,N=(0,R.Z)(S,F&&F.onChange),T=B;return F&&("undefined"===typeof H&&(d=F.value,H="object"===typeof(s=v.value)&&null!==s?d===s:String(d)===String(s)),"undefined"===typeof T&&(T=F.name)),(0,p.jsx)(j,(0,n.Z)({type:"radio",icon:i.cloneElement(x,{fontSize:null!=(e=L.props.fontSize)?e:P}),checkedIcon:i.cloneElement(m,{fontSize:null!=(a=M.props.fontSize)?a:P}),ownerState:O,classes:W,name:T,checked:H,onChange:N,ref:o,className:(0,c.Z)(W.root,E)},V))}))},87916:function(t,o,e){"use strict";var a=e(96234),r=e(7896),n=e(31461),i=e(5057),c=e(25506),l=e(2286),d=e(58708),s=e(42903),u=e(80538),v=e(96266),p=["actions","children","defaultValue","name","onChange","value"],f=i.forwardRef((function(t,o){var e=t.actions,f=t.children,h=t.defaultValue,m=t.name,Z=t.onChange,g=t.value,b=(0,n.Z)(t,p),x=i.useRef(null),z=(0,d.Z)({controlled:g,default:h,name:"RadioGroup"}),R=(0,a.Z)(z,2),C=R[0],B=R[1];i.useImperativeHandle(e,(function(){return{focus:function(){var t=x.current.querySelector("input:not(:disabled):checked");t||(t=x.current.querySelector("input:not(:disabled)")),t&&t.focus()}}}),[]);var S=(0,l.Z)(o,x),y=(0,u.Z)(m),w=i.useMemo((function(){return{name:y,onChange:function(t){B(t.target.value),Z&&Z(t,t.target.value)},value:C}}),[y,Z,B,C]);return(0,v.jsx)(s.Z.Provider,{value:w,children:(0,v.jsx)(c.Z,(0,r.Z)({role:"radiogroup",ref:S},b,{children:f}))})}));o.Z=f},42903:function(t,o,e){"use strict";var a=e(5057).createContext(void 0);o.Z=a},3895:function(t,o,e){var a=e(98323),r=e(97247),n=e(89479),i=e(73470),c=e(74631),l=e(51565);t.exports=function(t,o,e,d){var s=-1,u=r,v=!0,p=t.length,f=[],h=o.length;if(!p)return f;e&&(o=i(o,c(e))),d?(u=n,v=!1):o.length>=200&&(u=l,v=!1,o=new a(o));t:for(;++s<p;){var m=t[s],Z=null==e?m:e(m);if(m=d||0!==m?m:0,v&&Z===Z){for(var g=h;g--;)if(o[g]===Z)continue t;f.push(m)}else u(o,Z,d)||f.push(m)}return f}},13973:function(t,o,e){var a=e(3895),r=e(61350),n=e(43676);t.exports=function(t,o,e){var i=t.length;if(i<2)return i?n(t[0]):[];for(var c=-1,l=Array(i);++c<i;)for(var d=t[c],s=-1;++s<i;)s!=c&&(l[c]=a(l[c]||d,t[s],o,e));return n(r(l,1),o,e)}},69163:function(t,o,e){var a=e(5948),r=e(86456),n=e(13973),i=e(7244),c=e(59408),l=r((function(t){var o=c(t);return o="function"==typeof o?o:void 0,n(a(t,i),void 0,o)}));t.exports=l}}]);
|