@abtnode/webapp 1.16.17-beta-ce49fe0e → 1.16.17-beta-2679e686
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/build/asset-manifest.json +33 -27
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/static/css/3826.fafc5663.chunk.css +11 -0
- package/build/static/js/1294.19517674.chunk.js +1 -0
- package/build/static/js/1366.634a178c.chunk.js +2 -0
- package/build/static/js/1685.8024c33d.chunk.js +2 -0
- package/build/static/js/{1826.07c285de.chunk.js → 1826.6b07b9d8.chunk.js} +1 -1
- package/build/static/js/{2129.120e36ae.chunk.js → 2129.a503ddc2.chunk.js} +1 -1
- package/build/static/js/2311.1fe5b0ce.chunk.js +2 -0
- package/build/static/js/{2828.4f318970.chunk.js → 2828.e4af547b.chunk.js} +1 -1
- package/build/static/js/2911.92a82b04.chunk.js +1 -0
- package/build/static/js/{3476.c0b3411b.chunk.js → 3476.ef8ac7ae.chunk.js} +1 -1
- package/build/static/js/{3732.f5d8b39b.chunk.js → 3732.f9a2d362.chunk.js} +1 -1
- package/build/static/js/3826.99a169b4.chunk.js +2 -0
- package/build/static/js/3826.99a169b4.chunk.js.LICENSE.txt +63 -0
- package/build/static/js/3883.e143ca26.chunk.js +1 -0
- package/build/static/js/{4274.22984e96.chunk.js → 4274.9c2254c7.chunk.js} +1 -1
- package/build/static/js/{4906.d14fcb6e.chunk.js → 4906.825f650b.chunk.js} +1 -1
- package/build/static/js/{5526.c5d6afb5.chunk.js → 5526.4ee4d769.chunk.js} +2 -2
- package/build/static/js/{556.381dcbd8.chunk.js → 556.ebc2f879.chunk.js} +1 -1
- package/build/static/js/{5808.af4433c9.chunk.js → 6277.06fe2ed5.chunk.js} +2 -1
- package/build/static/js/6277.06fe2ed5.chunk.js.LICENSE.txt +5 -0
- package/build/static/js/6511.d1cf7f55.chunk.js +1 -0
- package/build/static/js/6580.200b63e3.chunk.js +1 -0
- package/build/static/js/{6780.c6efc1ec.chunk.js → 6780.ca11f5a3.chunk.js} +1 -1
- package/build/static/js/{6931.5f06c0c1.chunk.js → 6931.2f740c87.chunk.js} +1 -1
- package/build/static/js/{7126.57231bf3.chunk.js → 7126.d8d1d9d0.chunk.js} +1 -1
- package/build/static/js/{744.f4da0c57.chunk.js → 744.b848ddc7.chunk.js} +1 -1
- package/build/static/js/7657.2b64e975.chunk.js +2 -0
- package/build/static/js/{8249.63c55b3a.chunk.js → 8249.97de2470.chunk.js} +1 -1
- package/build/static/js/{8262.869cc799.chunk.js → 8262.3e89fa11.chunk.js} +1 -1
- package/build/static/js/8973.500d9a87.chunk.js +1 -0
- package/build/static/js/9517.ac659c32.chunk.js +2 -0
- package/build/static/js/9517.ac659c32.chunk.js.LICENSE.txt +1 -0
- package/build/static/js/{984.cdeeebfc.chunk.js → 984.90672bbf.chunk.js} +1 -1
- package/build/static/js/main.643f1d87.js +2 -0
- package/package.json +1 -1
- package/build/static/js/1035.c851de07.chunk.js +0 -2
- package/build/static/js/1366.4c0caad2.chunk.js +0 -2
- package/build/static/js/1685.9865eee2.chunk.js +0 -2
- package/build/static/js/4407.8d6ca5cb.chunk.js +0 -2
- package/build/static/js/6511.6578f60b.chunk.js +0 -1
- package/build/static/js/6580.486d1bdd.chunk.js +0 -1
- package/build/static/js/8973.8d079dd3.chunk.js +0 -1
- package/build/static/js/main.5da1d98b.js +0 -2
- /package/build/static/css/{4407.cc1ab277.chunk.css → 7657.cc1ab277.chunk.css} +0 -0
- /package/build/static/js/{1366.4c0caad2.chunk.js.LICENSE.txt → 1366.634a178c.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1685.9865eee2.chunk.js.LICENSE.txt → 1685.8024c33d.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1035.c851de07.chunk.js.LICENSE.txt → 2311.1fe5b0ce.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5526.c5d6afb5.chunk.js.LICENSE.txt → 5526.4ee4d769.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{4407.8d6ca5cb.chunk.js.LICENSE.txt → 7657.2b64e975.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.5da1d98b.js.LICENSE.txt → main.643f1d87.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8973],{80378:function(e,n,t){t.d(n,{Z:function(){return x}});var r=t(33028),i=t(59740),o=t(55898),a=t.n(o),l=t(62681),s=t(72333),c=t(6352),d=t.n(c),u=t(35432),f=t(58238),p=t(14491);var m=t(96266),h=["blocklet","style","size","ancestors"];function x(e){var n=e.blocklet,t=e.style,o=e.size,a=e.ancestors,c=(0,i.Z)(e,h),x=(0,f.h6)(),g=function(e){var n,t=e.blocklet,r=e.ancestors,i=void 0===r?[]:r,o=(0,f.h6)(),a=o.inService,l="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,p.XN)(null===t||void 0===t?void 0:t.status)?"~":""),s=a?d()(p.zn,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",l):d()(o.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)s=d()(t.deployedFrom,(0,p.lk)(t.meta.bundleDid,t.meta.logo),l);else{var c=window.env.apiPrefix||"/",m=i.concat(t),h=a?m.slice(1):m;s=d()(c,"/blocklet/logo-bundle".concat(h.map((function(e){return"/".concat(e.meta.did)})).join("")),l)}return{logoUrl:s,inService:a}}({blocklet:n,ancestors:a}),Z=g.logoUrl,v=g.inService,b=c.variant,j=v?function(){}:function(e){e.target.src="".concat(x.imgPrefix,"/blocklet.png")},y=(0,m.jsx)("img",{src:Z,onError:j,alt:n.meta.name,style:{width:o}});return n.meta.logo||(y=(0,m.jsx)(s.Z,{did:n.meta.did||"",responsive:!0})),(0,m.jsx)(l.Z,(0,r.Z)((0,r.Z)({variant:b||"square",style:Object.assign({backgroundColor:"transparent",width:o,height:o,borderRadius:10},t)},c),{},{children:y}))}x.propTypes={blocklet:a().object.isRequired,style:a().object,size:a().oneOfType([a().number,a().string]),ancestors:a().array},x.defaultProps={style:{},size:40,ancestors:[]}},74286:function(e,n,t){t.d(n,{Z:function(){return l}});var r=t(55898),i=t.n(r),o=t(39948),a=t(96266);function l(e){var n=e.depth;return(0,a.jsx)(o.Z,{ml:Math.max(2*(n-1),0),sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}l.propTypes={depth:i().number},l.defaultProps={depth:1}},44784:function(e,n,t){var r,i=t(71171),o=t(33028),a=t(59740),l=t(33518),s=t(82790),c=t(96266),d=["labelProps","className","style"];function u(e){var n=e.labelProps,t=e.className,r=e.style,i=(0,a.Z)(e,d),l=(0,o.Z)((0,o.Z)({},n),{},{labelPlacement:(null===n||void 0===n?void 0:n.labelPlacement)||"start"});return(0,c.jsx)(f,{className:t,style:r,children:(0,c.jsx)(s.Z,(0,o.Z)({labelProps:l},i))})}u.propTypes=s.Z.propTypes,u.defaultProps=s.Z.defaultProps;var f=l.Z.div(r||(r=(0,i.Z)(["\n max-width: 300px;\n > label {\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n }\n "," {\n max-width: 100%;\n }\n"])),(function(e){return e.theme.breakpoints.down("sm")}));n.Z=u},5119:function(e,n,t){t.r(n),t.d(n,{default:function(){return mt}});var r=t(71171),i=t(33028),o=t(96234),a=t(59740),l=t(68079),s=t(5057),c=t(33518),d=t(55898),u=t.n(d),f=t(96181),p=t(6352),m=t.n(p),h=t(35432),x=t(39948),g=t(55402),Z=t(82275),v=t(96399),b=t(65688),j=t(37633),y=t(48037),k=t(92273),C=t(76720),L=t(15849),w=t(68420),E=t(94464),S=t(38242),_=t(80378),P=t(1722),O=t(32723),A=t(34795),T=t(43681),R=t.n(T),N=t(50482),B=t.n(N),I=t(36554),F=t(29034),K=t(28726),U=t(80578),D=t(76811),z=t(86229),G=t(28641),W=t(44846),V=t(13727),q=t(56184),Y=t(67680),M=t(74490),H=t(51177),J=t(19654),Q=t(96366),X=t(35406),$=t(11875),ee=t(95890),ne=t(96266),te=["label","disabled","required","initialValue","onChange","style","onSubmit","triggers","options","formatterBeforeSubmit"],re={PaperProps:{style:{maxHeight:224,width:250}}},ie=function(e,n,t){return{fontWeight:-1===n.indexOf(e)?t.typography.fontWeightRegular:t.typography.fontWeightMedium}};function oe(e){var n=e.label,t=e.disabled,r=e.required,l=e.initialValue,c=e.onChange,d=e.style,u=e.onSubmit,f=e.triggers,p=e.options,m=e.formatterBeforeSubmit,h=(0,a.Z)(e,te),g=(0,Q.Z)(),Z=(0,s.useState)(!1),v=(0,o.Z)(Z,2),b=v[0],j=v[1],y=(0,s.useState)(!1),k=(0,o.Z)(y,2),C=k[0],L=k[1],w=(0,s.useState)(l),E=(0,o.Z)(w,2),S=E[0],_=E[1],P=(0,s.useState)(S),T=(0,o.Z)(P,2),R=T[0],N=T[1],B=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(){return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),e.prev=1,e.next=4,u("function"===typeof m?m(R):R);case 4:!1===e.sent?N(S):(N(R),_(R)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),N(S);case 11:return e.prev=11,L(!1),j(!1),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[1,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),I=b?(0,ne.jsx)(H.Z,(0,i.Z)((0,i.Z)({value:R,onChange:function(e){var n=e.target.value;n="string"===typeof n?n.split(","):n,N(n),c(n)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",renderValue:function(e){return(0,ne.jsx)(x.Z,{sx:{display:"flex",flexWrap:"wrap"},children:e.filter((function(e){return p.some((function(n){return n.code===e}))})).map((function(e){return(0,ne.jsx)(J.Z,{label:p.find((function(n){return n.code===e})).name,style:{marginRight:8},size:"small"},e)}))})},MenuProps:re},h),{},{children:p.map((function(e){return(0,ne.jsx)(M.Z,{value:e.code,style:ie(e.code,R,g),children:e.name},e.code)}))})):(0,ne.jsx)(x.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:R.filter((function(e){return p.some((function(n){return n.code===e}))})).map((function(e){return(0,ne.jsx)(J.Z,{label:p.find((function(n){return n.code===e})).name,style:{marginRight:8},size:"small"},e)}))});return(0,ne.jsx)($.Z,{className:"form",style:d,children:(0,ne.jsxs)(x.Z,{className:"form-item",children:[(0,ne.jsxs)(x.Z,{className:"form-item-label",children:[n,r&&(0,ne.jsx)(X.Z,{})]}),(0,ne.jsxs)(x.Z,{className:"form-item-body",children:[(0,ne.jsx)(x.Z,{className:"form-item-input",children:I}),(0,ne.jsx)(x.Z,{className:"form-item-action",children:b?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Y.Z,{"data-cy":"schema-form-item-confirm",onClick:B,disabled:t||C,size:"large",children:C?(0,ne.jsx)(W.Z,{size:24}):(0,ne.jsx)(q.Z,{})}),(0,ne.jsx)(Y.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){N(S),j(!1)},disabled:t||C,size:"large",children:(0,ne.jsx)(V.default,{})})]}):(0,ne.jsx)(ee.Z,{triggers:f,onEnterEdit:function(){return j(!0)},disabled:t})})]})]})})}oe.propTypes={style:u().object,onSubmit:u().func,onChange:u().func,label:u().string,initialValue:u().string,required:u().bool,disabled:u().bool,triggers:u().array,options:u().array,formatterBeforeSubmit:u().func},oe.defaultProps={style:{},onSubmit:function(){},onChange:function(){},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],formatterBeforeSubmit:function(e){return e.join(",")}};var ae,le=t(58238),se=t(14491),ce=t(54063),de=t(63406),ue=t(78410),fe=t(31853),pe=t(55152),me=t(70461),he=t(73545),xe=t(29054);function ge(e){var n=e.initialValue,t=e.onChange,r=e.disabled,i=e.loading,a=(0,w.PE)().t,l=(0,he.T)().api,s=(0,xe.y0)().blocklet,c=(0,fe.Z)({newAppSk:"",isConnectOpen:!1}),d=(0,o.Z)(c,2),u=d[0],f=d[1],p=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n);case 3:return e.prev=3,f({newAppSk:""}),e.finish(3);case 6:case"end":return e.stop()}}),e,null,[[0,,3,6]])})));return function(n){return e.apply(this,arguments)}}(),m=function(){return f({isConnectOpen:!1})},g=s.structVersion===h.APP_STRUCT_VERSION?[{key:"rotate-with-did-wallet",title:"Migrate with DID Wallet",handler:function(){(0,se.An)(s.status)?z.Z.error(a("blocklet.error.isRunning")):(0,S.isInProgress)(s.status)?z.Z.error(a("blocklet.error.isInProgress")):f({isConnectOpen:!0})}}]:[];return[(0,ne.jsx)(G.Z,{disabled:r,loading:i,initialValue:n,onSubmit:function(e){return f({newAppSk:e}),!1},triggers:g,secure:!0}),u.newAppSk&&(0,ne.jsx)(me.Z,{title:a("blocklet.config.appSkTitle"),description:(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(x.Z,{children:a("blocklet.config.appSkChangeTip")}),(0,ne.jsx)(x.Z,{fontWeight:"bold",mt:2,children:a("blocklet.config.appDidChangeTip")}),(0,ne.jsxs)(ve,{children:[(0,ne.jsx)("li",{children:a("blocklet.config.appDidChangeTipL1")}),(0,ne.jsx)("li",{children:a("blocklet.config.appDidChangeTipL2")})]})]}),confirm:a("confirm"),cancel:a("cancel"),onConfirm:function(){return p(u.newAppSk)},onCancel:function(){return f({newAppSk:""})}}),(0,ne.jsx)(pe.default,{popup:!0,open:u.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:l.get,checkTimeout:3e5,onSuccess:m,extraParams:{appDid:s.appDid},messages:{title:a("setup.keyPair.title"),scan:a("setup.keyPair.scan"),confirm:a("setup.keyPair.confirm"),success:a("setup.keyPair.success")},onClose:m})]}ge.propTypes={initialValue:u().string,onChange:u().func,disabled:u().bool,loading:u().bool},ge.defaultProps={initialValue:"default",onChange:function(){},disabled:!1,loading:!1};var Ze,ve=(0,c.Z)("ul")(ae||(ae=(0,r.Z)(["\n padding-left: 16px;\n li {\n margin-top: 8px;\n list-style: disk;\n font-weight: bold;\n }\n"]))),be=t(13128),je=t(55372),ye=t(11750),ke=t(88574),Ce=t(26174),Le=t(88092),we=t(50185),Ee=t(17425);function Se(e){var n=e.onCancel,t=e.onSuccess,r=e.onError,i=(0,s.useContext)(he.B).api,a=(0,s.useState)(!1),l=(0,o.Z)(a,2),c=l[0],d=l[1],u=(0,w.PE)(),f=u.t,p=u.locale,m=(0,s.useState)(""),h=(0,o.Z)(m,2),g=h[0],Z=h[1],v=(0,s.useState)(!1),b=(0,o.Z)(v,2),j=b[0],y=b[1],k=(0,s.useState)(0),C=(0,o.Z)(k,2),L=C[0],E=C[1],S=(0,s.useState)(""),_=(0,o.Z)(S,2),P=_[0],O=_[1],A=(0,Ee.DJ)().endpoint,T=(0,s.useState)(!1),R=(0,o.Z)(T,2),N=R[0],B=R[1],I=function(e){Z(null),d(!0);try{O(e.result),E(U.length-1)}catch(t){var n=(0,se.Z)(t);Z(n),r(t)}finally{d(!1)}},F=function(){y(!1),E(0)},U=[{body:(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(ye.Z,{children:f("team.transferApp.transferDialog.tips.progress")}),(0,ne.jsx)(ye.Z,{mt:3,mb:2,children:f("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:f("common.cancel"),confirm:f("team.transferApp.transferDialog.createTransferLink"),onCancel:n,onConfirm:function(){y(!0),E(1)}},{body:function(){return(0,ne.jsx)(pe.default,{action:"transfer-app-owner",open:j,locale:p,checkFn:i.get,onClose:F,onSuccess:I,checkTimeout:3e5,extraParams:{},messages:{title:f("team.transferApp.connectDialog.title"),scan:f("team.transferApp.connectDialog.scan"),confirm:f("team.transferApp.connectDialog.confirm"),success:f("team.transferApp.connectDialog.success")},popup:!0})}},{body:function(){var e=(0,se.VP)({transferId:P.transferId,endpoint:A});return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(x.Z,{component:Pe,dangerouslySetInnerHTML:{__html:f("team.transferApp.transferDialog.createSuccessTip1")}}),(0,ne.jsx)(x.Z,{component:Pe,mt:2,children:(0,ne.jsx)(Pe,{children:f("team.transferApp.transferDialog.createSuccessTip3")})}),(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(x.Z,{component:Pe,mt:2,children:(0,ne.jsx)(Pe,{children:f("team.transferApp.transferDialog.createSuccessTip2",{expireDate:(0,se.B2)(P.expireDate,p)})})}),(0,ne.jsx)(x.Z,{my:1,children:(0,ne.jsx)(we.Z,{children:e})})]}),(0,ne.jsx)("div",{children:(0,ne.jsx)(Ce.Z,{value:"end",control:(0,ne.jsx)(Le.Z,{checked:N,onChange:function(e){return B(e.target.checked)}}),label:f("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:f("common.confirm"),onConfirm:t}],D=U[L];return(0,ne.jsxs)(be.ZP,{title:(0,ne.jsx)(Pe,{className:"title",children:f("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,ne.jsxs)(ne.Fragment,{children:[D.cancel&&(0,ne.jsx)(K.Z,{onClick:D.onCancel,color:"inherit",children:D.cancel}),(0,ne.jsxs)(K.Z,{onClick:D.onConfirm,color:"error",disabled:c||L===U.length-1&&!N,variant:"contained",autoFocus:!0,children:[c&&(0,ne.jsx)(W.Z,{size:16}),D.confirm]})]}),children:[(0,ne.jsx)(je.Z,{component:"div",children:"function"===typeof D.body?D.body():D.body}),!!g&&(0,ne.jsx)(ke.Z,{type:"error",variant:"icon",children:g})]})}Se.propTypes={onCancel:u().func.isRequired,onSuccess:u().func.isRequired,onError:u().func},Se.defaultProps={onError:function(){}};var _e,Pe=c.Z.div(Ze||(Ze=(0,r.Z)(["\n font-size: 16px;\n font-weight: bold;\n &.title {\n font-size: 20px;\n }\n"]))),Oe=["blocklet","onUpdate","hasPermission"],Ae=Object.keys(D.SUPPORTED_LANGUAGES).map((function(e){return{code:e,name:D.SUPPORTED_LANGUAGES[e].nativeName}}));function Te(e){var n,t=e.blocklet,r=e.onUpdate,l=e.hasPermission,c=(0,a.Z)(e,Oe),d=(0,le.h6)(),u=(0,s.useContext)(w.RD).t,f=(0,s.useState)(""),p=(0,o.Z)(f,2),m=p[0],g=p[1],Z=(0,s.useState)(""),v=(0,o.Z)(Z,2),b=v[0],j=v[1],y=(0,s.useState)(!1),k=(0,o.Z)(y,2),C=k[0],L=k[1],E=(0,S.getWhoCanAccess)(t),_=null===t||void 0===t||null===(n=t.settings)||void 0===n?void 0:n.publicToStore,P=b||!l,T=d.inService,N=d.ws.useSubscription,W=t.meta.did,V=t.site,q=R()(t.meta,"capabilities.clusterMode",!1);if(N(h.EVENTS.NODE_RUNTIME_INFO,(function(e){q&&g(R()(e,"cpu.physicalCores",""))})),(0,se.wS)(t.status))return null;var Y=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE})),M=!Y||"yes"===Y.value,H=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES})),J=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL})),Q=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE})),X=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT})),$=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON})),ee=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO})),te=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER})),re=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR})),ie=[{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:u("blocklet.config.name"),value:t.environments.find((function(e){return"BLOCKLET_APP_NAME"===e.key})).value},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:u("blocklet.config.description"),value:t.environments.find((function(e){return"BLOCKLET_APP_DESCRIPTION"===e.key})).value},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,description:u("blocklet.config.appUrl"),value:J?J.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE,description:u("blocklet.config.logoSquare"),value:Q?Q.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT,description:u("blocklet.config.logoRect"),value:X?X.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON,description:u("blocklet.config.logoFavicon"),value:$?$.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO,description:u("blocklet.config.logo"),value:ee?ee.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:u("blocklet.config.copyrightOwner"),value:te?te.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:u("blocklet.config.copyrightYear"),value:re?re.value:""}];if(q){var ae=t.configs.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE})),fe=ae?ae.value:m;ie.push({key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,description:u("blocklet.config.clusterSize"),value:fe,cpuCores:m})}var pe=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,o,a;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return j(!0),e.prev=3,i=n.target.checked,e.next=7,d.api.configPublicToStore({input:{did:t.meta.did,publicToStore:i}});case 7:o=e.sent,a=o.blocklet,r(a),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),z.Z.error(e.t0.message);case 15:return e.prev=15,j(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[3,12,15,18]])})));return function(n){return e.apply(this,arguments)}}(),me=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n,i){var o,a,l,s;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){e.next=5;break}if(!(o=(0,se.I)({value:i,cpuCores:m}))){e.next=5;break}return z.Z.error(o),e.abrupt("return");case 5:return a=[{key:n,value:i}],e.prev=6,j(!0),e.next=10,d.api.configBlocklet({input:{did:t.meta.did,configs:a}});case 10:l=e.sent,s=l.blocklet,r(s),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(6),z.Z.error(e.t0.message);case 18:return e.prev=18,j(!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[6,15,18,21]])})));return function(n,t){return e.apply(this,arguments)}}(),he=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,o,a;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return j(!0),e.prev=3,i=n.target.checked,e.next=7,d.api.configBlocklet({input:{did:t.meta.did,configs:[{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE,value:i?"no":"yes"}]}});case 7:o=e.sent,a=o.blocklet,r(a),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),z.Z.error(e.t0.message);case 15:return e.prev=15,j(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[3,12,15,18]])})));return function(n){return e.apply(this,arguments)}}(),xe=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var r,i,o;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=V.corsAllowedOrigins||[],i=n.split(",").map((function(e){return e.trim()})).filter(Boolean),!B()(r,i)){e.next=4;break}return e.abrupt("return",!1);case 4:return e.prev=4,j(!0),o=i.length?i:["__none__"],e.next=9,d.api.updateRoutingSite({input:{id:V.id,corsAllowedOrigins:o,teamDid:t.meta.did}});case 9:j(!1),e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(4),z.Z.error(e.t0.message),j(!1),e.abrupt("return",!1);case 17:return e.abrupt("return",!0);case 18:case"end":return e.stop()}}),e,null,[[4,12]])})));return function(n){return e.apply(this,arguments)}}(),Ze=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,o;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return j(!0),e.prev=3,e.next=6,d.api.configBlocklet({input:{did:t.meta.did,configs:[{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SK,value:n}]}});case 6:i=e.sent,o=i.blocklet,r(o),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),z.Z.error(e.t0.message);case 14:return e.prev=14,j(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[3,11,14,17]])})));return function(n){return e.apply(this,arguments)}}();return(0,ne.jsxs)(Ie,(0,i.Z)((0,i.Z)({},c),{},{children:[ie.map((function(e){return(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:e.description}),(0,ne.jsx)(G.Z,{style:{marginTop:0},disabled:b||P,loading:b,initialValue:e.value,onSubmit:function(n){return me(e.key,n)}})]})})),(0,ne.jsx)(x.Z,{className:"config-form",children:"all"===E&&"registry"===t.source&&(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsxs)(x.Z,{className:"config-label",children:[u("blocklet.config.access.publicToStore"),(0,ne.jsx)(x.Z,{className:"config-desc",children:u("blocklet.config.access.publicInstanceTip")})]}),(0,ne.jsx)(I.Z,{disabled:P,checked:_,defaultChecked:!0,onChange:pe})]})}),(0,ne.jsx)(x.Z,{className:"config-form",component:F.Z,my:3}),(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:u("blocklet.config.languages")}),(0,ne.jsx)(oe,{style:{marginTop:0},disabled:b||P,loading:b,options:Ae,initialValue:H?H.value.split(","):["en","zh"],onSubmit:function(e){return me("BLOCKLET_APP_LANGUAGES",e)}})]}),(0,ne.jsx)(x.Z,{className:"config-form",component:F.Z,my:3}),(0,ne.jsx)(x.Z,{className:"config-form",mt:2,children:(0,ne.jsx)(x.Z,{className:"config-label",mb:0,children:u("common.security")})}),(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:u("router.domainSecurity.cors.title")}),(0,ne.jsx)(x.Z,{mb:1.5,className:"config-desc",children:u("router.domainSecurity.cors.description",{name:"the blocklet"})}),(0,ne.jsx)(G.Z,{style:{marginTop:0},disabled:b||P,loading:b,initialValue:(V.corsAllowedOrigins||[]).join(", "),onSubmit:xe})]}),(0,ne.jsx)(x.Z,{className:"config-form",component:F.Z,my:3}),(0,ne.jsx)(x.Z,{mb:2,className:"config-label",fontSize:20,children:u("blocklet.config.dangerZone")}),(0,ne.jsxs)(x.Z,{px:2,py:1,sx:{border:"1px solid red",borderRadius:2},children:[(0,ne.jsx)(x.Z,{className:"config-form",mt:2,children:!T&&(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsxs)(x.Z,{className:"config-label",children:[u("blocklet.config.deletable.name"),(0,ne.jsx)(x.Z,{className:"config-desc",children:u(M?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable")})]}),(0,ne.jsx)(I.Z,{disabled:P,checked:!M,defaultChecked:!0,onChange:he})]})}),(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:u("blocklet.config.sk")}),(0,ne.jsx)(ge,{disabled:b||P,loading:b,initialValue:t.environments.find((function(e){return"BLOCKLET_APP_SK"===e.key})).value,onChange:Ze})]}),T&&(0,ne.jsx)(de.Z,{role:"owner",children:function(e){return(e||ce.C)&&(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsx)(x.Z,{className:"config-label",mb:0,children:u("team.transferApp.name")}),(0,ne.jsxs)(K.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"transfer-app",onClick:function(){return L(!0)},children:[(0,ne.jsx)(U.Z,{style:{fontSize:"1.3em",marginRight:4}}),u("team.transferApp.name")]})]}),C&&(0,ne.jsx)(Se,{onCancel:function(){return L(!1)},onSuccess:function(){return L(!1)}})]})}}),(0,ne.jsx)(x.Z,{className:"config-form",mt:2,children:(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsxs)(x.Z,{className:"config-label",children:[u("blocklet.config.clearCache.name"),(0,ne.jsx)(x.Z,{className:"config-desc",children:u("blocklet.config.clearCache.purpose")})]}),(0,ne.jsx)(ue.Z,{teamDid:W})]})})]})]}))}var Re=(0,de.V)(Te,"mutate_blocklets"),Ne=(0,de.V)(Te,"",se.Wf);function Be(e){return(0,le.h6)().inService?(0,ne.jsx)(Ne,(0,i.Z)({},e)):(0,ne.jsx)(Re,(0,i.Z)({},e))}Te.propTypes={blocklet:u().object.isRequired,onUpdate:u().func,hasPermission:u().bool},Te.defaultProps={onUpdate:function(){},hasPermission:!1};var Ie=c.Z.div(_e||(_e=(0,r.Z)(["\n padding-top: 24px;\n .config-form {\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n max-height: 60vh;\n }\n }\n\n .config-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 16px 0;\n }\n\n .config-label {\n font-weight: bold;\n }\n\n .config-desc {\n font-weight: normal;\n font-size: 12px;\n color: #666;\n }\n\n .form-item {\n margin-top: 0;\n }\n"])),(function(e){return e.theme.breakpoints.down("md")})),Fe=t(25710),Ke=t(93066),Ue=t(80576),De=t(47020),ze=t(56556),Ge=t(8708),We=t.n(Ge),Ve=t(99360),qe=t(95550),Ye=t(766),Me=t.n(Ye),He=t(24529),Je=t.n(He),Qe=t(16727),Xe=t.n(Qe),$e={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:""};var en=function(){var e,n,t,r=(0,le.h6)().api,o=(0,xe.y0)().blocklet,a=(0,w.PE)().t,l=null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,s=Object.assign((0,i.Z)({},$e),(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.notification)||void 0===t?void 0:t.email)||{}),c=(0,qe.cI)({defaultValues:We()(s,Object.keys($e))}),d=c.handleSubmit,u=c.control,f=c.formState,p=c.watch,m=c.reset,h=p("enabled"),g=(0,Ve.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var t,o,s,c,d;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.configNotification({input:{did:l,notification:JSON.stringify({email:n})}});case 3:s=e.sent,c=s.blocklet,d=Object.assign((0,i.Z)({},$e),(null===c||void 0===c||null===(t=c.settings)||void 0===t||null===(o=t.notification)||void 0===o?void 0:o.email)||{}),m(d),z.Z.success(a("oauth.saveSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.Z.error(e.t0.message||a("oauth.saveFailed"));case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(n){return e.apply(this,arguments)}}()),Z=(0,Ve.Z)((function(e){var n=null===e||void 0===e?void 0:e.trim();return n?!!Me()(n)||a("notification.email.fromInvalid"):a("notification.email.fromRequired")})),v=(0,Ve.Z)((function(e){var n=null===e||void 0===e?void 0:e.trim();return n?!!Je()(n,{require_host:!1,protocols:[]})||a("notification.email.hostInvalid"):a("notification.email.hostRequired")})),b=(0,Ve.Z)((function(e){return e?!!Xe()(e)||a("notification.email.portInvalid"):a("notification.email.portRequired")})),j=(0,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("notification.email.userRequired")})),y=(0,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("notification.email.passwordRequired")})),k=(0,Ve.Z)((function(){return!0}));return(0,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:d(g),disabled:!0,children:[(0,ne.jsx)(qe.Qr,{name:"enabled",control:u,render:function(e){var n=e.field;return(0,ne.jsx)(Ce.Z,{control:(0,ne.jsx)(I.Z,(0,i.Z)({checked:n.value},n)),label:a("notification.email.enable"),sx:{marginBottom:"8px"}})}}),(0,ne.jsx)(qe.Qr,{name:"from",control:u,rules:{validate:h?Z:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.Z,(0,i.Z)((0,i.Z)({},t),{},{label:a("notification.email.from"),error:!!f.errors[t.name],helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(qe.Qr,{name:"host",control:u,rules:{validate:h?v:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.Z,(0,i.Z)((0,i.Z)({},t),{},{error:!!f.errors[t.name],label:a("notification.email.host"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(qe.Qr,{name:"port",control:u,rules:{validate:h?b:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.Z,(0,i.Z)((0,i.Z)({},t),{},{type:"number",error:!!f.errors[t.name],label:a("notification.email.port"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(qe.Qr,{name:"user",control:u,rules:{validate:h?j:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.Z,(0,i.Z)((0,i.Z)({},t),{},{error:!!f.errors[t.name],label:a("notification.email.user"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(qe.Qr,{name:"password",control:u,rules:{validate:h?y:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.Z,(0,i.Z)((0,i.Z)({},t),{},{type:"password",error:!!f.errors[t.name],label:a("notification.email.password"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(qe.Qr,{name:"secure",control:u,rules:{validate:k},render:function(e){var n=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(Ce.Z,{control:(0,ne.jsx)(I.Z,(0,i.Z)((0,i.Z)({checked:n.value},n),{},{disabled:!h})),label:a("notification.email.secure"),style:{marginBottom:16}})})}}),(0,ne.jsx)(ze.Z,{type:"submit",variant:"contained",onSubmit:d(g),disabled:!f.isDirty,children:a("oauth.save")})]})})},nn=[{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:"More"}),value:"more"}];var tn,rn,on=function(){var e=(0,s.useState)(nn[0].value),n=(0,o.Z)(e,2),t=n[0],r=n[1],i=(0,s.useContext)(w.RD).t,a=(0,Ke.Z)((function(){return{email:(0,ne.jsx)(en,{}),more:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Fe.Z,{children:i("notification.comingSoon")})})}}),[i]);return(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(E.Z,{tabs:nn,current:t,onChange:r}),(0,ne.jsx)(x.Z,{marginTop:"10px",children:a[t]})]})},an=t(75239),ln=t(48342),sn=t(94552),cn=t(24558),dn=t(74286),un=t(76667),fn=t(70648),pn=t(44067),mn=t(7664),hn=t(44123),xn=t(53906),gn=[{value:h.WHO_CAN_ACCESS.ALL,icon:xn.Z,title:{zh:"\u6240\u6709\u4eba\u53ef\u8bbf\u95ee",en:"Accessible to all"},description:{zh:"\u5411\u6240\u6709\u4eba\u5f00\u653e\uff0c\u65e0\u9700\u901a\u884c\u8bc1\u5373\u53ef\u8bbf\u95ee\u5e94\u7528",en:"Open to the world anyone can access without passport"}},{value:h.WHO_CAN_ACCESS.INVITED,icon:hn.Z,title:{zh:"\u53ea\u6709\u88ab\u9080\u8bf7\u7684\u4eba\u53ef\u4ee5\u8bbf\u95ee",en:"Only invited people can access"},description:{zh:"\u7a0d\u540e\u60a8\u53ef\u4ee5\u5728\u7ba1\u7406\u9875\u9762\u4e2d\u9080\u8bf7\u6210\u5458",en:"You can invite members later in the admin page"}},{value:h.WHO_CAN_ACCESS.OWNER,icon:mn.Z,title:{zh:"\u53ea\u6709\u5e94\u7528\u6240\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee",en:"Only Owner of the blocklet can access"},description:{zh:"\u5fc5\u987b\u63d0\u4f9b\u6240\u6709\u8005\u901a\u884c\u8bc1\u624d\u80fd\u8bbf\u95ee\u5e94\u7528",en:"You must provide owner passport to access this application"}}],Zn="roles",vn=[].concat((0,l.Z)(gn),[{value:Zn,icon:fn.Z,title:{zh:"\u6307\u5b9a\u901a\u884c\u8bc1\u53ef\u8bbf\u95ee",en:"Accessible to selected passports"},description:{zh:"\u53ea\u6709\u6307\u5b9a\u7684\u901a\u884c\u8bc1\u53ef\u4ee5\u8bbf\u95ee",en:"Only specified passports can access"}}]),bn=function(e,n){if(e&&e.startsWith(h.WHO_CAN_ACCESS_PREFIX_ROLES)){var t=(0,S.getRolesFromAuthConfig)({whoCanAccess:e}),r=n.filter((function(e){return t.includes(e.name)}));return{access:Zn,roles:r}}return{access:e,roles:[]}},jn=function(e,n){var t=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).roles,r=void 0===t?[]:t,i=(e.configs||[]).find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.COMPONENT_ACCESS_WHO}));if(i)return bn(i.value,r);if(n&&R()(n,"settings.whoCanAccess")&&R()(n,"settings.whoCanAccess")!==h.WHO_CAN_ACCESS.ALL)return bn(R()(n,"settings.whoCanAccess"),r);var o=(0,S.findServiceFromMeta)(e.meta,h.NODE_SERVICES.AUTH);return R()(o,"config.whoCanAccess")?bn(o.config.whoCanAccess,r):{access:h.WHO_CAN_ACCESS.ALL,roles:[]}};function yn(e){var n=e.blocklet,t=e.ancestors,r=e.children,i=(0,Q.Z)(),a=(0,s.useState)(""),c=(0,o.Z)(a,2),d=c[0],u=c[1],f=(0,w.PE)(),p=f.t,m=f.locale,g=(0,le.h6)().api,Z=(0,Ee.DJ)().roles,v=(0,s.useState)(""),b=(0,o.Z)(v,2),j=b[0],y=b[1],k=t[0]||n,C=jn(n,k,{roles:Z}),L=C.access,E=C.roles,_=(0,s.useState)(L),P=(0,o.Z)(_,2),T=P[0],R=P[1],N=(0,s.useState)(E),B=(0,o.Z)(N,2),I=B[0],F=B[1],U=[].concat((0,l.Z)(t.map((function(e){return e.meta.did}))),[n.meta.did]),D={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:i.palette.text.secondary},G=t.concat(n).map((function(e){return(0,S.getDisplayName)(e,!0)})).join(" / ");if((0,se.wS)(n.status))return null;if("unknown"===n.status&&(0,se.wS)(n.status))return null;var V=function(){u(!1)},q=function(e){e.stopPropagation(),u(!0)},H=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(){var n;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!j){e.next=2;break}return e.abrupt("return");case 2:return y(!0),e.prev=3,(n=T)===Zn&&(n="".concat(h.WHO_CAN_ACCESS_PREFIX_ROLES).concat(I.map((function(e){return e.name})).join(","))),e.next=8,g.updateWhoCanAccess({input:{did:U,whoCanAccess:n}});case 8:z.Z.success(p("blocklet.config.access.updatedTip")),V(),y(!1),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(3),y(!1),z.Z.error((0,se.Z)(e.t0));case 17:case"end":return e.stop()}}),e,null,[[3,13]])})));return function(){return e.apply(this,arguments)}}(),X=j||T===Zn&&!I.length;return["function"===typeof r?r({open:q}):(0,ne.jsx)(Y.Z,{onClick:q,"data-cy":"action-config-component",children:(0,ne.jsx)(un.default,{})}),d&&(0,ne.jsxs)(Cn,{open:!0,fullWidth:!0,title:G,onClose:V,PaperProps:{style:{minHeight:"auto"}},actions:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(K.Z,{onClick:V,color:"inherit","data-cy":"config-access-cancel",children:p("common.cancel")}),(0,ne.jsxs)(K.Z,{onClick:H,color:"primary",disabled:X,variant:"contained",autoFocus:!0,"data-cy":"config-access-confirm",children:[j&&(0,ne.jsx)(W.Z,{size:16}),p("common.confirm")]})]}),children:[(0,ne.jsx)(x.Z,{mt:4,mb:3,children:(0,ne.jsx)(De.Z,{label:p("blocklet.config.access.description"),select:!0,fullWidth:!0,value:T,onChange:function(e){var n=e.target.value;R(n)},"data-cy":"config-access-select",SelectProps:{renderValue:function(e){var n=vn.find((function(n){return n.value===e}));return n?(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(n.icon,{style:D}),n.title[m]]}):null}},children:vn.map((function(e){return(0,ne.jsxs)(Ln,{value:e.value,sx:{display:"block"},"data-cy":"config-access-opt-".concat(e.value),children:[(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(e.icon,{style:D}),(0,ne.jsx)(x.Z,{children:e.title[m]})]}),(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(x.Z,{className:"tip",children:e.description[m]})})]})}))})}),T===Zn&&(0,ne.jsx)(x.Z,{mt:4,mb:3,children:(0,ne.jsx)(De.Z,{label:p("blocklet.config.access.description"),select:!0,fullWidth:!0,value:I.map((function(e){return e.name})),onChange:function(e){F(Z.filter((function(n){return(e.target.value||[]).includes(n.name)})))},SelectProps:{multiple:!0,renderValue:function(e){return(0,ne.jsx)(x.Z,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:e.map((function(e){var n=Z.find((function(n){return n.name===e}));return(0,ne.jsx)(J.Z,{label:n.title},n.text)}))})}},children:Z.map((function(e){var n=e.name,t=e.title;return(0,ne.jsxs)(M.Z,{value:n,children:[(0,ne.jsx)(Le.Z,{checked:I.some((function(e){return e.name===n}))}),(0,ne.jsx)(pn.Z,{primary:t})]},n)}))})})]})]}yn.propTypes={blocklet:u().object.isRequired,ancestors:u().array,children:u().any},yn.defaultProps={ancestors:[],children:null};var kn,Cn=(0,c.Z)(be.ZP)(tn||(tn=(0,r.Z)(["\n .MuiDialogContent-root {\n padding-top: 0;\n margin-top: -32px;\n }\n .MuiToolbar-root {\n padding-right: 12px;\n }\n .ux-dialog_right {\n padding-right: 20px;\n }\n"]))),Ln=(0,c.Z)(M.Z)(rn||(rn=(0,r.Z)(["\n .tip {\n font-size: 12px;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.text.secondary}));function wn(e){var n,t,r=e.blocklet,i=e.ancestors,a=e.depth,c=(0,Q.Z)(),d=(0,w.PE)(),u=d.t,f=d.locale,p=(0,Ee.DJ)().roles,m=(0,s.useState)(!0),h=(0,o.Z)(m,2),g=h[0],Z=h[1],v=(0,xe.y0)().recommendedDomain,b=i[0]||r,j="/".concat(i.map((function(e){return e.mountPoint||"/"})).join("/"),"/").concat(r.mountPoint||"/").replace(/\/+/g,"/"),y=(0,se.vH)({blocklet:b,domain:{value:v},mountPoint:j,params:(0,se.f0)(b,f)}),L={fill:c.palette.text.secondary},E=a>0&&r.children.length>0,P=(0,ne.jsx)(Y.Z,{size:"small",children:g?(0,ne.jsx)(C.Z,{fontSize:"inherit"}):(0,ne.jsx)(k.default,{fontSize:"inherit"})}),O=jn(r,b,{roles:p}),A=O.access,T=O.roles;if("roles"!==A)t=gn.find((function(e){return e.value===A}))||gn[2];else{var R=T.map((function(e){return e.title})).join("/");t={title:{zh:"\u53ea\u6709 ".concat(R," \u53ef\u4ee5\u8bbf\u95ee"),en:"Only ".concat(R," can access")}}}return[(a>0||"gateway"!==r.meta.group)&&(0,ne.jsxs)(x.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)(x.Z,{pl:Math.max(2*(a-1),0),width:{xs:300,md:400},display:"flex",alignItems:"center",style:{cursor:E?"pointer":"cursor"},onClick:function(){return E&&Z(!g)},children:[E?P:(0,ne.jsx)(x.Z,{width:28}),(0,ne.jsx)(_.Z,{blocklet:r,ancestors:i}),(0,ne.jsxs)(x.Z,{ml:"16px",children:[(0,ne.jsx)(x.Z,{style:{color:"#222",fontSize:18},children:(0,S.getDisplayName)(r,!0)}),(0,ne.jsx)(x.Z,{display:"flex",alignItems:"center",children:(0,ne.jsx)(x.Z,{color:"text.secondary",children:t.title[f]})})]})]},r),(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(an.Z,{title:u("common.visit"),children:(0,ne.jsx)("a",{target:"_blank",href:y,rel:"noopener noreferrer",title:y,children:(0,ne.jsx)(Y.Z,{children:(0,ne.jsx)(sn.Z,{})})})}),(0,ne.jsx)(yn,{blocklet:r,ancestors:i,children:function(e){var n=e.open;return(0,ne.jsx)(an.Z,{title:u("common.edit"),children:(0,ne.jsx)(Y.Z,{onClick:n,"data-cy":"btn-edit-".concat(r.meta.did),children:(0,ne.jsx)(cn.Z,{style:L})})})}})]},"actions")]},"group-not-gateway-box"),(0,ne.jsx)(dn.Z,{depth:a}),null!==(n=r.children)&&void 0!==n&&n.length?(0,ne.jsx)(ln.Z,{in:g,children:r.children.map((function(e){return(0,ne.jsx)(wn,{blocklet:e,ancestors:[].concat((0,l.Z)(i),[r]),depth:a+1},"".concat(a+1,"-").concat(e.meta.did))}))},"blocklet-collapse"):null]}function En(){var e=(0,w.PE)().t,n=(0,xe.y0)().blocklet,t=(0,l.Z)(n.children)||[];return"gateway"!==n.meta.group&&t.unshift(n),(0,ne.jsx)(Sn,{component:"div",children:t&&t.length?[(0,ne.jsx)(x.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},style:{maxWidth:1080},children:(0,ne.jsx)(wn,{blocklet:n},"0-".concat(n.meta.did))},"top-blocklet-".concat(n.meta.did))]:(0,ne.jsx)(x.Z,{mt:8,children:(0,ne.jsx)(Fe.Z,{children:e("blocklet.component.noComponent")})})})}wn.propTypes={blocklet:u().object.isRequired,ancestors:u().array,depth:u().number},wn.defaultProps={ancestors:[],depth:0},En.propTypes={};var Sn=(0,c.Z)(x.Z)(kn||(kn=(0,r.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n margin-top: ",";\n margin-bottom: ",";\n &.first {\n margin-top: 0;\n }\n }\n"])),(function(e){return e.theme.spacing(5)}),(function(e){return e.theme.spacing(3)})),_n=t(44784);var Pn=function(){var e,n,t,r=(0,le.h6)().api,o=(0,xe.y0)().blocklet,a=(0,w.PE)().t,l=null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,s=Object.assign({enabled:!1,domain:"",clientId:""},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.oauth)||void 0===t?void 0:t.auth0)||{}),c=(0,qe.cI)({defaultValues:We()(s,["domain","clientId","enabled"])}),d=c.handleSubmit,u=c.control,f=c.formState,p=c.watch,m=c.reset,h=p("enabled"),g=(0,Ve.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var t,i,o,s,c;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.configOAuth({input:{did:l,oauth:JSON.stringify({auth0:n})}});case 3:o=e.sent,s=o.blocklet,c=Object.assign({enabled:!1,domain:"",clientId:""},(null===s||void 0===s||null===(t=s.settings)||void 0===t||null===(i=t.oauth)||void 0===i?void 0:i.auth0)||{}),m(c),z.Z.success(a("oauth.saveSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.Z.error(e.t0.message||a("oauth.saveFailed"));case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(n){return e.apply(this,arguments)}}()),Z=(0,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("oauth.auth0.domainDescribe")})),v=(0,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("oauth.auth0.clientIdDescribe")})),b=(0,Ve.Z)((function(){return!0}));return(0,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:d(g),disabled:!0,children:[(0,ne.jsx)(qe.Qr,{name:"enabled",control:u,render:function(e){var n=e.field;return(0,ne.jsx)(Ce.Z,{control:(0,ne.jsx)(_n.Z,(0,i.Z)({checked:n.value,style:{marginRight:"6px"}},n)),label:a("oauth.auth0.enable"),sx:{marginBottom:2,ml:1}})}}),(0,ne.jsx)(qe.Qr,{name:"domain",control:u,rules:{validate:h?Z:b},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.Z,(0,i.Z)((0,i.Z)({},t),{},{label:a("oauth.auth0.domain"),error:!!f.errors[t.name],helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(qe.Qr,{name:"clientId",control:u,rules:{validate:h?v:b},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.Z,(0,i.Z)((0,i.Z)({},t),{},{error:!!f.errors[t.name],label:a("oauth.auth0.clientId"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(ze.Z,{type:"submit",variant:"contained",onSubmit:d(g),disabled:!f.isDirty,children:a("oauth.save")})]})})},On=t(77150),An=t(24103),Tn={ttl:604800};function Rn(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?86400*e.ttl:e.ttl/86400;return(0,i.Z)((0,i.Z)({},e),{},{ttl:n})}function Nn(){var e,n,t=(0,le.h6)().api,r=(0,xe.y0)().blocklet,o=null===r||void 0===r||null===(e=r.meta)||void 0===e?void 0:e.did,a=Object.assign({},Tn,(null===r||void 0===r||null===(n=r.settings)||void 0===n?void 0:n.session)||{}),l=(0,qe.cI)({defaultValues:We()(Rn(a),["ttl"])}),s=l.handleSubmit,c=l.control,d=l.formState,u=l.reset,f=(0,w.PE)().t,p=(0,Ve.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var r,i,a,l;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.updateAppSessionConfig({input:{did:o,config:Rn(n,!0)}});case 3:i=e.sent,a=i.blocklet,l=Object.assign({},Tn,We()((null===a||void 0===a||null===(r=a.settings)||void 0===r?void 0:r.session)||{},["ttl"])),u(Rn(l)),z.Z.success(f("common.configSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.Z.error(e.t0.message);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(n){return e.apply(this,arguments)}}());return(0,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:s(p),disabled:!0,children:[(0,ne.jsx)(qe.Qr,{name:"ttl",control:c,render:function(e){var n=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,sx:{mb:2},children:(0,ne.jsxs)(An.Z,{px:3,children:[(0,ne.jsx)(x.Z,{mx:-3,my:.5,children:f("blocklet.config.session.ttl",{day:n.value})}),(0,ne.jsx)(On.ZP,(0,i.Z)((0,i.Z)({},n),{},{defaultValue:7,step:1,marks:[{value:1,label:f("blocklet.config.session.day",{day:1})},{value:7,label:f("blocklet.config.session.days",{day:7})},{value:14,label:f("blocklet.config.session.days",{day:14})},{value:21,label:f("blocklet.config.session.days",{day:21})},{value:30,label:f("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto",style:{maxWidth:"360px"}}))]})})}}),(0,ne.jsx)(ze.Z,{type:"submit",variant:"contained",onSubmit:s(p),disabled:!d.isDirty,children:f("oauth.save")})]})})}var Bn=t(82555),In=t(30333),Fn=t(75760),Kn=t(97038),Un=t(12673),Dn=t(92706),zn=t.n(Dn),Gn=(0,s.forwardRef)((function(e,n){var t=(0,s.useContext)(w.RD).t,r=(0,Un.Z)({show:!1,title:"",content:"",onConfirm:zn(),onCancel:zn(),loading:!1}),i=(0,Ve.Z)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.show=!0,r.title=e.title,r.content=e.content,r.onConfirm=e.onConfirm||zn(),r.onCancel=e.onCancel||zn(),r.loading=!1})),o=(0,Ve.Z)((function(){r.title="",r.content="",r.onConfirm=zn(),r.onCancel=zn()})),a=(0,Ve.Z)((function(){r.show=!1,setTimeout((function(){o()}),300)})),l=(0,Ve.Z)((function(){a(),null===r||void 0===r||r.onCancel()}),[]),c=(0,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.loading=!0,e.prev=1,e.next=4,null===r||void 0===r?void 0:r.onConfirm(a);case 4:return e.prev=4,r.loading=!1,e.finish(4);case 7:case"end":return e.stop()}}),e,null,[[1,,4,7]])}))),[]);return(0,s.useImperativeHandle)(n,(function(){return{open:i,close:a}}),[i,a]),(0,ne.jsx)(be.I4,{open:r.show,title:r.title,onConfirm:c,onCancel:l,confirmButton:{text:t("common.confirm"),props:{variant:"contained",color:"primary",loading:r.loading}},cancelButton:{text:t("common.cancel"),props:{variant:"outlined",color:"primary"}},children:r.content})}));var Wn=t(64886),Vn=t(42080),qn=t.n(Vn),Yn=t(75506),Mn=t.n(Yn),Hn=t(47685),Jn=t(13260),Qn=t(82434),Xn=t.n(Qn),$n=(0,s.forwardRef)((function(e,n){var t,r,i=(0,s.useContext)(w.RD).t,o=(0,xe.y0)().blocklet,a=(0,le.h6)().api,l=(0,Un.Z)({mode:"view",show:!1,data:{},callback:zn()}),c=(0,Hn.Fg)(),d=(null===c||void 0===c||null===(t=c.transitions)||void 0===t||null===(r=t.duration)||void 0===r?void 0:r.leavingScreen)||300,u=(0,Ve.Z)((function(){l.mode="view",l.data={},l.callback=zn()}),[]),f=(0,Ve.Z)((function(){l.show=!1,setTimeout((function(){u()}),d)}),[]),p=(0,Ve.Z)((function(e){l.mode="view",l.show=!0,l.data=e}),[]),h=(0,Ve.Z)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zn();l.mode="approve",l.show=!0,l.data=e,l.callback=n}),[]);(0,s.useImperativeHandle)(n,(function(){return{open:p,close:f,approve:h}}),[p,f,h]);var g=(0,Ke.Z)((function(){if(!l.show)return[];l.data.migratedFrom=[l.data.appId,l.data.appPid];var e=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return!1!==l.data.isMaster&&qn()(e,"appliedAt","status"),e.map((function(e){var n=i("federated.info.".concat(e)),t=l.data[e];if("appName"===e&&l.data.isMaster&&(t=(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(Bn.Z,{component:In.Z}),t]})),["appId","appPid","serverId"].includes(e)&&(t=(0,ne.jsx)(Jn.kL,{children:t})),["appUrl"].includes(e)&&(t=(0,ne.jsx)(x.Z,{component:"a",href:t,target:"_blank",children:t})),["appLogo"].includes(e)){var r=Xn()(t)?t:m()(l.data.appUrl||"",t||"");try{var o=new URL(r);o.searchParams.set("imageFilter","resize"),o.searchParams.set("w","80"),o.searchParams.set("h","80"),t=(0,ne.jsx)("img",{src:o.href,width:"60",height:"60",alt:l.data.appName})}catch(a){t=(0,ne.jsx)("img",{src:r,width:"60",height:"60",alt:l.data.appName})}}("status"===e&&(t=t&&i("federated.status.".concat(t))),"migratedFrom"===e)&&(t=(l.data.migratedFrom||[]).filter((function(e){return![l.data.appId,l.data.appPid].includes(e)})).map((function(e){return(0,ne.jsx)(Jn.kL,{children:e})})));return Mn()(t)&&(t="-"),{name:n,value:t}}))}),[l.data]),Z="approve"===l.mode,v=(0,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.auditFederatedLogin({input:{memberPid:l.data.appPid,did:o.appPid,status:"rejected"}});case 2:f(),null===l||void 0===l||l.callback(!1);case 4:case"end":return e.stop()}}),e)})))),b=(0,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.auditFederatedLogin({input:{memberPid:l.data.appPid,did:o.appPid,status:"approved"}});case 2:f(),null===l||void 0===l||l.callback(!0);case 4:case"end":return e.stop()}}),e)}))));return(0,ne.jsx)(be.ZP,{open:l.show,title:i(Z?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:f,actions:Z?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(ze.Z,{color:"error",variant:"contained",onClick:v,children:i("common.reject")}),(0,ne.jsx)(ze.Z,{variant:"contained",onClick:b,children:i("common.approve")})]}):(0,ne.jsx)(ze.Z,{variant:"outlined",onClick:f,children:i("common.close")}),children:g.map((function(e){return(0,ne.jsx)(Wn.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:e.name,children:e.value},e.name)}))})})),et=$n,nt=t(79842),tt=t(85408),rt=t.n(tt),it=(0,s.forwardRef)((function(e,n){var t,r,i=(0,Hn.Fg)(),o=(null===i||void 0===i||null===(t=i.transitions)||void 0===t||null===(r=t.duration)||void 0===r?void 0:r.leavingScreen)||300,a=(0,s.useContext)(w.RD).t,l=(0,Un.Z)({show:!1,data:{link:""}}),c=(0,Ve.Z)((function(){l.data.link=""}),[]),d=(0,Ve.Z)((function(){l.show=!1,setTimeout((function(){c()}),o)}),[]),u=(0,Ve.Z)((function(e){var n=e.link;l.show=!0,l.data.link=n}),[]);(0,s.useImperativeHandle)(n,(function(){return{open:u,close:d}}),[u,d]);var f=(0,Ve.Z)((function(){rt()(l.data.link),d()}),[d]);return(0,ne.jsxs)(be.ZP,{open:l.show,title:a("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:(0,ne.jsx)(K.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:f,children:a("common.copyAndClose")}),children:[(0,ne.jsx)(x.Z,{mb:1,children:a("federated.inviteJoinFederatedLoginDescription")}),(0,ne.jsx)(x.Z,{sx:{"& .copy-button":{display:"none !important"}},children:(0,ne.jsx)(nt.Z,{language:"shell",style:{marginBottom:0},children:l.data.link})})]})}));function ot(e){var n,t,r,i,a,l=e.mode,c=(0,s.useRef)(null),d=(0,s.useRef)(null),u=(0,s.useContext)(w.RD),f=u.t,p=u.locale,m=(0,xe.y0)(),h=m.blocklet,g=m.actions.refreshBlocklet,Z=function(){var e=(0,s.useRef)(null),n=(0,Ve.Z)((function(){for(var n,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];null===(n=e.current)||void 0===n||n.open.apply(n,r)})),t=(0,Ve.Z)((function(){for(var n,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];null===(n=e.current)||void 0===n||n.close.apply(n,r)})),r={open:n,close:t};return{confirmHolder:(0,ne.jsx)(Gn,{ref:e}),confirmApi:r}}(),v=Z.confirmApi,b=Z.confirmHolder,j=(0,le.h6)().api,y=(null===(n=h.settings.federated)||void 0===n?void 0:n.sites)||[],k=(null===(t=h.settings.federated)||void 0===t?void 0:t.config)||{autoLogin:!1},C=!1!==k.isMaster,L=(0,Ve.Z)((function(e){var n;null===(n=d.current)||void 0===n||n.open(e)})),E=(0,Ve.Z)((function(e){var n;null===(n=d.current)||void 0===n||n.approve(e,g)})),S=(0,Ve.Z)((function(e){v.open({title:f("federated.disableFederatedLogin"),content:f("federated.disableFederatedLoginDescription"),onConfirm:function(n){return(0,A.Z)((0,O.Z)().mark((function t(){return(0,O.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,j.auditFederatedLogin({input:{memberPid:e.appPid,did:h.appPid,status:"revoked"}});case 2:n();case 3:case"end":return t.stop()}}),t)})))()}})})),_=(0,Ve.Z)((function(e){v.open({title:f("federated.enableFederatedLogin"),content:f("federated.enableFederatedLoginDescription"),onConfirm:function(n){return(0,A.Z)((0,O.Z)().mark((function t(){return(0,O.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,j.auditFederatedLogin({input:{memberPid:e.appPid,did:h.appPid,status:"approved"}});case 2:n();case 3:case"end":return t.stop()}}),t)})))()}})})),P=(0,Ke.Z)((function(){var e=[{label:f("common.name"),name:"appName",options:{customBodyRenderLite:function(e){var n=y[e],t=!1!==n.isMaster;return(0,ne.jsx)(x.Z,{display:"inline-block",children:(0,ne.jsxs)(x.Z,{component:"a",display:"flex",alignItems:"center",href:n.appUrl,target:"_blank",onClick:function(e){e.stopPropagation()},children:[t&&(0,ne.jsx)(Bn.Z,{component:In.Z,style:{marginRight:"4px"}}),n.appName]})})}}},{label:f("common.did"),name:"appId",options:{customBodyRenderLite:function(e){var n=y[e];return(0,ne.jsx)(Kn.Z,{children:n.appId})}}},{label:f("common.status"),name:"status",options:{customBodyRenderLite:function(e){var n=y[e],t=!1!==n.isMaster;return(0,ne.jsx)(x.Z,{children:t?"-":f("federated.status.".concat(n.status))})}}}];return C&&e.push({label:f("common.actions"),name:"actions",options:{customBodyRenderLite:function(e){var n=y[e],t=!1!==n.isMaster;return(0,ne.jsx)(x.Z,{display:"flex",gap:1,children:t?(0,ne.jsxs)(ne.Fragment,{children:["rejected"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"error",size:"small",onClick:function(e){e.stopPropagation()},children:f("federated.status.rejected")}),"revoked"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"secondary",size:"small",onClick:function(e){e.stopPropagation()},children:f("federated.status.revoked")})]}):(0,ne.jsxs)(ne.Fragment,{children:["pending"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"primary",size:"small",onClick:function(e){e.stopPropagation(),E(n)},children:f("federated.status.pending")}),"approved"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"error",size:"small",onClick:function(e){e.stopPropagation(),S(n)},style:{whiteSpace:"nowrap"},children:f("federated.revoke")}),"revoked"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"warning",size:"small",onClick:function(e){e.stopPropagation(),_(n)},style:{whiteSpace:"nowrap"},children:f("federated.approve")})]})})}}}),e}),[k.appId,y,C]),T=(0,Ke.Z)((function(){return{sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick:function(e,n){var t=n.dataIndex,r=y[t];L(r)}}}),[]),R=(0,Ve.Z)((function(){var e,n=h.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL}));null!==n&&void 0!==n&&n.value?null===(e=c.current)||void 0===e||e.open({link:n.value}):z.Z.error(f("federated.failedToGetFederatedLoginLink"))}),[null===(r=h.site)||void 0===r||null===(i=r.domainAliases)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.href]),N=(0,s.useState)(k.autoLogin||!1),B=(0,o.Z)(N,2),I=B[0],F=B[1],U=(0,Ve.Z)((function(){v.open({title:f(I?"federated.disableFederatedAutoLogin":"federated.enableFederatedAutoLogin"),content:f(I?"federated.disableFederatedAutoLoginDescription":"federated.enableFederatedAutoLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,O.Z)().mark((function n(){return(0,O.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,j.configFederated({input:{did:h.appPid,autoLogin:!I}});case 2:F((function(e){return!e})),e();case 4:case"end":return n.stop()}}),n)})))()}})}),[F,I]),G=(0,Ve.Z)((function(){v.open({title:f("federated.quitFederatedLogin"),content:f("federated.quitFederatedLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,O.Z)().mark((function n(){return(0,O.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,j.quitFederatedLogin({input:{did:h.appPid}});case 2:e();case 3:case"end":return n.stop()}}),n)})))()}})})),W=(0,Ve.Z)((function(){v.open({title:f("federated.disbandFederatedLogin"),content:f("federated.disbandFederatedLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,O.Z)().mark((function n(){return(0,O.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,j.disbandFederatedLogin({input:{did:h.appPid}});case 2:e();case 3:case"end":return n.stop()}}),n)})))()}})})),V=[];return"master"!==l?V.push((0,ne.jsx)(K.Z,{size:"small",variant:"contained",color:"error",onClick:G,sx:{ml:1},children:f("federated.quitFederatedLogin")},"quitFederatedLogin")):(V.push((0,ne.jsx)(K.Z,{size:"small",variant:"contained",onClick:R,sx:{ml:1},children:f("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),V.push((0,ne.jsx)(K.Z,{color:"error",size:"small",variant:"contained",onClick:W,sx:{ml:1},children:f("federated.disbandFederatedLogin")},"disbandFederatedLogin"))),(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Fn.Z,{className:"main-table",locale:p,data:y,columns:P,customButtons:V,title:(0,ne.jsx)(x.Z,{className:"table-toolbar-left",children:"master"===l?f("oauth.federated"):(0,ne.jsx)(Ce.Z,{sx:{ml:0,"& span.MuiSwitch-switchBase":{display:"flex"},"& span.MuiSwitch-track":{display:"block"}},control:(0,ne.jsx)(_n.Z,{checked:I,style:{marginRight:"6px"},onChange:U}),label:f("federated.enableFederatedAutoLogin")})}),options:T}),b,(0,ne.jsx)(it,{ref:c}),(0,ne.jsx)(et,{ref:d})]})}ot.propTypes={mode:u().oneOf(["member","master"])},ot.defaultProps={mode:"member"};var at=ot,lt=(0,s.forwardRef)((function(e,n){var t,r,i=(0,s.useContext)(w.RD).t,o=(0,le.h6)().api,a=(0,xe.y0)().blocklet,l=null===a||void 0===a?void 0:a.appPid,c=(0,Hn.Fg)(),d=(null===c||void 0===c||null===(t=c.transitions)||void 0===t||null===(r=t.duration)||void 0===r?void 0:r.leavingScreen)||300,u=(0,Un.Z)({show:!1,appUrl:"",appUrlError:"",callback:zn()}),f=(0,Ve.Z)((function(){u.appUrl="",u.appUrlError="",u.callback=zn()}),[]),p=(0,Ve.Z)((function(){u.show=!1,setTimeout((function(){f()}),d)}),[]),m=(0,Ve.Z)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zn();u.show=!0,u.callback=e}),[]);(0,s.useImperativeHandle)(n,(function(){return{open:m,close:p}}),[m,p]);var h=(0,Ve.Z)((function(e){if(!e)throw new Error(i("federated.federatedJoinAppUrlRequired"));if(!Xn()(e))throw new Error(i("federated.federatedJoinAppUrlInvalid"))})),g=(0,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){var n;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,h(u.appUrl),e.next=4,o.joinFederatedLogin({input:{did:l,appUrl:u.appUrl}});case 4:n=e.sent,u.show=!1,p(),null===u||void 0===u||u.callback(n),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),u.appUrlError=e.t0.message;case 13:case"end":return e.stop()}}),e,null,[[0,10]])}))),[p,l]);return(0,ne.jsxs)(be.ZP,{open:u.show,title:i("federated.joinFederatedLogin"),onClose:p,PaperProps:{style:{minHeight:"unset"}},actions:(0,ne.jsx)(K.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:g,children:i("common.confirm")}),children:[(0,ne.jsx)(x.Z,{mb:1,children:i("federated.joinFederatedLoginDescription")}),(0,ne.jsx)(De.Z,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:i("federated.federatedJoinAppUrl"),label:i("federated.federatedJoinAppUrl"),value:u.appUrl,error:!!u.appUrlError,helperText:u.appUrlError||"eg: https://www.arcblock.io",onChange:function(e){u.appUrl=e.target.value}})]})})),st=lt;function ct(){var e,n,t,r,i=(0,s.useRef)(null),o=(0,s.useRef)(null),a=(0,s.useContext)(w.RD).t,l=(0,xe.y0)(),c=l.blocklet,d=l.actions.refreshBlocklet,u=(0,Ve.Z)((function(){var e,n,t,r=null===(e=c.site)||void 0===e||null===(n=e.domainAliases)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.href;if(r)try{var o,l=new URL(r);null===(o=i.current)||void 0===o||o.open({link:l.origin})}catch(s){z.Z.error(a("federated.failedToGetFederatedLoginLink"))}}),[null===(e=c.site)||void 0===e||null===(n=e.domainAliases)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.href]),f=(0,Ve.Z)((function(){var e;null===(e=o.current)||void 0===e||e.open((function(){d()}))}),[d]);if((null===(r=c.settings.federated)||void 0===r?void 0:r.sites.length)>0){var p,m=!1!==(null===(p=c.settings.federated)||void 0===p?void 0:p.config.isMaster);return(0,ne.jsx)(at,{mode:m?"master":"member"})}return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsxs)(x.Z,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:[(0,ne.jsx)(K.Z,{variant:"contained",onClick:u,children:a("federated.inviteJoinFederatedLogin")}),(0,ne.jsx)(F.Z,{sx:{width:"150px",color:"rgba(0, 0, 0, 0.3)"},children:"OR"}),(0,ne.jsx)(K.Z,{variant:"outlined",onClick:f,children:a("federated.joinFederatedLogin")})]}),(0,ne.jsx)(it,{ref:i}),(0,ne.jsx)(st,{ref:o})]})}var dt,ut=function(){var e=(0,s.useContext)(w.RD).t,n=[{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:e("oauth.commonSettings")}),value:"settings"},{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:e("oauth.federated")}),value:"federated"},{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:"Auth0"}),value:"auth0"},{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:e("oauth.moreLogin")}),value:"more"}],t=(0,s.useState)(n[0].value),r=(0,o.Z)(t,2),i=r[0],a=r[1],l=(0,Ke.Z)((function(){return{auth0:(0,ne.jsx)(Pn,{}),federated:(0,ne.jsx)(ct,{}),more:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Fe.Z,{children:e("oauth.comingSoon")})}),settings:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Nn,{})})}}),[e]);return(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(E.Z,{tabs:n,current:i,onChange:a}),(0,ne.jsx)(x.Z,{marginTop:"10px",children:l[i]})]})},ft=["blocklet","onUpdate"],pt=function e(n){var t=n.tabs,r=n.blocklet,i=n.ancestors,o=void 0===i?[]:i,a=n.depth,s=void 0===a?1:a,c=n.t,d=[].concat((0,l.Z)(o.map((function(e){return e.meta.did}))),[r.meta.did]).join("/"),u=!(null!==o&&void 0!==o&&o.length);t.push({label:(0,ne.jsxs)(x.Z,{pl:2*Math.max(1,s-1),display:"flex",alignItems:"center",justifyContent:"flex-start",children:[u?(0,ne.jsx)(P.Z,{size:24,blocklet:r}):(0,ne.jsx)(_.Z,{size:24,blocklet:r,ancestors:o}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:u?c("blocklet.component.container"):(0,S.getDisplayName)(r,!0)})})]},d),value:d}),r.children.length>0&&r.children.forEach((function(n){e({tabs:t,blocklet:n,ancestors:[].concat((0,l.Z)(o),[r]),depth:s+1,t:c})}))};function mt(e){var n=e.blocklet,t=e.onUpdate,r=(0,a.Z)(e,ft),l=(0,s.useContext)(w.RD).t,c=(0,le.h6)(),d=c.info,u=c.inService,p=(0,s.useState)(!0),S=(0,o.Z)(p,2),_=S[0],P=S[1],O=(0,L.useSearchParams)(),A=(0,o.Z)(O,2),T=A[0],R=A[1],N=T.get("tab")||"general",B=[{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-general",children:[(0,ne.jsx)(Z.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.general")})})]},"general"),value:"general"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-access",children:[(0,ne.jsx)(v.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.access")})})]},"access"),value:"access"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-oauth",children:[(0,ne.jsx)(b.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.login")})})]},"oauth"),value:"oauth"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-notification",children:[(0,ne.jsx)(j.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.notification")})})]},"notification"),value:"notification"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-preference",children:[(0,ne.jsx)(x.Z,{ml:-2,style:{transform:"translateY(2px)"},children:_?(0,ne.jsx)(C.Z,{fontSize:"inherit"}):(0,ne.jsx)(k.default,{fontSize:"inherit"})}),(0,ne.jsx)(y.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.preferences")})})]},"preference"),value:"preference"}];_&&pt({tabs:B,blocklet:n,t:l});var I=null;if("general"===N)I=(0,ne.jsx)(Be,{blocklet:n,onUpdate:t});else if("access"===N)I=(0,ne.jsx)(En,{});else if("oauth"===N)I=(0,ne.jsx)(ut,{});else if("notification"===N)I=(0,ne.jsx)(on,{});else{var F=u?h.WELLKNOWN_SERVICE_PATH_PREFIX:d.routing.adminPath,K=new URLSearchParams;u||K.set("authKey","__sst"),K.set("schemaKey",m()(window.location.origin,F,"/api/preferences?id=".concat(encodeURIComponent(N)))),I=(0,ne.jsx)(f.Z,{url:"".concat(m()(window.location.origin,F,"/hosted/form-collector/"),"?").concat(K.toString()),width:"100%",height:"100%",frameBorder:0,styles:{border:0}})}return(0,ne.jsx)(ht,(0,i.Z)((0,i.Z)({},r),{},{children:(0,ne.jsxs)(g.ZP,{container:!0,spacing:4,columns:24,children:[(0,ne.jsx)(g.ZP,{item:!0,sm:7,md:5,children:(0,ne.jsx)(E.Z,{tabs:B,current:N,orientation:"vertical",onChange:function(e){"preference"===e?P(!_):R((function(n){return"general"===e?n.delete("tab"):n.set("tab",e),n}))},sx:{borderRight:1,height:"100%",borderColor:"divider"}})}),(0,ne.jsx)(g.ZP,{item:!0,sm:17,md:19,children:(0,ne.jsx)(x.Z,{style:{minHeight:"66vh",height:"100%",position:"relative",overflow:"hidden"},children:I})})]})}))}mt.propTypes={blocklet:u().object.isRequired,onUpdate:u().func},mt.defaultProps={onUpdate:function(){}};var ht=c.Z.div(dt||(dt=(0,r.Z)(["\n .MuiTab-root {\n text-align: left;\n align-items: flex-start;\n font-weight: normal;\n }\n .Mui-selected {\n font-weight: bold;\n }\n"])))},78410:function(e,n,t){t.d(n,{Z:function(){return Z}});var r=t(33028),i=t(32723),o=t(34795),a=t(96234),l=t(59740),s=t(5057),c=t(86229),d=t(28726),u=t(44846),f=t(68420),p=t(99875),m=t(58238),h=t(70461),x=t(96266),g=["teamDid","size"];function Z(e){var n=e.teamDid,t=e.size,Z=void 0===t?"small":t,v=(0,l.Z)(e,g),b=(0,f.PE)().t,j=(0,m.h6)().api,y=(0,s.useState)(!1),k=(0,a.Z)(y,2),C=k[0],L=k[1],w=(0,s.useState)(null),E=(0,a.Z)(w,2),S=E[0],_=E[1],P=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,L(!0),e.next=4,j.clearCache({input:{teamDid:n}});case 4:r=e.sent,c.Z.success(b("blocklet.config.clearCache.success",{count:(null===(t=r.removed)||void 0===t?void 0:t.length)||0})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),c.Z.error((0,p.Z)(e.t0));case 11:return e.prev=11,L(!1),_(null),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[0,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),O={title:b("blocklet.config.clearCache.title"),description:b("blocklet.config.clearCache.description"),confirm:b("common.confirm"),cancel:b("common.cancel"),onConfirm:P,onCancel:function(){L(!1),_(null)}};return(0,x.jsxs)("div",(0,r.Z)((0,r.Z)({},v),{},{children:[(0,x.jsxs)(d.Z,{onClick:function(){return _(O)},color:"error",variant:"outlined",size:Z,children:[C?(0,x.jsx)(u.Z,{size:16,style:{marginRight:5}}):null,b("blocklet.config.clearCache.action")]}),S&&(0,x.jsx)(h.Z,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,onConfirm:S.onConfirm,onCancel:S.onCancel})]}))}},50185:function(e,n,t){t.d(n,{Z:function(){return f}});var r=t(33028),i=t(59740),o=t(5057),a=t(55898),l=t.n(a),s=t(12937),c=t(68420),d=t(96266),u=["children"];function f(e){var n=e.children,t=(0,i.Z)(e,u),a=(0,o.useContext)(c.RD).t;return(0,d.jsx)(s.Z,(0,r.Z)((0,r.Z)({tip:a("common.copyTip"),copiedTip:a("common.copiedTip")},t),{},{children:n}))}f.propTypes={children:l().any.isRequired}},28641:function(e,n,t){t.d(n,{Z:function(){return k}});var r=t(33028),i=t(32723),o=t(34795),a=t(96234),l=t(59740),s=t(5057),c=t(55898),d=t.n(c),u=t(39948),f=t(47020),p=t(44846),m=t(13727),h=t(56184),x=t(67680),g=t(35406),Z=t(11875),v=t(95890),b=t(96266),j=["label","disabled","required","initialValue","onChange","placeholder","style","onSubmit","secure","triggers","formatterBeforeSubmit"],y=function(e,n,t){return null===e&&n&&t?"******":e?n?"******":e:""};function k(e){var n=e.label,t=e.disabled,c=e.required,d=e.initialValue,k=e.onChange,C=e.placeholder,L=e.style,w=e.onSubmit,E=e.secure,S=e.triggers,_=e.formatterBeforeSubmit,P=(0,l.Z)(e,j),O=(0,s.useState)(!1),A=(0,a.Z)(O,2),T=A[0],R=A[1],N=(0,s.useState)(!1),B=(0,a.Z)(N,2),I=B[0],F=B[1],K=(0,s.useState)(E&&"__encrypted__"===d?null:d),U=(0,a.Z)(K,2),D=U[0],z=U[1],G=(0,s.useState)(D),W=(0,a.Z)(G,2),V=W[0],q=W[1],Y=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return F(!0),e.prev=1,e.next=4,w(V);case 4:!1===e.sent?q(D):(n=V,"function"===typeof _&&(n=_(V)),q(n),z(n)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),q(D);case 11:return e.prev=11,F(!1),R(!1),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[1,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),M=function(e){q(e),k(e)},H=T?(0,b.jsx)(f.Z,(0,r.Z)({style:{flex:1},fullWidth:!0,value:V,onChange:function(e){M(e.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:C,onKeyDown:function(e){"Enter"===e.key&&Y()},disabled:t,type:E?"password":"text"},P)):(0,b.jsx)(u.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:y(V,E,d)});return(0,b.jsx)(Z.Z,{className:"form",style:L,children:(0,b.jsxs)(u.Z,{className:"form-item",children:[(0,b.jsxs)(u.Z,{className:"form-item-label",children:[n,c&&(0,b.jsx)(g.Z,{})]}),(0,b.jsxs)(u.Z,{className:"form-item-body",children:[(0,b.jsx)(u.Z,{className:"form-item-input",children:H}),(0,b.jsx)(u.Z,{className:"form-item-action",children:T?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x.Z,{"data-cy":"schema-form-item-confirm",onClick:Y,disabled:t||I,size:"large",children:I?(0,b.jsx)(p.Z,{size:24}):(0,b.jsx)(h.Z,{})}),(0,b.jsx)(x.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){q(D),R(!1)},disabled:t||I,size:"large",children:(0,b.jsx)(m.default,{})})]}):(0,b.jsx)(v.Z,{triggers:S,onEnterEdit:function(){return R(!0)},disabled:t})})]})]})})}k.propTypes={style:d().object,onSubmit:d().func,onChange:d().func,label:d().string,initialValue:d().string,placeholder:d().string,required:d().bool,disabled:d().bool,secure:d().bool,triggers:d().array,formatterBeforeSubmit:d().func},k.defaultProps={style:{},onSubmit:function(){},onChange:function(){},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},11875:function(e,n,t){var r,i=t(71171),o=t(33518),a=t(39948);n.Z=(0,o.Z)(a.Z)(r||(r=(0,i.Z)(["\n width: 100%;\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n "," {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n "," {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n\n .MuiChip-root {\n margin-top: -4px;\n }\n }\n\n .MuiSelect-select {\n padding: 8px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n "," {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}))},95890:function(e,n,t){t.d(n,{Z:function(){return Z}});var r=t(96234),i=t(5057),o=t(55898),a=t.n(o),l=t(24558),s=t(67680),c=t(56556),d=t(49127),u=t(49390),f=t(37200),p=t(25228),m=t(24202),h=t(74490),x=t(1733),g=t(96266);function Z(e){var n=e.triggers,t=e.onEnterEdit,o=e.disabled,a=i.useRef(null),Z=i.useState(!1),v=(0,r.Z)(Z,2),b=v[0],j=v[1];return 0===n.length?(0,g.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(l.Z,{})}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(d.Z,{variant:"outlined",ref:a,"aria-label":"split button",children:[(0,g.jsx)(c.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(l.Z,{})}),(0,g.jsx)(c.Z,{size:"small","aria-controls":b?"split-button-menu":void 0,"aria-expanded":b?"true":void 0,onClick:function(){j((function(e){return!e}))},children:(0,g.jsx)(u.Z,{})})]}),(0,g.jsx)(m.Z,{sx:{zIndex:9999},open:b,anchorEl:a.current,role:void 0,placement:"bottom-end",children:(0,g.jsx)(p.Z,{children:(0,g.jsx)(f.d,{onClickAway:function(e){a.current&&a.current.contains(e.target)||j(!1)},children:(0,g.jsx)(x.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((function(e){return(0,g.jsx)(h.Z,{onClick:function(){return n=e.handler,j(!1),void n();var n},children:e.title},e.key)}))})})})})]})}Z.propTypes={triggers:a().arrayOf(a().shape({key:a().string.isRequired,title:a().string.isRequired,handler:a().func.isRequired})),onEnterEdit:a().func.isRequired,disabled:a().bool.isRequired},Z.defaultProps={triggers:[]}},35406:function(e,n,t){var r,i=t(71171),o=t(33518).Z.span(r||(r=(0,i.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(function(e){return e.theme.palette.error.main}));n.Z=o},54063:function(e,n,t){t.d(n,{C:function(){return r}});var r="true"===localStorage.getItem("enableDebug")}}]);
|