@abtnode/blocklet-services 1.16.14-beta-c308dc3b → 1.16.14-beta-cb53c14b
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/build/asset-manifest.json +135 -124
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/service-worker.js.map +1 -1
- package/build/static/css/{4603.dce369d5.chunk.css → 5355.c4fb5c4a.chunk.css} +1 -1
- package/build/static/css/{780.e3db6e49.chunk.css → 5982.ac464505.chunk.css} +1 -1
- package/build/static/css/{2130.b9437a64.chunk.css → 7272.0ae9f678.chunk.css} +1 -1
- package/build/static/js/1095.d6f2ef77.chunk.js +2 -0
- package/build/static/js/1546.05fce5c0.chunk.js +2 -0
- package/build/static/js/1660.13706e35.chunk.js +2 -0
- package/build/static/js/1830.7b197c4d.chunk.js +2 -0
- package/build/static/js/1980.79862e88.chunk.js +2 -0
- package/build/static/js/2216.089c1302.chunk.js +3 -0
- package/build/static/js/2291.497ddae4.chunk.js +2 -0
- package/build/static/js/2393.9c045444.chunk.js +2 -0
- package/build/static/js/252.8dd19212.chunk.js +3 -0
- package/build/static/js/2653.0a8b831d.chunk.js +2 -0
- package/build/static/js/2664.706462f0.chunk.js +2 -0
- package/build/static/js/2686.3a7c583a.chunk.js +2 -0
- package/build/static/js/2724.3fa7fc88.chunk.js +2 -0
- package/build/static/js/2750.edf7d107.chunk.js +2 -0
- package/build/static/js/3110.9ff701b3.chunk.js +3 -0
- package/build/static/js/3241.eeba87d0.chunk.js +2 -0
- package/build/static/js/3593.afccdc50.chunk.js +2 -0
- package/build/static/js/3595.3ac8a5df.chunk.js +3 -0
- package/build/static/js/4009.65d1c083.chunk.js +2 -0
- package/build/static/js/4023.f88d8f4b.chunk.js +2 -0
- package/build/static/js/4164.3f21a941.chunk.js +2 -0
- package/build/static/js/4319.8d9e189e.chunk.js +2 -0
- package/build/static/js/{445.7ad42b19.chunk.js → 445.1f8bed72.chunk.js} +3 -3
- package/build/static/js/4547.5b51d4f3.chunk.js +2 -0
- package/build/static/js/4682.23dd054e.chunk.js +2 -0
- package/build/static/js/4715.c191216b.chunk.js +2 -0
- package/build/static/js/4716.b9fa5e09.chunk.js +2 -0
- package/build/static/js/4764.51208c0d.chunk.js +2 -0
- package/build/static/js/4846.aa1ac1ac.chunk.js +2 -0
- package/build/static/js/5176.31463f87.chunk.js +2 -0
- package/build/static/js/5355.da516161.chunk.js +2 -0
- package/build/static/js/5434.523d071d.chunk.js +2 -0
- package/build/static/js/5541.1d065ac6.chunk.js +2 -0
- package/build/static/js/5645.3c5c0f93.chunk.js +2 -0
- package/build/static/js/5683.46331372.chunk.js +2 -0
- package/build/static/js/5848.487098c8.chunk.js +2 -0
- package/build/static/js/5859.64cba18d.chunk.js +2 -0
- package/build/static/js/5960.6c234993.chunk.js +2 -0
- package/build/static/js/5982.19c5663f.chunk.js +2 -0
- package/build/static/js/617.324a4c7b.chunk.js +3 -0
- package/build/static/js/6186.c6880563.chunk.js +2 -0
- package/build/static/js/6326.3a3cb154.chunk.js +2 -0
- package/build/static/js/6658.bce97eda.chunk.js +2 -0
- package/build/static/js/6711.38948be4.chunk.js +2 -0
- package/build/static/js/6737.5aef67e7.chunk.js +2 -0
- package/build/static/js/6771.583c16c9.chunk.js +3 -0
- package/build/static/js/6921.2f39f974.chunk.js +2 -0
- package/build/static/js/7006.b21fb368.chunk.js +2 -0
- package/build/static/js/7056.5e345b05.chunk.js +3 -0
- package/build/static/js/7056.5e345b05.chunk.js.LICENSE.txt +7 -0
- package/build/static/js/7272.99410ed2.chunk.js +3 -0
- package/build/static/js/7977.38c9fc34.chunk.js +2 -0
- package/build/static/js/8437.0d88b9db.chunk.js +2 -0
- package/build/static/js/861.a19bf499.chunk.js +2 -0
- package/build/static/js/8610.89893a07.chunk.js +2 -0
- package/build/static/js/878.fe952f7d.chunk.js +2 -0
- package/build/static/js/9102.7087c66c.chunk.js +2 -0
- package/build/static/js/9106.783701ea.chunk.js +2 -0
- package/build/static/js/926.d1421ce1.chunk.js +2 -0
- package/build/static/js/9292.803f7e05.chunk.js +2 -0
- package/build/static/js/9409.8f1cfa24.chunk.js +2 -0
- package/build/static/js/9620.585d8c25.chunk.js +2 -0
- package/build/static/js/9899.3267a1e3.chunk.js +2 -0
- package/build/static/js/9996.9a2238b0.chunk.js +2 -0
- package/build/static/js/main.56713b6c.js +3 -0
- package/build/static/js/{main.3e42ffde.js.LICENSE.txt → main.56713b6c.js.LICENSE.txt} +0 -6
- package/package.json +24 -24
- package/build/static/js/1162.ff3136ae.chunk.js +0 -2
- package/build/static/js/1210.b6221400.chunk.js +0 -2
- package/build/static/js/1255.0e8a8a45.chunk.js +0 -2
- package/build/static/js/1832.3ac49edc.chunk.js +0 -2
- package/build/static/js/1980.dc299167.chunk.js +0 -2
- package/build/static/js/2130.f123740e.chunk.js +0 -3
- package/build/static/js/2139.341406d2.chunk.js +0 -2
- package/build/static/js/3242.c54d8ce1.chunk.js +0 -2
- package/build/static/js/3464.12806bfe.chunk.js +0 -2
- package/build/static/js/3800.f5b8660e.chunk.js +0 -2
- package/build/static/js/3963.2e06f9bc.chunk.js +0 -3
- package/build/static/js/4056.7104fbed.chunk.js +0 -2
- package/build/static/js/4319.e99b5af9.chunk.js +0 -2
- package/build/static/js/4359.5ed52fe3.chunk.js +0 -2
- package/build/static/js/4492.97b0d4f6.chunk.js +0 -2
- package/build/static/js/4547.3692fa06.chunk.js +0 -2
- package/build/static/js/4603.7a55b2c4.chunk.js +0 -2
- package/build/static/js/4651.3fbbf7ac.chunk.js +0 -3
- package/build/static/js/4682.81053e18.chunk.js +0 -2
- package/build/static/js/4716.a1240199.chunk.js +0 -2
- package/build/static/js/5050.7feba723.chunk.js +0 -3
- package/build/static/js/5052.8d91917d.chunk.js +0 -2
- package/build/static/js/5176.68fd3fde.chunk.js +0 -2
- package/build/static/js/5233.faabaae9.chunk.js +0 -2
- package/build/static/js/5376.9c06ee1e.chunk.js +0 -3
- package/build/static/js/5430.6aa38ea1.chunk.js +0 -2
- package/build/static/js/5491.f227b5b4.chunk.js +0 -2
- package/build/static/js/5645.a17cd258.chunk.js +0 -2
- package/build/static/js/5711.aa17ef28.chunk.js +0 -2
- package/build/static/js/5813.3f792b20.chunk.js +0 -2
- package/build/static/js/6315.59e078f6.chunk.js +0 -2
- package/build/static/js/652.9c9e49fa.chunk.js +0 -2
- package/build/static/js/655.cdee65b4.chunk.js +0 -2
- package/build/static/js/6711.a62d0bcd.chunk.js +0 -2
- package/build/static/js/6737.4f37dd4a.chunk.js +0 -2
- package/build/static/js/6792.a534f860.chunk.js +0 -3
- package/build/static/js/6792.a534f860.chunk.js.LICENSE.txt +0 -21
- package/build/static/js/6891.6c7018ab.chunk.js +0 -2
- package/build/static/js/7006.0aa7d1b3.chunk.js +0 -2
- package/build/static/js/7291.5553195e.chunk.js +0 -2
- package/build/static/js/731.9f99f66f.chunk.js +0 -2
- package/build/static/js/7371.d13e6cd3.chunk.js +0 -2
- package/build/static/js/7518.5b02f3ba.chunk.js +0 -2
- package/build/static/js/766.ab730327.chunk.js +0 -2
- package/build/static/js/780.32bf1f5b.chunk.js +0 -2
- package/build/static/js/8031.9944bf3c.chunk.js +0 -2
- package/build/static/js/8395.b1ffb35e.chunk.js +0 -2
- package/build/static/js/8437.e4b47fc3.chunk.js +0 -2
- package/build/static/js/861.1e3923ec.chunk.js +0 -2
- package/build/static/js/8669.814198b8.chunk.js +0 -2
- package/build/static/js/868.60de5f6d.chunk.js +0 -2
- package/build/static/js/8960.2b3e5e40.chunk.js +0 -2
- package/build/static/js/9381.4be08f8a.chunk.js +0 -2
- package/build/static/js/9409.ce15e157.chunk.js +0 -2
- package/build/static/js/9476.bc480cfc.chunk.js +0 -2
- package/build/static/js/9506.d732d124.chunk.js +0 -2
- package/build/static/js/982.11dc355f.chunk.js +0 -3
- package/build/static/js/main.3e42ffde.js +0 -3
- package/build/static/media/iconify.212917dd32288c600255.cjs +0 -2
- /package/build/static/{media/iconify.212917dd32288c600255.cjs.LICENSE.txt → js/2216.089c1302.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{982.11dc355f.chunk.js.LICENSE.txt → 252.8dd19212.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5376.9c06ee1e.chunk.js.LICENSE.txt → 3110.9ff701b3.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{4651.3fbbf7ac.chunk.js.LICENSE.txt → 3595.3ac8a5df.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{445.7ad42b19.chunk.js.LICENSE.txt → 445.1f8bed72.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{3963.2e06f9bc.chunk.js.LICENSE.txt → 617.324a4c7b.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5050.7feba723.chunk.js.LICENSE.txt → 6771.583c16c9.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{2130.f123740e.chunk.js.LICENSE.txt → 7272.99410ed2.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[2724],{42724:function(e,n,t){t.r(n),t.d(n,{default:function(){return Yr}});var r=t(33028),o=t(59740),i=t(19611),a=t.n(i),l=t(68079),c=t(71171),s=t(32723),u=t(34795),d=t(96234),p=t(30969),m=t(16380),f=t(24974),h=t.n(f),x=t(84636),v=t(38361),g=t(59071),Z=t(38357),y=t(96074),b=t(46973),k=t(94551),j=t(3715),C=t(51711),P=t(85385),R=t(55829),E=t(11909),T=t(3994),w=t(6779),S=t(88412),_=t(88876),U=t(13875),N=t(57256),I=t(10814),D=t(49884),L=t(34159),O=t(96628),B=t(20244),F=t(94308),q=t(70177),A=t(47333),G=t(29996),z=t(78789),W=t(7017),M=t(6399),V=t.n(M),K=t(94984),Y=t(43820),H=t(36558),X=t(61472),Q=t(2878),J=t.n(Q),$=t(9715),ee=t(19638),ne=t(37574);function te(e){var n,t=e.sourceInfo,r=e.blocklet,o=(0,p.useContext)(A.RD).t;return(0,ne.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)($.Z,{type:"success",children:J()(t.source)},"source"),"registry"===t.source&&(0,ne.jsx)(ee.Z,{href:a()(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:o("blocklet.overview.viewInStore")})]})}te.propTypes={sourceInfo:h().shape({source:h().string,deployedFrom:h().string}),blocklet:h().object},te.defaultProps={sourceInfo:{},blocklet:{}};var re=t(94282),oe=t(88397),ie=t(59505),ae=t(8479),le=t(41395),ce=t(24891),se=t(22572),ue=["blocklet","checkUpgrade","hasPermission"];function de(e){var n=e.blocklet,t=e.checkUpgrade,i=e.hasPermission,a=(0,o.Z)(e,ue),l=(0,le.h6)().api,c=(0,p.useContext)(A.RD).t,m=(0,p.useState)(!1),f=(0,d.Z)(m,2),h=f[0],x=f[1],v=(0,p.useState)(""),g=(0,d.Z)(v,2),Z=g[0],y=g[1],b=(0,p.useState)(null),j=(0,d.Z)(b,2),C=j[0],P=j[1],R=(0,p.useState)(null),E=(0,d.Z)(R,2),T=E[0],S=E[1];(0,p.useEffect)((function(){P(null),t&&(n.mode,ie.BLOCKLET_MODES.DEVELOPMENT)}),[n,t]);var _=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 x(!0),e.prev=1,t={did:n.meta.did,version:C.version,storeUrl:C.registryUrl||""},e.next=5,(0,ce._v)(2e3);case 5:return e.next=7,l.upgradeBlocklet({input:t});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),K.Z.error("Blocklet upgrade failed: ".concat((0,ce.Z)(e.t0)));case 12:return e.prev=12,x(!1),S(null),e.finish(12);case 16:case"end":return e.stop()}}),e,null,[[1,9,12,16]])})));return function(){return e.apply(this,arguments)}}(),U={title:"".concat(c("common.upgrade")," ").concat(c("common.blocklet")," ").concat((0,W.getDisplayName)(n)),description:c("blocklet.action.upgradeDescription"),confirm:c("blocklet.action.confirmUpgrade"),cancel:c("common.cancel"),onConfirm:_,onCancel:function(){x(!1),S(null)}};return i&&C&&!(0,W.isInProgress)(n.status)?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(X.Z,(0,r.Z)((0,r.Z)({},a),{},{children:n.meta.version})),(0,ne.jsx)(w.Z,{title:c("common.updateAvailable",{version:C.version}),children:(0,ne.jsx)(k.Z,{size:"small",style:{marginLeft:8},disabled:h,onClick:function(){return S(U)},children:h?(0,ne.jsx)(F.Z,{size:16}):(0,ne.jsx)(oe.Z,{style:{fontSize:16,color:"red"}})})}),!!Z&&(0,ne.jsx)(K.Z,{variant:"error",message:Z,onClose:function(){return y("")}}),T&&(0,ne.jsx)(ae.Z,{title:T.title,description:T.description,confirm:T.confirm,cancel:T.cancel,params:T.params,onConfirm:T.onConfirm,onCancel:T.onCancel})]}):(0,ne.jsx)(X.Z,(0,r.Z)((0,r.Z)({},a),{},{children:n.meta.version}))}de.propTypes={blocklet:h().object.isRequired,checkUpgrade:h().bool,hasPermission:h().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=t(70998),xe=["mode"];function ve(e){var n=e.mode,t=(0,o.Z)(e,xe);return"development"===n?(0,ne.jsx)(X.Z,(0,r.Z)((0,r.Z)({type:"primary"},t),{},{children:"DEV"})):null}ve.propTypes={mode:h().string.isRequired};var ge,Ze,ye,be=t(88356),ke=t(50496),je=t(19865),Ce=t(32666),Pe=t(87006),Re=t(18877),Ee=t(73820),Te=t(38996),we=t(44181),Se=t(60306),_e=t(56567),Ue=t(81172),Ne=t(75296),Ie=t(52838),De=t(81779),Le=t(90713),Oe=t(97475),Be=t(65481),Fe=t(83153),qe={Add:j.Z,Check:Te.default,Delete:I.default,Edit:be.default,Clear:we.default,DetailPanel:Ie.default,Filter:_e.Z,FirstPage:Ue.default,LastPage:Ne.default,NextPage:Ie.default,PreviousPage:De.default,Search:Le.default,ResetSearch:we.default,SortArrow:Oe.Z,Export:Se.default,ThirdStateCheck:Be.default,ViewColumn:Fe.default},Ae=m.default.div(ge||(ge=(0,c.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"]))),Ge=t(55008),ze=function(e,n){var t=e.description;return Object.values(ie.CHAIN_PROP_MAP).includes(e.key)&&(t=t?"".concat(t," (").concat(n("blocklet.config.sharedToAllComponents"),")"):n("blocklet.config.sharedToAllComponents")),t&&(0,ne.jsx)("div",{style:{marginLeft:12},children:t})};function We(e){var n=e.blocklet,t=e.ancestors,o=(0,le.h6)(),i=o.inService,a=(0,p.useContext)(A.RD).t,c=[].concat((0,l.Z)(t.map((function(e){return e.meta.did}))),[n.meta.did]),d=function(){return K.Z.success(a("blocklet.config.changedTip"))},m=function(e){return e.custom};if((0,ce.wS)(n.status))return null;if("unknown"===n.status&&(0,ce.wS)(n.status))return null;var f=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 K.Z.error(a("blocklet.config.environment.keyValueRequired")),e.abrupt("return");case 3:if(!n.key.startsWith("BLOCKLET_")&&!n.key.startsWith("COMPONENT_")){e.next=6;break}return K.Z.error(a("blocklet.config.environment.invalidKey")),e.abrupt("return");case 6:return n.custom=!0,e.next=9,o.api.configBlocklet({input:{did:c,configs:[n]}});case 9:"ok"===(t=e.sent).code&&d(t.blocklet);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),h=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n,t){var r,i,l;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.required||n.key.trim()&&n.value.trim()){e.next=3;break}return K.Z.error(a("blocklet.config.environment.keyValueRequired")),e.abrupt("return");case 3:if(!n.key.startsWith("BLOCKLET_")||ie.BLOCKLET_CONFIGURABLE_KEY[n.key]){e.next=6;break}return K.Z.error(a("blocklet.config.environment.invalidKey")),e.abrupt("return");case 6:if(n.key!==ie.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){e.next=11;break}if(!(r=(0,ce.I)(n))){e.next=11;break}return K.Z.error(r),e.abrupt("return");case 11:if(i=[n],n.key===t.key){e.next=17;break}if(n.custom){e.next=16;break}return K.Z.error("Only key of custom env can be changed"),e.abrupt("return");case 16:i.push({key:t.key,custom:!0});case 17:return e.prev=17,e.next=20,o.api.configBlocklet({input:{did:c,configs:i}});case 20:"ok"===(l=e.sent).code&&d(l.blocklet),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(17),K.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)}}(),x=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.required){e.next=3;break}return K.Z.error(a("blocklet.config.environment.deleteForbidden")),e.abrupt("return");case 3:if(n.custom){e.next=6;break}return K.Z.error("Only key of custom env can be changed"),e.abrupt("return");case 6:return e.next=8,o.api.configBlocklet({input:{did:c,configs:[{key:n.key,custom:!0}]}});case 8:"ok"===(t=e.sent).code&&d(t.blocklet);case 10:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),v=(n.configs||[]).filter((function(e){return!ie.BLOCKLET_CONFIGURABLE_KEY[e.key]})),g=(0,W.getSharedConfigObj)(n,t),Z=(0,W.getComponentMissingConfigs)(n,t),y=v.map((function(e){return(0,r.Z)((0,r.Z)({},e),{},{value:Object.values(ie.CHAIN_PROP_MAP).includes(e.key)&&Object.keys(g).includes(e.key)?g[e.key]:g[e.key]||e.value})})),b=y.some((function(e){return e.key&&e.key.startsWith("BWA_")})),k={onRowAdd:f,onRowUpdate:h,onRowDelete:x,isDeletable:m};return(0,ne.jsxs)(Ve,{children:[!!Z.length&&(0,ne.jsx)(Re.Z,{severity:"error",style:{marginTop:24},children:a("blocklet.config.missingRequired")}),b&&(0,ne.jsx)(Re.Z,{severity:"info",children:a("blocklet.config.environment.tip")}),(0,ne.jsx)(se.Z,{permission:i?"":"mutate_blocklets",role:i?ce.Wf:[],children:function(e){return(0,ne.jsx)(Ae,{className:(0,ce.Au)(n)?"readonly-block config-table":"config-table","data-disabled-text":a("blocklet.config.disabledText"),children:(0,ne.jsx)(Ce.ZP,{title:(0,ne.jsx)("h4",{children:a("common.environment")}),columns:[{title:a("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:function(e){return(0,ne.jsx)(Ee.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)(Ke,{children:(0,ne.jsx)(Pe.Z,{fullWidth:!0,size:"small",disabled:!1===m(t),value:n,onChange:function(e){return r(e.target.value)},variant:"outlined",label:"Key",placeholder:a("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:a("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:function(e){return e.value?e.secure?"******":(0,ne.jsx)(Ee.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)(Ke,{children:[(0,ne.jsx)(Pe.Z,{fullWidth:!0,size:"small",value:"__encrypted__"===n?"":n,onChange:function(e){return r(e.target.value)},variant:"outlined",label:a("common.value"),placeholder:a("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),ze(t,a)]})}}],icons:(0,r.Z)((0,r.Z)({},Ge.Z),qe),options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:a("common.actions")},body:{emptyDataSourceMessage:a("common.noData")}},data:y,editable:e?k:{}})})}})]})}We.propTypes={blocklet:h().object.isRequired,ancestors:h().array},We.defaultProps={ancestors:[]};var Me,Ve=m.default.div(Ze||(Ze=(0,c.Z)(["\n .readonly-block {\n position: relative;\n &::after {\n content: attr(data-disabled-text);\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(230, 230, 230, 0.7);\n font-size: 24px;\n letter-spacing: 2px;\n color: #e33371;\n padding: 20px;\n word-break: break-all;\n word-wrap: break-word;\n z-index: 10;\n }\n }\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})),Ke=m.default.div(ye||(ye=(0,c.Z)(["\n height: 60px;\n"]))),Ye=t(88617),He=t(67019),Xe=["blocklet","ancestors","hasPermission"];function Qe(e){var n=e.blocklet,t=e.ancestors,i=e.hasPermission,a=(0,o.Z)(e,Xe),l=(0,A.PE)().t,c=(0,le.h6)().api,m=!t.length,f=m?n.meta.did:t.map((function(e){return e.meta.did}))[0],h=(0,p.useState)(""),x=(0,d.Z)(h,2),g=x[0],Z=x[1],y=(0,p.useState)(""),b=(0,d.Z)(y,2),k=b[0],j=b[1],C=g||!i;if(!f)return null;if("unknown"===n.status&&(0,ce.wS)(n.status))return null;var P=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 Z(!0),e.prev=1,r={rootDid:f,mountPoint:(0,Ye.ZP)(t)},m||(r.did=n.meta.did),e.next=6,c.updateComponentMountPoint({input:r});case 6:return Z(!1),e.abrupt("return",!0);case 10:throw e.prev=10,e.t0=e.catch(1),Z(!1),e.t0.message=(0,ce.Z)(e.t0),K.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)(tn,(0,r.Z)((0,r.Z)({component:"div"},a),{},{children:(0,ne.jsx)(v.Z,{mt:3,children:(0,ne.jsx)(He.Z,{label:l("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:g||C,loading:g,required:!0,initialValue:n.mountPoint,onSubmit:P,onChange:function(e){j(l("common.slugifyHint",{value:(0,ce.LN)(e)}))},helperText:k,formatterBeforeSubmit:function(e){return(0,Ye.ZP)(e)}})})}))}var Je=(0,se.V)(Qe,"mutate_blocklets"),$e=(0,se.V)(Qe,"",ce.Wf);function en(e){return(0,le.h6)().inService?(0,ne.jsx)($e,(0,r.Z)({},e)):(0,ne.jsx)(Je,(0,r.Z)({},e))}Qe.propTypes={blocklet:h().object.isRequired,ancestors:h().array,hasPermission:h().bool},Qe.defaultProps={ancestors:[],hasPermission:!1};var nn,tn=m.default.div(Me||(Me=(0,c.Z)([""])));function rn(e){var n=e.blocklet,t=e.ancestors,r=e.children,o=(0,p.useState)(""),i=(0,d.Z)(o,2),a=i[0],l=i[1],c=(0,A.PE)().t,s=!!t.length,u=(0,p.useState)("settings"),m=(0,d.Z)(u,2),f=m[0],h=m[1],x=s?(0,W.getDisplayName)(n,!0):c("blocklet.component.container");if((0,ce.wS)(n.status))return null;if("unknown"===n.status&&(0,ce.wS)(n.status))return null;var g=function(e){e.stopPropagation(),l(!0)},Z={settings:{label:c("blocklet.component.setting"),value:"settings",component:(0,ne.jsx)(en,{blocklet:n,ancestors:t})},environments:{label:c("common.environment"),value:"environments",component:(0,ne.jsx)(We,{blocklet:n,ancestors:t})}},y=Object.values(Z).map((function(e){return{label:e.label,value:e.value}})),b=Z[f]||Z.settings;return["function"===typeof r?r({open:g}):(0,ne.jsx)(k.Z,{onClick:g,"data-cy":"action-config-component",children:(0,ne.jsx)(be.default,{})}),a&&(0,ne.jsx)(an,{open:!0,fullWidth:!0,maxWidth:"md",title:x,onClose:function(){l(!1)},PaperProps:{style:{minHeight:"auto"}},children:s?(0,ne.jsxs)(v.Z,{mt:1,children:[(0,ne.jsx)(je.Z,{tabs:y,current:f,onChange:function(e){h(e)},scrollButtons:"auto"}),b.component]}):(0,ne.jsx)(We,{blocklet:n,ancestors:t})})]}rn.propTypes={blocklet:h().object.isRequired,ancestors:h().array,children:h().any},rn.defaultProps={ancestors:[],children:null};var on,an=(0,m.default)(ke.Z)(nn||(nn=(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"]))),ln=t(33359),cn=t(76492),sn=t(97517);function un(e){var n=e.component,t=e.remove,o=e.disabled,i=e.tip,a=e.showConfirm,l=e.hideBtn,c=e.onCancel,m=(0,p.useContext)(A.RD).t,f=(0,p.useState)(!1),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=(0,p.useState)(null),Z=(0,d.Z)(g,2),y=Z[0],b=Z[1],k=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 v(!0),e.next=3,t(n.component,n.removeType);case 3:v(!1),b(null);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),j=o||x,C=function(){b({title:"".concat(m("common.delete")," ").concat(n.meta.title||n.meta.name),description:function(e,n){return(0,ne.jsxs)(ln.Z,{component:"div",children:[(0,ne.jsx)(ln.Z,{gutterBottom:!0,children:m("blocklet.action.removeComponentDescription")}),(0,ne.jsxs)(sn.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)(D.Z,{value:"keepData",control:(0,ne.jsx)(cn.Z,{}),label:m("blocklet.action.removeComponentKeepData")}),(0,ne.jsx)(D.Z,{value:"complete",control:(0,ne.jsx)(cn.Z,{}),label:m("blocklet.action.removeComponentComplete")})]})]})},confirm:m("common.confirm"),cancel:m("common.cancel"),params:{component:n,removeType:"keepData"},onConfirm:k,onCancel:function(){b(null),c()}})};(0,p.useEffect)((function(){a?C():(v(!1),b(null))}),[a]);var P=(0,ne.jsx)(pn,{size:"small",disabled:j,onClick:function(){return C},"data-cy":"delete-component-btn",children:(0,ne.jsx)(I.default,{disabled:j})}),R=(0,ne.jsx)(w.Z,{title:i||m("common.delete"),children:(0,ne.jsx)("span",{children:P})});return(0,ne.jsxs)(ne.Fragment,{children:[!l&&R,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})]})}un.propTypes={component:h().object.isRequired,remove:h().func,onCancel:h().func,disabled:h().bool,showConfirm:h().bool,hideBtn:h().bool,tip:h().string},un.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 dn,pn=(0,m.default)(k.Z)(on||(on=(0,c.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"]))),mn=t(8825),fn=t(60003);function hn(e){var n=e.component,t=e.onStart,r=e.onStop,o=e.disabled,i=e.tip,a=(0,p.useContext)(A.RD).t,l=(0,p.useState)(!1),c=(0,d.Z)(l,2),m=c[0],f=c[1],h=(0,p.useState)(),x=(0,d.Z)(h,2),v=x[0],g=x[1],Z=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 f(!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),K.Z.error(e.t0.message);case 9:f(!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 f(!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),K.Z.error(e.t0.message);case 9:f(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),b=o||m,k=["starting","running"].includes(n.status),j=k?fn.Z:mn.Z,C=(0,ne.jsx)(xn,{disabled:b,onClick:function(){var e;k?g({title:"".concat(a("common.stop")," ").concat(null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.title),description:a("blocklet.action.stopComponentDescription"),confirm:a("blocklet.action.confirmStop"),cancel:a("common.cancel"),onConfirm:function(){return g(null),y()},onCancel:function(){return g(null)}}):Z()},"data-cy":"".concat(k?"stop":"start","-component-btn"),children:(0,ne.jsx)(j,{disabled:b})});return[(0,ne.jsx)(w.Z,{title:i||a("common.".concat(k?"stop":"start")),children:(0,ne.jsx)("span",{children:C})},"btn"),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},"connect")]}hn.propTypes={component:h().object.isRequired,onStart:h().func,onStop:h().func,disabled:h().bool,tip:h().string},hn.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 xn=(0,m.default)(k.Z)(dn||(dn=(0,c.Z)(["\n &.Mui-disabled {\n opacity: 0.5;\n }\n"]))),vn=t(2569),gn=t(12700),Zn=t.n(gn),yn=t(43260),bn=t.n(yn),kn=t(76032),jn=t.n(kn),Cn=t(60523),Pn=t.n(Cn),Rn=t(47768),En=t(43207),Tn=t(2689),wn=t(1437),Sn=t(75255),_n=t(90445),Un=t(71464),Nn=t(23299),In=t(78598),Dn=t(23426),Ln=t(45008),On=t(8016),Bn=t(14458),Fn=t(83241),qn=t(13885),An=t(54559),Gn=t(74743),zn=t(67888),Wn=t(9943),Mn=t(86008),Vn=t(93310),Kn=t(64698),Yn=t(36508),Hn=t(6200),Xn={meta:h().object.isRequired,onCancel:h().func.isRequired},Qn=(0,Gn.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 Jn(e){var n=e.action,t=e.onSelect,r=e.onNext,o=Qn(),i=(0,A.PE)().t,a=[{action:"purchase",title:i("store.purchase.purchase.title"),description:i("store.purchase.purchase.description")},{action:"verify",title:i("store.purchase.verify.title"),description:i("store.purchase.verify.description")}];return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(zn.Z,{className:o.tabPanel,children:a.map((function(e){return(0,ne.jsxs)(Wn.ZP,{button:!0,selected:n===e.action,onClick:function(){return t(e.action)},children:[(0,ne.jsx)(Vn.Z,{className:o.iconRoot,children:"purchase"===e.action?(0,ne.jsx)(Kn.Z,{style:{color:"purchase"===n?Hn.Z.primary.main:"#AAA",fontSize:32}}):(0,ne.jsx)(Yn.Z,{style:{color:"verify"===n?Hn.Z.primary.main:"#AAA",fontSize:32}})}),(0,ne.jsx)(Mn.Z,{primary:e.title,secondary:e.description})]},e.action)}))}),r&&(0,ne.jsx)(G.Z,{fullWidth:!0,disabled:!n,variant:"contained",color:"primary",style:{marginTop:16},onClick:r,children:i("common.next")})]})}Jn.propTypes={action:h().oneOf(["both","purchase","verify"]).isRequired,onSelect:h().func.isRequired,onNext:h().func.isRequired};var $n=["mode"];function et(e){var n=e.meta,t=e.onCancel,o=e.mode,i=e.handlePaySuccess,l=(0,A.PE)(),c=l.t,m=l.locale,f=(0,le.h6)().info,h=(0,ce.yP)(f),x=(0,p.useState)(null),v=(0,d.Z)(x,2),g=v[0],Z=v[1],y=new URL(null===n||void 0===n?void 0:n.registryUrl).origin,b=(0,W.getDisplayName)({meta:n}),k=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n,r){var a,l,d,p,m;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d=function(e){return(0,qn.Z)((function(){return An.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,a({downloadTokenList:r});case 6:e.next=11;break;case 8:return e.next=10,l(c("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,l(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})},a=function(e){var n=e.downloadTokenList;i({downloadTokenList:n})},l=function(e){K.Z.error(e),t(e)},"purchase"!==o||!g){e.next=9;break}return p=(0,ce.Pi)(g),m=p.statusUrl,e.next=7,d(m);case 7:e.next=11;break;case 9:return e.next=11,a({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,p.useEffect)((function(){if("purchase"===o){var e=new URL(y);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{An.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)}}),[o]),"purchase"===o&&!g)return"";var j={verify:{action:"verify-purchase-blocklet",checkFn:An.od.create({baseURL:y}).get,extraParams:{serverDid:f.did,blockletDid:null===n||void 0===n?void 0:n.did},messages:{title:c("store.purchase.verify.auth.title",{name:b}),scan:c("store.purchase.verify.auth.scan"),confirm:c("store.purchase.verify.auth.confirm"),success:c("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:An.od.create({baseURL:a()(y,"/store")}).get,extraParams:{factory:n.nftFactory,nw:g},messages:{title:c("store.purchase.auth.title",{name:b}),scan:c("store.purchase.auth.scan"),confirm:c("store.purchase.auth.confirm"),success:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("p",{children:c("store.purchase.auth.success")}),(0,ne.jsx)("p",{children:c("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return(0,ne.jsx)(Fn.default,(0,r.Z)({open:!0,locale:m,popup:!1,saveConnect:!1,className:"connect",baseUrl:y,onSuccess:k,cancelWhenScanned:t,onClose:t,checkTimeout:3e5,webWalletUrl:h,disableClose:!0,showDownload:!1},j[o]))}et.propTypes=(0,r.Z)((0,r.Z)({},Xn),{},{handlePaySuccess:h().func,mode:h().oneOf(["verify","purchase"]).isRequired}),et.defaultProps={handlePaySuccess:function(){}};var nt=(0,p.forwardRef)((function(e,n){var t=e.mode,i=(0,o.Z)(e,$n),a=(0,p.useState)("both"!==t?t:"verify"),l=(0,d.Z)(a,2),c=l[0],s=l[1],u=(0,p.useState)("both"!==t?2:1),m=(0,d.Z)(u,2),f=m[0],h=m[1],x=function(){c&&2!==f&&h(2)};return(0,p.useImperativeHandle)(n,(function(){return{onNext:x,getCurrentStep:function(){return f}}})),1===f?(0,ne.jsx)("div",{style:{maxWidth:520},children:(0,ne.jsx)(Jn,{action:c,onNext:null,onSelect:function(e){e!==c&&s(e)}})}):(0,ne.jsx)(et,(0,r.Z)((0,r.Z)({},i),{},{mode:c}))}));nt.propTypes={mode:h().oneOf(["both","verify","purchase"]).isRequired,ref:h().any},nt.defaultProps={ref:{}};var tt,rt=nt,ot=t(52654),it=t(30734),at=t(55632),lt=t(98185),ct=t(33665);function st(e){var n=Object.assign({},((0,ct.Z)(e),e));return(0,ne.jsxs)("div",(0,r.Z)((0,r.Z)({},n),{},{style:{width:"100%"},children:[(0,ne.jsx)("h3",{children:"End User License Agreement for Application"}),(0,ne.jsx)("p",{children:"Blocklet Server License Agreement ArcBlock, Inc. version 2020-08-28"}),(0,ne.jsx)("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),(0,ne.jsx)("p",{children:"\u6682\u65e0"})]}))}function ut(e){var n=e.meta,t=e.onClickNext,r=e.handleDescEle,o=(0,it.useNavigate)(),i=(0,A.PE)(),a=i.t,l=i.locale,c=t||function(){o("/launch-blocklet/install".concat(window.location.search))};return(0,ne.jsxs)(dt,{children:[(0,ne.jsx)("div",{className:"app-content",children:(0,ne.jsx)("div",{className:"agreement",children:(0,ne.jsx)("div",{className:"agreement-content",children:(0,ne.jsx)(lt.Z,{blockletMeta:{data:n},locale:l,handleDescEle:r})})})}),(0,ne.jsx)("div",{className:"button-container","data-cy":"agree-all",children:(0,ne.jsx)(at.Z,{onContinue:c,description:(0,ne.jsx)(st,{}),texts:{listenName:a("launchBlocklet.license"),buttonNext:a("launchBlocklet.next")}})})]})}ut.propTypes={meta:h().object.isRequired,onClickNext:h().func,handleDescEle:h().node},ut.defaultProps={onClickNext:null,handleDescEle:""};var dt=m.default.div(tt||(tt=(0,c.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")})),pt=t(38219),mt=t(70576),ft=t(50624),ht=t(77370),xt=t(90617);function vt(e){var n=e.defaultUrl,t=e.onCancel,o=e.onSuccess,i=e.onError,a=e.mode,l=e.handleText,c=(0,le.h6)().api,m=(0,ht.T)().api,f=(0,p.useState)(!1),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=(0,p.useState)(""),Z=(0,d.Z)(g,2),y=Z[0],b=Z[1],k=(0,A.PE)().t,j={dist:{}},C=(0,p.useState)(n),P=(0,d.Z)(C,2),R=P[0],E=P[1],T=(0,p.useState)(n?1:0),w=(0,d.Z)(T,2),S=w[0],_=w[1],U=(0,p.useState)(j),N=(0,d.Z)(U,2),I=N[0],D=N[1],L=(0,p.useState)(!1),O=(0,d.Z)(L,2),B=O[0],z=O[1],M=(0,p.useState)({}),V=(0,d.Z)(M,2),K=V[0],Y=V[1],X="component"===a,Q=!!X||!n,J=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var n,t,r,o,a,l;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:D(j),b(null),v(!0),e.prev=3,n=decodeURIComponent(R.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,c.getBlockletMetaFromUrl({input:{url:n}});case 14:t=e.sent,r=t.meta,o=t.inStore,a=t.registryUrl,D(r),Y({inStore:o,registryUrl:a,inputUrl:R.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,ce.Z)(e.t1)),b(l),i(e.t1);case 28:return e.prev=28,v(!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,p.useEffect)((function(){n&&J()}),[n]);var $=[{name:k("common.name"),value:(0,W.getDisplayName)({meta:I},!0)},{name:k("common.version"),value:I.version},{name:k("common.did"),value:(0,ne.jsx)(H.Z,{did:I.did})},{name:k("common.author"),value:(0,ce.rq)(I.author)},{name:k("blocklet.dist.downloadLink"),value:I.dist.tarball}],ee=[{label:k("blocklet.fromUrl.step0"),body:(0,ne.jsx)(ln.Z,{component:"div",children:(0,ne.jsx)(Pe.Z,{label:k("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,style:{marginBottom:32},margin:"dense",helperText:k("blocklet.fromUrl.description"),value:R,onChange:function(e){b(null),E(e.target.value)},disabled:x,onKeyPress:function(e){"Enter"===e.key&&(e.preventDefault(),J(),_(1))}})}),cancel:k("common.cancel"),confirm:k("common.next"),onCancel:t,onConfirm:function(){J(),_(1)}},{label:k("blocklet.fromUrl.step1"),body:x?(0,ne.jsx)("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:(0,ne.jsx)(F.Z,{})}):I.did?(0,ne.jsx)("div",{style:{paddingLeft:"10%"},children:$.map((function(e){return e.name===k("common.did")?(0,ne.jsx)(q.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:function(){return k("common.did")},children:e.value},e.name):(0,ne.jsx)(q.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)}))}):null,cancel:k(Q?"common.pre":"common.cancel"),confirm:(null===l||void 0===l?void 0:l.confirm)||k("blocklet.fromUrl.confirm"),onCancel:function(){Q?_((function(e){return e-1})):t()},onConfirm:function(){!function(){if(X)return o((0,r.Z)({meta:I},K)),void t();v(!0),z(!0)}()}}],te=ee[S];return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsxs)(ke.Z,{title:(null===l||void 0===l?void 0:l.title)||k("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:function(){return te.onCancel()},showCloseButton:0===S,disableEscapeKeyDown:!0,open:!0,actions:(0,ne.jsxs)(ne.Fragment,{children:[te.cancel&&(0,ne.jsx)(G.Z,{onClick:function(e){e.stopPropagation(),b(null),te.onCancel()},color:"inherit",children:te.cancel||k("common.cancel")}),(0,ne.jsxs)(G.Z,{onClick:function(e){e.stopPropagation(),te.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:x||!R||y,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[x&&0===S&&(0,ne.jsx)(F.Z,{size:16}),te.confirm]})]}),children:[Q&&(0,ne.jsx)(pt.Z,{alternativeLabel:!0,activeStep:S,children:ee.map((function(e){var n=e.label;return(0,ne.jsx)(mt.Z,{children:(0,ne.jsx)(ft.Z,{children:n})},n)}))}),(0,ne.jsx)(En.Z,{component:"div",style:{marginTop:24},children:te.body}),!!y&&(0,ne.jsx)(Nn.Z,{type:"error",style:{width:"100%",marginTop:8},children:y})]}),I&&B&&(0,ne.jsx)(Fn.default,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:m.get,checkTimeout:3e5,onSuccess:function(){v(!1),z(!1),o((0,r.Z)({meta:I},K)),t()},extraParams:{title:I.title,wt:(0,xt.iK)(I),blockletMetaUrl:decodeURIComponent(R.trim())},messages:{title:k("setup.keyPair.title"),scan:k("setup.keyPair.scan"),confirm:k("setup.keyPair.confirm"),success:k("setup.keyPair.success")},onClose:function(){v(!1),z(!1)}})]})}vt.propTypes={defaultUrl:h().string,onCancel:h().func.isRequired,onSuccess:h().func.isRequired,onError:h().func,mode:h().oneOf(["install","component"]),handleText:h().object},vt.defaultProps={onError:function(){},defaultUrl:"",mode:"install",handleText:{}};var gt=t(17708),Zt="blocklet-add-component-registry",yt="server-add-registry",bt=(0,Gn.Z)((function(e){return{addMenuItemRoot:{justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}}}));function kt(e){var n=e.disabled,t=e.storeList,r=e.teamDid,o=e.onAdd,i=(0,le.h6)().api,a=(0,p.useState)(!1),l=(0,d.Z)(a,2),c=l[0],m=l[1],f=(0,p.useState)(!0),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=(0,p.useState)(!1),Z=(0,d.Z)(g,2),y=Z[0],b=Z[1],k=(0,p.useState)(""),C=(0,d.Z)(k,2),P=C[0],R=C[1],E=(0,p.useState)(""),T=(0,d.Z)(E,2),w=T[0],S=T[1],_=(0,A.PE)().t,U=bt(),N=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var n,a,l,c;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m(!0),e.prev=1,n=(0,ce.bQ)(P,t),a=n.isNew,l=n.decoded,a){e.next=5;break}throw new Error(_("store.blockletRegistry.haveSameRegistry"));case 5:return e.next=7,i.addBlockletStore({input:{teamDid:r,url:l}});case 7:o(l),b(!1),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),c="".concat(_("store.blockletRegistry.addFailed")," ").concat((0,ce.Z)(e.t0)),S(c);case 15:return e.prev=15,m(!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,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsxs)(Wn.ZP,{button:!0,disabled:n,className:U.addMenuItemRoot,onClick:function(){b(!0)},children:[(0,ne.jsx)(j.Z,{font:!0}),(0,ne.jsx)(ln.Z,{variant:"inherit",children:_("store.blockletRegistry.addRegistry")})]}),(0,ne.jsxs)(ke.Z,{title:_("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:y,onClose:function(){return b(!1)},PaperProps:{style:{minHeight:"auto"}},actions:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(G.Z,{onClick:function(e){e.stopPropagation(),b(!1)},color:"inherit",children:_("common.cancel")}),(0,ne.jsxs)(G.Z,{onClick:function(e){e.stopPropagation(),N()},color:"primary","data-cy":"install-blocklet-next-step",disabled:c||!P||x,variant:"contained",autoFocus:!0,children:[c&&(0,ne.jsx)(F.Z,{size:16}),_("common.confirm")]})]}),children:[(0,ne.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,ne.jsx)(En.Z,{component:"div",children:(0,ne.jsx)(ln.Z,{component:"div",children:(0,ne.jsx)(Pe.Z,{label:_("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:P,onChange:function(e){S(null);var n=!1;e.target.value.trim()||(n=!0),e.target.value.trim()||S(_("store.blockletRegistry.registryUrlEmpty")),R(e.target.value),v(n)},disabled:c,onKeyPress:function(e){"Enter"===e.key&&(e.preventDefault(),e.target.value.trim()?N():S(_("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!w&&(0,ne.jsx)(Nn.Z,{type:"error",style:{width:"100%"},children:w})]})]})}kt.propTypes={teamDid:h().string.isRequired,disabled:h().bool,storeList:h().array,onAdd:h().func},kt.defaultProps={disabled:!1,storeList:[],onAdd:function(){}};var jt=t(65667),Ct=t(94702),Pt=t(30291);function Rt(e){var n=e.title,t=e.description,o=e.confirmPlaceholder,i=e.cancel,a=e.confirm,l=e.params,c=e.onCancel,s=e.onConfirm,u=e.keyName,d=(0,A.PE)().t,p={title:function(){return(0,ne.jsxs)("div",{children:[n," (".concat(u,")")]})},description:function(e,n){return(0,ne.jsxs)("div",{children:[(0,ne.jsx)(Re.Z,{severity:"warning",style:{width:"100%"},children:d("common.notice")}),(0,ne.jsx)("div",{style:{marginTop:24,marginBottom:24},dangerouslySetInnerHTML:{__html:t}}),(0,ne.jsxs)("div",{style:{marginBottom:24},children:[d("common.click"),"\uff1a",(0,ne.jsx)(Ee.Z,{"data-cy":"click-copy",children:u})]}),(0,ne.jsx)(ln.Z,{component:"div",children:(0,ne.jsx)(Pe.Z,{label:o,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:e.inputVal,onChange:function(t){var o;o=(0,r.Z)((0,r.Z)({},e),{},{inputVal:t.target.value,__disableConfirm:u!==t.target.value}),n((0,r.Z)((0,r.Z)({},o),{},{__disableConfirm:o.__disableConfirm}))}})})]})},confirm:a,cancel:i,onConfirm:s,onCancel:c,params:(0,r.Z)({inputVal:"",__disableConfirm:!0},l)};return(0,ne.jsx)(ae.Z,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})}function Et(e){var n=e.store,t=e.teamDid,r=e.onDelete,o=(0,le.h6)().api,i=(0,A.PE)().t,a=(0,p.useState)(!1),l=(0,d.Z)(a,2),c=l[0],m=l[1],f=(0,p.useState)(null),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=(0,Ct.Z)(),Z=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 e.prev=0,m(!0),e.next=4,o.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),K.Z.error("Remove Blocklet Store Error: ".concat((0,ce.Z)(e.t0)));case 10:return e.prev=10,m(!1),v(null),e.finish(10);case 14:case"end":return e.stop()}}),e,null,[[0,7,10,14]])})));return function(){return e.apply(this,arguments)}}(),y={keyName:n.url,title:i("store.blockletRegistry.deleteRegistry"),description:i("store.blockletRegistry.deleteDesc",{name:"<b>".concat(n.url,"</b>"),color:g.palette.error.main}),confirmPlaceholder:i("store.blockletRegistry.confirmDesc",{name:n.url}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:Z,onCancel:function(){m(!1),v(null)}};return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(k.Z,{disabled:c,onClick:function(e){e.stopPropagation(),v(y)},size:"large",children:(0,ne.jsx)(Pt.default,{})}),x&&(0,ne.jsx)(Rt,{keyName:x.keyName,title:x.title,description:x.description,confirmPlaceholder:x.confirmPlaceholder,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}Rt.propTypes={title:h().any.isRequired,keyName:h().any.isRequired,description:h().any.isRequired,confirmPlaceholder:h().any.isRequired,cancel:h().string,confirm:h().string,params:h().object,onCancel:h().func,onConfirm:h().func.isRequired},Rt.defaultProps={onCancel:function(){},cancel:"",confirm:"Confirm",params:{}},Et.propTypes={teamDid:h().string.isRequired,store:h().object.isRequired,onDelete:h().func},Et.defaultProps={onDelete:function(){}};var Tt,wt=(0,Gn.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 St(e){var n=e.teamDid,t=e.store,r=e.onDelete,o=wt();return(0,ne.jsxs)("div",{className:o.menuName,children:[(0,ne.jsx)(ln.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:t.name}),(0,ne.jsx)(ln.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(t.url)}),(0,ne.jsxs)(jt.Z,{children:[(0,ne.jsx)(k.Z,{onClick:function(e){e.stopPropagation(),window.open(t.url)},size:"large",children:(0,ne.jsx)(E.Z,{})}),!t.protected&&(0,ne.jsx)(Et,{store:t,onDelete:r,teamDid:n})]})]})}function _t(e){var n=e.onChange,t=e.loading,r=e.children,o=e.extra,i=(0,A.PE)().t,a=(0,le.h6)(),l=a.info,c=a.inService,s=(0,Ln.y0)().blocklet,u=(0,p.useState)(!1),m=(0,d.Z)(u,2),f=m[0],h=m[1],x=(0,p.useRef)(null),v=c?Zt:yt,g=(0,gt.Z)(v),Z=(0,d.Z)(g,2),y=Z[0],b=Z[1],k=(0,ce.dX)({fromBlocklet:c,blocklet:s,nodeInfo:l}),j=k.storeList,C=k.teamDid,P=y&&j.find((function(e){return y===e.url}))||j[0],R=l.mode===B.NODE_MODES.SERVERLESS;return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsxs)(Nt,{children:[(0,ne.jsx)(G.Z,{ref:x,color:"secondary","data-cy":"add-component-select-store",endIcon:(0,ne.jsx)(Oe.Z,{color:"secondary"}),onClick:function(){h(!0)},style:{padding:"0 2px"},children:(0,ne.jsx)(ln.Z,{color:"secondary",children:P.name})}),(0,ne.jsx)(ln.Z,{color:"secondary",children:o})]}),(0,ne.jsxs)(Pe.Z,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:i("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:P,autoFocus:!0,onChange:function(e){var t=e.target.value;b(t.url),n(t)},SelectProps:{open:f,MenuProps:{anchorEl:x.current},renderValue:function(e){return null===e||void 0===e?void 0:e.name},onClose:function(){h(!1)}},style:{display:"none"},margin:"normal",children:[null===j||void 0===j?void 0:j.map((function(e){return(0,ne.jsx)(Tn.Z,{value:e,"data-cy":e.url,children:(0,ne.jsx)(St,{teamDid:C,store:e,onDelete:function(){var n;y===e.url&&b(null===(n=j[0])||void 0===n?void 0:n.url)}})},e.url)})),!R&&(0,ne.jsx)(kt,{disabled:t,storeList:j,teamDid:C,onAdd:function(e){b(e)}})]}),r({currentRegistry:P})]})}St.propTypes={teamDid:h().string.isRequired,store:h().shape({name:h().string.isRequired,url:h().string.isRequired,protected:h().bool}).isRequired,onDelete:h().func},St.defaultProps={onDelete:function(){}},_t.propTypes={onChange:h().func,loading:h().bool,children:h().any.isRequired,extra:h().node},_t.defaultProps={onChange:function(){},loading:!1,extra:""};var Ut,Nt=m.default.div(Tt||(Tt=(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})),It=t(37433),Dt=t(51921),Lt=t(9709),Ot=t(49956),Bt=["handleButtonClick","handleSearchSelect","storeUrl","handleBlockletRender","extraFilter","serverVersion"],Ft=function(e,n){return a()(n,"/blocklets/".concat(e.did))},qt=function(e){var n=e.blocklet,t=e.attribute,r=e.value;return n._formatted?n._formatted[t]:r},At=function(e){return e.inStore&&!1===(0,W.isFreeBlocklet)(e)};function Gt(e){var n=e.blocklet,t=e.blocklets,r=e.handleButtonClick,o=e.endpoint,i=(0,A.PE)().t,l=a()(o,(0,ce.lk)(n.did,n.logo||"")),c=(0,p.useState)(!1),m=(0,d.Z)(c,2),f=m[0],h=m[1],x=At(n)?i("common.purchase"):i("blocklet.component.choose"),v=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(i){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.preventDefault(),i.stopPropagation(),e.prev=2,h(!0),e.next=6,r({meta:n,registryUrl:o,blocklets:t});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),K.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:Ft(n,o),style:{color:"initial",textDecoration:"none"},onClick:function(e){return!!e.currentTarget.contains(e.target)||(e.preventDefault(),!1)},target:"_blank",children:(0,ne.jsx)(Qt,{title:qt({blocklet:n,attribute:"title",value:n.title||n.name}),did:n.did,description:qt({blocklet:n,attribute:"description",value:n.description}),cover:n.logo?l:"",version:n.version,button:(0,ne.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,ne.jsx)(Ot.Kk,{children:(0,ne.jsx)(G.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)(F.Z,{size:16,style:{marginRight:3}}),x]}):x},n.did)})})})})}function zt(e){var n=e.handleButtonClick,t=e.handleSearchSelect,i=e.storeUrl,a=e.handleBlockletRender,l=e.extraFilter,c=e.serverVersion,s=(0,o.Z)(e,Bt),u=(0,A.PE)().locale,m=(0,p.useState)({}),f=(0,d.Z)(m,2),h=f[0],x=f[1],v=i;return(0,p.useEffect)((function(){x({})}),[v]),(0,ne.jsx)(Dt.ErrorBoundary,{FallbackComponent:It.H,resetKeys:[v],children:(0,ne.jsx)("div",(0,r.Z)((0,r.Z)({},s),{},{children:(0,ne.jsx)(Lt.Z,{blockletRender:function(e){var t=(0,r.Z)((0,r.Z)({},e),{},{handleButtonClick:n,endpoint:v});return a((0,r.Z)((0,r.Z)({},e),{},{defaultRender:(0,ne.jsx)(Gt,(0,r.Z)({},t))}))},baseSearch:!0,endpoint:v,locale:u,onFilterChange:function(e){x(e)},onSearchSelect:t,filters:h,extraFilter:l,serverVersion:c})}))})}Gt.propTypes={blocklet:h().object.isRequired,blocklets:h().array,handleButtonClick:h().func,endpoint:h().string},Gt.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]},zt.propTypes={storeUrl:h().string.isRequired,handleButtonClick:h().func,handleSearchSelect:h().func,handleBlockletRender:h().func,extraFilter:h().func,serverVersion:h().string},zt.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:""};var Wt,Mt,Vt,Kt,Yt,Ht,Xt,Qt=(0,m.default)(Ot.ZP)(Ut||(Ut=(0,c.Z)(["\n .ms-highlight {\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main})),Jt=t(50822),$t=["name","validation"],er=["default","key"],nr=function(e){return e.inStore&&!1===(0,W.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(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.title||e.name},lr=(0,p.forwardRef)((function(e,n){var t=e.meta,o=e.isMobile,i=e.onStepChange,a=(0,Un.useStepContext)(),l=a.steps,c=a.activeStep,s=a.setActiveStepByKey,u=a.setActiveStepByIndex,d=(0,A.PE)(),m=d.t,f=d.locale,h=l[c];return(0,p.useEffect)((function(){i(c)}),[i,c]),(0,p.useImperativeHandle)(n,(function(){return{setActiveStepByKey:s,setActiveStepByIndex:u}})),(0,ne.jsx)(mr,{component:"div",className:o?"mobileStyle":"",children:(0,ne.jsx)(_n.Z,{locale:f,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:m("blocklet.component.add"),children:(0,ne.jsx)(dr,{children:null!==h&&void 0!==h&&h.body&&"function"===typeof h.body?h.body():h.body})})})}));function cr(e){var n,t,i,a,c,m,f,h=e.blocklet,x=e.children,g=(0,A.PE)(),Z=g.t,y=g.locale,b=(0,p.useState)(!1),k=(0,d.Z)(b,2),j=k[0],C=k[1],P=(0,p.useState)(null),R=(0,d.Z)(P,2),E=R[0],T=R[1],w=(0,p.useState)(""),S=(0,d.Z)(w,2),_=S[0],U=S[1],N=(0,p.useState)(""),I=(0,d.Z)(N,2),D=I[0],L=I[1],O=(0,p.useState)(""),q=(0,d.Z)(O,2),z=q[0],M=q[1],V=(0,le.h6)(),Y=V.api,H=V.ws.useSubscription,X=V.inService,Q=V.info,J=(0,Ln.y0)().actions.refreshBlocklet,$=(0,p.useState)(null),ee=(0,d.Z)($,2),te=ee[0],re=ee[1],oe=(0,p.useState)(!1),ae=(0,d.Z)(oe,2),se=ae[0],ue=ae[1],de={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceCapability:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},pe=(0,p.useState)(de),me=(0,d.Z)(pe,2),fe=me[0],he=me[1],xe=(0,p.useState)(0),ve=(0,d.Z)(xe,2),ge=ve[0],Ze=ve[1],ye=(0,p.useRef)({}),be=(0,p.useRef)({}),ke=(0,p.useRef)({}),je=(0,Sn.Z)((function(e){return e.breakpoints.down("md")})),Ce=ye.current.meta,Re=(be.current||{}).setActiveStepByIndex,Ee=Q.mode===B.NODE_MODES.SERVERLESS,we=function(e){return he((function(n){return(0,r.Z)((0,r.Z)({},n),e)}))};(0,p.useEffect)((function(){if(fe.pathPrefix){var e=De((0,r.Z)((0,r.Z)({},fe),{},{pathPrefix:fe.pathPrefix,locale:y})).errMsg;U(e)}}),[fe.pathPrefix]),(0,p.useEffect)((function(){0===ge&&he(de)}),[ge]);var Se=function(){var e;return null!==ye&&void 0!==ye&&null!==(e=ye.current)&&void 0!==e&&e.meta?(0,W.getDisplayName)(ye.current):""},_e=function(e){!function n(t){we({installResultProps:{variant:"error",title:Se(),subTitle:e,footer:(0,ne.jsx)(G.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,Ie(ye.current.installInput);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),children:(0,ne.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[t&&(0,ne.jsx)(F.Z,{size:16,style:{marginRight:8}}),Z("common.retry")]})})}})}()},Ue=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===h||void 0===h||null===(r=h.meta)||void 0===r?void 0:r.did)&&e(n)}};H(ie.BlockletEvents.statusChange,Ue((function(e){if(e.status===ie.BlockletStatus.upgrading)we({installResultProps:{variant:"success",title:Se(),subTitle:Z("blocklet.component.installSuccessTip")}})})),[null===h||void 0===h||null===(n=h.meta)||void 0===n?void 0:n.did]),H(ie.BlockletEvents.downloadFailed,Ue((function(){_e(Z("blocklet.component.installComponentError"))})),[null===h||void 0===h||null===(t=h.meta)||void 0===t?void 0:t.did]),H(ie.BlockletEvents.installFailed,Ue((function(){_e(Z("blocklet.component.installComponentError"))})),[null===h||void 0===h||null===(i=h.meta)||void 0===i?void 0:i.did]);var Ne=function(){C(!1),L(!1),he({}),ye.current={}},Ie=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,x,v,g,Z,y,b,k,j,P,R,E,T,w,S;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=fe.pathPrefix,a=fe.bundleDid,l=fe.title,c=fe.componentName,u=void 0===c?"":c,d=fe.componentDid,p=void 0===d?"":d,m=(null===(t=ye.current)||void 0===t?void 0:t.meta)||{},f=m.configs,x=void 0===f?[]:f,v=m.registryUrl,g=m.inStore,Z=m.inputUrl,y=null===(o=ye.current)||void 0===o?void 0:o.downloadTokenList,b=g?(0,ce.Rn)(v,a):Z,C(!0),k=(0,r.Z)((0,r.Z)((0,r.Z)({rootDid:h.meta.did,url:b,mountPoint:(0,Ye.ZP)(i),title:l,name:u,did:p},fe.hasEnvironmentsStep&&x.length>0?{configs:x.map((function(e){return(0,r.Z)((0,r.Z)({},e),{},{value:fe.configsValue[e.key]||""})}))}:{}),y?{downloadTokenList:y}:{}),n),e.prev=6,e.next=9,Y.installComponent({input:k});case 9:if(!v){e.next=15;break}if(j=(0,ce.dX)({fromBlocklet:X,nodeInfo:Q,blocklet:h}),P=j.teamDid,R=j.storeList,E=(0,ce.bQ)(v,R),T=E.isNew,w=E.decoded,!T){e.next=15;break}return e.next=15,Y.addBlockletStore({input:{teamDid:P,url:w}});case 15:we({installResultProps:{}}),J({showError:!1,attachRuntimeInfo:!1}),e.next=25;break;case 19:e.prev=19,e.t0=e.catch(6),S=(0,ce.Z)(e.t0),K.Z.error(S),console.error("installComponent error: ",e.t0),_e(S);case 25:return e.prev=25,C(!1),ye.current.installInput=k,e.finish(25);case 29:case"end":return e.stop()}}),e,null,[[6,19,25,29]])})));return function(n){return e.apply(this,arguments)}}(),De=function(e){return{errMsg:(0,ot.Rw)({params:(0,r.Z)((0,r.Z)({},e),{},{did:e.bundleDid}),blocklets:[h],blocklet:h,locale:y})}},Le=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=De((0,r.Z)((0,r.Z)({},fe),{},{locale:y})),o=t.errMsg,U(o),ge!==Fe.length-2){e.next=5;break}return e.next=5,Ie(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)}}(),Oe=function(){Re((function(e){return e-1}))},Be=function(e){var n,t,i=e.chooseParams,a=void 0===i?ye.current:i,c=e.componentDid,s=e.isInit,u=void 0!==s&&s,d=a.meta,p=a.registryUrl,m=a.inStore,f=a.inputUrl,x=d.did,v=d.title,g=d.name,Z=((null===(n=h.settings)||void 0===n?void 0:n.children)||[]).filter((function(e){return"deleted"===e.status&&e.meta.bundleDid===x})),y=c||"",b=null===(t=d.environments)||void 0===t?void 0:t.map((function(e){var n=e.name,t=e.validation,i=(0,o.Z)(e,$t),a={validation:Pn()(t)?"":t};return(0,r.Z)((0,r.Z)({},i),{},{key:n},a)}));ye.current=(0,r.Z)((0,r.Z)({},a),{},{meta:(0,r.Z)((0,r.Z)({},d),{},{configs:b,registryUrl:p,inStore:m,inputUrl:f})});var k={};if(u){var j=[h],C=b||[],P=Zn()(bn()([].concat((0,l.Z)(C),[])),"key").filter((function(e){return!!e.key})).sort((function(e,n){return e.required&&!n.required?-1:n.required&&!e.required?1:0})),R=(0,W.getSharedConfigObj)({configs:P},j),E={},T=P.map((function(e){var n=e.default,t=e.key,i=(0,o.Z)(e,er);return E[t]=R[t]||n,(0,r.Z)((0,r.Z)({},i),{},{key:t,hidden:!!ie.BLOCKLET_CONFIGURABLE_KEY[t]})}));k=(0,r.Z)((0,r.Z)({},k),{},{configsList:T,configsValue:E,hasMissRequiredConfigs:ir(T,E)})}var w,S,_=h.children.some((function(e){return"/"===e.mountPoint})),U=Z.find((function(e){return e.meta.bundleDid===x}));U?k=(0,r.Z)((0,r.Z)({},k),{},{pathPrefix:U.mountPoint,title:v||"",componentName:U.meta.name,hasEnvironmentsStep:!1}):k=(0,r.Z)((0,r.Z)({},k),{},{pathPrefix:_?"/".concat((0,Ye.ZP)(g)):"/",title:v||"",componentName:"",hasEnvironmentsStep:(null===(w=ye.current.meta)||void 0===w||null===(S=w.environments)||void 0===S?void 0:S.length)>0});var N=nr(ye.current.meta),I=tr(ye.current.meta),D=rr(h);we((0,r.Z)((0,r.Z)({bundleDid:x,componentDid:y},k),{},{hasRequiredEnvironments:or(ye.current.meta),requirePurchase:N,didSpaceCapability:I,didSpaceEndpoint:D})),u&&N&&function(){var e=fe.pathPrefix,n=fe.bundleDid,t=fe.title,r=fe.componentName,o=void 0===r?"":r,i=fe.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;re({meta:c,installOpts:{type:"component",rootDid:h.meta.did,mountPoint:e,url:p,title:t,name:o,did:a}})}()},Fe=[{key:"selectComponent",name:Z("blocklet.component.selectComponent"),body:(0,ne.jsxs)(ur,{component:"div",children:[fe.showFromUrlDialog&&(0,ne.jsx)(vt,{mode:"component",onCancel:function(){we({showFromUrlDialog:!1})},onSuccess:function(e){var n=e.meta,t=e.inputUrl,r=e.inStore,o=e.registryUrl;Be({chooseParams:{meta:n,inputUrl:t,inStore:r,registryUrl:o},isInit:!0}),we({showFromUrlDialog:!1}),Le()},handleText:{title:Z("blocklet.component.addComponentTip.fromUrl"),confirm:Z("blocklet.component.choose")}}),(0,ne.jsx)(_t,{extra:Ee?null:(0,ne.jsxs)(G.Z,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:function(){we({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[(0,ne.jsx)(wn.Z,{style:{fontSize:20,marginRight:4}})," ",Z("blocklet.component.addComponentTip.fromUrl")," "]}),loading:j,onChange:function(){he({}),ye.current={}},children:function(e){var n=e.currentRegistry;return(0,ne.jsx)(zt,{serverVersion:null===Q||void 0===Q?void 0:Q.version,style:je?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:n.url,handleButtonClick:function(e){Be({chooseParams:(0,r.Z)((0,r.Z)({},e),{},{inStore:!0}),isInit:!0})},handleBlockletRender:function(e){var n=e.blocklet,t=e.defaultRender,r=(null===fe||void 0===fe?void 0:fe.bundleDid)&&(null===fe||void 0===fe?void 0:fe.bundleDid)===(null===n||void 0===n?void 0:n.did);return(0,ne.jsxs)(hr,{children:[r&&(0,ne.jsx)("div",{className:"check-container",children:(0,ne.jsx)(Te.default,{className:"check-icon"})}),(0,ne.jsx)("div",{className:r?"choose-blocklet":"",style:{marginLeft:16},children:t})]})},extraFilter:function(e){return null===e||void 0===e?void 0:e.filter((function(e){return!!(0,W.isComponentBlocklet)(e)&&!(h.children||[]).some((function(n){return n.meta.did===e.did}))}))}})}})]}),cancel:Z("common.cancel"),confirm:ar(fe)?Z("blocklet.component.addNext",{name:ar(fe)}):Z("common.next"),onCancel:Ne,onConfirm:function(){Le()}},{key:"agreement",name:Z("launchBlocklet.introduction"),body:(0,ne.jsxs)(ur,{component:"div",className:"agreement-wrapper",children:[(0,ne.jsx)(Rn.Z,{title:Z("launchBlocklet.introduction"),subTitle:Z("blocklet.component.addComponentTip.introduction")}),(0,ne.jsx)(ut,{meta:Ce,onClickNext:Le,handleDescEle:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("p",{children:(0,ne.jsx)("div",{dangerouslySetInnerHTML:{__html:Z("blocklet.component.addComponentTip.".concat(fe.requirePurchase?"isPurchase":"isFree"),{name:Se()})}})}),(0,ne.jsx)("p",{children:Z("blocklet.component.addComponentTip.belowInformation")})]})})]}),cancel:Z("common.pre"),confirm:Z("launchBlocklet.next"),onCancel:Oe,onConfirm:function(){ue(!1),Le()}},Ce&&fe.requirePurchase&&{key:"purchase",name:(0,ne.jsxs)(ne.Fragment,{children:[Z("common.verifyNFT"),(0,ne.jsx)(Bn.Z,{})]}),body:(0,ne.jsxs)(ur,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(2===(null===(a=ke.current)||void 0===a||null===(c=a.getCurrentStep)||void 0===c?void 0:c.call(a))||se)&&(0,ne.jsx)(fr,{title:Z("common.verifyNFT"),subTitle:Z("blocklet.component.addComponentTip.verifyNFT")}),jn()(fe.purchaseResultProps)?te&&(0,ne.jsx)(rt,{ref:ke,meta:te.meta,mode:fe.componentDid?"verify":"both",onCancel:function(e){ue(!1),we({purchaseResultProps:{variant:"error",title:Se(),subTitle:e,style:{paddingTop:120},footer:(0,ne.jsx)(G.Z,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:function(){we({purchaseResultProps:{}})},children:Z("common.retry")})}})},installOpts:te.installOpts,handlePaySuccess:function(e){var n=e.downloadTokenList;ye.current.downloadTokenList=n,ue(!1),Le()}}):(0,ne.jsx)("div",{className:"flex-align-center flex-justify-center",children:(0,ne.jsx)(Dn.Z,(0,r.Z)({},fe.purchaseResultProps))})]}),disabled:2===(null===(m=ke.current)||void 0===m||null===(f=m.getCurrentStep)||void 0===f?void 0:f.call(m))||se,cancel:Z("common.pre"),confirm:Z("common.next"),onConfirm:function(){"function"===typeof ke.current.onNext&&(ke.current.onNext(),ue(!0))},onCancel:function(){Oe()}},{key:"config",name:Z("common.config"),error:_,body:(0,ne.jsxs)(ur,{component:"div",children:[(0,ne.jsx)(fr,{title:Z("common.config"),subTitle:Z("blocklet.component.addComponentTip.config")}),(0,ne.jsx)(Pe.Z,{label:Z("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:z||Z("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:fe.pathPrefix,onChange:function(e){var n=e.target.value;we({pathPrefix:n}),M(Z("common.slugifyHint",{value:(0,ce.LN)(n)}))}}),!!_&&(0,ne.jsx)(Nn.Z,{type:"error",style:{width:"100%",marginTop:8},children:_})]}),cancel:Z("common.pre"),confirm:Z("common.next"),onCancel:Oe,onConfirm:function(){Le()}},Ce&&(null===fe||void 0===fe?void 0:fe.hasEnvironmentsStep)&&{key:"environment",name:(0,ne.jsxs)(ne.Fragment,{children:[Z("common.environment")," ",fe.hasRequiredEnvironments&&(0,ne.jsx)(Bn.Z,{})]}),disabled:!!E||(null===fe||void 0===fe?void 0:fe.hasMissRequiredConfigs),body:function(){return(0,ne.jsxs)(ur,{component:"div",children:[(0,ne.jsx)(fr,{title:Z("common.environment"),subTitle:Z("blocklet.component.addComponentTip.environment")}),(0,ne.jsx)(On.Z,{style:{marginTop:-12,width:"100%"},schema:fe.configsList,defaultValue:fe.configsValue,onChange:function(e,n){var t=n.action,r=n.currentItem,o=n.allValues;"confirm"===t&&we({hasMissRequiredConfigs:ir(fe.configsList,o),configsValue:o}),"edit"===t?T(r):["cancel","confirm"].includes(t)&&T(null)}})]})},cancel:Z("common.pre"),confirm:Z("common.next"),onCancel:Oe,onConfirm:Le},Ce&&(null===fe||void 0===fe?void 0:fe.didSpaceCapability)&&{key:"didSpace",name:(0,ne.jsxs)(ne.Fragment,{children:[Z("blocklet.component.didSpaceConfig")," ","required"===fe.didSpaceCapability&&(0,ne.jsx)(Bn.Z,{})]}),disabled:"required"===fe.didSpaceCapability&&!fe.didSpaceEndpoint,body:function(){return(0,ne.jsxs)(ur,{component:"div",children:[(0,ne.jsx)(fr,{title:Z("blocklet.component.didSpaceConfig"),subTitle:Z("blocklet.component.didSpaceConfigTip")}),(0,ne.jsx)(v.Z,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:(0,ne.jsx)(Jt.Z,{sx:{"& .MuiFormHelperText-root":{wordBreak:"break-all"}},helperText:fe.didSpaceEndpoint&&Z("blocklet.component.didSpaceConnected",{endpoint:fe.didSpaceEndpoint}),onConnect:function(){Le()}})})]})},cancel:Z("common.pre"),confirm:Z("common.next"),onCancel:Oe,onConfirm:Le},{key:"install",name:Z("common.install"),disabled:!1,loading:!1,body:(0,ne.jsx)(ur,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:jn()(fe.installResultProps)?(0,ne.jsx)(In.Z,{message:(0,ne.jsx)(xr,{children:Z("blocklet.component.installingCanCloseWindowTip")}),increaseSpeed:.3,messageLoop:!1}):(0,ne.jsx)("div",{style:{marginTop:120},children:(0,ne.jsx)(Dn.Z,(0,r.Z)({},fe.installResultProps))})}),confirm:Z("common.complete"),onConfirm:function(){Ne(),setTimeout((function(){var e=document.getElementsByClassName("dashboard-main")[0];e&&(e.scrollTop=e.scrollHeight)}),200)}}].filter((function(e){return e})),qe=Fe[ge]||{},Ae=function(e){e.stopPropagation(),L(!0)},Ge=ge<Fe.length-1;return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof x?x({loading:j,open:Ae}):(0,ne.jsxs)(Tn.Z,{onClick:Ae,className:"component-action","data-cy":"action-add-component",children:[j?(0,ne.jsx)(F.Z,{size:16}):(0,ne.jsx)(wn.Z,{style:{fontSize:18,marginRight:5}}),Z("blocklet.component.add")]}),D&&(0,ne.jsx)(sr,{title:Z("blocklet.component.addWithName",{name:(0,W.getDisplayName)(h)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:je?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:function(e,n){var t,r;"backdropClick"!==n&&(null===(t=Fe[0])||void 0===t||null===(r=t.onCancel)||void 0===r||r.call(t))},showCloseButton:Ge,disableEscapeKeyDown:!0,open:!0,actions:(0,ne.jsxs)(ne.Fragment,{children:[qe.cancel&&(0,ne.jsx)(G.Z,{onClick:function(e){e.stopPropagation(),qe.onCancel()},disabled:ge===Fe.length-2&&j,color:"inherit",children:qe.cancel||Z("common.cancel")}),qe.confirm&&(0,ne.jsx)(G.Z,{onClick:function(e){e.stopPropagation(),qe.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||("boolean"===typeof qe.disabled?qe.disabled:!(!j&&!qe.error&&fe.bundleDid)||ge>0&&!fe.pathPrefix),variant:"contained",autoFocus:!0,title:qe.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"280px",display:"inline-block"},children:(0,ne.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[("boolean"===typeof qe.loading?qe.loading:j)&&(0,ne.jsx)(F.Z,{size:16}),qe.confirm]})})]}),children:(0,ne.jsx)(Un.StepProvider,{steps:Fe,mode:"memory",children:(0,ne.jsx)(lr,{ref:be,meta:Ce,isMobile:je,onStepChange:function(e){Ze(e)}})})})]})}lr.propTypes={meta:h().any,onStepChange:h().func.isRequired,isMobile:h().bool.isRequired},lr.defaultProps={meta:null},cr.propTypes={children:h().any,blocklet:h().object.isRequired},cr.defaultProps={children:null};var sr=(0,m.default)(ke.Z)(Wt||(Wt=(0,c.Z)(["\n .MuiDialogContent-root {\n padding-left: 0;\n padding-right: 0;\n padding-bottom: 0;\n }\n .MuiDialogActions-root {\n padding: 16px 24px;\n }\n header:empty {\n display: none;\n }\n"]))),ur=(0,m.default)(ln.Z)(Mt||(Mt=(0,c.Z)(["\n width: 100%;\n height: 100%;\n"]))),dr=m.default.div(Vt||(Vt=(0,c.Z)(["\n padding: 34px 24px 24px;\n width: 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"]))),pr=function(e){return e.isMobile?"\n height: calc(100vh - 56px - 64px - 48px);\n ":""},mr=(0,m.default)(En.Z)(Kt||(Kt=(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 // content-panel\n .root-header + div{\n padding-top: 0;\n position: relative;\n & > div {\n padding-top: 0;\n }\n }\n\n ":"\n height: 72vh;\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-top: 0;\n // padding-left: 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: 24px;\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 pr(e)}),(function(e){return pr(e)})),fr=(0,m.default)(Rn.Z)(Yt||(Yt=(0,c.Z)(["\n margin-bottom: 24px;\n"]))),hr=m.default.div(Ht||(Ht=(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})),xr=m.default.div(Xt||(Xt=(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})),vr=function(e){return e.children.filter((function(e){return e.meta.interfaces.find((function(e){return e.type===ie.BLOCKLET_INTERFACE_TYPE_WEB}))}))};function gr(e){var n=e.params,t=e.setParams,o=e.setError,i=e.serviceTypes,a=(0,A.PE)().t,l=(0,Ln.y0)().blocklet,c=l.meta.did,s=vr(l),u=(0,p.useState)([]),m=(0,d.Z)(u,2),f=m[0],h=m[1],x={301:a("common.redirectPermanently"),302:a("common.redirectTemporary"),307:a("common.redirectTemporary"),308:a("common.redirectPermanently")};return(0,p.useEffect)((function(){if(n.type===B.ROUTING_RULE_TYPES.COMPONENT&&n.componentId){var e=s.find((function(e){return e.meta.did===n.componentId})),o=(0,W.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"}),h(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)(Pe.Z,{select:!0,label:a("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:n.type,onChange:function(e){o(""),t((0,r.Z)((0,r.Z)({},n),{},{type:e.target.value,did:e.target.value===B.ROUTING_RULE_TYPES.BLOCKLET?c:"",__disableConfirm:!1}))},style:{marginBottom:32},SelectProps:{},children:i.map((function(e){var n=e.name,t=e.value;return(0,ne.jsx)(Tn.Z,{value:t,children:n},t)}))}),n.type===B.ROUTING_RULE_TYPES.REDIRECT&&[(0,ne.jsx)(Pe.Z,{select:!0,label:a("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(x).map((function(e){return(0,ne.jsx)(Tn.Z,{value:e,children:"".concat(x[e]," - ").concat(e)},e)}))},"redirectCode"),(0,ne.jsx)(Pe.Z,{label:a("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"redirect-url-input",fullWidth:!0,value:n.url,helperText:a("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()?o(""):o(a("router.validation.redirectUrlRequired"))}},"redirectUrl")],n.type===B.ROUTING_RULE_TYPES.COMPONENT&&[(0,ne.jsx)(Pe.Z,{select:!0,label:a("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:n.componentId,onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{componentId:e.target.value}))},style:{marginBottom:32},SelectProps:{},children:s.map((function(e){return(0,ne.jsx)(Tn.Z,{value:e.meta.did,selected:e.meta.did===n.componentId,children:(0,W.getDisplayName)(e,!0)},e.meta.did)}))},"componentId"),f.length?(0,ne.jsx)(Pe.Z,{select:!0,label:a("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:n.pageGroup,helperText:a("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{pageGroup:e.target.value}))},SelectProps:{},children:f.map((function(e){return(0,ne.jsx)(Tn.Z,{value:e.value,selected:e.value===n.pageGroup,children:e.label},e.label)}))},"pageGroup"):null].filter(Boolean),n.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,ne.jsx)(Pe.Z,{label:a("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:n.url,helperText:a("router.urlHelperText"),style:{marginBottom:32},onChange:function(e){t((0,r.Z)((0,r.Z)({},n),{},{url:e.target.value,__disableConfirm:!e.target.value.trim()})),e.target.value.trim()?o(""):o(a("router.validation.rewriteUrlRequired"))}},"url")]})}function Zr(e){var n=e.children,t=(0,A.PE)().t,o=(0,le.h6)().api,i=(0,Ln.y0)().blocklet,a=(0,p.useState)(!1),l=(0,d.Z)(a,2),c=l[0],m=l[1],f=(0,p.useState)(null),h=(0,d.Z)(f,2),x=h[0],v=h[1],g=i.meta.did,Z=i.site.id,y=function(){var e=(0,u.Z)((0,s.Z)().mark((function e(n){var r,i;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,ot.fX)(n,t);case 3:if(!(r=e.sent)){e.next=6;break}throw r;case 6:return m(!0),i={from:{pathPrefix:(0,Ye.ZP)(n.pathPrefix)},to:{type:n.type}},n.type===B.ROUTING_RULE_TYPES.REDIRECT&&(i.to.url=n.url.trim(),i.to.redirectCode=n.redirectCode),n.type===B.ROUTING_RULE_TYPES.COMPONENT&&(i.to.did=g,i.to.componentId=n.componentId,i.to.pageGroup=n.pageGroup),n.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(i.to.url=(0,Ye.ZP)(n.url)),e.next=13,o.addRoutingRule({input:{id:Z,rule:i,teamDid:g}});case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),K.Z.error(e.t0.message);case 18:return e.prev=18,m(!1),v(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)}}(),b={title:t("router.rule.add.title"),description:function(e,n,o){return(0,ne.jsxs)(ln.Z,{component:"div",children:[(0,ne.jsx)(Pe.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(a){var l=!1,c=(0,ot.Rw)({params:(0,r.Z)((0,r.Z)({},e),{},{pathPrefix:a.target.value}),blocklets:[i]});o(c),e.type===B.ROUTING_RULE_TYPES.BLOCKLET&&c&&(l=!0),e.type!==B.ROUTING_RULE_TYPES.REDIRECT||e.url||(l=!0),e.type!==B.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(l=!0),a.target.value.trim()||(l=!0,o(t("router.validation.pathPrefixRequired"))),l||o("");var s=t("common.slugifyHint",{value:(0,ce.LN)(a.target.value)});n((0,r.Z)((0,r.Z)({},e),{},{pathPrefix:a.target.value,pathPrefixHint:s,__disableConfirm:l}))}}),(0,ne.jsx)(gr,{params:e,setParams:function(e){o(null),(0,ot.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:B.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,__disableConfirm:!0},onConfirm:y,onCancel:function(){m(!1),v(null)}},k=function(e){e.stopPropagation(),v(b)};return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof n?n({loading:c,open:k}):(0,ne.jsxs)(Tn.Z,{onClick:k,className:"rule-action","data-cy":"action-add-rule",children:[c?(0,ne.jsx)(F.Z,{size:16}):(0,ne.jsx)(wn.Z,{style:{fontSize:18,marginRight:5}}),t("router.rule.add.title")]}),x&&(0,ne.jsx)(ae.Z,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel,color:"primary"})]})}gr.propTypes={params:h().object,serviceTypes:h().array,setParams:h().func,setError:h().func},gr.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:B.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:B.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:B.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Component - Pass traffic to blocklet component",value:B.ROUTING_RULE_TYPES.COMPONENT}],setParams:function(){},setError:function(){}},Zr.propTypes={children:h().any},Zr.defaultProps={children:null};var yr=t(92522),br=t.n(yr),kr=t(59467),jr=t(87862);function Cr(e){var n=e.id,t=e.from,r=e.children,o=(0,A.PE)().t,i=(0,le.h6)().api,a=(0,Ln.y0)().blocklet,l=(0,p.useState)(!1),c=(0,d.Z)(l,2),m=c[0],f=c[1],h=(0,p.useState)(null),x=(0,d.Z)(h,2),v=x[0],g=x[1],Z=a.meta.did,y=a.site.id,b=t.pathPrefix,k=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 f(!0),e.prev=1,e.next=4,i.deleteRoutingRule({input:{id:y,ruleId:n,teamDid:Z}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),K.Z.error(e.t0.message);case 9:return e.prev=9,g(null),f(!1),e.finish(9);case 13:case"end":return e.stop()}}),e,null,[[1,6,9,13]])})));return function(){return e.apply(this,arguments)}}(),j={keyName:b,title:o("router.rule.delete.title"),description:o("router.rule.delete.description",{name:"<b>".concat(b,"</b>")}),confirmPlaceholder:o("router.rule.delete.confirm_desc",{name:b}),confirm:o("common.delConfirm"),cancel:o("router.rule.delete.cancel"),onConfirm:k,onCancel:function(){f(!1),g(null)}},C=function(e){e.stopPropagation(),g(j)};return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof r?r({loading:m,open:C}):(0,ne.jsxs)(Tn.Z,{onClick:C,className:"rule-action","data-cy":"action-delete-rule",children:[m?(0,ne.jsx)(F.Z,{size:16}):(0,ne.jsx)(I.default,{style:{fontSize:18,marginRight:5}}),o("router.rule.delete.title")]}),v&&(0,ne.jsx)(Rt,{keyName:v.keyName,title:v.title,description:v.description,confirmPlaceholder:v.confirmPlaceholder,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]})}function Pr(e){var n=e.id,t=e.from,o=e.to,i=e.children,a=(0,A.PE)().t,l=(0,le.h6)().api,c=(0,Ln.y0)().blocklet,m=(0,p.useState)(!1),f=(0,d.Z)(m,2),h=f[0],x=f[1],v=(0,p.useState)(null),g=(0,d.Z)(v,2),Z=g[0],y=g[1],b=c.meta.did,k=c.site.id,j=t.pathPrefix,C=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,ot.fX)(t,a);case 3:if(!(r=e.sent)){e.next=6;break}throw r;case 6:return x(!0),o={id:n,from:{pathPrefix:(0,Ye.ZP)(t.pathPrefix)},to:{type:t.type}},t.type===B.ROUTING_RULE_TYPES.REDIRECT&&(o.to.url=t.url,o.to.redirectCode=t.redirectCode),t.type===B.ROUTING_RULE_TYPES.COMPONENT&&(o.to.did=b,o.to.componentId=t.componentId,o.to.pageGroup=t.pageGroup),t.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(o.to.url=(0,Ye.ZP)(t.url)),e.next=13,l.updateRoutingRule({input:{id:k,rule:o,teamDid:b}});case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),K.Z.error(e.t0.message);case 18:return e.prev=18,x(!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)}}(),P={title:a("router.rule.update.title"),description:function(e,n,t){return(0,ne.jsxs)(ln.Z,{component:"div",children:[(0,ne.jsx)(Pe.Z,{label:a("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix","data-cy":"path-prefix-input",fullWidth:!0,autoFocus:!0,helperText:e.helperText||a("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:e.pathPrefix,onChange:function(o){var i=!1;e.type!==B.ROUTING_RULE_TYPES.REDIRECT||e.url||(i=!0),e.type!==B.ROUTING_RULE_TYPES.GENERAL_REWRITE||e.url||(i=!0),o.target.value.trim()||(i=!0,t(a("router.validation.pathPrefixRequired"))),i||t("");var l=a("common.slugifyHint",{value:(0,ce.LN)(o.target.value)});n((0,r.Z)((0,r.Z)({},e),{},{pathPrefix:o.target.value,helperText:l,__disableConfirm:i}))}}),(0,ne.jsx)(gr,{params:e,setParams:function(e){(0,ot.fX)(e,a)?n((0,r.Z)((0,r.Z)({},e),{},{__disableConfirm:!0})):n((0,r.Z)({},e))},setError:t})]})},confirm:a("router.rule.update.confirm"),cancel:a("router.rule.update.cancel"),color:"primary",params:{did:o.did||"",pathPrefix:"/"===j?j:j.replace(/^\/+/,"").replace(/\/+$/,""),type:o.type||B.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:o.redirectCode||302,componentId:o.componentId||"",pageGroup:o.pageGroup||"",url:o.url||"",__disableConfirm:!1},onConfirm:C,onCancel:function(){x(!1),y(null)}},R=function(e){e.stopPropagation(),y(P)};return(0,ne.jsxs)(ne.Fragment,{children:["function"===typeof i?i({loading:h,open:R}):(0,ne.jsxs)(Tn.Z,{onClick:R,className:"rule-action","data-cy":"action-update-rule",children:[h?(0,ne.jsx)(F.Z,{size:16}):(0,ne.jsx)(be.default,{style:{fontSize:18,marginRight:5}}),a("router.rule.update.title")]}),Z&&(0,ne.jsx)(ae.Z,{title:Z.title,description:Z.description,confirm:Z.confirm,color:Z.color,cancel:Z.cancel,params:Z.params,onConfirm:Z.onConfirm,onCancel:Z.onCancel})]})}function Rr(e){var n=(0,A.PE)().locale,t=(0,Ln.y0)(),o=t.blocklet,i=t.recommendedDomain,a=(0,ce.Sk)(i,e.from.pathPrefix,(0,ce.f0)(o,n));return(0,ne.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)("a",{target:"_blank",href:a,rel:"noopener noreferrer",title:a,children:(0,ne.jsx)(k.Z,{size:"small",children:(0,ne.jsx)(E.Z,{})})}),(0,ne.jsx)(Pr,(0,r.Z)((0,r.Z)({},e),{},{children:function(n){var t=n.open;return(0,ne.jsx)(k.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-update-rule",children:(0,ne.jsx)(P.Z,{})})}})),(0,ne.jsx)(Cr,(0,r.Z)((0,r.Z)({},e),{},{children:function(n){var t=n.open;return(0,ne.jsx)(k.Z,{size:"small",onClick:t,disabled:e.isProtected,"data-cy":"action-delete-rule",children:(0,ne.jsx)(I.default,{})})}}))]})}Cr.propTypes={id:h().string.isRequired,from:h().object.isRequired,children:h().any},Cr.defaultProps={children:null},Pr.propTypes={id:h().string.isRequired,from:h().object.isRequired,to:h().object.isRequired,children:h().any},Pr.defaultProps={children:null},Rr.propTypes={isProtected:h().bool},Rr.defaultProps={isProtected:!1};var Er=["group"];function Tr(e){var n=e.group,t=(0,o.Z)(e,Er);return n?(0,ne.jsx)(X.Z,(0,r.Z)((0,r.Z)({type:"reverse"},t),{},{children:n})):null}function wr(e){var n=e.domain,t=e.isHttps,r=e.toUrl,o=t?"https":"http",i=r;return br()(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 Sr(e){var n=e.hasPermission,t=(0,A.PE)(),o=t.t,i=t.locale,a=(0,Ct.Z)(),l=(0,Ln.y0)(),c=l.blocklet,s=l.recommendedDomain;return c.site.rules.filter((function(e){return e.to.type!==B.ROUTING_RULE_TYPES.BLOCKLET})).map((function(e){var t=null,l=null;e.to.type===B.ROUTING_RULE_TYPES.NONE?t="404":e.to.type===B.ROUTING_RULE_TYPES.REDIRECT?t=e.to.redirectCode:e.to.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE?t="R":e.to.type===B.ROUTING_RULE_TYPES.COMPONENT&&(l=c.children.find((function(n){return n.meta.did===e.to.componentId})),t="C");var u=e.isProtected?(0,ne.jsx)(w.Z,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:(0,ne.jsx)("span",{children:(0,ne.jsx)(k.Z,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:(0,ne.jsx)(jr.Z,{style:{fill:a.palette.text.disabled}})})})}):(0,ne.jsx)(Rr,(0,r.Z)({},e));return[(0,ne.jsxs)(v.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)(v.Z,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,ne.jsx)(v.Z,{width:28}),"object"===typeof t?t:(0,ne.jsx)(kr.Z,{children:t}),(0,ne.jsxs)(v.Z,{ml:2,children:[(0,ne.jsxs)(v.Z,{style:{color:"#222",fontSize:16},children:[e.to.type===B.ROUTING_RULE_TYPES.NONE&&o("common.page404"),e.to.type===B.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),e.to.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),e.to.type===B.ROUTING_RULE_TYPES.COMPONENT&&(0,W.getDisplayName)(l,!0)]}),(0,ne.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[e.to.type===B.ROUTING_RULE_TYPES.REDIRECT&&(0,ne.jsx)(wr,{domain:s,toUrl:e.to.url}),e.to.type===B.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(0,ne.jsx)(wr,{domain:s,toUrl:e.to.url}),e.to.type===B.ROUTING_RULE_TYPES.COMPONENT&&(0,ne.jsx)(Tr,{group:e.to.pageGroup})]})]})]}),(0,ne.jsx)(v.Z,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,ne.jsx)(ee.Z,{href:(0,ce.Sk)(s,e.from.pathPrefix,(0,ce.f0)(c,i)),target:"_blank",style:{fontSize:16},underline:"hover",children:e.from.pathPrefix})},e.from.pathPrefix),(0,ne.jsx)(v.Z,{children:n&&(0,ne.jsx)("div",{style:{textAlign:"right"},children:u})},"actions")]},"rule"),(0,ne.jsx)(vn.Z,{},"divider")]}))}Tr.propTypes={group:h().string.isRequired},wr.propTypes={domain:h().string.isRequired,toUrl:h().string.isRequired,isHttps:h().bool},wr.defaultProps={isHttps:!1},Sr.propTypes={hasPermission:h().bool},Sr.defaultProps={hasPermission:!1};var _r=(0,se.V)(Sr,"mutate_blocklets"),Ur=(0,se.V)(Sr,"",ce.Wf);function Nr(e){return(0,le.h6)().inService?(0,ne.jsx)(Ur,(0,r.Z)({},e)):(0,ne.jsx)(_r,(0,r.Z)({},e))}var Ir,Dr,Lr,Or=t(80714),Br=["blocklet","onUpdate","getComponentUrl"],Fr=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)(X.Z,{children:e.version})}]:[]},qr=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}},Ar=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 Gr(e){var n,t,r,o=e.blocklet,i=e.ancestors,a=e.depth,l=e.onRemove,c=e.onStart,m=e.onStop,f=e.onRestart,h=e.onReload,y=e.getComponentUrl,b=e.app,j=(0,p.useContext)(A.RD),C=j.t,T=j.locale,S=(0,p.useState)(),_=(0,d.Z)(S,2),D=_[0],L=_[1],B=(0,p.useState)(!1),F=(0,d.Z)(B,2),G=F[0],z=F[1],M=(0,p.useState)(!1),K=(0,d.Z)(M,2),Q=K[0],J=K[1],$=(0,p.useState)(null),ee=(0,d.Z)($,2),oe=ee[0],ie=ee[1],le=(0,Y.K)().deletingBlocklets,se=o.status;1===a&&le.includes(o.meta.did)&&(se="deleting");var ue,de="/".concat(o.mountPoint||"/").replace(/\/+/g,"/"),pe=y(de),me=D?qr(D):{},xe=D?[{name:C("common.name"),value:(0,W.getDisplayName)(D,!0)},{name:C("common.version"),value:(0,ne.jsx)(fe,{blocklet:D,checkUpgrade:!1})},{name:C("common.status"),value:(0,ne.jsx)(re.Z,{status:se,source:D.source})},"running"===o.status?{name:C("blocklet.startedAt"),value:(0,ce.B2)(o.startedAt,T)}:null,"running"!==o.status?{name:C("blocklet.stoppedAt"),value:(0,ce.B2)(o.stoppedAt,T)}:null,{name:C("common.mountPoint"),value:de},{name:C("common.group"),value:(0,ne.jsx)(X.Z,{type:"success",children:D.meta.group})},{name:C("blocklet.overview.source"),value:(0,ne.jsx)(te,{sourceInfo:me,blocklet:o})},{name:C("blocklet.overview.deployedFrom"),value:me.deployedFrom||"-"},{name:C("common.did"),value:(0,ne.jsx)(H.Z,{did:D.meta.did})},{name:C("common.author"),value:(0,ce.rq)(D.meta.author)},{name:C("common.engine"),value:Fr(D.engine,C).map((function(e){var n=e.name,t=e.value;return(0,ne.jsx)(q.Z,{style:{marginBottom:4},nameWidth:120,name:n,children:t},n)}))},null!==(n=o.dependents)&&void 0!==n&&n.length?{name:C("common.dependents"),value:(0,ne.jsx)(v.Z,{children:o.dependents.map((function(e){return(0,ne.jsx)(v.Z,{children:"".concat(Ar(e.id,b)," ").concat(e.required?"(".concat(C("common.required"),")"):"")})}))})}:null].filter(Boolean):[],ge=(0,W.isInProgress)(b.status),Ze=(0,W.isInProgress)(o.status),ye="";if(ge||Ze||1===a&&le.includes(o.meta.did))ye=C("blocklet.component.tip.stopBlocklet");else if(null!==(t=o.dependents)&&void 0!==t&&t.length){var be=o.dependents.filter((function(e){return e.required}));if(be.length){var ke=be.map((function(e){return Ar(e.id,b)}));ye=C("blocklet.component.tip.requiredBy",{name:ke.join(", ")})}}return[(0,ne.jsxs)(Wr,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)(v.Z,{pl:2,width:{xs:300,md:400},display:"flex",alignItems:"center",children:[(0,ne.jsx)(he.Z,{blocklet:o,ancestors:i}),(0,ne.jsxs)(v.Z,{ml:"16px",children:[(0,ne.jsx)(v.Z,{className:"component-name",onClick:function(){return L(o)},children:(0,W.getDisplayName)(o,!0)}),(0,ne.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(fe,{blocklet:o,checkUpgrade:!1}),(0,ne.jsx)(ve,{style:{marginLeft:4},mode:o.mode||""}),"unknown"!==se&&(0,ne.jsx)(re.Z,{style:{marginLeft:4},status:se,source:o.source}),!(null===(r=o.dependents)||void 0===r||!r.length)&&(0,ne.jsx)(w.Z,{title:["".concat(C("common.dependents"),": "),o.dependents.map((function(e){return(0,ne.jsx)(v.Z,{pl:1,children:"".concat(Ar(e.id,b)," ").concat(e.required?"(".concat(C("common.required"),")"):"")})}))],children:(0,ne.jsx)(v.Z,{display:"flex",color:"primary.main",ml:1,children:(0,ne.jsx)(O.JO,{icon:"octicon:package-dependents-16"})})})]})]})]},o),(0,ne.jsx)(v.Z,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:(0,ne.jsx)("a",{target:"_blank",href:pe,rel:"noopener noreferrer",title:pe,children:(0,ne.jsx)(v.Z,{maxWidth:400,sx:{color:"secondary.main",fontSize:18,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:V()(de)})})},de),(0,ne.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(w.Z,{title:C("common.visit"),children:(0,ne.jsx)("a",{target:"_blank",href:pe,rel:"noopener noreferrer",children:(0,ne.jsx)(k.Z,{size:"small",children:(0,ne.jsx)(E.Z,{})})})}),(0,ne.jsx)(rn,{blocklet:o,ancestors:i,children:function(e){var n=e.open;return(0,ne.jsx)(w.Z,{title:C("common.config"),children:(0,ne.jsx)(zr,{color:"error",badgeContent:"",variant:"dot",invisible:!(0,W.getComponentMissingConfigs)(o,i).length,children:(0,ne.jsx)(k.Z,{onClick:n,size:"small",children:(0,ne.jsx)(P.Z,{})})})},"config")}}),(0,ne.jsx)(hn,{blocklet:b,component:o,onStart:c,onStop:m,disabled:"starting"!==b.status&&(0,W.isInProgress)(b.status)}),(0,ne.jsx)(Or.Z,{"data-cy":"component-actions",actions:[{icon:(0,ne.jsx)(R.Z,{}),text:C("common.detail"),onClick:function(){L(o)}},{icon:(0,ne.jsx)(U.default,{}),text:C("common.restart"),onClick:function(){ie({title:"".concat(C("common.restart")," ").concat(o.meta.title),description:C("blocklet.action.restartDescription"),confirm:C("blocklet.action.confirmRestart"),cancel:C("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 J(!0),e.next=3,f(o);case 3:J(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),onCancel:function(){return ie(null)}})},disabled:ge||Ze||"running"!==o.status},{icon:(0,ne.jsx)(N.Z,{}),text:C("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 J(!0),e.next=3,h(o);case 3:J(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),disabled:Q||ge||Ze||"running"!==o.status},{icon:(0,ne.jsx)(I.default,{}),text:C("common.delete"),onClick:function(){z(!0)},disabled:ge||Ze||!!ye,tip:ye}]})]},"actions")]},"group-not-gateway-box"),(0,ne.jsx)(vn.Z,{depth:2}),!!D&&(0,ne.jsx)(x.Z,{open:!0,fullWidth:!0,maxWidth:"md",onClose:function(){L(null)},children:(0,ne.jsxs)(v.Z,{paddingY:1.5,children:[(0,ne.jsx)(Z.Z,{children:C("common.componentBasicInfo")}),(0,ne.jsx)(g.Z,{children:(ue=xe,ue.map((function(e){return e.name===C("common.did")||e.name===C("blocklet.appId")?(0,ne.jsx)(q.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:function(){return e.name},children:e.value},e.name):(0,ne.jsx)(q.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)})))})]},"dialog-wrapper")},"base-info-dialog"),(0,ne.jsx)(un,{blocklet:b,component:o,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 J(!0),e.prev=1,e.next=4,l.apply(void 0,n);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:J(!1),z(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),onCancel:function(){return z(!1)},hideBtn:!0,showConfirm:G}),oe&&(0,ne.jsx)(ae.Z,{title:oe.title,description:oe.description,confirm:oe.confirm,cancel:oe.cancel,params:oe.params,onConfirm:oe.onConfirm,onCancel:oe.onCancel})]}Gr.propTypes={blocklet:h().object.isRequired,ancestors:h().array,depth:h().number,onRemove:h().func,onStart:h().func,onStop:h().func,onRestart:h().func,onReload:h().func,getComponentUrl:h().func,app:h().object},Gr.defaultProps={ancestors:[],depth:0,onRemove:function(){},onStart:function(){},onStop:function(){},onRestart:function(){},onReload:function(){},getComponentUrl:function(){return window.location.origin},app:null};var zr=(0,m.default)(C.Z)(Ir||(Ir=(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})),Wr=(0,m.default)(v.Z)(Dr||(Dr=(0,c.Z)(["\n .component-name {\n color: #222;\n font-size: 16px;\n cursor: pointer;\n }\n"])));function Mr(e){var n=e.blocklet,t=(e.onUpdate,e.getComponentUrl),i=(0,o.Z)(e,Br),a=(0,p.useContext)(A.RD).t,c=(0,le.h6)(),m=c.api,f=c.inService,h=c.info,C=(0,Y.K)(),R=C.addDeletingDid,E=C.removeDeletingDid,U=C.matchDeletingDid,N=(0,p.useState)(!1),I=(0,d.Z)(N,2),O=I[0],q=I[1],M=(0,p.useState)(null),V=(0,d.Z)(M,2),H=V[0],X=V[1],Q=(0,p.useState)(null),J=(0,d.Z)(Q,2),$=J[0],ee=J[1],te=(0,p.useState)(!1),re=(0,d.Z)(te,2),oe=re[0],ie=re[1],ae=n&&n.structVersion!==B.APP_STRUCT_VERSION,ue=(0,p.useState)(!1),de=(0,d.Z)(ue,2),pe=de[0],me=de[1],fe=(0,l.Z)(n.children)||[];"gateway"!==n.meta.group&&fe.unshift(n),U(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,l;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!O){e.next=2;break}return e.abrupt("return");case 2:return q(!0),e.prev=3,e.next=6,m.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,q(!1),r){e.next=16;break}return K.Z.info(a("blocklet.component.noUpdate")),e.abrupt("return");case 16:i=[],(0,W.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})}})),l={},i.forEach((function(e){l[e.groupId]?e.disabled=!0:l[e.groupId]=!0})),X({params:{updateId:r},list:i,checks:l,hasChecks:!0}),e.next=27;break;case 23:e.prev=23,e.t1=e.catch(3),q(!1),K.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(!O){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,q(!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,m.upgradeComponents({input:r});case 8:q(!1),X(null),me(null),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(2),q(!1),K.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 R(t.meta.did),e.prev=1,e.next=4,m.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),K.Z.error((0,ce.Z)(e.t0)),E(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,m.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),K.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,m.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),K.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,m.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),K.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,m.reloadBlocklet({input:{did:n.meta.did,componentDids:[t.meta.did]}});case 3:return e.next=5,(0,ce._v)(800);case 5:K.Z.success(a("blocklet.reloadSuccess")),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),K.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)(Vr,(0,r.Z)((0,r.Z)({component:"div"},i),{},{children:[(0,ne.jsxs)(v.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)("div",{className:"title",children:[a("common.components"),!ae&&(0,ne.jsx)(se.Z,{permission:f?"":"mutate_blocklets",role:f?ce.Wf:[],children:(0,ne.jsx)(zr,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!pe,children:(0,ne.jsxs)(G.Z,{disabled:O||(0,W.isInProgress)(n.status),color:"secondary",onClick:function(){he()},"data-cy":"check-for-updates",children:[(0,ne.jsx)(v.Z,{mr:.5,display:"flex",children:O?(0,ne.jsx)(F.Z,{size:16}):(0,ne.jsx)(b.Z,{style:{fontSize:"1em"}})}),a("blocklet.component.checkUpdateTitle")]})})})]}),(0,ne.jsx)(se.Z,{permission:f?"":"mutate_blocklets",role:f?ce.Wf:[],children:(0,ne.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(Zr,{children:function(e){var t=e.open;return(0,ne.jsxs)(G.Z,{disabled:O||(0,W.isInProgress)(n.status),variant:"text",color:"primary","data-cy":"add-rule",onClick:t,children:[(0,ne.jsx)(j.Z,{style:{fontSize:"1.3em",marginRight:4}}),a("router.rule.add.title")]})}}),!ae&&(0,ne.jsx)(cr,{blocklet:n,serverVersion:h.version,children:function(e){var t=e.open;return(0,ne.jsxs)(G.Z,{disabled:O||(0,W.isInProgress)(n.status),variant:"text",color:"primary","data-cy":"add-component",onClick:t,children:[(0,ne.jsx)(j.Z,{style:{fontSize:"1.3em",marginRight:4}}),a("blocklet.component.add")]})}}),!ae&&(0,ne.jsx)(rn,{blocklet:n,ancestors:[],children:function(e){var n=e.open;return(0,ne.jsx)(w.Z,{title:"".concat(a("blocklet.component.container")).concat(a("common.config")),children:(0,ne.jsx)(k.Z,{onClick:n,size:"small",color:"primary",children:(0,ne.jsx)(P.Z,{style:{fontSize:18}})})},"config")}})]})})]}),fe&&fe.length?(0,ne.jsxs)(v.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},children:["gateway"!==n.meta.group&&(0,ne.jsx)(Gr,{blocklet:n,app:n,onRemove:ve,onStart:ge,onStop:Ze,onReload:be,onRestart:ye,getComponentUrl:t},"0-".concat(n.meta.did)),n.children.map((function(e){return(0,ne.jsx)(Gr,{depth:1,blocklet:e,ancestors:[n],app:n,onRemove:ve,onStart:ge,onStop:Ze,onReload:be,onRestart:ye,getComponentUrl:t},"1-".concat(e.meta.did))}))]},"top-blocklet-".concat(n.meta.did)):(0,ne.jsx)(v.Z,{mt:8,children:(0,ne.jsx)(z.Z,{children:a("blocklet.component.noComponent")})}),!!n.site.rules.length&&(0,ne.jsx)(v.Z,{mt:0,ml:{xs:"-16px",md:"-28px"},children:(0,ne.jsx)(Nr,{})}),!!H&&(0,ne.jsx)(x.Z,{open:!0,fullWidth:!0,children:(0,ne.jsxs)(v.Z,{paddingY:1.5,children:[(0,ne.jsx)(Z.Z,{children:a("blocklet.component.updateTitle")}),(0,ne.jsx)(v.Z,{component:g.Z,py:4,children:H.list.map((function(e){return(0,ne.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(_.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)(v.Z,{flexGrow:1,mt:3,children:[(0,ne.jsx)(v.Z,{item:!0,xs:8,children:e.name}),e.version&&(0,ne.jsxs)(T.ZP,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[(0,ne.jsx)(T.ZP,{item:!0,xs:3,children:e.version}),(0,ne.jsx)(T.ZP,{item:!0,xs:1,children:(0,ne.jsx)(S.Z,{style:{fontSize:"0.9em"}})}),(0,ne.jsx)(T.ZP,{item:!0,xs:3,children:(0,ne.jsx)(v.Z,{color:"secondary.main",children:e.newVersion})})]})]},"".concat(e.name,"-").concat(e.newVersion))]})}))}),(0,ne.jsxs)(y.Z,{style:{padding:"8px 24px 24px"},children:[(0,ne.jsx)(G.Z,{onClick:function(){X(null)},children:a("common.cancel")}),(0,ne.jsxs)(G.Z,{onClick:function(e){e.stopPropagation(),xe()},color:"primary",disabled:O||!H.hasChecks,variant:"contained",autoFocus:!0,children:[O&&(0,ne.jsx)(F.Z,{size:16}),a("common.update")]})]})]})}),!!$&&(0,ne.jsx)(x.Z,{open:!0,fullWidth:!0,onClose:function(){return ee(!1)},children:(0,ne.jsxs)(v.Z,{paddingY:1.5,children:[(0,ne.jsx)(Z.Z,{children:a("common.configuration")}),(0,ne.jsx)(g.Z,{children:(0,ne.jsx)(v.Z,{py:2,children:(0,ne.jsx)(D.Z,{control:(0,ne.jsx)(L.Z,{checked:oe,onChange:function(e){return ie(!!e.target.checked)}}),label:a("blocklet.component.showContainer")})})})]})})]}))}Mr.propTypes={blocklet:h().object.isRequired,onUpdate:h().func,getComponentUrl:h().func},Mr.defaultProps={onUpdate:function(){},getComponentUrl:function(){return window.location.origin}};var Vr=m.default.div(Lr||(Lr=(0,c.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n margin-bottom: ",";\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"])),(function(e){return e.theme.spacing(1)})),Kr=["blocklet"];function Yr(e){var n=e.blocklet,t=(0,o.Z)(e,Kr);return(0,ne.jsx)(Mr,(0,r.Z)({blocklet:n,getComponentUrl:function(e){return"".concat(a()(window.location.origin,e))}},t))}Yr.defaultProps={}},50822:function(e,n,t){t.d(n,{Z:function(){return H}});var r,o=t(32723),i=t(33028),a=t(34795),l=t(96234),c=t(59740),s=t(30969),u=t(83241),d=t(47333),p=t(59505),m=t(95803),f=t.n(m),h=t(24974),x=t.n(h),v=t(19611),g=t.n(v),Z=t(50576),y=t(33359),b=t(94984),k=t(7017),j=t(45008),C=t(41395),P=t(71171),R=t(68079),E=t(16380),T=t(92522),w=t.n(T),S=t(17708),_=t(29996),U=t(9943),N=t(25599),I=t(59467),D=t(86008),L=t(87006),O=t(28126),B=t(74202),F=t(77370),q=t(37574),A=["onSelect","endpoint","gatewayUrl","loading","size","helperText"],G=[{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"}],z=(0,O.D)();function W(e){var n=e.onSelect,t=e.endpoint,r=e.gatewayUrl,o=e.loading,a=e.size,u=e.helperText,p=(0,c.Z)(e,A),m=(0,S.Z)("did-space-gateway-list",G),f=(0,l.Z)(m,2),h=f[0],x=f[1],v=(0,s.useState)(r||G[0].value),Z=(0,l.Z)(v,2),y=Z[0],k=Z[1],j=(0,d.PE)().t,C=(0,F.T)().api;return(0,s.useEffect)((function(){y&&!h.find((function(e){return e.value===y}))&&C.get(g()(y,"/__blocklet__.js?type=json")).then((function(e){x([].concat((0,R.Z)(h),[{value:y,label:e.data.appName}]))})).catch((function(e){console.error(e),b.Z.error("Can not add this gateway, please check the url and try again")}))}),[y]),(0,q.jsx)(M,(0,i.Z)((0,i.Z)({},p),{},{freeSolo:!0,selectOnFocus:!0,clearOnBlur:!0,handleHomeEndKeys:!0,value:y,options:h,onChange:function(e,n){if(n)if("string"===typeof n){var t=h.find((function(e){return e.label===n}));t&&k(t.value)}else n.inputValue?k(n.inputValue):n.value&&k(n.value)},getOptionLabel:function(e){return"string"===typeof e?e:e.inputValue?e.inputValue:e.label},renderOption:function(e,n){return(0,q.jsxs)(U.ZP,(0,i.Z)((0,i.Z)({},e),{},{children:[(0,q.jsx)(N.Z,{children:(0,q.jsx)(I.Z,{children:n.avatar})}),(0,q.jsx)(D.Z,{primary:n.label,secondary:n.value})]}),n.value)},filterOptions:function(e,n){var t=z(e,n);n.inputValue&&w()(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,q.jsx)(L.Z,(0,i.Z)((0,i.Z)({},e),{},{helperText:u,label:j("storage.spaces.label"),size:a,InputProps:(0,i.Z)((0,i.Z)({},e.InputProps),{},{type:"search",endAdornment:(0,q.jsx)(_.Z,{variant:"contained",onClick:function(){return n(y)},size:"small",loading:o,disable:o,sx:{position:"absolute",right:0,display:"flex",justifyContent:"center",alignItems:"center",width:"100px",height:"100%"},children:j(t?"storage.spaces.reconnect":"storage.spaces.connect.now")})})}))}}))}var M=(0,E.default)(B.Z)(r||(r=(0,P.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")}));W.propTypes={onSelect:x().func.isRequired,endpoint:x().string,loading:x().bool,size:x().string,helperText:x().string,gatewayUrl:x().string},W.defaultProps={endpoint:void 0,loading:!1,size:"small",helperText:"",gatewayUrl:""};var V=W,K=["onConnect"];var Y=(0,s.forwardRef)((function(e,n){var t=e.onConnect,r=(0,c.Z)(e,K),m=(0,C.h6)(),h=m.api,x=m.info.did,v=(0,s.useContext)(d.RD),P=v.t,R=v.locale,E=(0,j.y0)(),T=E.blocklet,w=E.actions.refreshBlocklet,S=(0,s.useState)(""),_=(0,l.Z)(S,2),U=_[0],N=_[1],I=(0,s.useMemo)((function(){var e,n,t,r;return{endpoint:(null===T||void 0===T||null===(e=T.environments)||void 0===e||null===(n=e.find((function(e){return e.key===p.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===n?void 0:n.value)||"",gatewayUrl:(null===T||void 0===T||null===(t=T.environments)||void 0===t||null===(r=t.find((function(e){return e.key===p.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACES_URL})))||void 0===r?void 0:r.value)||""}}),[T]),D=(0,k.getAppName)(T),L=(0,k.getAppDescription)(T),O=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)}}(T),B=O.appUrl,F=O.isReady;function A(e,n){return G.apply(this,arguments)}function G(){return(G=(0,a.Z)((0,o.Z)().mark((function e(n,t){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h.configBlocklet({input:{did:[n],configs:[{key:p.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACES_URL,value:U},{key:p.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:t}]}}).then((function(){b.Z.success(P("storage.spaces.connect.succeeded",R))})).catch((function(e){console.error(e),b.Z.error(e.message)}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var z=function(){var e=(0,a.Z)((0,o.Z)().mark((function e(n,r){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A(T.meta.did,r(n.endpoint));case 2:setTimeout((function(){H((function(e){return(0,i.Z)((0,i.Z)({},e),{},{open:!1})})),null===t||void 0===t||t(),w()}),3e3);case 3:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),W=(0,s.useState)({open:!1}),M=(0,l.Z)(W,2),Y=M[0],H=M[1];return(0,s.useEffect)((function(){H((function(e){return(0,i.Z)((0,i.Z)({},e),{},{messages:{title:P("storage.spaces.authorize.title",{appName:D}),scan:P("storage.spaces.authorize.scan",{appName:D}),confirm:"",success:(0,q.jsx)(y.Z,{gutterBottom:!0,children:P("storage.spaces.authorize.success")})}})}))}),[D,R,P]),(0,s.useImperativeHandle)(n,(function(){return{getEndpoint:function(){return I.endpoint},getGatewayUrl:function(){return I.gatewayUrl}}})),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(V,(0,i.Z)((0,i.Z)((0,i.Z)({},r),I),{},{onSelect:function(e){(0,Z.isEmpty)(e)?b.Z.error(P("storage.spaces.addressCannotEmpty",R)):(N(e),H((function(n){return(0,i.Z)((0,i.Z)({},n),{},{action:"one-click-authorization",checkTimeout:3e5,prefix:g()(e,"space/api/did"),baseUrl:new URL(e).origin,checkFn:f().create({baseURL:g()(e,"space")}).get,extraParams:{appDid:T.appDid,appName:D,appDescription:L,scopes:"list:object read:object write:object",appUrl:B,referrer:window.location.href,nodeDid:x},onClose:function(){H((function(e){return(0,i.Z)((0,i.Z)({},e),{},{open:!1})}))},open:!0})})))},loading:!F})),(0,q.jsx)(u.default,{forceConnected:!1,saveConnect:!1,prefix:Y.prefix,open:Y.open,popup:!0,action:Y.action,baseUrl:Y.baseUrl,checkFn:Y.checkFn,onSuccess:z,onClose:Y.onClose,checkTimeout:Y.checkTimeout,extraParams:Y.extraParams,messages:Y.messages,locale:R})]})}));Y.propTypes={onConnect:x().func},Y.defaultProps={onConnect:function(){}};var H=Y},36558:function(e,n,t){var r=t(33028),o=t(59740),i=t(24974),a=t.n(i),l=t(86822),c=t(19638),s=t(23586),u=t(37574),d=["did","href","external","avatarProps"];function p(e){var n=e.did,t=e.href,i=e.external,a=(e.avatarProps,(0,o.Z)(e,d)),p=(0,u.jsx)(s.Z,(0,r.Z)({did:n},a));return t?i?(0,u.jsx)(c.Z,{target:"_blank",href:t,underline:"hover",children:p}):(0,u.jsx)(l.rU,{to:t,children:p}):p}p.propTypes={did:a().string.isRequired,to:a().string,href:a().string,avatarProps:a().object,external:a().bool},p.defaultProps={to:"",href:"",avatarProps:{},external:!1},n.Z=p},8016:function(e,n,t){t.d(n,{Z:function(){return D}});var r=t(71171),o=t(56666),i=t(33028),a=t(96234),l=t(30969),c=t(24974),s=t.n(c),u=t(16380),d=t(38361),p=t(1484),m=t(88581),f=t(27724),h=t(94551),x=t(94308),v=t(83176),g=t(98545),Z={description:s().string,editing:s().bool,onChange:s().func,required:s().bool,value:s().any,componentProps:s().object,render:s().func,renderFormItem:s().func},y=t(37574);function b(e){var n=e.editing,t=e.value,r=e.onChange,o=(0,l.useState)(!1),i=(0,a.Z)(o,2),c=i[0],s=i[1],u=(0,l.useRef)(),p=(0,l.useRef)(t);(0,l.useEffect)((function(){var e=null;return n&&(e=setTimeout((function(){s(!0)}),50)),function(){clearTimeout(e)}}),[n]);var m=function(e){p.current=e,r(e)},f=(0,y.jsx)(d.Z,{className:"form-item-input slot",px:1,children:(0,y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t,"auto"!==t&&(0,y.jsx)("div",{style:{marginLeft:4,backgroundColor:t,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),h=(0,y.jsxs)(d.Z,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:function(){s(!1),r(p.current)},children:[(0,y.jsx)(d.Z,{display:"flex",alignItems:"center",onClick:function(){return s(!0)},children:(0,y.jsx)("div",{ref:u,style:{flexShrink:0,marginLeft:"8px",backgroundColor:t,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:"auto"===t?"default":"pointer"}})}),(0,y.jsx)(v.ZP,{open:c,anchorEl:u.current,onClose:function(){return s(!1)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:(0,y.jsx)(g.AI,{color:t,onChange:function(e){return m(e.hex)}})})]});return n?h:f}b.propTypes=Z;var k=t(59740),j=t(87006),C=["editing","description","value","onChange","componentProps"];function P(e){var n=e.editing,t=e.description,r=e.value,o=e.onChange,a=e.componentProps,c=(0,k.Z)(e,C),s=a.placeholder,u=(0,l.useRef)(r),p=function(e){u.current=e,o(e)};return n?(0,y.jsx)(j.Z,(0,i.Z)({style:{flex:1},fullWidth:!0,value:r,onChange:function(e){e.persist(),p(e.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:t||s,onKeyDown:function(e){"Enter"===e.key&&o(u.current,"confirm")}},c)):(0,y.jsx)(d.Z,{px:1,className:"form-item-input slot",children:r})}P.propTypes=Z,P.defaultProps={componentProps:{}};var R=t(52469),E=t.n(R),T=t(84938),w=t(7017),S=["editing","value","onChange","componentProps"];function _(e){var n=e.editing,t=e.value,r=e.onChange,o=e.componentProps,a=(0,k.Z)(e,S),l=o.blocklet,c="auto"===t?(0,T.getPassportColorFromDid)(l.appDid):t;return(0,y.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,y.jsx)("img",{style:{width:96,marginRight:12},alt:"",src:E()({title:"Owner",issuer:(0,w.getDisplayName)(l),issuerDid:l.appDid,ownerName:"Your Name",ownerDid:l.appDid,isDataUrl:!0,preferredColor:t||"auto"})}),(0,y.jsx)(b,(0,i.Z)((0,i.Z)({},a),{},{editing:n,value:n?c:t,onChange:r,componentProps:o}))]})}_.propTypes=(0,i.Z)((0,i.Z)({},Z),{},{componentProps:s().shape({blocklet:s().object.isRequired}).isRequired}),_.defaultProps={};var U,N=t(14458),I=t(28412);function D(e){var n=e.schema,t=e.loading,r=e.value,c=e.defaultValue,s=e.onChange,u=e.style,v=e.disabled,g="[object Object]"===Object.prototype.toString.call(r),Z=(0,l.useState)(null),k=(0,a.Z)(Z,2),j=k[0],C=k[1],R=(0,l.useState)(g?r:c),E=(0,a.Z)(R,2),T=E[0],w=E[1],S=(0,l.useRef)();function U(e,n,t){var r=e.key,a=e.secure,l=T[r]!==n,c=(0,i.Z)((0,i.Z)({},T),{},(0,o.Z)({},r,n));l&&w(c),s((0,o.Z)({},r,n),{allValues:c,action:t,currentItem:e}),"confirm"===t&&a&&w((0,i.Z)((0,i.Z)({},T),{},(0,o.Z)({},r,"__encrypted__"))),["confirm","cancel"].includes(t)?I(null):I(e)}function I(e){if(e)return S.current=T[e.key],void C(e);S.current=null,C(null)}return(0,y.jsx)(L,{className:"form",style:u,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,s=e.componentProps,u=void 0===s?{}:s;if(c)return null;var Z=!(!j||n!==j.key),k=function(e,n){var t=n.editing,o=void 0!==t&&t,i=e.key,a=g?r[i]:T[i];return"__encrypted__"===a?o?"":"******":a}(e,{editing:Z}),C=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:P,color:b,passport:_}[null===i||void 0===i?void 0:i.toLowerCase()]}(e,{editing:Z}),R={inputProps:{"data-cy":"schema-form-item-component"},key:n,description:o,editing:Z,value:k,onChange:function(n){return U(e,n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"change")},componentProps:u};return(0,y.jsxs)(d.Z,{className:"form-item",children:[(0,y.jsxs)(d.Z,{className:"form-item-label",style:{color:a&&!k?"#ff0000":"#333"},children:[o,a&&(0,y.jsx)(N.Z,{})]}),(0,y.jsxs)(d.Z,{className:"form-item-body",children:[(0,y.jsx)(d.Z,{className:"form-item-input",children:(0,y.jsx)(C,(0,i.Z)({},R))}),(0,y.jsx)(d.Z,{className:"form-item-action",children:Z?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(h.Z,{"data-cy":"schema-form-item-confirm",onClick:function(){U(e,k,"confirm")},disabled:v||t,size:"large",children:t?(0,y.jsx)(x.Z,{size:24}):(0,y.jsx)(f.Z,{})}),(0,y.jsx)(h.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){U(e,S.current,"cancel")},disabled:v||t,size:"large",children:(0,y.jsx)(m.default,{})})]}):(0,y.jsx)(h.Z,{"data-cy":"schema-form-item-edit",onClick:function(){U(e,T[n],"edit")},disabled:v||j,size:"large",children:(0,y.jsx)(p.Z,{})})})]})]},n)}))})}D.propTypes={schema:s().array.isRequired,loading:s().bool,onChange:s().func.isRequired,value:s().object,defaultValue:s().object,style:s().object,disabled:s().bool},D.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};var L=(0,u.default)(I.Z)(U||(U=(0,r.Z)([""])))},54559:function(e,n,t){t.d(n,{hi:function(){return i},od:function(){return o.a}});var r=t(95803),o=t.n(r);o().defaults.timeout=1e4;var i=o().create()}}]);
|
|
2
|
+
//# sourceMappingURL=2724.3fa7fc88.chunk.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[2750],{74202:function(e,t,n){n.d(t,{Z:function(){return Q}});var o=n(56666),r=n(31461),a=n(7896),i=n(30969),l=n(81856),c=n(26540),u=n(28126),s=n(74262),p=n(4850),d=n(45971),f=n(17363),v=n(24099),g=n(62746),h=n(2975);function m(e){return(0,h.Z)("MuiListSubheader",e)}(0,g.Z)("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);var b=n(37574),x=["className","color","component","disableGutters","disableSticky","inset"],Z=(0,d.ZP)("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,"default"!==n.color&&t["color".concat((0,v.Z)(n.color))],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14)},"primary"===n.color&&{color:(t.vars||t).palette.primary.main},"inherit"===n.color&&{color:"inherit"},!n.disableGutters&&{paddingLeft:16,paddingRight:16},n.inset&&{paddingLeft:72},!n.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper})})),y=i.forwardRef((function(e,t){var n=(0,f.Z)({props:e,name:"MuiListSubheader"}),o=n.className,i=n.color,u=void 0===i?"default":i,s=n.component,p=void 0===s?"li":s,d=n.disableGutters,g=void 0!==d&&d,h=n.disableSticky,y=void 0!==h&&h,O=n.inset,I=void 0!==O&&O,S=(0,r.Z)(n,x),P=(0,a.Z)({},n,{color:u,component:p,disableGutters:g,disableSticky:y,inset:I}),C=function(e){var t=e.classes,n=e.color,o=e.disableGutters,r=e.inset,a=e.disableSticky,i={root:["root","default"!==n&&"color".concat((0,v.Z)(n)),!o&&"gutters",r&&"inset",!a&&"sticky"]};return(0,c.Z)(i,m,t)}(P);return(0,b.jsx)(Z,(0,a.Z)({as:p,className:(0,l.default)(C.root,o),ref:t,ownerState:P},S))}));y.muiSkipListHighlight=!0;var O=y,I=n(46672),S=n(94551),P=n(7173),C=n(76925),k=n(6005),w=n(62878),L=n(60251),A=n(42571),T=n(1578);function R(e){return(0,h.Z)("MuiAutocomplete",e)}var N,M,D=(0,g.Z)("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),E=n(87352),z=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],F=["ref"],H=(0,d.ZP)("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState,r=n.fullWidth,a=n.hasClearIcon,i=n.hasPopupIcon,l=n.inputFocused,c=n.size;return[(0,o.Z)({},"& .".concat(D.tag),t.tag),(0,o.Z)({},"& .".concat(D.tag),t["tagSize".concat((0,v.Z)(c))]),(0,o.Z)({},"& .".concat(D.inputRoot),t.inputRoot),(0,o.Z)({},"& .".concat(D.input),t.input),(0,o.Z)({},"& .".concat(D.input),l&&t.inputFocused),t.root,r&&t.fullWidth,i&&t.hasPopupIcon,a&&t.hasClearIcon]}})((function(e){var t,n,r,i,l,c=e.ownerState;return(0,a.Z)((t={},(0,o.Z)(t,"&.".concat(D.focused," .").concat(D.clearIndicator),{visibility:"visible"}),(0,o.Z)(t,"@media (pointer: fine)",(0,o.Z)({},"&:hover .".concat(D.clearIndicator),{visibility:"visible"})),t),c.fullWidth&&{width:"100%"},(l={},(0,o.Z)(l,"& .".concat(D.tag),(0,a.Z)({margin:3,maxWidth:"calc(100% - 6px)"},"small"===c.size&&{margin:2,maxWidth:"calc(100% - 4px)"})),(0,o.Z)(l,"& .".concat(D.inputRoot),(n={flexWrap:"wrap"},(0,o.Z)(n,".".concat(D.hasPopupIcon,"&, .").concat(D.hasClearIcon,"&"),{paddingRight:30}),(0,o.Z)(n,".".concat(D.hasPopupIcon,".").concat(D.hasClearIcon,"&"),{paddingRight:56}),(0,o.Z)(n,"& .".concat(D.input),{width:0,minWidth:30}),n)),(0,o.Z)(l,"& .".concat(C.Z.root),{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}}),(0,o.Z)(l,"& .".concat(C.Z.root,".").concat(k.Z.sizeSmall),(0,o.Z)({},"& .".concat(C.Z.input),{padding:"2px 4px 3px 0"})),(0,o.Z)(l,"& .".concat(w.Z.root),(r={padding:9},(0,o.Z)(r,".".concat(D.hasPopupIcon,"&, .").concat(D.hasClearIcon,"&"),{paddingRight:39}),(0,o.Z)(r,".".concat(D.hasPopupIcon,".").concat(D.hasClearIcon,"&"),{paddingRight:65}),(0,o.Z)(r,"& .".concat(D.input),{padding:"7.5px 4px 7.5px 5px"}),(0,o.Z)(r,"& .".concat(D.endAdornment),{right:9}),r)),(0,o.Z)(l,"& .".concat(w.Z.root,".").concat(k.Z.sizeSmall),(0,o.Z)({paddingTop:6,paddingBottom:6,paddingLeft:6},"& .".concat(D.input),{padding:"2.5px 4px 2.5px 8px"})),(0,o.Z)(l,"& .".concat(L.Z.root),(i={paddingTop:19,paddingLeft:8},(0,o.Z)(i,".".concat(D.hasPopupIcon,"&, .").concat(D.hasClearIcon,"&"),{paddingRight:39}),(0,o.Z)(i,".".concat(D.hasPopupIcon,".").concat(D.hasClearIcon,"&"),{paddingRight:65}),(0,o.Z)(i,"& .".concat(L.Z.input),{padding:"7px 4px"}),(0,o.Z)(i,"& .".concat(D.endAdornment),{right:9}),i)),(0,o.Z)(l,"& .".concat(L.Z.root,".").concat(k.Z.sizeSmall),(0,o.Z)({paddingBottom:1},"& .".concat(L.Z.input),{padding:"2.5px 4px"})),(0,o.Z)(l,"& .".concat(k.Z.hiddenLabel),{paddingTop:8}),(0,o.Z)(l,"& .".concat(L.Z.root,".").concat(k.Z.hiddenLabel),(0,o.Z)({paddingTop:0,paddingBottom:0},"& .".concat(D.input),{paddingTop:16,paddingBottom:17})),(0,o.Z)(l,"& .".concat(L.Z.root,".").concat(k.Z.hiddenLabel,".").concat(k.Z.sizeSmall),(0,o.Z)({},"& .".concat(D.input),{paddingTop:8,paddingBottom:9})),(0,o.Z)(l,"& .".concat(D.input),(0,a.Z)({flexGrow:1,textOverflow:"ellipsis",opacity:0},c.inputFocused&&{opacity:1})),l))})),W=(0,d.ZP)("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:function(e,t){return t.endAdornment}})({position:"absolute",right:0,top:"calc(50% - 14px)"}),j=(0,d.ZP)(S.Z,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:function(e,t){return t.clearIndicator}})({marginRight:-2,padding:4,visibility:"hidden"}),V=(0,d.ZP)(S.Z,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:function(e,t){var n=e.ownerState;return(0,a.Z)({},t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen)}})((function(e){var t=e.ownerState;return(0,a.Z)({padding:2,marginRight:-2},t.popupOpen&&{transform:"rotate(180deg)"})})),B=(0,d.ZP)(p.Z,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:function(e,t){var n=e.ownerState;return[(0,o.Z)({},"& .".concat(D.option),t.option),t.popper,n.disablePortal&&t.popperDisablePortal]}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({zIndex:(t.vars||t).zIndex.modal},n.disablePortal&&{position:"absolute"})})),q=(0,d.ZP)(I.Z,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:function(e,t){return t.paper}})((function(e){var t=e.theme;return(0,a.Z)({},t.typography.body1,{overflow:"auto"})})),G=(0,d.ZP)("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:function(e,t){return t.loading}})((function(e){var t=e.theme;return{color:(t.vars||t).palette.text.secondary,padding:"14px 16px"}})),K=(0,d.ZP)("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:function(e,t){return t.noOptions}})((function(e){var t=e.theme;return{color:(t.vars||t).palette.text.secondary,padding:"14px 16px"}})),U=(0,d.ZP)("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:function(e,t){return t.listbox}})((function(e){var t,n,r=e.theme;return(0,o.Z)({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative"},"& .".concat(D.option),(n={minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16},(0,o.Z)(n,r.breakpoints.up("sm"),{minHeight:"auto"}),(0,o.Z)(n,"&.".concat(D.focused),{backgroundColor:(r.vars||r).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}),(0,o.Z)(n,'&[aria-disabled="true"]',{opacity:(r.vars||r).palette.action.disabledOpacity,pointerEvents:"none"}),(0,o.Z)(n,"&.".concat(D.focusVisible),{backgroundColor:(r.vars||r).palette.action.focus}),(0,o.Z)(n,'&[aria-selected="true"]',(t={backgroundColor:r.vars?"rgba(".concat(r.vars.palette.primary.mainChannel," / ").concat(r.vars.palette.action.selectedOpacity,")"):(0,s.Fq)(r.palette.primary.main,r.palette.action.selectedOpacity)},(0,o.Z)(t,"&.".concat(D.focused),{backgroundColor:r.vars?"rgba(".concat(r.vars.palette.primary.mainChannel," / calc(").concat(r.vars.palette.action.selectedOpacity," + ").concat(r.vars.palette.action.hoverOpacity,"))"):(0,s.Fq)(r.palette.primary.main,r.palette.action.selectedOpacity+r.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(r.vars||r).palette.action.selected}}),(0,o.Z)(t,"&.".concat(D.focusVisible),{backgroundColor:r.vars?"rgba(".concat(r.vars.palette.primary.mainChannel," / calc(").concat(r.vars.palette.action.selectedOpacity," + ").concat(r.vars.palette.action.focusOpacity,"))"):(0,s.Fq)(r.palette.primary.main,r.palette.action.selectedOpacity+r.palette.action.focusOpacity)}),t)),n))})),_=(0,d.ZP)(O,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:function(e,t){return t.groupLabel}})((function(e){var t=e.theme;return{backgroundColor:(t.vars||t).palette.background.paper,top:-8}})),J=(0,d.ZP)("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:function(e,t){return t.groupUl}})((0,o.Z)({padding:0},"& .".concat(D.option),{paddingLeft:24})),Q=i.forwardRef((function(e,t){var n,o,s,d,g,h=(0,f.Z)({props:e,name:"MuiAutocomplete"}),m=(h.autoComplete,h.autoHighlight,h.autoSelect,h.blurOnSelect,h.ChipProps),x=h.className,Z=h.clearIcon,y=void 0===Z?N||(N=(0,b.jsx)(A.Z,{fontSize:"small"})):Z,O=h.clearOnBlur,S=(void 0===O&&h.freeSolo,h.clearOnEscape,h.clearText),C=void 0===S?"Clear":S,k=h.closeText,w=void 0===k?"Close":k,L=h.componentsProps,D=void 0===L?{}:L,Q=h.defaultValue,X=(void 0===Q&&h.multiple,h.disableClearable),Y=void 0!==X&&X,$=(h.disableCloseOnSelect,h.disabled),ee=void 0!==$&&$,te=(h.disabledItemsFocusable,h.disableListWrap,h.disablePortal),ne=void 0!==te&&te,oe=(h.filterSelectedOptions,h.forcePopupIcon),re=void 0===oe?"auto":oe,ae=h.freeSolo,ie=void 0!==ae&&ae,le=h.fullWidth,ce=void 0!==le&&le,ue=h.getLimitTagsText,se=void 0===ue?function(e){return"+".concat(e)}:ue,pe=h.getOptionLabel,de=void 0===pe?function(e){var t;return null!=(t=e.label)?t:e}:pe,fe=h.groupBy,ve=h.handleHomeEndKeys,ge=(void 0===ve&&h.freeSolo,h.includeInputInList,h.limitTags),he=void 0===ge?-1:ge,me=h.ListboxComponent,be=void 0===me?"ul":me,xe=h.ListboxProps,Ze=h.loading,ye=void 0!==Ze&&Ze,Oe=h.loadingText,Ie=void 0===Oe?"Loading\u2026":Oe,Se=h.multiple,Pe=void 0!==Se&&Se,Ce=h.noOptionsText,ke=void 0===Ce?"No options":Ce,we=(h.openOnFocus,h.openText),Le=void 0===we?"Open":we,Ae=h.PaperComponent,Te=void 0===Ae?I.Z:Ae,Re=h.PopperComponent,Ne=void 0===Re?p.Z:Re,Me=h.popupIcon,De=void 0===Me?M||(M=(0,b.jsx)(T.Z,{})):Me,Ee=h.readOnly,ze=void 0!==Ee&&Ee,Fe=h.renderGroup,He=h.renderInput,We=h.renderOption,je=h.renderTags,Ve=h.selectOnFocus,Be=(void 0===Ve&&h.freeSolo,h.size),qe=void 0===Be?"medium":Be,Ge=h.slotProps,Ke=void 0===Ge?{}:Ge,Ue=(0,r.Z)(h,z),_e=(0,u.Z)((0,a.Z)({},h,{componentName:"Autocomplete"})),Je=_e.getRootProps,Qe=_e.getInputProps,Xe=_e.getInputLabelProps,Ye=_e.getPopupIndicatorProps,$e=_e.getClearProps,et=_e.getTagProps,tt=_e.getListboxProps,nt=_e.getOptionProps,ot=_e.value,rt=_e.dirty,at=_e.expanded,it=_e.id,lt=_e.popupOpen,ct=_e.focused,ut=_e.focusedTag,st=_e.anchorEl,pt=_e.setAnchorEl,dt=_e.inputValue,ft=_e.groupedOptions,vt=!Y&&!ee&&rt&&!ze,gt=(!ie||!0===re)&&!1!==re,ht=Qe().onMouseDown,mt=(null!=xe?xe:{}).ref,bt=tt(),xt=bt.ref,Zt=(0,r.Z)(bt,F),yt=(0,E.Z)(xt,mt),Ot=(0,a.Z)({},h,{disablePortal:ne,expanded:at,focused:ct,fullWidth:ce,hasClearIcon:vt,hasPopupIcon:gt,inputFocused:-1===ut,popupOpen:lt,size:qe}),It=function(e){var t=e.classes,n=e.disablePortal,o=e.expanded,r=e.focused,a=e.fullWidth,i=e.hasClearIcon,l=e.hasPopupIcon,u=e.inputFocused,s=e.popupOpen,p=e.size,d={root:["root",o&&"expanded",r&&"focused",a&&"fullWidth",i&&"hasClearIcon",l&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",u&&"inputFocused"],tag:["tag","tagSize".concat((0,v.Z)(p))],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",s&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return(0,c.Z)(d,R,t)}(Ot);if(Pe&&ot.length>0){var St=function(e){return(0,a.Z)({className:It.tag,disabled:ee},et(e))};g=je?je(ot,St,Ot):ot.map((function(e,t){return(0,b.jsx)(P.Z,(0,a.Z)({label:de(e),size:qe},St({index:t}),m))}))}if(he>-1&&Array.isArray(g)){var Pt=g.length-he;!ct&&Pt>0&&(g=g.splice(0,he)).push((0,b.jsx)("span",{className:It.tag,children:se(Pt)},g.length))}var Ct=Fe||function(e){return(0,b.jsxs)("li",{children:[(0,b.jsx)(_,{className:It.groupLabel,ownerState:Ot,component:"div",children:e.group}),(0,b.jsx)(J,{className:It.groupUl,ownerState:Ot,children:e.children})]},e.key)},kt=We||function(e,t){return(0,b.jsx)("li",(0,a.Z)({},e,{children:de(t)}))},wt=function(e,t){var n=nt({option:e,index:t});return kt((0,a.Z)({},n,{className:It.option}),e,{selected:n["aria-selected"],index:t,inputValue:dt},Ot)},Lt=null!=(n=Ke.clearIndicator)?n:D.clearIndicator,At=null!=(o=Ke.paper)?o:D.paper,Tt=null!=(s=Ke.popper)?s:D.popper,Rt=null!=(d=Ke.popupIndicator)?d:D.popupIndicator;return(0,b.jsxs)(i.Fragment,{children:[(0,b.jsx)(H,(0,a.Z)({ref:t,className:(0,l.default)(It.root,x),ownerState:Ot},Je(Ue),{children:He({id:it,disabled:ee,fullWidth:!0,size:"small"===qe?"small":void 0,InputLabelProps:Xe(),InputProps:(0,a.Z)({ref:pt,className:It.inputRoot,startAdornment:g,onClick:function(e){e.target===e.currentTarget&&ht(e)}},(vt||gt)&&{endAdornment:(0,b.jsxs)(W,{className:It.endAdornment,ownerState:Ot,children:[vt?(0,b.jsx)(j,(0,a.Z)({},$e(),{"aria-label":C,title:C,ownerState:Ot},Lt,{className:(0,l.default)(It.clearIndicator,null==Lt?void 0:Lt.className),children:y})):null,gt?(0,b.jsx)(V,(0,a.Z)({},Ye(),{disabled:ee,"aria-label":lt?w:Le,title:lt?w:Le,ownerState:Ot},Rt,{className:(0,l.default)(It.popupIndicator,null==Rt?void 0:Rt.className),children:De})):null]})}),inputProps:(0,a.Z)({className:It.input,disabled:ee,readOnly:ze},Qe())})})),st?(0,b.jsx)(B,(0,a.Z)({as:Ne,disablePortal:ne,style:{width:st?st.clientWidth:null},ownerState:Ot,role:"presentation",anchorEl:st,open:lt},Tt,{className:(0,l.default)(It.popper,null==Tt?void 0:Tt.className),children:(0,b.jsxs)(q,(0,a.Z)({ownerState:Ot,as:Te},At,{className:(0,l.default)(It.paper,null==At?void 0:At.className),children:[ye&&0===ft.length?(0,b.jsx)(G,{className:It.loading,ownerState:Ot,children:Ie}):null,0!==ft.length||ie||ye?null:(0,b.jsx)(K,{className:It.noOptions,ownerState:Ot,role:"presentation",onMouseDown:function(e){e.preventDefault()},children:ke}),ft.length>0?(0,b.jsx)(U,(0,a.Z)({as:be,className:It.listbox,ownerState:Ot},Zt,xe,{ref:yt,children:ft.map((function(e,t){return fe?Ct({key:e.key,group:e.group,children:e.options.map((function(t,n){return wt(t,e.index+n)}))}):wt(e,t)}))})):null]}))})):null]})}))},28126:function(e,t,n){n.d(t,{D:function(){return d},Z:function(){return m}});var o=n(96234),r=n(7896),a=n(30969),i=n(3210),l=n(29959),c=n(15460),u=n(34604),s=n(54372);function p(e){return"undefined"!==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignoreAccents,n=void 0===t||t,o=e.ignoreCase,r=void 0===o||o,a=e.limit,i=e.matchFrom,l=void 0===i?"any":i,c=e.stringify,u=e.trim,s=void 0!==u&&u;return function(e,t){var o=t.inputValue,i=t.getOptionLabel,u=s?o.trim():o;r&&(u=u.toLowerCase()),n&&(u=p(u));var d=u?e.filter((function(e){var t=(c||i)(e);return r&&(t=t.toLowerCase()),n&&(t=p(t)),"start"===l?0===t.indexOf(u):t.indexOf(u)>-1})):e;return"number"===typeof a?d.slice(0,a):d}}function f(e,t){for(var n=0;n<e.length;n+=1)if(t(e[n]))return n;return-1}var v=d(),g=5,h=function(e){var t;return null!==e.current&&(null==(t=e.current.parentElement)?void 0:t.contains(document.activeElement))};function m(e){var t,n=e.unstable_isActiveElementInListbox,p=void 0===n?h:n,d=e.unstable_classNamePrefix,m=void 0===d?"Mui":d,b=e.autoComplete,x=void 0!==b&&b,Z=e.autoHighlight,y=void 0!==Z&&Z,O=e.autoSelect,I=void 0!==O&&O,S=e.blurOnSelect,P=void 0!==S&&S,C=e.clearOnBlur,k=void 0===C?!e.freeSolo:C,w=e.clearOnEscape,L=void 0!==w&&w,A=e.componentName,T=void 0===A?"useAutocomplete":A,R=e.defaultValue,N=void 0===R?e.multiple?[]:null:R,M=e.disableClearable,D=void 0!==M&&M,E=e.disableCloseOnSelect,z=void 0!==E&&E,F=e.disabled,H=e.disabledItemsFocusable,W=void 0!==H&&H,j=e.disableListWrap,V=void 0!==j&&j,B=e.filterOptions,q=void 0===B?v:B,G=e.filterSelectedOptions,K=void 0!==G&&G,U=e.freeSolo,_=void 0!==U&&U,J=e.getOptionDisabled,Q=e.getOptionLabel,X=void 0===Q?function(e){var t;return null!=(t=e.label)?t:e}:Q,Y=e.groupBy,$=e.handleHomeEndKeys,ee=void 0===$?!e.freeSolo:$,te=e.id,ne=e.includeInputInList,oe=void 0!==ne&&ne,re=e.inputValue,ae=e.isOptionEqualToValue,ie=void 0===ae?function(e,t){return e===t}:ae,le=e.multiple,ce=void 0!==le&&le,ue=e.onChange,se=e.onClose,pe=e.onHighlightChange,de=e.onInputChange,fe=e.onOpen,ve=e.open,ge=e.openOnFocus,he=void 0!==ge&&ge,me=e.options,be=e.readOnly,xe=void 0!==be&&be,Ze=e.selectOnFocus,ye=void 0===Ze?!e.freeSolo:Ze,Oe=e.value,Ie=(0,i.Z)(te);t=function(e){var t=X(e);return"string"!==typeof t?String(t):t};var Se=a.useRef(!1),Pe=a.useRef(!0),Ce=a.useRef(null),ke=a.useRef(null),we=a.useState(null),Le=(0,o.Z)(we,2),Ae=Le[0],Te=Le[1],Re=a.useState(-1),Ne=(0,o.Z)(Re,2),Me=Ne[0],De=Ne[1],Ee=y?0:-1,ze=a.useRef(Ee),Fe=(0,l.Z)({controlled:Oe,default:N,name:T}),He=(0,o.Z)(Fe,2),We=He[0],je=He[1],Ve=(0,l.Z)({controlled:re,default:"",name:T,state:"inputValue"}),Be=(0,o.Z)(Ve,2),qe=Be[0],Ge=Be[1],Ke=a.useState(!1),Ue=(0,o.Z)(Ke,2),_e=Ue[0],Je=Ue[1],Qe=a.useCallback((function(e,n){if((ce?We.length<n.length:null!==n)||k){var o;if(ce)o="";else if(null==n)o="";else{var r=t(n);o="string"===typeof r?r:""}qe!==o&&(Ge(o),de&&de(e,o,"reset"))}}),[t,qe,ce,de,Ge,k,We]),Xe=(0,l.Z)({controlled:ve,default:!1,name:T,state:"open"}),Ye=(0,o.Z)(Xe,2),$e=Ye[0],et=Ye[1],tt=a.useState(!0),nt=(0,o.Z)(tt,2),ot=nt[0],rt=nt[1],at=!ce&&null!=We&&qe===t(We),it=$e&&!xe,lt=it?q(me.filter((function(e){return!K||!(ce?We:[We]).some((function(t){return null!==t&&ie(e,t)}))})),{inputValue:at&&ot?"":qe,getOptionLabel:t}):[],ct=(0,c.Z)({filteredOptions:lt,value:We,inputValue:qe});a.useEffect((function(){var e=We!==ct.value;_e&&!e||_&&!e||Qe(null,We)}),[We,Qe,_e,ct.value,_]);var ut=$e&<.length>0&&!xe,st=(0,u.Z)((function(e){-1===e?Ce.current.focus():Ae.querySelector('[data-tag-index="'.concat(e,'"]')).focus()}));a.useEffect((function(){ce&&Me>We.length-1&&(De(-1),st(-1))}),[We,ce,Me,st]);var pt=(0,u.Z)((function(e){var t=e.event,n=e.index,o=e.reason,r=void 0===o?"auto":o;if(ze.current=n,-1===n?Ce.current.removeAttribute("aria-activedescendant"):Ce.current.setAttribute("aria-activedescendant","".concat(Ie,"-option-").concat(n)),pe&&pe(t,-1===n?null:lt[n],r),ke.current){var a=ke.current.querySelector('[role="option"].'.concat(m,"-focused"));a&&(a.classList.remove("".concat(m,"-focused")),a.classList.remove("".concat(m,"-focusVisible")));var i=ke.current;if("listbox"!==ke.current.getAttribute("role")&&(i=ke.current.parentElement.querySelector('[role="listbox"]')),i)if(-1!==n){var l=ke.current.querySelector('[data-option-index="'.concat(n,'"]'));if(l&&(l.classList.add("".concat(m,"-focused")),"keyboard"===r&&l.classList.add("".concat(m,"-focusVisible")),i.scrollHeight>i.clientHeight&&"mouse"!==r&&"touch"!==r)){var c=l,u=i.clientHeight+i.scrollTop,s=c.offsetTop+c.offsetHeight;s>u?i.scrollTop=s-i.clientHeight:c.offsetTop-c.offsetHeight*(Y?1.3:0)<i.scrollTop&&(i.scrollTop=c.offsetTop-c.offsetHeight*(Y?1.3:0))}}else i.scrollTop=0}})),dt=(0,u.Z)((function(e){var n=e.event,o=e.diff,r=e.direction,a=void 0===r?"next":r,i=e.reason,l=void 0===i?"auto":i;if(it){var c=function(e,t){if(!ke.current||-1===e)return-1;for(var n=e;;){if("next"===t&&n===lt.length||"previous"===t&&-1===n)return-1;var o=ke.current.querySelector('[data-option-index="'.concat(n,'"]')),r=!W&&(!o||o.disabled||"true"===o.getAttribute("aria-disabled"));if(!(o&&!o.hasAttribute("tabindex")||r))return n;n+="next"===t?1:-1}}(function(){var e=lt.length-1;if("reset"===o)return Ee;if("start"===o)return 0;if("end"===o)return e;var t=ze.current+o;return t<0?-1===t&&oe?-1:V&&-1!==ze.current||Math.abs(o)>1?0:e:t>e?t===e+1&&oe?-1:V||Math.abs(o)>1?e:0:t}(),a);if(pt({index:c,reason:l,event:n}),x&&"reset"!==o)if(-1===c)Ce.current.value=qe;else{var u=t(lt[c]);Ce.current.value=u,0===u.toLowerCase().indexOf(qe.toLowerCase())&&qe.length>0&&Ce.current.setSelectionRange(qe.length,u.length)}}})),ft=a.useCallback((function(){if(it&&!function(){var e,n;if(-1!==ze.current&&ct.filteredOptions&&ct.filteredOptions.length!==lt.length&&ct.inputValue===qe&&(ce?We.length===ct.value.length&&ct.value.every((function(e,n){return t(We[n])===t(e)})):(e=ct.value,n=We,(e?t(e):"")===(n?t(n):"")))){var o=ct.filteredOptions[ze.current];if(o&<.some((function(e){return t(e)===t(o)})))return!0}return!1}()){var e=ce?We[0]:We;if(0!==lt.length&&null!=e){if(ke.current)if(null==e)ze.current>=lt.length-1?pt({index:lt.length-1}):pt({index:ze.current});else{var n=lt[ze.current];if(ce&&n&&-1!==f(We,(function(e){return ie(n,e)})))return;var o=f(lt,(function(t){return ie(t,e)}));-1===o?dt({diff:"reset"}):pt({index:o})}}else dt({diff:"reset"})}}),[lt.length,!ce&&We,K,dt,pt,it,qe,ce]),vt=(0,u.Z)((function(e){(0,s.Z)(ke,e),e&&ft()}));a.useEffect((function(){ft()}),[ft]);var gt=function(e){$e||(et(!0),rt(!0),fe&&fe(e))},ht=function(e,t){$e&&(et(!1),se&&se(e,t))},mt=function(e,t,n,o){if(ce){if(We.length===t.length&&We.every((function(e,n){return e===t[n]})))return}else if(We===t)return;ue&&ue(e,t,n,o),je(t)},bt=a.useRef(!1),xt=function(e,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"options",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"selectOption",r=t;if(ce){var a=f(r=Array.isArray(We)?We.slice():[],(function(e){return ie(t,e)}));-1===a?r.push(t):"freeSolo"!==n&&(r.splice(a,1),o="removeOption")}Qe(e,r),mt(e,r,o,{option:t}),z||e&&(e.ctrlKey||e.metaKey)||ht(e,o),(!0===P||"touch"===P&&bt.current||"mouse"===P&&!bt.current)&&Ce.current.blur()};var Zt=function(e,t){if(ce){""===qe&&ht(e,"toggleInput");var n=Me;-1===Me?""===qe&&"previous"===t&&(n=We.length-1):((n+="next"===t?1:-1)<0&&(n=0),n===We.length&&(n=-1)),n=function(e,t){if(-1===e)return-1;for(var n=e;;){if("next"===t&&n===We.length||"previous"===t&&-1===n)return-1;var o=Ae.querySelector('[data-tag-index="'.concat(n,'"]'));if(o&&o.hasAttribute("tabindex")&&!o.disabled&&"true"!==o.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t),De(n),st(n)}},yt=function(e){Se.current=!0,Ge(""),de&&de(e,"","clear"),mt(e,ce?[]:null,"clear")},Ot=function(e){return function(t){if(e.onKeyDown&&e.onKeyDown(t),!t.defaultMuiPrevented&&(-1!==Me&&-1===["ArrowLeft","ArrowRight"].indexOf(t.key)&&(De(-1),st(-1)),229!==t.which))switch(t.key){case"Home":it&&ee&&(t.preventDefault(),dt({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":it&&ee&&(t.preventDefault(),dt({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),dt({diff:-g,direction:"previous",reason:"keyboard",event:t}),gt(t);break;case"PageDown":t.preventDefault(),dt({diff:g,direction:"next",reason:"keyboard",event:t}),gt(t);break;case"ArrowDown":t.preventDefault(),dt({diff:1,direction:"next",reason:"keyboard",event:t}),gt(t);break;case"ArrowUp":t.preventDefault(),dt({diff:-1,direction:"previous",reason:"keyboard",event:t}),gt(t);break;case"ArrowLeft":Zt(t,"previous");break;case"ArrowRight":Zt(t,"next");break;case"Enter":if(-1!==ze.current&&it){var n=lt[ze.current],o=!!J&&J(n);if(t.preventDefault(),o)return;xt(t,n,"selectOption"),x&&Ce.current.setSelectionRange(Ce.current.value.length,Ce.current.value.length)}else _&&""!==qe&&!1===at&&(ce&&t.preventDefault(),xt(t,qe,"createOption","freeSolo"));break;case"Escape":it?(t.preventDefault(),t.stopPropagation(),ht(t,"escape")):L&&(""!==qe||ce&&We.length>0)&&(t.preventDefault(),t.stopPropagation(),yt(t));break;case"Backspace":if(ce&&!xe&&""===qe&&We.length>0){var r=-1===Me?We.length-1:Me,a=We.slice();a.splice(r,1),mt(t,a,"removeOption",{option:We[r]})}break;case"Delete":if(ce&&!xe&&""===qe&&We.length>0&&-1!==Me){var i=Me,l=We.slice();l.splice(i,1),mt(t,l,"removeOption",{option:We[i]})}}}},It=function(e){Je(!0),he&&!Se.current&>(e)},St=function(e){p(ke)?Ce.current.focus():(Je(!1),Pe.current=!0,Se.current=!1,I&&-1!==ze.current&&it?xt(e,lt[ze.current],"blur"):I&&_&&""!==qe?xt(e,qe,"blur","freeSolo"):k&&Qe(e,We),ht(e,"blur"))},Pt=function(e){var t=e.target.value;qe!==t&&(Ge(t),rt(!1),de&&de(e,t,"input")),""===t?D||ce||mt(e,null,"clear"):gt(e)},Ct=function(e){var t=Number(e.currentTarget.getAttribute("data-option-index"));ze.current!==t&&pt({event:e,index:t,reason:"mouse"})},kt=function(e){pt({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"touch"}),bt.current=!0},wt=function(e){var t=Number(e.currentTarget.getAttribute("data-option-index"));xt(e,lt[t],"selectOption"),bt.current=!1},Lt=function(e){return function(t){var n=We.slice();n.splice(e,1),mt(t,n,"removeOption",{option:We[e]})}},At=function(e){$e?ht(e,"toggleInput"):gt(e)},Tt=function(e){e.currentTarget.contains(e.target)&&e.target.getAttribute("id")!==Ie&&e.preventDefault()},Rt=function(e){e.currentTarget.contains(e.target)&&(Ce.current.focus(),ye&&Pe.current&&Ce.current.selectionEnd-Ce.current.selectionStart===0&&Ce.current.select(),Pe.current=!1)},Nt=function(e){""!==qe&&$e||At(e)},Mt=_&&qe.length>0;Mt=Mt||(ce?We.length>0:null!==We);var Dt=lt;if(Y){new Map;Dt=lt.reduce((function(e,t,n){var o=Y(t);return e.length>0&&e[e.length-1].group===o?e[e.length-1].options.push(t):e.push({key:n,index:n,group:o,options:[t]}),e}),[])}return F&&_e&&St(),{getRootProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.Z)({"aria-owns":ut?"".concat(Ie,"-listbox"):null},e,{onKeyDown:Ot(e),onMouseDown:Tt,onClick:Rt})},getInputLabelProps:function(){return{id:"".concat(Ie,"-label"),htmlFor:Ie}},getInputProps:function(){return{id:Ie,value:qe,onBlur:St,onFocus:It,onChange:Pt,onMouseDown:Nt,"aria-activedescendant":it?"":null,"aria-autocomplete":x?"both":"list","aria-controls":ut?"".concat(Ie,"-listbox"):void 0,"aria-expanded":ut,autoComplete:"off",ref:Ce,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:F}},getClearProps:function(){return{tabIndex:-1,onClick:yt}},getPopupIndicatorProps:function(){return{tabIndex:-1,onClick:At}},getTagProps:function(e){var t=e.index;return(0,r.Z)({key:t,"data-tag-index":t,tabIndex:-1},!xe&&{onDelete:Lt(t)})},getListboxProps:function(){return{role:"listbox",id:"".concat(Ie,"-listbox"),"aria-labelledby":"".concat(Ie,"-label"),ref:vt,onMouseDown:function(e){e.preventDefault()}}},getOptionProps:function(e){var n=e.index,o=e.option,r=(ce?We:[We]).some((function(e){return null!=e&&ie(o,e)})),a=!!J&&J(o);return{key:t(o),tabIndex:-1,role:"option",id:"".concat(Ie,"-option-").concat(n),onMouseMove:Ct,onClick:wt,onTouchStart:kt,"data-option-index":n,"aria-disabled":a,"aria-selected":r}},id:Ie,inputValue:qe,value:We,dirty:Mt,expanded:it&&Ae,popupOpen:it,focused:_e||-1!==Me,anchorEl:Ae,setAnchorEl:Te,focusedTag:Me,groupedOptions:Dt}}},33665:function(e,t,n){function o(e){if(null==e)throw new TypeError("Cannot destructure "+e)}n.d(t,{Z:function(){return o}})}}]);
|
|
2
|
+
//# sourceMappingURL=2750.edf7d107.chunk.js.map
|