@abtnode/blocklet-services 1.16.16-beta-ca17cc31 → 1.16.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/api/emails/components/copyright.js +3 -1
  2. package/api/socket/channel/component.js +18 -19
  3. package/build/asset-manifest.json +97 -97
  4. package/build/index.html +1 -1
  5. package/build/service-worker.js +1 -1
  6. package/build/service-worker.js.map +1 -1
  7. package/build/static/js/{1013.48b6d77d.chunk.js → 1013.7b9f0d1c.chunk.js} +3 -3
  8. package/build/static/js/{1480.88c590c2.chunk.js → 1480.4d4dda1b.chunk.js} +2 -2
  9. package/build/static/js/1565.ba7ad6c9.chunk.js +2 -0
  10. package/build/static/js/2291.1627e4db.chunk.js +2 -0
  11. package/build/static/js/{2393.c5bbedfd.chunk.js → 2393.29558f48.chunk.js} +2 -2
  12. package/build/static/js/{2631.54f86f84.chunk.js → 2631.58f5f3bd.chunk.js} +2 -2
  13. package/build/static/js/2653.e7392aa1.chunk.js +2 -0
  14. package/build/static/js/{2686.7ae70bfd.chunk.js → 2686.890b32ed.chunk.js} +2 -2
  15. package/build/static/js/{2838.6fa46760.chunk.js → 2838.777de983.chunk.js} +3 -3
  16. package/build/static/js/{3038.8cbed218.chunk.js → 3038.40d611d1.chunk.js} +2 -2
  17. package/build/static/js/3593.4d68c718.chunk.js +2 -0
  18. package/build/static/js/3595.e2b52a55.chunk.js +3 -0
  19. package/build/static/js/3688.a821d97e.chunk.js +2 -0
  20. package/build/static/js/4023.c145cf94.chunk.js +2 -0
  21. package/build/static/js/{4355.42023420.chunk.js → 4355.7ff96d41.chunk.js} +2 -2
  22. package/build/static/js/4420.8b69d6e7.chunk.js +2 -0
  23. package/build/static/js/4706.d0c07efb.chunk.js +3 -0
  24. package/build/static/js/4716.bd8bed1b.chunk.js +2 -0
  25. package/build/static/js/{476.1f6135d6.chunk.js → 476.f196e88a.chunk.js} +2 -2
  26. package/build/static/js/4802.c534aa74.chunk.js +2 -0
  27. package/build/static/js/{5465.e0965b1d.chunk.js → 5465.19cd4b1f.chunk.js} +2 -2
  28. package/build/static/js/5628.8e4d578c.chunk.js +2 -0
  29. package/build/static/js/{5673.ab67c509.chunk.js → 5673.24aec022.chunk.js} +2 -2
  30. package/build/static/js/{5683.7e5d47f1.chunk.js → 5683.19dfa1f2.chunk.js} +2 -2
  31. package/build/static/js/{5960.adcd2848.chunk.js → 5960.e6da30ae.chunk.js} +2 -2
  32. package/build/static/js/{5982.89bdb419.chunk.js → 5982.27671e0b.chunk.js} +2 -2
  33. package/build/static/js/6186.99068c82.chunk.js +2 -0
  34. package/build/static/js/6452.8510e39f.chunk.js +2 -0
  35. package/build/static/js/{6498.bd96fa39.chunk.js → 6498.698608f8.chunk.js} +2 -2
  36. package/build/static/js/6576.2afa44eb.chunk.js +2 -0
  37. package/build/static/js/6737.16a327aa.chunk.js +2 -0
  38. package/build/static/js/{6771.acc94e01.chunk.js → 6771.fae30b2e.chunk.js} +3 -3
  39. package/build/static/js/6856.2eb98754.chunk.js +2 -0
  40. package/build/static/js/{6868.f2fd5c29.chunk.js → 6868.b4a7c4d1.chunk.js} +2 -2
  41. package/build/static/js/{6640.f40cecbd.chunk.js → 6919.aa19f009.chunk.js} +2 -2
  42. package/build/static/js/{7465.babf76bb.chunk.js → 6974.9fe85473.chunk.js} +3 -3
  43. package/build/static/js/{7006.b72aff66.chunk.js → 7006.8f0645e5.chunk.js} +2 -2
  44. package/build/static/js/{7367.60cb10e0.chunk.js → 7367.c5adfbb1.chunk.js} +2 -2
  45. package/build/static/js/7516.eb541f26.chunk.js +2 -0
  46. package/build/static/js/{8143.e1c8ca20.chunk.js → 8143.34374ce2.chunk.js} +2 -2
  47. package/build/static/js/{8497.0cf2247d.chunk.js → 8497.e83aa0c8.chunk.js} +2 -2
  48. package/build/static/js/{8604.ad77a749.chunk.js → 8604.ad426a4a.chunk.js} +3 -3
  49. package/build/static/js/9088.4313ac38.chunk.js +3 -0
  50. package/build/static/js/9102.ff87def5.chunk.js +2 -0
  51. package/build/static/js/9409.c853d69d.chunk.js +2 -0
  52. package/build/static/js/941.94668382.chunk.js +2 -0
  53. package/build/static/js/{9899.af2e4f43.chunk.js → 9899.277d673f.chunk.js} +2 -2
  54. package/build/static/js/main.adbd79ef.js +3 -0
  55. package/package.json +25 -25
  56. package/build/static/js/1565.6df974b9.chunk.js +0 -2
  57. package/build/static/js/2291.4b1a6a86.chunk.js +0 -2
  58. package/build/static/js/2653.5dc29ed5.chunk.js +0 -2
  59. package/build/static/js/3593.c1eddcd6.chunk.js +0 -2
  60. package/build/static/js/3595.cbf763c8.chunk.js +0 -3
  61. package/build/static/js/3688.9bb1c7a8.chunk.js +0 -2
  62. package/build/static/js/4023.6d1a7ac8.chunk.js +0 -2
  63. package/build/static/js/4420.55971847.chunk.js +0 -2
  64. package/build/static/js/4706.212c92c8.chunk.js +0 -3
  65. package/build/static/js/4716.88f32cf2.chunk.js +0 -2
  66. package/build/static/js/4802.cf122fc7.chunk.js +0 -2
  67. package/build/static/js/50.cbaa5a4e.chunk.js +0 -3
  68. package/build/static/js/5628.e46ecc79.chunk.js +0 -2
  69. package/build/static/js/6186.6c16ec07.chunk.js +0 -2
  70. package/build/static/js/6452.143af37a.chunk.js +0 -2
  71. package/build/static/js/6576.f78daf32.chunk.js +0 -2
  72. package/build/static/js/6700.5dfd9c70.chunk.js +0 -2
  73. package/build/static/js/6737.7d135225.chunk.js +0 -2
  74. package/build/static/js/6856.e185e317.chunk.js +0 -2
  75. package/build/static/js/9102.828066ce.chunk.js +0 -2
  76. package/build/static/js/9409.62a2aee0.chunk.js +0 -2
  77. package/build/static/js/941.6a4ed4dd.chunk.js +0 -2
  78. package/build/static/js/main.8ae2fba0.js +0 -3
  79. /package/build/static/js/{1013.48b6d77d.chunk.js.LICENSE.txt → 1013.7b9f0d1c.chunk.js.LICENSE.txt} +0 -0
  80. /package/build/static/js/{2838.6fa46760.chunk.js.LICENSE.txt → 2838.777de983.chunk.js.LICENSE.txt} +0 -0
  81. /package/build/static/js/{3595.cbf763c8.chunk.js.LICENSE.txt → 3595.e2b52a55.chunk.js.LICENSE.txt} +0 -0
  82. /package/build/static/js/{4706.212c92c8.chunk.js.LICENSE.txt → 4706.d0c07efb.chunk.js.LICENSE.txt} +0 -0
  83. /package/build/static/js/{6771.acc94e01.chunk.js.LICENSE.txt → 6771.fae30b2e.chunk.js.LICENSE.txt} +0 -0
  84. /package/build/static/js/{7465.babf76bb.chunk.js.LICENSE.txt → 6974.9fe85473.chunk.js.LICENSE.txt} +0 -0
  85. /package/build/static/js/{8604.ad77a749.chunk.js.LICENSE.txt → 8604.ad426a4a.chunk.js.LICENSE.txt} +0 -0
  86. /package/build/static/js/{50.cbaa5a4e.chunk.js.LICENSE.txt → 9088.4313ac38.chunk.js.LICENSE.txt} +0 -0
  87. /package/build/static/js/{main.8ae2fba0.js.LICENSE.txt → main.adbd79ef.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[4716,6378],{44716:function(e,n,t){t.r(n);var o,r=t(71171),i=t(32723),a=t(34795),c=t(30969),s=t(16380),l=t(30734),u=t(86822),f=t(94308),d=t(38361),p=t(6779),g=t(238),v=t(94984),h=t(72836),w=t(26022),m=t(86776),y=t(20244),x=t(4485),E=t(38507),I=t(37574),P=function(e){setTimeout((function(){var n=new URL(window.location.href).searchParams.get("redirect");if(n){var t=decodeURIComponent(n);t.startsWith(y.WELLKNOWN_SERVICE_PATH_PREFIX)?e(t,{replace:!0}):window.location=t}else window.location=window.env.pathPrefix||"/"}),50)};n.default=function(){var e=(0,x.Tt)(),n=e.api,t=e.session,o=(0,w.PE)(),r=o.t,s=o.locale,_=(0,m.Z)().getPassportId,b=(0,l.useNavigate)(),k=new URL(window.location.href).searchParams,N=k.get("redirect"),Z=k.get("forceStayLogin"),L=window.blocklet.trustedFactories||[],R=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(n,o){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,E.ZB)(o(n.sessionToken)),(0,E.zI)(o(n.refreshToken)),e.next=4,t.loginFederatedMaster();case 4:return e.next=6,t.refresh();case 6:Z&&P(b);case 7:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){null!==t&&void 0!==t&&t.user&&!Z&&P(b)}),[null===t||void 0===t?void 0:t.user]);var C={passportId:_()},j=k.get("componentId");return j&&(C.componentId=j),t.loading||t.user&&!Z?(0,I.jsx)(g.Z,{children:(0,I.jsx)(f.Z,{})}):(0,I.jsx)(S,{children:(0,I.jsx)("div",{className:"connect-wrapper",children:(0,I.jsx)(h.default,{className:"connect",action:"login",checkFn:n.get,checkTimeout:6e5,webWalletUrl:(0,E.yP)(),onSuccess:R,onError:function(e){v.Z.error(e.message)},locale:s,messages:{title:r("login.dialog.title"),scan:r("login.dialog.scan"),confirm:r("login.dialog.confirm"),success:r("login.dialog.success")},extraParams:C,extraContent:(0,I.jsxs)(d.Z,{textAlign:"center",fontSize:14,children:[(0,I.jsx)(u.rU,{to:"".concat(y.WELLKNOWN_SERVICE_PATH_PREFIX,"/lost-passport?redirect=").concat(encodeURIComponent("".concat(window.location.pathname).concat(window.location.search))),style:{marginRight:24,color:"#4598FA"},children:r("lostPassport.title")}),L.length>0&&(0,I.jsx)(p.Z,{title:r("exchangePassport.tooltip",{collections:L.map((function(e){return e.factoryAddress}))}),placement:"top-end",enterTouchDelay:0,children:(0,I.jsx)(u.rU,{to:"".concat(y.WELLKNOWN_SERVICE_PATH_PREFIX,"/exchange-passport?redirect=").concat(encodeURIComponent(N||"/")),style:{color:"#4598FA"},children:r("exchangePassport.title")})})]})})})})};var S=s.Z.div(o||(o=(0,r.Z)(["\n box-sizing: border-box;\n width: 100%;\n height: 100vh;\n position: relative;\n display: flex;\n flex-direction: column;\n .connect-wrapper {\n flex: 1;\n }\n .connect {\n background: #fafafa;\n }\n"])))},86776:function(e,n,t){t.d(n,{Z:function(){return i}});var o=t(96234),r=t(17708);function i(){var e=(0,r.Z)("passportId",""),n=(0,o.Z)(e,3),t=n[0],i=n[1],a=n[2];return{getPassportId:function(){return setTimeout((function(){a()}),0),t||""},setPassportId:i}}},46378:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isNavigator=n.isBrowser=n.off=n.on=n.noop=void 0;n.noop=function(){},n.on=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];e&&e.addEventListener&&e.addEventListener.apply(e,n)},n.off=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];e&&e.removeEventListener&&e.removeEventListener.apply(e,n)},n.isBrowser="undefined"!==typeof window,n.isNavigator="undefined"!==typeof navigator},17708:function(e,n,t){var o=t(30969),r=t(46378);n.Z=function(e,n,t){if(!r.isBrowser)return[n,r.noop,r.noop];if(!e)throw new Error("useLocalStorage key may not be falsy");var i=t?t.raw?function(e){return e}:t.deserializer:JSON.parse,a=o.useRef((function(e){try{var o=t?t.raw?String:t.serializer:JSON.stringify,r=localStorage.getItem(e);return null!==r?i(r):(n&&localStorage.setItem(e,o(n)),n)}catch(c){return n}})),c=o.useState((function(){return a.current(e)})),s=c[0],l=c[1];o.useLayoutEffect((function(){return l(a.current(e))}),[e]);var u=o.useCallback((function(n){try{var o="function"===typeof n?n(s):n;if("undefined"===typeof o)return;var r=void 0;r=t?t.raw?"string"===typeof o?o:JSON.stringify(o):t.serializer?t.serializer(o):JSON.stringify(o):JSON.stringify(o),localStorage.setItem(e,r),l(i(r))}catch(c){}}),[e,l]),f=o.useCallback((function(){try{localStorage.removeItem(e),l(void 0)}catch(c){}}),[e,l]);return[s,u,f]}}}]);
2
- //# sourceMappingURL=4716.88f32cf2.chunk.js.map
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[4802],{92746:function(e,n,t){var r,i=t(71171),a=t(33028),o=t(59740),l=t(16380),s=t(50442),c=t(37574),d=["labelProps","className","style"];function u(e){var n=e.labelProps,t=e.className,r=e.style,i=(0,o.Z)(e,d),l=(0,a.Z)((0,a.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,a.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},121:function(e,n,t){t.r(n),t.d(n,{default:function(){return pt}});var r=t(71171),i=t(33028),a=t(96234),o=t(59740),l=t(68079),s=t(30969),c=t(16380),d=t(24974),u=t.n(d),f=t(95973),p=t(19611),m=t.n(p),h=t(20244),x=t(38361),v=t(3994),Z=t(79823),g=t(64689),b=t(99254),j=t(76527),k=t(85385),C=t(52838),y=t(23038),L=t(86822),E=t(26022),w=t(19865),S=t(7017),_=t(70998),P=t(84802),O=t(32723),A=t(34795),T=t(46292),R=t.n(T),N=t(15888),B=t.n(N),I=t(34159),F=t(75295),K=t(29996),U=t(13134),D=t(59505),z=t(94984),G=t(67019),W=t(94308),Y=t(88581),V=t(27724),H=t(94551),M=t(2689),q=t(39130),J=t(7173),Q=t(94702),X=t(14458),$=t(28412),ee=t(76934),ne=t(37574),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 ae(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,o.Z)(e,te),v=(0,Q.Z)(),Z=(0,s.useState)(!1),g=(0,a.Z)(Z,2),b=g[0],j=g[1],k=(0,s.useState)(!1),C=(0,a.Z)(k,2),y=C[0],L=C[1],E=(0,s.useState)(l),w=(0,a.Z)(E,2),S=w[0],_=w[1],P=(0,s.useState)(S),T=(0,a.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)(q.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,v),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)(H.Z,{"data-cy":"schema-form-item-confirm",onClick:B,disabled:t||y,size:"large",children:y?(0,ne.jsx)(W.Z,{size:24}):(0,ne.jsx)(V.Z,{})}),(0,ne.jsx)(H.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){N(S),j(!1)},disabled:t||y,size:"large",children:(0,ne.jsx)(Y.default,{})})]}):(0,ne.jsx)(ee.Z,{triggers:f,onEnterEdit:function(){return j(!0)},disabled:t})})]})]})})}ae.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},ae.defaultProps={style:{},onSubmit:function(){},onChange:function(){},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],formatterBeforeSubmit:function(e){return e.join(",")}};var oe=t(41395),le=t(24891),se=t(19066),ce=t(22572),de=t(85710),ue=t(8479),fe=["teamDid","size"];function pe(e){var n=e.teamDid,t=e.size,r=void 0===t?"small":t,l=(0,o.Z)(e,fe),c=(0,E.PE)().t,d=(0,oe.h6)().api,u=(0,s.useState)(!1),f=(0,a.Z)(u,2),p=f[0],m=f[1],h=(0,s.useState)(null),x=(0,a.Z)(h,2),v=x[0],Z=x[1],g=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(){var t,r;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,m(!0),e.next=4,d.clearCache({input:{teamDid:n}});case 4:r=e.sent,z.Z.success(c("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),z.Z.error((0,de.Z)(e.t0));case 11:return e.prev=11,m(!1),Z(null),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[0,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),b={title:c("blocklet.config.clearCache.title"),description:c("blocklet.config.clearCache.description"),confirm:c("common.confirm"),cancel:c("common.cancel"),onConfirm:g,onCancel:function(){m(!1),Z(null)}};return(0,ne.jsxs)("div",(0,i.Z)((0,i.Z)({},l),{},{children:[(0,ne.jsxs)(K.Z,{onClick:function(){return Z(b)},color:"error",variant:"outlined",size:r,children:[p?(0,ne.jsx)(W.Z,{size:16,style:{marginRight:5}}):null,c("blocklet.config.clearCache.action")]}),v&&(0,ne.jsx)(ue.Z,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,onConfirm:v.onConfirm,onCancel:v.onCancel})]}))}var me,he=t(43178),xe=t(72836),ve=t(77370),Ze=t(45008);function ge(e){var n=e.initialValue,t=e.onChange,r=e.disabled,i=e.loading,o=(0,E.PE)().t,l=(0,ve.T)().api,s=(0,Ze.y0)().blocklet,c=(0,he.Z)({newAppSk:"",isConnectOpen:!1}),d=(0,a.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})},v=s.structVersion===h.APP_STRUCT_VERSION?[{key:"rotate-with-did-wallet",title:"Migrate with DID Wallet",handler:function(){(0,le.An)(s.status)?z.Z.error(o("blocklet.error.isRunning")):(0,S.isInProgress)(s.status)?z.Z.error(o("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:v,secure:!0}),u.newAppSk&&(0,ne.jsx)(ue.Z,{title:o("blocklet.config.appSkTitle"),description:(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(x.Z,{children:o("blocklet.config.appSkChangeTip")}),(0,ne.jsx)(x.Z,{fontWeight:"bold",mt:2,children:o("blocklet.config.appDidChangeTip")}),(0,ne.jsxs)(je,{children:[(0,ne.jsx)("li",{children:o("blocklet.config.appDidChangeTipL1")}),(0,ne.jsx)("li",{children:o("blocklet.config.appDidChangeTipL2")})]})]}),confirm:o("confirm"),cancel:o("cancel"),onConfirm:function(){return p(u.newAppSk)},onCancel:function(){return f({newAppSk:""})}}),(0,ne.jsx)(xe.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:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("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 be,je=(0,c.Z)("ul")(me||(me=(0,r.Z)(["\n padding-left: 16px;\n li {\n margin-top: 8px;\n list-style: disk;\n font-weight: bold;\n }\n"]))),ke=t(50496),Ce=t(43207),ye=t(33359),Le=t(23299),Ee=t(49884),we=t(88876),Se=t(73820),_e=t(80670);function Pe(e){var n=e.onCancel,t=e.onSuccess,r=e.onError,i=(0,s.useContext)(ve.B).api,o=(0,s.useState)(!1),l=(0,a.Z)(o,2),c=l[0],d=l[1],u=(0,E.PE)(),f=u.t,p=u.locale,m=(0,s.useState)(""),h=(0,a.Z)(m,2),v=h[0],Z=h[1],g=(0,s.useState)(!1),b=(0,a.Z)(g,2),j=b[0],k=b[1],C=(0,s.useState)(0),y=(0,a.Z)(C,2),L=y[0],w=y[1],S=(0,s.useState)(""),_=(0,a.Z)(S,2),P=_[0],O=_[1],A=(0,_e.DJ)().endpoint,T=(0,s.useState)(!1),R=(0,a.Z)(T,2),N=R[0],B=R[1],I=function(e){Z(null),d(!0);try{O(e.result),w(U.length-1)}catch(t){var n=(0,le.Z)(t);Z(n),r(t)}finally{d(!1)}},F=function(){k(!1),w(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(){k(!0),w(1)}},{body:function(){return(0,ne.jsx)(xe.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,le.VP)({transferId:P.transferId,endpoint:A});return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(x.Z,{component:Ae,dangerouslySetInnerHTML:{__html:f("team.transferApp.transferDialog.createSuccessTip1")}}),(0,ne.jsx)(x.Z,{component:Ae,mt:2,children:(0,ne.jsx)(Ae,{children:f("team.transferApp.transferDialog.createSuccessTip3")})}),(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(x.Z,{component:Ae,mt:2,children:(0,ne.jsx)(Ae,{children:f("team.transferApp.transferDialog.createSuccessTip2",{expireDate:(0,le.B2)(P.expireDate,p)})})}),(0,ne.jsx)(x.Z,{my:1,children:(0,ne.jsx)(Se.Z,{children:e})})]}),(0,ne.jsx)("div",{children:(0,ne.jsx)(Ee.Z,{value:"end",control:(0,ne.jsx)(we.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)(ke.ZP,{title:(0,ne.jsx)(Ae,{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)(Ce.Z,{component:"div",children:"function"===typeof D.body?D.body():D.body}),!!v&&(0,ne.jsx)(Le.Z,{type:"error",variant:"icon",children:v})]})}Pe.propTypes={onCancel:u().func.isRequired,onSuccess:u().func.isRequired,onError:u().func},Pe.defaultProps={onError:function(){}};var Oe,Ae=c.Z.div(be||(be=(0,r.Z)(["\n font-size: 16px;\n font-weight: bold;\n &.title {\n font-size: 20px;\n }\n"]))),Te=["blocklet","onUpdate","hasPermission"],Re=Object.keys(D.SUPPORTED_LANGUAGES).map((function(e){return{code:e,name:D.SUPPORTED_LANGUAGES[e].nativeName}}));function Ne(e){var n,t=e.blocklet,r=e.onUpdate,l=e.hasPermission,c=(0,o.Z)(e,Te),d=(0,oe.h6)(),u=(0,s.useContext)(E.RD).t,f=(0,s.useState)(""),p=(0,a.Z)(f,2),m=p[0],v=p[1],Z=(0,s.useState)(""),g=(0,a.Z)(Z,2),b=g[0],j=g[1],k=(0,s.useState)(!1),C=(0,a.Z)(k,2),y=C[0],L=C[1],w=(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,Y=t.site,V=R()(t.meta,"capabilities.clusterMode",!1);if(N(h.EVENTS.NODE_RUNTIME_INFO,(function(e){V&&v(R()(e,"cpu.physicalCores",""))})),(0,le.wS)(t.status))return null;var H=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE})),M=!H||"yes"===H.value,q=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(V){var de=t.configs.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE})),ue=de?de.value:m;ie.push({key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,description:u("blocklet.config.clusterSize"),value:ue,cpuCores:m})}var fe=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,a,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,i=n.target.checked,e.next=7,d.api.configPublicToStore({input:{did:t.meta.did,publicToStore:i}});case 7:a=e.sent,o=a.blocklet,r(o),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 a,o,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(!(a=(0,le.I)({value:i,cpuCores:m}))){e.next=5;break}return z.Z.error(a),e.abrupt("return");case 5:return o=[{key:n,value:i}],e.prev=6,j(!0),e.next=10,d.api.configBlocklet({input:{did:t.meta.did,configs:o}});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,a,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,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:a=e.sent,o=a.blocklet,r(o),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,a;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Y.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),a=i.length?i:["__none__"],e.next=9,d.api.updateRoutingSite({input:{id:Y.id,corsAllowedOrigins:a,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)}}(),ve=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,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,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,a=i.blocklet,r(a),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)(Ke,(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"===w&&"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:fe})]})}),(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)(ae,{style:{marginTop:0},disabled:b||P,loading:b,options:Re,initialValue:q?q.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:(Y.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:ve})]}),T&&(0,ne.jsx)(ce.Z,{role:"owner",children:function(e){return(e||se.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")]})]}),y&&(0,ne.jsx)(Pe,{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)(pe,{teamDid:W})]})})]})]}))}var Be=(0,ce.V)(Ne,"mutate_blocklets"),Ie=(0,ce.V)(Ne,"",le.Wf);function Fe(e){return(0,oe.h6)().inService?(0,ne.jsx)(Ie,(0,i.Z)({},e)):(0,ne.jsx)(Be,(0,i.Z)({},e))}Ne.propTypes={blocklet:u().object.isRequired,onUpdate:u().func,hasPermission:u().bool},Ne.defaultProps={onUpdate:function(){},hasPermission:!1};var Ke=c.Z.div(Oe||(Oe=(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")})),Ue=t(78789),De=t(46121),ze=t(87535),Ge=t(87006),We=t(72097),Ye=t(49735),Ve=t.n(Ye),He=t(35147),Me=t(14764),qe=t(52553),Je=t.n(qe),Qe=t(27021),Xe=t.n(Qe),$e=t(44632),en=t.n($e),nn={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:""};var tn=function(){var e,n,t,r=(0,oe.h6)().api,a=(0,Ze.y0)().blocklet,o=(0,E.PE)().t,l=null===a||void 0===a||null===(e=a.meta)||void 0===e?void 0:e.did,s=Object.assign((0,i.Z)({},nn),(null===a||void 0===a||null===(n=a.settings)||void 0===n||null===(t=n.notification)||void 0===t?void 0:t.email)||{}),c=(0,Me.cI)({defaultValues:Ve()(s,Object.keys(nn))}),d=c.handleSubmit,u=c.control,f=c.formState,p=c.watch,m=c.reset,h=p("enabled"),v=(0,He.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var t,a,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)({},nn),(null===c||void 0===c||null===(t=c.settings)||void 0===t||null===(a=t.notification)||void 0===a?void 0:a.email)||{}),m(d),z.Z.success(o("oauth.saveSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.Z.error(e.t0.message||o("oauth.saveFailed"));case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(n){return e.apply(this,arguments)}}()),Z=(0,He.Z)((function(e){var n=null===e||void 0===e?void 0:e.trim();return n?!!Je()(n)||o("notification.email.fromInvalid"):o("notification.email.fromRequired")})),g=(0,He.Z)((function(e){var n=null===e||void 0===e?void 0:e.trim();return n?!!Xe()(n,{require_host:!1,protocols:[]})||o("notification.email.hostInvalid"):o("notification.email.hostRequired")})),b=(0,He.Z)((function(e){return e?!!en()(e)||o("notification.email.portInvalid"):o("notification.email.portRequired")})),j=(0,He.Z)((function(e){return!(null===e||void 0===e||!e.trim())||o("notification.email.userRequired")})),k=(0,He.Z)((function(e){return!(null===e||void 0===e||!e.trim())||o("notification.email.passwordRequired")})),C=(0,He.Z)((function(){return!0}));return(0,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:d(v),disabled:!0,children:[(0,ne.jsx)(Me.Qr,{name:"enabled",control:u,render:function(e){var n=e.field;return(0,ne.jsx)(Ee.Z,{control:(0,ne.jsx)(I.Z,(0,i.Z)({checked:n.value},n)),label:o("notification.email.enable"),sx:{marginBottom:"8px"}})}}),(0,ne.jsx)(Me.Qr,{name:"from",control:u,rules:{validate:h?Z:C},render:function(e){var n,t=e.field;return(0,ne.jsx)(ze.Z,{fullWidth:!0,children:(0,ne.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{label:o("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)(Me.Qr,{name:"host",control:u,rules:{validate:h?g:C},render:function(e){var n,t=e.field;return(0,ne.jsx)(ze.Z,{fullWidth:!0,children:(0,ne.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{error:!!f.errors[t.name],label:o("notification.email.host"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(Me.Qr,{name:"port",control:u,rules:{validate:h?b:C},render:function(e){var n,t=e.field;return(0,ne.jsx)(ze.Z,{fullWidth:!0,children:(0,ne.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{type:"number",error:!!f.errors[t.name],label:o("notification.email.port"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(Me.Qr,{name:"user",control:u,rules:{validate:h?j:C},render:function(e){var n,t=e.field;return(0,ne.jsx)(ze.Z,{fullWidth:!0,children:(0,ne.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{error:!!f.errors[t.name],label:o("notification.email.user"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(Me.Qr,{name:"password",control:u,rules:{validate:h?k:C},render:function(e){var n,t=e.field;return(0,ne.jsx)(ze.Z,{fullWidth:!0,children:(0,ne.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{type:"password",error:!!f.errors[t.name],label:o("notification.email.password"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(Me.Qr,{name:"secure",control:u,rules:{validate:C},render:function(e){var n=e.field;return(0,ne.jsx)(ze.Z,{fullWidth:!0,children:(0,ne.jsx)(Ee.Z,{control:(0,ne.jsx)(I.Z,(0,i.Z)((0,i.Z)({checked:n.value},n),{},{disabled:!h})),label:o("notification.email.secure"),style:{marginBottom:16}})})}}),(0,ne.jsx)(We.Z,{type:"submit",variant:"contained",onSubmit:d(v),disabled:!f.isDirty,children:o("oauth.save")})]})})},rn=[{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 an,on,ln=function(){var e=(0,s.useState)(rn[0].value),n=(0,a.Z)(e,2),t=n[0],r=n[1],i=(0,s.useContext)(E.RD).t,o=(0,De.Z)((function(){return{email:(0,ne.jsx)(tn,{}),more:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Ue.Z,{children:i("notification.comingSoon")})})}}),[i]);return(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(w.Z,{tabs:rn,current:t,onChange:r}),(0,ne.jsx)(x.Z,{marginTop:"10px",children:o[t]})]})},sn=t(6779),cn=t(6698),dn=t(11909),un=t(1484),fn=t(2569),pn=t(88356),mn=t(98127),hn=t(86008),xn=t(70115),vn="roles",Zn=[].concat((0,l.Z)(xn.Z),[{value:vn,icon:mn.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"}}]),gn=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:vn,roles:r}}return{access:e,roles:[]}},bn=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 gn(i.value,r);if(n&&R()(n,"settings.whoCanAccess")&&R()(n,"settings.whoCanAccess")!==h.WHO_CAN_ACCESS.ALL)return gn(R()(n,"settings.whoCanAccess"),r);var a=(0,S.findServiceFromMeta)(e.meta,h.NODE_SERVICES.AUTH);return R()(a,"config.whoCanAccess")?gn(a.config.whoCanAccess,r):{access:h.WHO_CAN_ACCESS.ALL,roles:[]}};function jn(e){var n=e.blocklet,t=e.ancestors,r=e.children,i=(0,Q.Z)(),o=(0,s.useState)(""),c=(0,a.Z)(o,2),d=c[0],u=c[1],f=(0,E.PE)(),p=f.t,m=f.locale,v=(0,oe.h6)().api,Z=(0,_e.DJ)().roles,g=(0,s.useState)(""),b=(0,a.Z)(g,2),j=b[0],k=b[1],C=t[0]||n,y=bn(n,C,{roles:Z}),L=y.access,w=y.roles,_=(0,s.useState)(L),P=(0,a.Z)(_,2),T=P[0],R=P[1],N=(0,s.useState)(w),B=(0,a.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,le.wS)(n.status))return null;if("unknown"===n.status&&(0,le.wS)(n.status))return null;var Y=function(){u(!1)},V=function(e){e.stopPropagation(),u(!0)},q=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 k(!0),e.prev=3,(n=T)===vn&&(n="".concat(h.WHO_CAN_ACCESS_PREFIX_ROLES).concat(I.map((function(e){return e.name})).join(","))),e.next=8,v.updateWhoCanAccess({input:{did:U,whoCanAccess:n}});case 8:z.Z.success(p("blocklet.config.access.updatedTip")),Y(),k(!1),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(3),k(!1),z.Z.error((0,le.Z)(e.t0));case 17:case"end":return e.stop()}}),e,null,[[3,13]])})));return function(){return e.apply(this,arguments)}}(),X=j||T===vn&&!I.length;return["function"===typeof r?r({open:V}):(0,ne.jsx)(H.Z,{onClick:V,"data-cy":"action-config-component",children:(0,ne.jsx)(pn.default,{})}),d&&(0,ne.jsxs)(Cn,{open:!0,fullWidth:!0,title:G,onClose:Y,PaperProps:{style:{minHeight:"auto"}},actions:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(K.Z,{onClick:Y,color:"inherit","data-cy":"config-access-cancel",children:p("common.cancel")}),(0,ne.jsxs)(K.Z,{onClick:q,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)(Ge.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=Zn.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:Zn.map((function(e){return(0,ne.jsxs)(yn,{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===vn&&(0,ne.jsx)(x.Z,{mt:4,mb:3,children:(0,ne.jsx)(Ge.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)(we.Z,{checked:I.some((function(e){return e.name===n}))}),(0,ne.jsx)(hn.Z,{primary:t})]},n)}))})})]})]}jn.propTypes={blocklet:u().object.isRequired,ancestors:u().array,children:u().any},jn.defaultProps={ancestors:[],children:null};var kn,Cn=(0,c.Z)(ke.ZP)(an||(an=(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"]))),yn=(0,c.Z)(M.Z)(on||(on=(0,r.Z)(["\n .tip {\n font-size: 12px;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.text.secondary}));function Ln(e){var n,t,r=e.blocklet,i=e.ancestors,o=e.depth,c=(0,Q.Z)(),d=(0,E.PE)(),u=d.t,f=d.locale,p=(0,_e.DJ)().roles,m=(0,s.useState)(!0),h=(0,a.Z)(m,2),v=h[0],Z=h[1],g=(0,Ze.y0)().recommendedDomain,b=i[0]||r,j="/".concat(i.map((function(e){return e.mountPoint||"/"})).join("/"),"/").concat(r.mountPoint||"/").replace(/\/+/g,"/"),k=(0,le.vH)({blocklet:b,domain:{value:g},mountPoint:j,params:(0,le.f0)(b,f)}),L={fill:c.palette.text.secondary},w=o>0&&r.children.length>0,P=(0,ne.jsx)(H.Z,{size:"small",children:v?(0,ne.jsx)(y.Z,{fontSize:"inherit"}):(0,ne.jsx)(C.default,{fontSize:"inherit"})}),O=bn(r,b,{roles:p}),A=O.access,T=O.roles;if("roles"!==A)t=xn.Z.find((function(e){return e.value===A}))||xn.Z[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[(o>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*(o-1),0),width:{xs:300,md:400},display:"flex",alignItems:"center",style:{cursor:w?"pointer":"cursor"},onClick:function(){return w&&Z(!v)},children:[w?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)(sn.Z,{title:u("common.visit"),children:(0,ne.jsx)("a",{target:"_blank",href:k,rel:"noopener noreferrer",title:k,children:(0,ne.jsx)(H.Z,{children:(0,ne.jsx)(dn.Z,{})})})}),(0,ne.jsx)(jn,{blocklet:r,ancestors:i,children:function(e){var n=e.open;return(0,ne.jsx)(sn.Z,{title:u("common.edit"),children:(0,ne.jsx)(H.Z,{onClick:n,"data-cy":"btn-edit-".concat(r.meta.did),children:(0,ne.jsx)(un.Z,{style:L})})})}})]},"actions")]},"group-not-gateway-box"),(0,ne.jsx)(fn.Z,{depth:o}),null!==(n=r.children)&&void 0!==n&&n.length?(0,ne.jsx)(cn.Z,{in:v,children:r.children.map((function(e){return(0,ne.jsx)(Ln,{blocklet:e,ancestors:[].concat((0,l.Z)(i),[r]),depth:o+1},"".concat(o+1,"-").concat(e.meta.did))}))},"blocklet-collapse"):null]}function En(){var e=(0,E.PE)().t,n=(0,Ze.y0)().blocklet,t=(0,l.Z)(n.children)||[];return"gateway"!==n.meta.group&&t.unshift(n),(0,ne.jsx)(wn,{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)(Ln,{blocklet:n},"0-".concat(n.meta.did))},"top-blocklet-".concat(n.meta.did))]:(0,ne.jsx)(x.Z,{mt:8,children:(0,ne.jsx)(Ue.Z,{children:e("blocklet.component.noComponent")})})})}Ln.propTypes={blocklet:u().object.isRequired,ancestors:u().array,depth:u().number},Ln.defaultProps={ancestors:[],depth:0},En.propTypes={};var wn=(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)})),Sn=t(92746);var _n=function(){var e,n,t,r=(0,oe.h6)().api,a=(0,Ze.y0)().blocklet,o=(0,E.PE)().t,l=null===a||void 0===a||null===(e=a.meta)||void 0===e?void 0:e.did,s=Object.assign({enabled:!1,domain:"",clientId:""},(null===a||void 0===a||null===(n=a.settings)||void 0===n||null===(t=n.oauth)||void 0===t?void 0:t.auth0)||{}),c=(0,Me.cI)({defaultValues:Ve()(s,["domain","clientId","enabled"])}),d=c.handleSubmit,u=c.control,f=c.formState,p=c.watch,m=c.reset,h=p("enabled"),v=(0,He.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var t,i,a,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:a=e.sent,s=a.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(o("oauth.saveSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.Z.error(e.t0.message||o("oauth.saveFailed"));case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(n){return e.apply(this,arguments)}}()),Z=(0,He.Z)((function(e){return!(null===e||void 0===e||!e.trim())||o("oauth.auth0.domainDescribe")})),g=(0,He.Z)((function(e){return!(null===e||void 0===e||!e.trim())||o("oauth.auth0.clientIdDescribe")})),b=(0,He.Z)((function(){return!0}));return(0,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:d(v),disabled:!0,children:[(0,ne.jsx)(Me.Qr,{name:"enabled",control:u,render:function(e){var n=e.field;return(0,ne.jsx)(Ee.Z,{control:(0,ne.jsx)(Sn.Z,(0,i.Z)({checked:n.value,style:{marginRight:"6px"}},n)),label:o("oauth.auth0.enable"),sx:{marginBottom:2,ml:1}})}}),(0,ne.jsx)(Me.Qr,{name:"domain",control:u,rules:{validate:h?Z:b},render:function(e){var n,t=e.field;return(0,ne.jsx)(ze.Z,{fullWidth:!0,children:(0,ne.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{label:o("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)(Me.Qr,{name:"clientId",control:u,rules:{validate:h?g:b},render:function(e){var n,t=e.field;return(0,ne.jsx)(ze.Z,{fullWidth:!0,children:(0,ne.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{error:!!f.errors[t.name],label:o("oauth.auth0.clientId"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,ne.jsx)(We.Z,{type:"submit",variant:"contained",onSubmit:d(v),disabled:!f.isDirty,children:o("oauth.save")})]})})},Pn=t(29529),On=t(25139),An={ttl:604800};function Tn(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 Rn(){var e,n,t=(0,oe.h6)().api,r=(0,Ze.y0)().blocklet,a=null===r||void 0===r||null===(e=r.meta)||void 0===e?void 0:e.did,o=Object.assign({},An,(null===r||void 0===r||null===(n=r.settings)||void 0===n?void 0:n.session)||{}),l=(0,Me.cI)({defaultValues:Ve()(Tn(o),["ttl"])}),s=l.handleSubmit,c=l.control,d=l.formState,u=l.reset,f=(0,E.PE)().t,p=(0,He.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var r,i,o,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:a,config:Tn(n,!0)}});case 3:i=e.sent,o=i.blocklet,l=Object.assign({},An,Ve()((null===o||void 0===o||null===(r=o.settings)||void 0===r?void 0:r.session)||{},["ttl"])),u(Tn(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)(Me.Qr,{name:"ttl",control:c,render:function(e){var n=e.field;return(0,ne.jsx)(ze.Z,{fullWidth:!0,sx:{mb:2},children:(0,ne.jsxs)(On.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)(Pn.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)(We.Z,{type:"submit",variant:"contained",onSubmit:s(p),disabled:!d.isDirty,children:f("oauth.save")})]})})}var Nn=t(48537),Bn=t(95002),In=t(2291),Fn=t(75260),Kn=t(28595),Un=t(61398),Dn=t.n(Un),zn=(0,s.forwardRef)((function(e,n){var t=(0,s.useContext)(E.RD).t,r=(0,Kn.Z)({show:!1,title:"",content:"",onConfirm:Dn(),onCancel:Dn(),loading:!1}),i=(0,He.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||Dn(),r.onCancel=e.onCancel||Dn(),r.loading=!1})),a=(0,He.Z)((function(){r.title="",r.content="",r.onConfirm=Dn(),r.onCancel=Dn()})),o=(0,He.Z)((function(){r.show=!1,setTimeout((function(){a()}),300)})),l=(0,He.Z)((function(){o(),null===r||void 0===r||r.onCancel()}),[]),c=(0,He.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(o);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:o}}),[i,o]),(0,ne.jsx)(ke.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 Gn=t(70177),Wn=t(59182),Yn=t.n(Wn),Vn=t(76032),Hn=t.n(Vn),Mn=t(55581),qn=t(63531),Jn=t(92522),Qn=t.n(Jn),Xn=(0,s.forwardRef)((function(e,n){var t,r,i=(0,s.useContext)(E.RD).t,a=(0,Ze.y0)().blocklet,o=(0,oe.h6)().api,l=(0,Kn.Z)({mode:"view",show:!1,data:{},callback:Dn()}),c=(0,Mn.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,He.Z)((function(){l.mode="view",l.data={},l.callback=Dn()}),[]),f=(0,He.Z)((function(){l.show=!1,setTimeout((function(){u()}),d)}),[]),p=(0,He.Z)((function(e){l.mode="view",l.show=!0,l.data=e}),[]),h=(0,He.Z)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dn();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 v=(0,De.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&&Yn()(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)(Nn.Z,{component:Bn.Z}),t]})),["appId","appPid","serverId"].includes(e)&&(t=(0,ne.jsx)(qn.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=Qn()(t)?t:m()(l.data.appUrl||"",t||"");try{var a=new URL(r);a.searchParams.set("imageFilter","resize"),a.searchParams.set("w","80"),a.searchParams.set("h","80"),t=(0,ne.jsx)("img",{src:a.href,width:"60",height:"60",alt:l.data.appName})}catch(o){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)(qn.kL,{children:e})})));return Hn()(t)&&(t="-"),{name:n,value:t}}))}),[l.data]),Z="approve"===l.mode,g=(0,He.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,o.auditFederatedLogin({input:{memberPid:l.data.appPid,did:a.appPid,status:"rejected"}});case 2:f(),null===l||void 0===l||l.callback(!1);case 4:case"end":return e.stop()}}),e)})))),b=(0,He.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,o.auditFederatedLogin({input:{memberPid:l.data.appPid,did:a.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)(ke.ZP,{open:l.show,title:i(Z?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:f,actions:Z?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(We.Z,{color:"error",variant:"contained",onClick:g,children:i("common.reject")}),(0,ne.jsx)(We.Z,{variant:"contained",onClick:b,children:i("common.approve")})]}):(0,ne.jsx)(We.Z,{variant:"outlined",onClick:f,children:i("common.close")}),children:v.map((function(e){return(0,ne.jsx)(Gn.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:e.name,children:e.value},e.name)}))})})),$n=Xn,et=t(29951),nt=t(34760),tt=t.n(nt),rt=(0,s.forwardRef)((function(e,n){var t,r,i=(0,Mn.Fg)(),a=(null===i||void 0===i||null===(t=i.transitions)||void 0===t||null===(r=t.duration)||void 0===r?void 0:r.leavingScreen)||300,o=(0,s.useContext)(E.RD).t,l=(0,Kn.Z)({show:!1,data:{link:""}}),c=(0,He.Z)((function(){l.data.link=""}),[]),d=(0,He.Z)((function(){l.show=!1,setTimeout((function(){c()}),a)}),[]),u=(0,He.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,He.Z)((function(){tt()(l.data.link),d()}),[d]);return(0,ne.jsxs)(ke.ZP,{open:l.show,title:o("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:(0,ne.jsx)(K.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:f,children:o("common.copyAndClose")}),children:[(0,ne.jsx)(x.Z,{mb:1,children:o("federated.inviteJoinFederatedLoginDescription")}),(0,ne.jsx)(x.Z,{sx:{"& .copy-button":{display:"none !important"}},children:(0,ne.jsx)(et.Z,{language:"shell",style:{marginBottom:0},children:l.data.link})})]})}));function it(e){var n,t,r,i,o,l=e.mode,c=(0,s.useRef)(null),d=(0,s.useRef)(null),u=(0,s.useContext)(E.RD),f=u.t,p=u.locale,m=(0,Ze.y0)(),h=m.blocklet,v=m.actions.refreshBlocklet,Z=function(){var e=(0,s.useRef)(null),n=(0,He.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,He.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)(zn,{ref:e}),confirmApi:r}}(),g=Z.confirmApi,b=Z.confirmHolder,j=(0,oe.h6)().api,k=(null===(n=h.settings.federated)||void 0===n?void 0:n.sites)||[],C=(null===(t=h.settings.federated)||void 0===t?void 0:t.config)||{autoLogin:!1},y=!1!==C.isMaster,L=(0,He.Z)((function(e){var n;null===(n=d.current)||void 0===n||n.open(e)})),w=(0,He.Z)((function(e){var n;null===(n=d.current)||void 0===n||n.approve(e,v)})),S=(0,He.Z)((function(e){g.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,He.Z)((function(e){g.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,De.Z)((function(){var e=[{label:f("common.name"),name:"appName",options:{customBodyRenderLite:function(e){var n=k[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)(Nn.Z,{component:Bn.Z,style:{marginRight:"4px"}}),n.appName]})})}}},{label:f("common.did"),name:"appId",options:{customBodyRenderLite:function(e){var n=k[e];return(0,ne.jsx)(Fn.Z,{children:n.appId})}}},{label:f("common.status"),name:"status",options:{customBodyRenderLite:function(e){var n=k[e],t=!1!==n.isMaster;return(0,ne.jsx)(x.Z,{children:t?"-":f("federated.status.".concat(n.status))})}}}];return y&&e.push({label:f("common.actions"),name:"actions",options:{customBodyRenderLite:function(e){var n=k[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(),w(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}),[C.appId,k,y]),T=(0,De.Z)((function(){return{sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick:function(e,n){var t=n.dataIndex,r=k[t];L(r)}}}),[]),R=(0,He.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===(o=i[0])||void 0===o?void 0:o.href]),N=(0,s.useState)(C.autoLogin||!1),B=(0,a.Z)(N,2),I=B[0],F=B[1],U=(0,He.Z)((function(){g.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,He.Z)((function(){g.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,He.Z)((function(){g.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)})))()}})})),Y=[];return"master"!==l?Y.push((0,ne.jsx)(K.Z,{size:"small",variant:"contained",color:"error",onClick:G,sx:{ml:1},children:f("federated.quitFederatedLogin")},"quitFederatedLogin")):(Y.push((0,ne.jsx)(K.Z,{size:"small",variant:"contained",onClick:R,sx:{ml:1},children:f("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),Y.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)(In.Z,{className:"main-table",locale:p,data:k,columns:P,customButtons:Y,title:(0,ne.jsx)(x.Z,{className:"table-toolbar-left",children:"master"===l?f("oauth.federated"):(0,ne.jsx)(Ee.Z,{sx:{ml:0,"& span.MuiSwitch-switchBase":{display:"flex"},"& span.MuiSwitch-track":{display:"block"}},control:(0,ne.jsx)(Sn.Z,{checked:I,style:{marginRight:"6px"},onChange:U}),label:f("federated.enableFederatedAutoLogin")})}),options:T}),b,(0,ne.jsx)(rt,{ref:c}),(0,ne.jsx)($n,{ref:d})]})}it.propTypes={mode:u().oneOf(["member","master"])},it.defaultProps={mode:"member"};var at=it,ot=(0,s.forwardRef)((function(e,n){var t,r,i=(0,s.useContext)(E.RD).t,a=(0,oe.h6)().api,o=(0,Ze.y0)().blocklet,l=null===o||void 0===o?void 0:o.appPid,c=(0,Mn.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,Kn.Z)({show:!1,appUrl:"",appUrlError:"",callback:Dn()}),f=(0,He.Z)((function(){u.appUrl="",u.appUrlError="",u.callback=Dn()}),[]),p=(0,He.Z)((function(){u.show=!1,setTimeout((function(){f()}),d)}),[]),m=(0,He.Z)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dn();u.show=!0,u.callback=e}),[]);(0,s.useImperativeHandle)(n,(function(){return{open:m,close:p}}),[m,p]);var h=(0,He.Z)((function(e){if(!e)throw new Error(i("federated.federatedJoinAppUrlRequired"));if(!Qn()(e))throw new Error(i("federated.federatedJoinAppUrlInvalid"))})),v=(0,He.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,a.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)(ke.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:v,children:i("common.confirm")}),children:[(0,ne.jsx)(x.Z,{mb:1,children:i("federated.joinFederatedLoginDescription")}),(0,ne.jsx)(Ge.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}})]})})),lt=ot;function st(){var e,n,t,r,i=(0,s.useRef)(null),a=(0,s.useRef)(null),o=(0,s.useContext)(E.RD).t,l=(0,Ze.y0)(),c=l.blocklet,d=l.actions.refreshBlocklet,u=(0,He.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 a,l=new URL(r);null===(a=i.current)||void 0===a||a.open({link:l.origin})}catch(s){z.Z.error(o("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,He.Z)((function(){var e;null===(e=a.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:o("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:o("federated.joinFederatedLogin")})]}),(0,ne.jsx)(rt,{ref:i}),(0,ne.jsx)(lt,{ref:a})]})}var ct,dt=function(){var e=(0,s.useContext)(E.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,a.Z)(t,2),i=r[0],o=r[1],l=(0,De.Z)((function(){return{auth0:(0,ne.jsx)(_n,{}),federated:(0,ne.jsx)(st,{}),more:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Ue.Z,{children:e("oauth.comingSoon")})}),settings:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Rn,{})})}}),[e]);return(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(w.Z,{tabs:n,current:i,onChange:o}),(0,ne.jsx)(x.Z,{marginTop:"10px",children:l[i]})]})},ut=["blocklet","onUpdate"],ft=function e(n){var t=n.tabs,r=n.blocklet,i=n.ancestors,a=void 0===i?[]:i,o=n.depth,s=void 0===o?1:o,c=n.t,d=[].concat((0,l.Z)(a.map((function(e){return e.meta.did}))),[r.meta.did]).join("/"),u=!(null!==a&&void 0!==a&&a.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:a}),(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)(a),[r]),depth:s+1,t:c})}))};function pt(e){var n=e.blocklet,t=e.onUpdate,r=(0,o.Z)(e,ut),l=(0,s.useContext)(E.RD).t,c=(0,oe.h6)(),d=c.info,u=c.inService,p=(0,s.useState)(!0),S=(0,a.Z)(p,2),_=S[0],P=S[1],O=(0,L.lr)(),A=(0,a.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)(g.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)(y.Z,{fontSize:"inherit"}):(0,ne.jsx)(C.default,{fontSize:"inherit"})}),(0,ne.jsx)(k.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"}];_&&ft({tabs:B,blocklet:n,t:l});var I=null;if("general"===N)I=(0,ne.jsx)(Fe,{blocklet:n,onUpdate:t});else if("access"===N)I=(0,ne.jsx)(En,{});else if("oauth"===N)I=(0,ne.jsx)(dt,{});else if("notification"===N)I=(0,ne.jsx)(ln,{});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)(mt,(0,i.Z)((0,i.Z)({},r),{},{children:(0,ne.jsxs)(v.ZP,{container:!0,spacing:4,columns:24,children:[(0,ne.jsx)(v.ZP,{item:!0,sm:7,md:5,children:(0,ne.jsx)(w.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)(v.ZP,{item:!0,sm:17,md:19,children:(0,ne.jsx)(x.Z,{style:{minHeight:"66vh",height:"100%",position:"relative",overflow:"hidden"},children:I})})]})}))}pt.propTypes={blocklet:u().object.isRequired,onUpdate:u().func},pt.defaultProps={onUpdate:function(){}};var mt=c.Z.div(ct||(ct=(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"])))},19066:function(e,n,t){t.d(n,{C:function(){return r}});var r="true"===localStorage.getItem("enableDebug")},70115:function(e,n,t){var r=t(39517),i=t(87642),a=t(64076),o=t(20244);n.Z=[{value:o.WHO_CAN_ACCESS.ALL,icon:a.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:o.WHO_CAN_ACCESS.INVITED,icon:i.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:o.WHO_CAN_ACCESS.OWNER,icon:r.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"}}]}}]);
2
- //# sourceMappingURL=4802.cf122fc7.chunk.js.map