@abtnode/webapp 1.16.27-beta-426c1690 → 1.16.27-beta-d27e19fa
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 +35 -36
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/static/js/1667.0305ed57.chunk.js +1 -0
- package/build/static/js/1685.7e872f73.chunk.js +2 -0
- package/build/static/js/1794.ff8418be.chunk.js +1 -0
- package/build/static/js/1869.958bc1ed.chunk.js +1 -0
- package/build/static/js/2226.183fdd58.chunk.js +1 -0
- package/build/static/js/2355.ed718f0c.chunk.js +1 -0
- package/build/static/js/2536.2c1f5173.chunk.js +1 -0
- package/build/static/js/2646.0f064d37.chunk.js +1 -0
- package/build/static/js/{5526.d2a1b8f0.chunk.js → 3047.2530c08d.chunk.js} +2 -2
- package/build/static/js/3108.ce45067a.chunk.js +1 -0
- package/build/static/js/3217.0647b52d.chunk.js +1 -0
- package/build/static/js/3595.f18b855e.chunk.js +1 -0
- package/build/static/js/3646.656a10a6.chunk.js +1 -0
- package/build/static/js/3815.bb373a04.chunk.js +1 -0
- package/build/static/js/3998.be52d2b0.chunk.js +1 -0
- package/build/static/js/4542.bf4b1ee9.chunk.js +1 -0
- package/build/static/js/{4804.9dc4ff41.chunk.js → 4804.4efecf89.chunk.js} +2 -2
- package/build/static/js/4906.ce938f60.chunk.js +1 -0
- package/build/static/js/{5083.ecb059e3.chunk.js → 5083.b86f0c1f.chunk.js} +2 -2
- package/build/static/js/5433.2b6a887c.chunk.js +1 -0
- package/build/static/js/5515.b6a25364.chunk.js +1 -0
- package/build/static/js/5760.4f263e0c.chunk.js +1 -0
- package/build/static/js/{592.c99306f8.chunk.js → 592.4624a4d2.chunk.js} +2 -2
- package/build/static/js/6129.bafd3307.chunk.js +1 -0
- package/build/static/js/{6234.42a5a205.chunk.js → 6234.93acfe87.chunk.js} +1 -1
- package/build/static/js/6399.d5c8f353.chunk.js +1 -0
- package/build/static/js/7702.059ea71f.chunk.js +1 -0
- package/build/static/js/8110.9889f226.chunk.js +1 -0
- package/build/static/js/8299.854a15c8.chunk.js +1 -0
- package/build/static/js/833.aaaf3519.chunk.js +1 -0
- package/build/static/js/8399.77b6358a.chunk.js +1 -0
- package/build/static/js/{9713.0f0a2355.chunk.js → 9713.6f7c47cb.chunk.js} +1 -1
- package/build/static/js/9779.7c1f5592.chunk.js +1 -0
- package/build/static/js/main.774f6320.js +2 -0
- package/package.json +1 -1
- package/build/static/js/1667.a0c1bd62.chunk.js +0 -1
- package/build/static/js/1685.8aa7ded2.chunk.js +0 -2
- package/build/static/js/1794.7f151439.chunk.js +0 -1
- package/build/static/js/1869.ca76ad10.chunk.js +0 -1
- package/build/static/js/2294.9e37053f.chunk.js +0 -1
- package/build/static/js/2355.fe9e5eaf.chunk.js +0 -1
- package/build/static/js/2646.7e958bf1.chunk.js +0 -1
- package/build/static/js/3108.430b8b4e.chunk.js +0 -1
- package/build/static/js/3217.1d7bfa2b.chunk.js +0 -1
- package/build/static/js/3351.be676eac.chunk.js +0 -1
- package/build/static/js/3595.763ef502.chunk.js +0 -1
- package/build/static/js/3646.97713153.chunk.js +0 -1
- package/build/static/js/3815.fa2cf47f.chunk.js +0 -1
- package/build/static/js/3998.505c54b8.chunk.js +0 -1
- package/build/static/js/4542.61cf3cd5.chunk.js +0 -1
- package/build/static/js/4906.fc570676.chunk.js +0 -1
- package/build/static/js/5433.56888945.chunk.js +0 -1
- package/build/static/js/5760.b43b20af.chunk.js +0 -1
- package/build/static/js/6129.b538b033.chunk.js +0 -1
- package/build/static/js/7702.65c33107.chunk.js +0 -1
- package/build/static/js/8110.446170f9.chunk.js +0 -1
- package/build/static/js/8139.b91619d0.chunk.js +0 -1
- package/build/static/js/8299.99b06bd6.chunk.js +0 -1
- package/build/static/js/833.ae2cf030.chunk.js +0 -1
- package/build/static/js/8399.d74f7fac.chunk.js +0 -1
- package/build/static/js/9085.2eba86ab.chunk.js +0 -1
- package/build/static/js/9733.35499d50.chunk.js +0 -1
- package/build/static/js/9779.c840728c.chunk.js +0 -1
- package/build/static/js/main.f04637c6.js +0 -2
- /package/build/static/js/{1685.8aa7ded2.chunk.js.LICENSE.txt → 1685.7e872f73.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5526.d2a1b8f0.chunk.js.LICENSE.txt → 3047.2530c08d.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{4804.9dc4ff41.chunk.js.LICENSE.txt → 4804.4efecf89.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5083.ecb059e3.chunk.js.LICENSE.txt → 5083.b86f0c1f.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{592.c99306f8.chunk.js.LICENSE.txt → 592.4624a4d2.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.f04637c6.js.LICENSE.txt → main.774f6320.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8299],{13455:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var o=n(55898),s=n.n(o),a=n(36687),r=n(72333);const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAFACAYAAADNkKWqAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1aSURBVHgB7d3ZjhxVEoDhxDKN902AUF/w/s/lCwthtXc3VsvyzETNJNOUe6kllzgnvk9KwVyMMNj5d2ZGRtUP//qPAaCgOwNAUQIIlCWAQFl3B5jJt2/fhvPz8+HDhw/DxcXF5n/fuXNnODk5GR4/fjzcv39/uHvXH0HW84MhCFOL0L1//35zxN9fJ+J379694cWLF0LIKgSQyewavqs8evRICFmcAHK0Y8K3LUL45MmTzZUhzE0AOdiU4dsWAYznhHHAXASQvX39+nUTvY8fP04evm1xS/z8+XMhZBYCyM5ikjuGb2ljCE2OmZIAcqsvX74Mb9682fx1bSbHTEkAuVam8F3F5JhjCSDfyR6+bSbHHEoA+Vtr4dtmcsy+BJDh06dPm3W1VsO3zeSYXQlgUeOeblzxxWstPTI55jYCWMycLy9nZXLMdQSwiIrhu4rJMZcJYOeE72omxwQB7FTG8MVnAWaLsMlxbQLYmSX3dHc1DiMePny4WaeLX9sa63Q3MTmuSQA7seae7nVuurqKUL99+zZtCE2OaxDAxmV8eXmcuO7yfG0M4V9//ZXqdRyT4xoEsFGth29bxG/8d8r2XqLJcb8EsDG9he8qsZmSNYQmx30RwEZUCN+2rCt6Jsf9EMDkMkYgroSePXu2+XrLJcS/u8kxcxDAhDLu6cY7fHGiP336dLVnYSbHTE0AE8n68nJEL474+wxMjpmKACYgfIcxOeZYArgi4ZuOyTGHEMAVCN98TI7ZhwAuKPuebsvh22ZyzC4EcAEZp5dVrkhMjrmJAM6o4svLWZkccxUBnIHw5WVyzGUCOCHha4vJMQI4AeFrm8lxXQJ4BHu6fTE5rkcAD5Dt1inDnm5PTI7rEMAdeXm5HpPj/gngLYQPk+N+CeA1hI+rmBz3RQC3CB+7MDnugwD+jz1dDmFy3LbyAbSnyxRMjttUNoBeXmYOJsdtKRdA4WMJJsdtKBNA4WMtJsd5dR9A4SMLk+N8ug2gPV2yMjnOo7sA2tOlFSbH6+sigF5epmUmx+tpOoDCR09MjpfXZACFj96ZHC+jqQAKH9WYHM+riQDa06U6k+N5pA6gPV34J5PjaaUMoJeX4WYmx9NIFUDhg/2YHB8nRQCFD45ncry/VQMofDA9k+PdrRJAe7owP5Pj2y0aQHu6sDyT4+vNHkAvL0MOJsffmzWAEb34Dy58kEfmyXFcEcaxlNkCGOGLIwPhg6tlnBzHc/jT09NFztVZApglfsIHu8k2mIxb4ojg3CYPYPwkefny5bAme7pwmEyT419++WX2SfHkATw7O9s8+1uDPV2YRobJ8RJXgZOPXGLCtDQvL8O04i4qrsDiTmqtyXFcjcYAdc67uMkDeHFxMSxF+GBeYwjXmhxHT+Y8v5t9QBY/FcQPlhEhfPDgQXePl5pdf4hL41evXpX8Kj9YUsZlhqk0v/8Vl+OvX7/ePKcQQphOxk9in1o3C7BCCNPI+ClNc+nuEwCEEA5TKXyjbj8CZTuEFb7lHg6R9fMDl9B9EcYQRvzGl6SFkOp6Hmzso0wJxjfb4+j1W+7hNsL3TyULEJf8cQghVVSY6B6i9JkvhPSu4mBjH874QQjpj/Dtxpl+yeUQZv0aP7hJ5YnuIQTwCmMIfdgCLTDYOFy6AP7+++9pvsEqforaNyarrOG7/Ensf/zxR+qr0XQB3P4csgwhtF1CJlknui1+BUXaW2AhhH/KOtiIczWiF+dDa19Bkf4ZoBBSXdbw9fCMvJkhyOUQjl/asvZX+dk3Zk5ZJ7o9DQebO1svDyQ+f/68eRaSJYT2jTlW5oluj6+HNXuWjs8d4sjy5c72jTlUCxPdHr9itouzM2ITR6Zvubddwi5MdNfV1VkphLTCRDeHLs9GISQrE91cuj4LxxBm+kNn37gmE92cSlyGxG/u6enp5g/fu3fvhvPz82Ft9o37Z6KbX6n7sPjN/u233/6e1to3Zg4muu0o+SDKdglzMNFtT+kn8ULIFEx022UUOQghhzHRbZ8AXmLfmF2Y6PbDmXQF+8ZsM9HtkzPoBvaNMdHtmzNnR7ZLajHRrcEZsych7JuJbi3OlAMJYV9MdGtyhhzJvnHbTHRrE8CJ2Dduh4kuIwGcmH3jvEx02SaAM7FdkoeJLtcRwJkJ4XpMdLmNAC5ECJdjosuuBHBh9o3nY6LLvgRwJfaNp2GiyzEEcGX2jQ9jossUBDAR2yW3M9FlSgKYkBB+z0SXOQhgYkJoosu8BLABFfeNTXRZggA2pPd9YxNdliaADept39hEl7UIYMNa3y4x0WVtAtiB1kJooksWAtiR7CGMuMTWi8EGWQhgh7LuG5+dnQ2ZCB8C2LGM+8YZmOgyEsACMu4bL81gg6sIYDEZt0vmJHzcRACL6j2EJrrsQgCL6y2EBhvsQwDZyLhvvA/h4xACyD9k3De+iYkuxxBArpRx33hksMFUBJAbZdouET6mJoDsZM0QmugyFwFkL0uG0GCDuQkgB5lz31j4WIoAcpTL+8bjh5oe6uTkZPj555+Fj8V4oMIkIoQ//fTTcIwIoPixJAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKAsAQTKEkCgLAEEyhJAoCwBBMoSQKCsdAH8+vXrALTv27dvmyOzu0MyL1++HB49ejS8ePFiuHs33S8PuEVE7/3795tDAA/w6dOnzSGE0I6Li4tN9D5//pw+fKPUZRFCyO/Lly/DmzdvNn9tTRNFEULIp+XwjZoqyRjCBw8eDM+ePRvu3bs3AMuJW9vz8/Ph3bt3m1ve1k0ewDt37sx+/x+/AXFEAOOKUAhhXi0NNvYxeQDj9nSpnwxx6f3q1avNP/P58+fD48ePB2A6a4fv5ORkmNPkAXz48OHil8bx7uDr16+Ht2/fCiFMIMNEN+IXd5RzmjyAT58+Xe2nhRDCcTINNqIlc5vlGWDE5+zsbFiLEMJ+sk10Y9C5xHk7yxQ4yh1XgBGgNV0OYfya4vbcKzTwX1knunHr++uvvw5LmK0GceX1448/bn6qrL3fG//8uCKNW/P4qRKHEFJV1olu3D3GhUoccz/7G81agXhxOY54dy9LCONqMA4vVVON8H1vkbM/WwiD7RKqyLqju2b4Roue9UIIy8m6qhbP+MZn8muFb7TK2S6EMJ+s4cu4ubXqWT6GMNNvmH1jWpR5RzfzymqKy5z4D3N6eroJ4MePHzfH2uwb04LMg43xImLudbZjpLrPi8jEEa/QxKQ2QwjtG5ORie40fvjXfwxJja+tZAjhSAivF48O/vzzz+FQ8ThkqRdgW2WiO63UARwJYRsEcD4muvNoIoAjIcxNAKdnojuvpgI4ihCOw5IsX6MZIay+byyA0zDRXU6TZ+rlq67xJ6R9Y1pnoru8ps/QCIx9Y1pnoruebs5M2yW0xkR3fd2dkUJIdia6eXR7Jgoh2Zjo5tP9GWjfmDWZ6OZW5hLEvjFLMtFtQ7l7MPvGzMlEty1Nvgg9Jdsl06n8IrSJbpvKB3AkhMerGEAT3bYJ4BYhPFylAJro9kEAr2HfeH+9B9BEtz9eRLuGfWNGJrr9cvbcwr5xXSa6/XPW7MF2SQ0munU4Ww4ghH0y0a3HWXIEIeyDiW5dzo4J2Dduj4kuQQAnZN84PxNdLhPAGdg3zsdEl6t4EXoBVbZLMr4IbaLLTQRwQb2HMFMATXTZhQCuoNcQZgigiS77EMAV9bZvvFYATXQ5lCHIiuwbH8dEl2MJYAL2jfdjostUBDAZ2yXXM9FlagKYlBD+n4kucxHA5CqH0ESXuQlgI1rYN56CiS5L8hpMoyKAEYmIRRZxJXjMFWr8/yOAJrosRQAbl/Gl6h4YbNQggJ0QwmkIXy0C2BkhPIyJbk0C2Ckh3I3BRm0C2LmM+8YZCB9BAIuI+MUGRWxSVA2hiS7bBLCgTC9VL8Fgg+sIYGG9h1D4uI0A0l0ITXTZlQDyt9ZDaLDBvgSQ72T9EILrCB+HEkCulXHf+LL4cIgnT54IHwcTQG6V6aVqgw2mJIDsbM0QCh9zEED2tmQIx2+piy9nEj6mJoAcbM4QGmywBAHkaFPuGwsfSxJAJnPMvrGJLmsQQGaxy0vVBhusTQCZVYTww4cPmy84iu/6iNDFqtr9+/eFj9UJIFCWH79AWQIIlCWAQFn/BizMxGSX68uEAAAAAElFTkSuQmCC";var l=n(74094),c=n(96266);function d(e){let{blocklet:t,blockletMetaUrl:n}=e;const{did:o,logo:s}=t.meta;let d;return d=s?(0,c.jsx)(a.Z,{src:(0,l.aZ)({did:o,logoPath:s,baseUrl:new URL(n).origin}),fallback:i,width:64,size:"contain",placeholder:"application logo"}):(0,c.jsx)(r.Z,{did:o,size:64}),d}d.propTypes={blocklet:s().object.isRequired,blockletMetaUrl:s().string.isRequired}},13932:(e,t,n)=>{"use strict";n.d(t,{Z:()=>x});var o,s=n(71171),a=n(68420),r=n(77277),i=n(33518),l=n(39948),c=n(5057),d=n(11397),p=n.n(d),u=n(6202),h=n(96266);const m=p()("@abtnode/webapp:launch-blocklet:download-progress");const f=(e,t)=>{m("getDownloadBundleStep",e);return(e||[]).map((e=>{var n;const o=t("launchBlocklet.waiting.".concat("extracting"===e.status?"extractingComponent":"downloadingComponent"),{name:(null===(n=e.component)||void 0===n?void 0:n.title)||""}),s=e.total&&e.current?": ".concat(Math.floor(e.current/e.total*100)," %"):"";let a=e.name?": ".concat(e.name):"";return s||(a+="..."),"".concat(o).concat(s).concat(a)})).join("\n")};function x(e){let{appDid:t,visible:n}=e;const{t:o}=(0,a.PE)(),s=function(e){let{appDid:t}=e;const[n,o]=(0,c.useState)([]),s=(0,u.ZP)();return(0,c.useEffect)((()=>(s.on(r.BlockletEvents.downloadBundleProgress,(e=>{t&&t===(null===e||void 0===e?void 0:e.appDid)&&o((t=>{const n=[...t],o=n.findIndex((t=>{var n,o;return(null===(n=t.component)||void 0===n?void 0:n.did)===(null===(o=e.component)||void 0===o?void 0:o.did)}));return"completed"===e.status?-1!==o&&n.splice(o,1):-1!==o?n[o]=e:n.push(e),[...n]}))})),()=>{s.off(r.BlockletEvents.downloadBundleProgress)})),[t,s]),n}({appDid:t});return(0,h.jsx)(g,{style:{display:n?"block":"none"},children:f(s,o)})}x.defaultProps={appDid:"",visible:!0};const g=(0,i.Z)(l.Z)(o||(o=(0,s.Z)(["\n flex: 0 0 auto;\n white-space: pre;\n overflow-y: auto;\n overflow-x: auto;\n max-height: 10em;\n max-width: 500px;\n min-width: auto;\n @media (max-width: ","px) {\n max-width: 90%;\n max-height: 30vh;\n }\n"])),(e=>e.theme.breakpoints.values.md))},66436:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o,s=n(71171),a=n(33518),r=n(96266);function i(e){let{children:t}=e;return(0,r.jsx)(l,{children:t})}const l=a.Z.div(o||(o=(0,s.Z)(["\n color: #1dc1c7;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n"])))},11476:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var o=n(5057),s=n(77277),a=n(31853),r=n(11397),i=n.n(r),l=n(6202),c=n(10155);const d=i()("@abtnode/webapp:launch-blocklet:runtime-state"),p=Object.keys(s.BlockletStatus),u=Object.values(s.BlockletStatus),h=Object.values(s.BlockletEvents).filter((e=>![s.BlockletEvents.purchaseChange,s.BlockletEvents.domainStatus].includes(e))),m=(e,t)=>{var n;return(null===e||void 0===e?void 0:e.appDid)===t||(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.did)===t},f=8e3,x=2e3;function g(e){const t=(0,c.Z)(),n=(0,l.ZP)(),s=(0,o.useRef)(null),r=()=>{e&&!s.current&&(s.current=setInterval((()=>{e&&(d("polling blocklet state"),v())}),x))},[i,g]=(0,a.Z)({status:null,eventName:"",runtimeBlocklet:null,error:"",isGetBlocklet:!1,startPolling:r,stopPolling:()=>{s.current&&clearInterval(s.current)}}),v=()=>{t.getBlocklet({input:{did:e,attachRuntimeInfo:!0}}).then((e=>{g({status:e.blocklet?e.blocklet.status:"",eventName:"",runtimeBlocklet:e.blocklet,isGetBlocklet:!0})})).catch((e=>{console.error("get blocklet failed",e)}))};(0,o.useEffect)((()=>{let t=null;return e&&(d("schedule polling blocklet state"),t=setTimeout((()=>{r()}),f)),()=>{t&&clearInterval(t)}}),[e]),(0,o.useEffect)((()=>{e?null===i.status&&(d("polling blocklet state on start"),v()):g({status:"",eventName:"",runtimeBlocklet:null})}),[e,i.status]);const y=t=>n=>{if(m(n,e)){const e={status:null,eventName:t,runtimeBlocklet:n,isGetBlocklet:!1};if(n.error)d("blocklet error",{blockletEventName:t,error:n.error}),e.status="error",e.error=n.error;else{const o=p[u.indexOf(n.status)];d("blocklet event",{blockletEventName:t,status:o}),o&&(e.status=o)}g(e)}};for(const a of h)(0,o.useEffect)((()=>{const t=y(a);return e&&n.on(a,t),()=>{e&&n.off(a,t)}}),[e]);return i}},28299:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Qt});var o,s=n(71171),a=n(5057),r=n(53616),i=n.n(r),l=n(85493),c=n(6352),d=n.n(c),p=n(21371),u=n(15715),h=n(33518),m=n(68420),f=n(63902),x=n(51703),g=n(66889),v=n(10866),y=n(4456),w=n(12332),k=n(47791),b=n(64387),j=n(25339),A=n(75793),Z=n(2660),E=n(39948),S=n(19577),P=n(2478),C=n(44067),B=n(28726),D=n(42876),T=n(55898),R=n(96266);function M(e){let{children:t,selected:n}=e;return(0,R.jsxs)(L,{children:[t,(0,R.jsx)(E.Z,{className:"selected-container ".concat(n?"selected":""),children:(0,R.jsx)(D.default,{className:"selected-icon"})})]})}const L=(0,h.Z)(E.Z)(o||(o=(0,s.Z)(["\n position: relative;\n\n .selected-container {\n display: flex !important;\n position: absolute;\n right: 0px;\n bottom: 0px;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"])));M.propTypes={children:T.node.isRequired,selected:T.bool},M.defaultProps={selected:!1};var N=n(67654),O=n(65873),F=n(94639);const Q=(0,a.createContext)({}),{Provider:U,Consumer:z}=Q;function G(e){let{children:t}=e;const{t:n}=(0,m.PE)(),[o,s]=(0,N.Z)("spaceGatewaysForRestore",[{name:"Prod DID Spaces",url:"https://www.didspaces.com/app",protected:!0},{name:"Staging DID Spaces",url:"https://spaces.staging.arcblock.io/app",protected:!0}]),[r,i]=(0,N.Z)("selectedSpaceGatewayForRestore",o.find((e=>"https://www.didspaces.com/app"===e.url)));return(0,a.useEffect)((()=>{!async function(){const e=await Promise.all(o.map((async e=>{var t;const{data:n}=await F.Z.get(d()(e.url,"/__blocklet__.js?type=json"),{timeout:5e3}).catch((e=>(console.error(e),{data:{}}))),o=null!==(t=n.appName)&&void 0!==t?t:e.name;return(0,O.merge)(e,{name:o})})));s(e)}()}),[]),(0,R.jsx)(U,{value:{spaceGateways:o,selectedSpaceGateway:r,addSpaceGateway:e=>{const t=o.find((t=>e.url===t.url));if(t)throw new Error(n("storage.spaces.gateway.add.duplicate",{name:t.name}));s((()=>[...o,(0,O.cloneDeep)(e)])),i(e)},deleteSpaceGateway:e=>{if(e.url===r.url)throw new Error(n("storage.spaces.gateway.delete.failedForSelected"));s((()=>o.filter((t=>t.url!==e.url))))},handleSelectSpaceGateway:e=>{i(e)}},children:t})}G.defaultProps={};var I=n(92877),J=n(11750),H=n(83580),X=n(94552),K=n(67680),Y=n(19778),W=n(47595),_=n(60939),V=n(86229),q=n(72443),$=n.n(q);function ee(e){let{spaceGateway:t,onDeleteSpaceGateway:n}=e;const{t:o}=(0,m.PE)(),[s,r]=(0,a.useState)(!1),[i,l]=(0,a.useState)(!1),c=(e,t)=>{null===e||void 0===e||e.stopPropagation(),r(t)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(K.Z,{size:"small",onClick:e=>c(e,!0),children:(0,R.jsx)(W.default,{})}),(0,R.jsx)(_.Z,{title:o("common.delConfirmDescription",{data:"".concat(null===t||void 0===t?void 0:t.name)}),open:s,confirmButton:{text:o("common.confirm"),props:{variant:"contained",color:"error",loading:i}},cancelButton:{text:o("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:async e=>{try{null===e||void 0===e||e.stopPropagation(),l(!0),await n(t),r(!1)}catch(s){console.error(s),V.Z.error("".concat(o("storage.spaces.gateway.delete.failed"),": ").concat($()(s)))}finally{l(!1)}},onCancel:e=>c(e,!1)})]})}ee.defaultProps={onDeleteSpaceGateway:()=>{}};const te=ee;var ne=n(95335);const oe=function(){const e=(0,ne.Z)(),t=(0,u.Z)(e.breakpoints.down("md"));return{minWidth:t?300:e.breakpoints.values.sm,isMobile:t}};var se,ae=n(74094);const re=(0,I.Z)((()=>({menuName:{display:"flex",flex:1,flexDirection:"column",paddingRight:"24px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})));function ie(e){let{spaceGateway:t,selected:n,onDeleteSpaceGateway:o,onSelectGateway:s,...a}=e;const r=re(),{t:i}=(0,m.PE)(),{isMobile:l}=oe();return(0,R.jsxs)(le,{...a,children:[(0,R.jsx)(E.Z,{display:"inline-flex",marginRight:"8px",alignItems:"center",children:(0,R.jsx)("img",{alt:t.name,src:d()(t.url,"favicon.ico"),width:"48px",height:"48px"})}),(0,R.jsxs)(E.Z,{className:r.menuName,onClick:s,children:[(0,R.jsxs)(J.Z,{component:"span",variant:"subtitle1",style:{fontWeight:"400"},children:[null===t||void 0===t?void 0:t.name," ",n&&(0,R.jsx)(Y.Z,{color:"primary",style:{marginLeft:"8px"},children:i("common.selected")})]}),(0,R.jsx)(J.Z,{className:"url",component:"span",variant:"inherit",children:"".concat(l?(0,ae.aS)(null===t||void 0===t?void 0:t.url,38):null===t||void 0===t?void 0:t.url)})]}),(0,R.jsxs)(H.Z,{children:[(0,R.jsx)(K.Z,{onClick:e=>{e.stopPropagation(),window.open(t.url)},size:"small",children:(0,R.jsx)(X.Z,{})}),!0!==(null===t||void 0===t?void 0:t.protected)&&(0,R.jsx)(te,{spaceGateway:t,onDeleteSpaceGateway:async()=>{await o(t)}})]})]})}const le=(0,h.Z)(E.Z)(se||(se=(0,s.Z)(["\n display: flex;\n"])));ie.defaultProps={onDeleteSpaceGateway:()=>{},selected:!1,onSelectGateway:()=>{}};var ce=n(13128),de=n(44846),pe=n(47020),ue=n(55372),he=n(88574),me=n(96567);function fe(e){let{onAddGateway:t,...n}=e;const{t:o,locale:s}=(0,m.PE)(),[r,i]=(0,a.useState)(""),[l,c]=(0,a.useState)(!1),[p,u]=(0,a.useState)(!1),[h,f]=(0,a.useState)(""),x=async()=>{try{c(!0);const e=await(0,me.Z3)(r,{withSearchParams:!1});if(!await(0,me.w2)(e))throw new Error(o("storage.spaces.gateway.add.invalidUrl"));const{data:n}=await F.Z.get(d()(new URL(e).origin,"/__blocklet__.js?type=json")),s={name:n.appName,url:e,protected:!1};await t(s),V.Z.success(o("storage.spaces.addedWithName",{name:s.name})),u(!1)}catch(e){f("".concat(o("storage.spaces.gateway.add.failed",s),": ").concat($()(e)))}finally{c(!1)}};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.Z,{size:"middle",color:"primary",variant:"outlined",onClick:()=>u(!0),...n,children:o("storage.spaces.gateway.add.title")}),(0,R.jsxs)(ce.ZP,{title:o("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:p,onClose:()=>u(!1),PaperProps:{style:{minHeight:"auto"}},actions:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.Z,{onClick:e=>{e.stopPropagation(),u(!1)},color:"inherit",children:o("common.cancel")}),(0,R.jsxs)(B.Z,{onClick:e=>{e.stopPropagation(),x()},color:"primary","data-cy":"install-blocklet-next-step",disabled:l||!r,variant:"contained",autoFocus:!0,children:[l&&(0,R.jsx)(de.Z,{size:16}),o("common.confirm")]})]}),children:[(0,R.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,R.jsx)(ue.Z,{component:"div",children:(0,R.jsx)(J.Z,{component:"div",children:(0,R.jsx)(pe.Z,{label:o("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:r,onChange:e=>{f(null),i(e.target.value)},disabled:l,onKeyPress:async e=>{"Enter"===e.key&&(e.preventDefault(),await x())},autoFocus:!0})})})}),!!h&&(0,R.jsx)(he.Z,{type:"error",style:{width:"100%"},children:h})]})]})}fe.defaultProps={onAddGateway:()=>{}};const xe=fe;function ge(e){let{onConnect:t,...n}=e;const{spaceGateways:o,selectedSpaceGateway:s,handleSelectSpaceGateway:r,addSpaceGateway:i,deleteSpaceGateway:l}=(0,a.useContext)(Q),{t:c}=(0,m.PE)(),d=async e=>{await l(e)};return(0,R.jsxs)(E.Z,{...n,children:[(0,R.jsx)(S.Z,{children:o.map((e=>{const t=(null===e||void 0===e?void 0:e.url)===s.url;return(0,R.jsx)(M,{selected:t,children:(0,R.jsx)(P.ZP,{button:!0,selected:t,"data-cy":"get-space-endpoint-for-restore",children:(0,R.jsx)(C.Z,{children:(0,R.jsx)(ie,{spaceGateway:e,onDeleteSpaceGateway:d,selected:t,onSelectGateway:()=>(e=>{r(e)})(e)})})},e.url)})}))}),(0,R.jsxs)(E.Z,{display:"flex",marginTop:"16px",justifyContent:"center",alignItems:"center",children:[(0,R.jsx)(xe,{onAddGateway:async e=>{await i(e)}}),(0,R.jsx)(B.Z,{sx:{marginLeft:"16px"},size:"middle",variant:"contained",onClick:()=>{t(s)},children:c("storage.spaces.connect.now")})]})]})}ge.defaultProps={onConnect:()=>{}};const ve=ge;var ye;const we=(0,h.Z)("div")(ye||(ye=(0,s.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"])));const ke=function(){const{info:e}=(0,A.h6)(),{t:t,locale:n}=(0,a.useContext)(m.RD),o=(0,a.useMemo)((()=>e?(0,k.RU)(e):""),[e]);return(0,R.jsx)(G,{children:(0,R.jsxs)(we,{children:[(0,R.jsx)(Z.Z,{title:t("blocklet.restoreFromSpaces.connect.title"),subTitle:t("blocklet.restoreFromSpaces.connect.subTitle"),onClickBack:()=>window.history.back()}),(0,R.jsx)(E.Z,{display:"flex",justifyContent:"center",children:(0,R.jsx)(ve,{sx:{marginTop:"64px",marginBottom:"32px",width:"720px"},onConnect:e=>{const t=new URL(d()(e.url,"restore")),s=d()(o,"blocklets/restore/verify-ownership");t.searchParams.set("redirectUrl",s),t.searchParams.set("locale",n),window.location.href=t.toString()}})})]})})};var be,je=n(15849),Ae=n(48208),Ze=n(88577),Ee=n(69972),Se=n(38898),Pe=n(39463),Ce=n(10032),Be=n(31853),De=n(13455),Te=n(13932),Re=n(31910),Me=n(93040);const Le=(0,h.Z)("div")(be||(be=(0,s.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),Ne="verify-app-ownership-spaces";const Oe=function(){const{session:e}=(0,Ae.T)(),[t]=(0,je.useSearchParams)(),{t:n}=(0,m.PE)(),{api:o,info:s}=(0,A.h6)(),{api:r}=(0,Ae.T)(),{meta:i}=(0,Re.J_)(),c=(0,l.useNavigate)(),p=(0,a.useMemo)((()=>s?(0,k.RU)(s):""),[s]),[u,h]=(0,Be.Z)({isRestoring:!1,isComplete:!1,isOverwrite:!1,shouldReconnect:!1,exists:!1,accessUrl:"",isConnectOpen:!1,isConfirmOpen:!1,connectData:{action:"",checkFn:()=>{},extraParams:{}},connectMessages:{}}),f=t.get("launchType"),x=t.get("nftId"),g=t.get("chainHost"),v=t.get("from"),y=t.get("blocklet_meta_url"),w=t.get("launcherSessionId")||"",b=t.get("launcherUrl")||"",j=(e=>{const t=e.split("/").filter(Boolean);return t[t.length-2]})(i.spaceEndpoint),S=(0,Pe.getServerAuthMethod)(s,f,w,e.user),P=async(t,n)=>{const o=Array.isArray(t)?t.find((e=>!!e.sessionToken)):t;null!==o&&void 0!==o&&o.sessionToken&&((0,ae.ZB)(n(o.sessionToken)),await e.refresh()),h({isConnectOpen:!1}),setTimeout((()=>{const e=new URLSearchParams({appDid:j});[{name:"launchType",value:f},{name:"nftId",value:x},{name:"from",value:v},{name:"blocklet_meta_url",value:y},{name:"chainHost",value:g}].forEach((t=>{let{name:n,value:o}=t;o&&e.set(n,o)})),c("/blocklets/restore/restore-blocklet?".concat(e.toString()))}),0)},C=async function(){var t,s,a;let l=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!l){if(u.shouldReconnect)return void(window.location.href=d()(p,"blocklets/restore/connect-space"));if(e.user){const e=await o.getBlocklet({input:{did:j,attachRuntimeInfo:!0}});if(e.blocklet){const t=await(0,Me.DB)(e.blocklet);if(t){const n=new URL(t);"running"!==e.blocklet.status&&n.searchParams.set("__start__","1"),h({shouldReconnect:!0,exists:!0,accessUrl:n.href})}return}}}if("nft"===S){var c,m,v;const e=new URL(window.location.href);e.pathname=d()(null!==(c=null===(m=window)||void 0===m||null===(v=m.env)||void 0===v?void 0:v.apiPrefix)&&void 0!==c?c:"/","/api/did/".concat(Ne,"/token")),e.searchParams.set("appDid",j),e.searchParams.set("endpoint",i.spaceEndpoint),e.searchParams.set("referrer",window.location.href),e.searchParams.set("nftId",x),e.searchParams.set("appPid",i.did);const t={autoConnect:!1,launchType:f,nftId:x};g&&(e.searchParams.set("chainHost",g),t.chainHost=g),l&&e.searchParams.set("overwrite","1");const{data:o}=await r.get(e.href);return o.error?void V.Z.error(o.error):(t.nw=o.url,void h({isConnectOpen:!0,connectData:{action:"verify-restore-by-nft",extraParams:t},connectMessages:{title:n("blocklet.restoreFromSpaces.nftAuthDialog.title"),scan:n("blocklet.restoreFromSpaces.nftAuthDialog.scan"),confirm:n("blocklet.restoreFromSpaces.nftAuthDialog.confirm"),success:n("blocklet.restoreFromSpaces.nftAuthDialog.success")}}))}if("launcher"===S){const{launcherSession:e,error:t}=await o.getLauncherSession({input:{launcherUrl:b,launcherSessionId:w}});return void(e?h({isConnectOpen:!0,connectData:{action:Ne,extraParams:{appDid:j,appPid:i.did,endpoint:i.spaceEndpoint,referrer:window.location.href,restoreFrom:"spaces",overwrite:l?"1":void 0,launcherUrl:b,launcherSessionId:w,chainHost:g}},connectMessages:{title:n("blocklet.restoreBlocklet.verify.title"),scan:n("blocklet.restoreBlocklet.verify.scan"),confirm:n("blocklet.restoreBlocklet.verify.confirm"),success:n("blocklet.restoreBlocklet.verify.success")}}):V.Z.error("Launch session invalid: ".concat(t)))}if("session"===S)return void h({isConnectOpen:!0,connectData:{action:Ne,extraParams:{appDid:j,appPid:i.did,endpoint:i.spaceEndpoint,referrer:window.location.href,overwrite:l?"1":void 0,restoreFrom:"spaces"}},connectMessages:{title:n("blocklet.restoreBlocklet.verify.title"),scan:n("blocklet.restoreBlocklet.verify.scan"),confirm:n("blocklet.restoreBlocklet.verify.confirm"),success:n("blocklet.restoreBlocklet.verify.success")}});const y=new URL(window.location.href);y.pathname=d()(null!==(t=null===(s=window)||void 0===s||null===(a=s.env)||void 0===a?void 0:a.apiPrefix)&&void 0!==t?t:"/","/api/did/".concat(Ne,"/token")),y.searchParams.set("appDid",j),y.searchParams.set("appPid",i.did),y.searchParams.set("endpoint",i.spaceEndpoint),y.searchParams.set("referrer",window.location.href),y.searchParams.set("restoreFrom","spaces");const{data:k}=await r.get(y.href);e.login(P,{nw:k.url,openMode:"popup"})};return(0,a.useEffect)((()=>{C()}),[]),(0,R.jsxs)(Le,{children:[(0,R.jsx)(Z.Z,{title:n("blocklet.restoreBlocklet.verify.title"),subTitle:n("blocklet.restoreBlocklet.verify.subTitle"),onClickBack:()=>window.history.back()}),(0,R.jsxs)(E.Z,{textAlign:"center",mt:6,children:[(0,R.jsx)(De.Z,{blocklet:{meta:i},blockletMetaUrl:y}),(0,R.jsxs)(E.Z,{mt:2,mb:2,children:[(0,R.jsx)(J.Z,{variant:"body2",children:i.title}),(0,R.jsx)(Ee.Z,{did:j})]}),u.exists&&u.accessUrl&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(J.Z,{component:"p",variant:"body1",gutterBottom:!0,sx:{color:"orange"},children:n("blocklet.restoreBlocklet.verify.exists")}),(0,R.jsxs)(J.Z,{component:"div",sx:{marginTop:"32px"},children:[u.accessUrl&&(0,R.jsx)(B.Z,{variant:"contained",component:Se.Z,href:u.accessUrl,sx:{width:"160px",height:"100%"},children:n("blocklet.restoreBlocklet.verify.open")}),(0,R.jsx)(B.Z,{variant:"contained",color:"error",onClick:()=>{h({isConfirmOpen:!0})},sx:{width:"160px",height:"100%",marginLeft:"32px"},children:n("blocklet.restoreBlocklet.verify.overwrite")})]})]}),!u.exists&&(0,R.jsx)(B.Z,{variant:"contained",disabled:u.isConnectOpen,onClick:C,sx:{width:"180px",height:"100%"},children:n("blocklet.restoreBlocklet.verify.".concat(u.shouldReconnect?"reconnect":"verify"))})]}),u.connectData.isConnectOpen&&(0,R.jsx)(Te.Z,{appDid:j,visible:!1}),(0,R.jsx)(Ze.Z,{popup:!0,open:u.isConnectOpen,forceConnected:!1,saveConnect:!1,action:u.connectData.action,checkFn:r.get,checkTimeout:3e5,webWalletUrl:(0,ae.yP)(s),onSuccess:P,extraParams:u.connectData.extraParams,messages:u.connectMessages,onClose:()=>{h({isConnectOpen:!1})}}),u.isConfirmOpen&&(0,R.jsx)(Ce.Z,{color:"error",title:n("blocklet.restoreBlocklet.overwrite.title"),description:n("blocklet.restoreBlocklet.overwrite.description"),confirm:n("common.confirm"),onCancel:()=>{h({isConfirmOpen:!1})},onConfirm:()=>{h({isConfirmOpen:!1,isOverwrite:!0}),C(!0)}})]})};var Fe,Qe=n(55309);const Ue=(0,h.Z)(Qe.Z)(Fe||(Fe=(0,s.Z)(["\n && .result-footer {\n height: 120px;\n > div {\n flex-wrap: wrap;\n }\n }\n"])));var ze,Ge,Ie,Je=n(35266),He=n(77277),Xe=n(77429),Ke=n(75506),Ye=n.n(Ke),We=n(50482),_e=n.n(We),Ve=n(11397),qe=n.n(Ve),$e=n(11476),et=n(6202),tt=n(66436);const nt=qe()("@abtnode/webapp:restore-blocklet:step-install"),ot=(0,h.Z)("div")(ze||(ze=(0,s.Z)(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),st=h.Z.div(Ge||(Ge=(0,s.Z)(["\n line-height: 1.4em;\n .error-desc {\n margin-top: 8px;\n word-wrap: break-word;\n color: ",";\n }\n"])),(e=>e.theme.palette.grey[500])),at={[He.RESTORE_PROGRESS_STATUS.waiting]:0,[He.RESTORE_PROGRESS_STATUS.start]:1,[He.RESTORE_PROGRESS_STATUS.importData]:2,[He.RESTORE_PROGRESS_STATUS.downloading]:3,[He.RESTORE_PROGRESS_STATUS.importDataSuccess]:4,[He.RESTORE_PROGRESS_STATUS.installing]:5,[He.RESTORE_PROGRESS_STATUS.completed]:10};const rt=(0,h.Z)(E.Z)(Ie||(Ie=(0,s.Z)(["\n padding-top: 24px;\n"]))),it=function(){var e,t,n,o;const s=new URL(window.location.href),r=s.searchParams.get("appDid"),i=s.searchParams.get("launchType"),l=s.searchParams.get("nftId"),c=s.searchParams.get("fromLauncher"),d=s.searchParams.get("from"),p=s.searchParams.get("chainHost"),u=function(e){let{appDid:t}=e;const[n,o]=(0,a.useState)(He.RESTORE_PROGRESS_STATUS.waiting),s=(0,et.ZP)();return s.connect(),(0,a.useEffect)((()=>(s.on(He.BlockletEvents.restoreProgress,(e=>{t===(null===e||void 0===e?void 0:e.appDid)&&o(e)})),()=>{s.off(He.BlockletEvents.restoreProgress)})),[t,s]),n}({appDid:r}),[h,f]=(0,a.useState)(0),x=(0,a.useRef)(null),{meta:g}=(0,Re.J_)(),{t:v}=(0,m.PE)(),{api:y,info:w}=(0,A.h6)(),[b,j]=(0,Be.Z)({nextAccessUrl:"",installError:null}),E=(0,$e.Z)(r),{status:S,eventName:P}=E,C=()=>{f(12),x.current&&(clearTimeout(x.current),x.current=null),x.current=setTimeout((()=>{y.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then((e=>{e.blocklet&&M(e.blocklet)}))}),500)},D=()=>{var e,t;null!==E&&void 0!==E&&null!==(e=E.runtimeBlocklet)&&void 0!==e&&null!==(t=e.settings)&&void 0!==t&&t.initialized?f(11):C()},T=[v("blocklet.restoreFromSpaces.progress.waiting"),v("blocklet.restoreFromSpaces.progress.restoring"),v("blocklet.restoreFromSpaces.progress.importData"),v("blocklet.restoreFromSpaces.progress.downloading",{progress:"".concat(null!==(e=null===u||void 0===u||null===(t=u.data)||void 0===t?void 0:t.completed)&&void 0!==e?e:100,"/").concat(null!==(n=null===u||void 0===u||null===(o=u.data)||void 0===o?void 0:o.total)&&void 0!==n?n:100)}),v("blocklet.restoreFromSpaces.progress.importSuccess"),v("launchBlocklet.waiting.downloading"),v("launchBlocklet.waiting.verifying"),v("launchBlocklet.waiting.downloading"),v("launchBlocklet.waiting.extracting"),v("upgrading"===S?"common.upgrading":"launchBlocklet.waiting.installing"),v("launchBlocklet.waiting.installed"),v("launchBlocklet.waiting.starting"),v("launchBlocklet.waiting.done")];(0,a.useEffect)((()=>{if(u.status===He.RESTORE_PROGRESS_STATUS.error){const e={message:u.message,name:"restoreFailed",action:"retryRestore"};return _e()(e,b.installError)||V.Z.error($()(e)),void j({installError:e})}f(at[u.status]||0)}),[u.status]),(0,a.useEffect)((()=>{if("serverless"!==i||P!==He.BlockletEvents.nftConsumed)switch(S){case"waiting":f(6);break;case"downloading":f(7);break;case"installing":case"upgrading":f(8);break;case"installed":if("serverless"===i&&!(0,Me.MZ)(E))break;D();break;case"starting":f(11);break;case"running":f(12),C();break;case"stopped":C();break;case"corrupted":case"error":{var e;null===E||void 0===E||E.stopPolling();const t={message:null===E||void 0===E||null===(e=E.error)||void 0===e?void 0:e.message,name:null===E||void 0===E?void 0:E.eventName,action:"retryRestore"},n=function(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!_e()(t,b.installError)&&null!==E&&void 0!==E&&null!==(e=E.error)&&void 0!==e&&e.message&&V.Z.error($()(E.error)),j({installError:t,...n})};y.getBlocklet({input:{did:r,attachRuntimeInfo:!0}}).then((e=>{var o;let{blocklet:s}=e;null!==s&&void 0!==s&&null!==(o=s.settings)&&void 0!==o&&o.initialized&&(t.action="retryStart"),n()})).catch((()=>{n()}))}}else D()}),[S,P,E]);const M=async e=>{const t=await(0,Me.DB)(e);if(Ye()(t))return;const n=new URL(t);n.searchParams.set("serverUrl",(0,k.RU)(w)),"running"!==e.status&&n.searchParams.set("__start__","1"),c&&n.searchParams.set("fromLauncher",c),d&&n.searchParams.set("from",d),i&&n.searchParams.set("launchType",i),l&&n.searchParams.set("nftId",l),p&&n.searchParams.set("chainHost",p),null===E||void 0===E||E.stopPolling(),j({nextAccessUrl:n.href,status:e.status,resultMessage:"running"===e.status?{variant:"success",title:v("blocklet.restoreFromSpaces.restore.completeTitle"),subTitle:"",footer:v("common.open")}:{variant:"info",title:v("blocklet.restoreFromSpaces.restore.installedTitle"),subTitle:v("blocklet.restoreFromSpaces.restore.installedSubTitle"),footer:v("common.configuration")}})};if(b.installError){const e={retryRestore:(0,R.jsx)(B.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-install",component:je.Link,to:"/blocklets/restore/verify-ownership".concat(window.location.search),children:v("common.retry")}),retryStart:(0,R.jsx)(B.Z,{variant:"contained",className:"bottom-button","data-cy":"retry-start",onClick:()=>(async()=>{j({installError:null,nextAccessUrl:""}),await y.startBlocklet({input:{did:r}}),null===E||void 0===E||E.startPolling()})(),children:v("common.retry")})},t=b.installError.name?b.installError.name.replace("blocklet.",""):"installFailed";return(0,R.jsx)(Ue,{variant:"error",title:null===g||void 0===g?void 0:g.title,subTitle:(0,R.jsxs)(st,{children:[(0,R.jsx)("div",{children:v("launchBlocklet.error.".concat(t))}),b.installError.message&&(0,R.jsx)("div",{className:"error-desc",children:v("common.errorMessage")+b.installError.message})]}),footer:(0,R.jsxs)(rt,{children:[e[b.installError.action],"serverless"===i&&(0,R.jsx)("div",{style:{marginTop:"24px"},dangerouslySetInnerHTML:{__html:v("blocklet.restoreFromSpaces.restore.support",{communityLink:"https://community.arcblock.io/",supportEmail:"launcher@arcblock.io"})}})]})})}const L=!!b.nextAccessUrl;return nt("render",{status:S,eventName:P,launchType:i,runtimeBlockletState:E,state:b}),(0,R.jsxs)(ot,{children:[!L&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Z.Z,{title:v("blocklet.restoreBlocklet.restore.title"),subTitle:v("blocklet.restoreFromSpaces.restore.subTitle")}),(0,R.jsxs)(tt.Z,{children:[(0,R.jsx)(Je.Z,{increaseSpeed:.3,messageLoop:!1,message:(0,R.jsx)(Xe.Z,{steps:T,stepIndex:h,autoGrowth:10===h?1e3:4e3})}),[5,7,8].includes(h)&&(0,R.jsx)(Te.Z,{appDid:r})]})]}),L&&(0,R.jsx)(Ue,{variant:b.resultMessage.variant,title:b.resultMessage.title,subTitle:b.resultMessage.subTitle,footer:(0,R.jsx)(rt,{children:(0,R.jsx)(B.Z,{variant:"contained",style:{width:"200px"},component:Se.Z,href:b.nextAccessUrl,children:b.resultMessage.footer})})})]})};const lt=function(){return(0,R.jsx)(it,{})};var ct,dt,pt,ut=n(23484);function ht(){const e=(0,u.Z)((e=>e.breakpoints.down("md"))),{t:t,locale:n}=(0,m.PE)(),{info:o}=(0,A.h6)(),s=(0,ut.Z)(),{meta:r}=(0,Re.J_)(),c=(0,a.useMemo)((()=>o?(0,k.RU)(o):""),[o]),h=(0,b.yP)(o),Z=d()((0,b.Y5)(),"/blocklets/restore"),E=[{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:d()(Z,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreFromSpaces.restore.title"),path:d()(Z,"restore-blocklet")}];let S=[];S="launcher"===i()(s.get("from"))?[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")},...E]:[{key:"connect-space",name:t("blocklet.restoreFromSpaces.connect.title"),path:d()(Z,"connect-space")},{key:"select-blocklet",name:t("blocklet.restoreFromSpaces.selectBlocklet.title")},...E];const P=(0,R.jsx)(xt,{className:"".concat(c?"logo-can-click":""),children:(0,R.jsx)(w.Z,{onClick:()=>{c&&window.open(c)},logo:e?(0,R.jsx)(v.Z,{width:"32",height:"32"}):(0,R.jsx)(y.Z,{width:"128",height:"48"})})});return(0,R.jsx)(x.W,{steps:S,children:(0,R.jsx)(f.Z,{blockletMeta:r,locale:n,useOfSkeleton:!1,navLogo:P,navSubTitle:t("blocklet.restoreFromSpaces.navSubTitle"),loading:!1,headerEndAddons:(0,R.jsx)(g.Z,{webWalletUrl:h,SessionContext:j.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===r||void 0===r?void 0:r.logo,children:(0,R.jsxs)(ft,{children:[(0,R.jsx)(p.Global,{styles:mt}),(0,R.jsxs)(l.Routes,{children:[(0,R.jsx)(l.Route,{path:"connect-space",element:(0,R.jsx)(ke,{})}),(0,R.jsx)(l.Route,{path:"verify-ownership",element:(0,R.jsx)(Oe,{})}),(0,R.jsx)(l.Route,{path:"restore-blocklet",element:(0,R.jsx)(lt,{})}),(0,R.jsx)(l.Route,{path:"*",element:(0,R.jsx)(l.Navigate,{to:"connect-space",replace:!0})})]})]})})})}const mt=(0,p.css)(ct||(ct=(0,s.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),ft=h.Z.div(dt||(dt=(0,s.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(e=>e.theme.breakpoints.up("md"))),xt=h.Z.div(pt||(pt=(0,s.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])));var gt,vt,yt,wt=n(83294),kt=n(72333),bt=n(25710);function jt(e){let{onSelect:t}=e;const{api:n}=(0,A.h6)(),{t:o,locale:s}=(0,m.PE)(),[r,i]=(0,a.useState)(!1),[c,d]=(0,a.useState)([]),[p,u]=(0,a.useState)(""),[h,f]=(0,a.useState)(null),x=(0,l.useNavigate)();(0,a.useEffect)((()=>{(async()=>{try{i(!0),f(!1);const{getBlocklets:{blocklets:e},getBlockletsFromBackup:{backups:t}}=await n.doBatchQuery({getBlocklets:{input:{}},getBlockletsFromBackup:{input:{}}});d((t||[]).filter((t=>!(e||[]).some((e=>{var n;return t.appPid===(null===(n=e.meta)||void 0===n?void 0:n.did)})))).sort(((e,t)=>t.createdAt-e.createdAt)).slice(0,200)),i(!1)}catch(e){i(!1),f(e.message)}})()}),[]);let g=null;return g=h?(0,R.jsx)(he.Z,{type:"error",style:{width:"100%",marginTop:8},children:h}):r?(0,R.jsx)(de.Z,{size:16}):c.length?(0,R.jsx)(Zt,{children:c.map((e=>(0,R.jsxs)(Et,{className:"middle-font-size space ".concat(p===e.appDid?"selected":""),onClick:()=>(e=>{u(e.appDid)})(e),children:[(0,R.jsxs)("div",{className:"left",children:[(0,R.jsx)("div",{className:"header",children:(0,R.jsx)(E.Z,{sx:{width:40,height:40},children:(0,R.jsx)(kt.Z,{did:e.appDid,size:40})})}),(0,R.jsxs)("div",{className:"body",children:[(0,R.jsx)(J.Z,{className:"text",children:e.name}),(0,R.jsx)(J.Z,{className:"text middle-font-size",children:(0,R.jsx)(Ee.Z,{responsive:!1,compact:!0,inline:!0,copyable:!1,size:12,did:e.appDid})})]}),(0,R.jsxs)(E.Z,{color:"text.secondary",className:"footer small-font-size",children:[o("blocklet.restoreFromServer.backupIn")," ",(0,b.B2)(e.createdAt,s)]})]}),(0,R.jsx)("div",{className:"right",children:(0,R.jsx)("div",{className:"more",children:(0,R.jsx)(K.Z,{onClick:()=>{},className:"more-btn",size:"large","aria-label":"more functions",children:(0,R.jsx)(wt.Z,{color:"disabled"})})})}),(0,R.jsx)("div",{className:"selected-container",children:(0,R.jsx)(D.default,{className:"selected-icon"})})]},e.appDid)))}):(0,R.jsx)(bt.Z,{children:o("common.empty")}),(0,R.jsxs)(At,{style:{width:"100%"},children:[(0,R.jsx)(Z.Z,{title:o("blocklet.restoreFromServer.selectTitle"),subTitle:o("blocklet.restoreFromServer.description")}),(0,R.jsx)(E.Z,{mt:4,mx:3,className:"main-body",children:g}),(0,R.jsx)(E.Z,{className:"main-footer",display:"flex",justifyContent:"center",children:(0,R.jsx)(B.Z,{sx:{width:"180px",height:"100%"},onClick:e=>{e.stopPropagation(),(()=>{const e=c.find((e=>e.appDid===p));t({did:e.appDid,name:e.appDid,title:e.name});const n=new URL(window.location.href);n.searchParams.set("appDid",e.appDid),n.searchParams.set("appName",e.name),x("/blocklets/restore/verify-ownership".concat(n.search))})()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:r||h||!p,children:o("common.restore")})})]})}jt.defaultProps={onSelect:()=>{}};const At=(0,h.Z)(E.Z)(gt||(gt=(0,s.Z)(["\n .main-body {\n height: 50vh;\n "," {\n height: 80vh;\n }\n\n overflow: auto;\n }\n .main-footer {\n padding-top: 24px;\n padding-bottom: 24px;\n "," {\n position: fixed;\n bottom: 16px;\n width: 100%;\n padding-bottom: 0;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md"))),Zt=(0,h.Z)(E.Z)(vt||(vt=(0,s.Z)(["\n display: block;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n max-width: 1000px;\n margin: 0 auto;\n\n .space {\n display: flex;\n margin: 8px auto;\n\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 30px;\n height: 30px;\n border-radius: 0px 0px 7px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.3s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 30px;\n top: 30px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 15px;\n border-style: solid;\n /* border-color: transparent rgb(29, 193, 199) rgb(29, 193, 199) transparent; */\n border-color: transparent ","\n "," transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n }\n\n .space.selected {\n background-color: rgb(236, 251, 253);\n border-color: rgb(236, 251, 253);\n\n .selected-container {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n }\n"])),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.primary.main)),Et=(0,h.Z)("div")(yt||(yt=(0,s.Z)(["\n display: flex;\n position: relative;\n width: 100%;\n padding: 10px;\n border: 1 solid #ccc;\n cursor: pointer;\n\n .left {\n display: flex;\n align-items: flex-start;\n width: 100%;\n margin: 0px 20px 0px 0px;\n\n .header {\n padding: 5px 16px 0 0;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .footer {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 100%;\n }\n }\n\n .right {\n display: flex;\n }\n\n "," {\n .left {\n display: flex;\n flex-direction: column;\n margin-right: 20px;\n\n .header {\n display: none;\n }\n\n .footer {\n margin-top: 6px;\n margin-left: 0px;\n padding: 2px 0px;\n height: auto;\n }\n }\n\n .right {\n width: auto;\n }\n\n .text {\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n }\n }\n\n // \u516c\u5171\u5c5e\u6027\n .middle-font-size {\n font-size: 14px;\n }\n\n .small-font-size {\n font-size: 12px;\n }\n"])),(e=>e.theme.breakpoints.down("md")));var St,Pt=n(95712);const Ct=(0,h.Z)("div")(St||(St=(0,s.Z)(["\n width: 100%;\n height: 100%;\n overflow-y: auto;\n"]))),Bt="verify-app-ownership-disk";const Dt=function(){const e=new URL(window.location.href),t=e.searchParams.get("appDid"),n=e.searchParams.get("appName"),{t:o}=(0,m.PE)(),{api:s,info:r}=(0,A.h6)(),{session:i,api:l}=(0,Ae.T)(),c=(0,a.useMemo)((()=>r?(0,k.RU)(r):""),[r]),[p,u]=(0,Be.Z)({isRestoring:!1,isComplete:!1,connectData:{isConnectOpen:!1,action:"",checkFn:()=>{},extraParams:{}}}),h=()=>{u({connectData:{isConnectOpen:!1}}),setTimeout((()=>{const e=new URL(d()(c,"blocklets/restore/restore-blocklet".concat(window.location.search)));window.location.href=e.href}),0)},f=async()=>{if(i.user)await(async()=>{if((await s.getBlocklet({input:{did:t}})).blocklet)return V.Z.error("Blocklet ".concat(n,"(").concat(t,") already exists")),void u({shouldReconnect:!0});u({connectData:{isConnectOpen:!0,action:Bt,extraParams:{appDid:t,restoreFrom:"disk"}}})})();else{var e,o,a;const n=new URL(window.location.href);n.pathname=d()(null!==(e=null===(o=window)||void 0===o||null===(a=o.env)||void 0===a?void 0:a.apiPrefix)&&void 0!==e?e:"/","/api/did/".concat(Bt,"/token")),n.searchParams.set("appDid",t),n.searchParams.set("restoreFrom","disk");const{data:s}=await l.get(n.href);i.login(h,{nw:s.url,openMode:"popup"})}};return(0,a.useEffect)((()=>{f()}),[]),(0,R.jsxs)(Ct,{children:[(0,R.jsx)(Z.Z,{title:o("blocklet.restoreBlocklet.verify.title"),subTitle:o("blocklet.restoreBlocklet.verify.subTitle")}),(0,R.jsxs)(E.Z,{textAlign:"center",mt:6,children:[(0,R.jsx)(Pt.Z,{did:t,size:128}),(0,R.jsxs)(E.Z,{mt:2,mb:2,children:[(0,R.jsx)(J.Z,{variant:"body2",children:n}),(0,R.jsx)(Ee.Z,{did:t})]}),(0,R.jsx)(B.Z,{variant:"contained",disabled:p.connectData.isConnectOpen,onClick:f,sx:{width:"180px",height:"100%"},children:o("blocklet.restoreBlocklet.verify.".concat(p.shouldReconnect?"reconnect":"verify"))})]}),p.connectData.isConnectOpen&&(0,R.jsx)(Te.Z,{appDid:t,visible:!1}),(0,R.jsx)(Ze.Z,{popup:!0,open:p.connectData.isConnectOpen,forceConnected:!1,saveConnect:!1,action:p.connectData.action,checkFn:l.get,checkTimeout:3e5,webWalletUrl:(0,ae.yP)(r),onSuccess:h,extraParams:p.connectData.extraParams,messages:{title:o("blocklet.restoreBlocklet.verify.title"),scan:o("blocklet.restoreBlocklet.verify.scan"),confirm:o("blocklet.restoreBlocklet.verify.confirm"),success:o("blocklet.restoreBlocklet.verify.success")},onClose:()=>{u({connectData:{isConnectOpen:!1}})}})]})};var Tt,Rt,Mt;function Lt(){const e=(0,u.Z)((e=>e.breakpoints.down("md"))),{t:t,locale:n}=(0,m.PE)(),{info:o}=(0,A.h6)(),{meta:s,setMeta:r}=(0,a.useState)({}),i=(0,a.useMemo)((()=>o?(0,k.RU)(o):""),[o]),c=(0,b.yP)(o),h=d()((0,b.Y5)(),"/blocklets/restore"),Z=[{key:"select",name:t("blocklet.restoreFromServer.selectTitle"),path:d()(h,"select")},{key:"verify-ownership",name:t("blocklet.restoreBlocklet.verify.title"),path:d()(h,"verify-ownership")},{key:"restore-blocklet",name:t("blocklet.restoreBlocklet.restore.title"),path:d()(h,"restore-blocklet")}],E=(0,R.jsx)(Ft,{className:"".concat(i?"logo-can-click":""),children:(0,R.jsx)(w.Z,{onClick:()=>{i&&window.open(i)},logo:e?(0,R.jsx)(v.Z,{width:"32",height:"32"}):(0,R.jsx)(y.Z,{width:"128",height:"48"})})});return(0,R.jsx)(x.W,{steps:Z,children:(0,R.jsx)(f.Z,{blockletMeta:{...s,registryUrl:""},locale:n,useOfSkeleton:!1,navLogo:E,headerEndAddons:(0,R.jsx)(g.Z,{webWalletUrl:c,SessionContext:j.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:null===s||void 0===s?void 0:s.logo,children:(0,R.jsxs)(Ot,{children:[(0,R.jsx)(p.Global,{styles:Nt}),(0,R.jsxs)(l.Routes,{children:[(0,R.jsx)(l.Route,{path:"select",element:(0,R.jsx)(jt,{onSelect:r})}),(0,R.jsx)(l.Route,{path:"verify-ownership",element:(0,R.jsx)(Dt,{})}),(0,R.jsx)(l.Route,{path:"restore-blocklet",element:(0,R.jsx)(lt,{})}),(0,R.jsx)(l.Route,{path:"*",element:(0,R.jsx)(l.Navigate,{to:"select".concat(window.location.search),replace:!0})})]})]})})})}const Nt=(0,p.css)(Tt||(Tt=(0,s.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),Ot=h.Z.div(Rt||(Rt=(0,s.Z)(["\n "," {\n padding-top: 34px;\n }\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"])),(e=>e.theme.breakpoints.up("md"))),Ft=h.Z.div(Mt||(Mt=(0,s.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])));function Qt(){const{search:e}=window.location;return e.includes("restoreFrom=server")?(0,R.jsx)(Lt,{}):(0,R.jsx)(ht,{})}},12332:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var o,s,a=n(71171),r=n(55898),i=n.n(r),l=n(33518),c=n(96266);function d(e){let{logo:t,name:n,subname:o,previousData:s,...a}=e,r=(0,c.jsx)(p,{logo:t}),i=n,l=o;return s.logo&&(r=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{logo:t,className:"left-fade-in-ele"}),(0,c.jsx)(p,{logo:s.logo,className:"postion-abs left-fade-out-ele"})]})),s.name&&s.name!==n&&(i=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"right-fade-in-ele",style:{display:"inline-block"},children:n}),(0,c.jsx)("span",{className:"postion-abs right-fade-out-ele",children:s.name})]})),s.subname&&s.subname!==o&&(l=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"right-fade-in-ele",style:{display:"inline-block"},children:o}),(0,c.jsx)("span",{className:"postion-abs right-fade-out-ele",children:s.subname})]})),(0,c.jsx)(h,{...a,children:(0,c.jsxs)("div",{className:"logo-inner",children:[(0,c.jsx)("div",{className:"logo-img-content",children:r}),(0,c.jsxs)("div",{className:"logo-info ".concat(n||o?"":"zero-left"),children:[(0,c.jsx)("div",{className:"logo-name",children:i}),(0,c.jsx)("div",{className:"logo-subname",children:l})]})]})})}function p(e){let{logo:t,...n}=e;return(0,c.jsx)(u,{...n,children:t})}d.propTypes={logo:i().element.isRequired,name:i().string,subname:i().string,previousData:i().object},d.defaultProps={name:"",subname:"",previousData:{logo:"",name:"",subname:""}};const u=l.Z.div(o||(o=(0,a.Z)(["\n display: block;\n > * {\n display: block;\n }\n"]))),h=l.Z.div(s||(s=(0,a.Z)(["\n position: relative;\n display: block;\n\n .logo-inner {\n display: flex;\n align-items: center;\n height: 100%;\n .logo-img-content {\n position: relative;\n display: block;\n }\n .logo-info {\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: 10px;\n letter-spacing: 0.1px;\n &.zero-left {\n margin-left: 0%;\n }\n .logo-name {\n position: relative;\n line-height: 16px;\n font-size: 16px;\n color: #121319;\n }\n .logo-subname {\n position: relative;\n line-height: 13px;\n font-size: 13px;\n color: #7d8085;\n }\n }\n }\n\n .postion-abs {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n }\n\n .right-fade-out-ele {\n animation: right-fade-out ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n }\n\n .right-fade-in-ele {\n animation: right-fade-in ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: both;\n }\n\n @keyframes right-fade-out {\n 0% {\n opacity: 1;\n transform: translate(0, 0);\n }\n 100% {\n opacity: 0;\n transform: translate(8px, 0);\n }\n }\n\n @keyframes right-fade-in {\n 0% {\n opacity: 0;\n transform: translate(8px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n\n .left-fade-out-ele {\n animation: left-fade-out ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n }\n\n .left-fade-in-ele {\n animation: left-fade-in ease 0.5s;\n animation-delay: 2s;\n animation-fill-mode: both;\n }\n\n @keyframes left-fade-out {\n 0% {\n opacity: 1;\n transform: translate(0, 0);\n }\n 100% {\n opacity: 0;\n transform: translate(-8px, 0);\n }\n }\n\n @keyframes left-fade-in {\n 0% {\n opacity: 0;\n transform: translate(-8px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n"])))},80676:(e,t,n)=>{"use strict";n.d(t,{hi:()=>a,od:()=>s.a});var o=n(10458),s=n.n(o);s().defaults.timeout=1e4;const a=s().create()},96567:(e,t,n)=>{"use strict";n.d(t,{EJ:()=>v,Jf:()=>g,LQ:()=>p,Nb:()=>u,UV:()=>y,Xv:()=>c,Z3:()=>w,ag:()=>m,mo:()=>h,nD:()=>d,nU:()=>x,w2:()=>f});var o=n(82434),s=n.n(o),a=n(77277),r=n(65873),i=n(2842),l=n(80676);function c(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/"),o=n.at(-4),s=n.at(-2);return(0,i.xn)(t,"space",o,"apps",s,"explorer?key=/apps/".concat(s,"/.did-objects/").concat(s,"/"))}function d(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,i.xn)(t,"space",n)}function p(e){return e.replace(/\/$/,"").split("/").at(-4)}async function u(e){try{if(!s()(e))return!1;const{headers:t}=await l.hi.head(e,{timeout:5e3});return"true"===t["x-listable"]&&"true"===t["x-readable"]&&"true"===t["x-writeable"]}catch(t){return console.error(t),!1}}function h(e){var t;return(null===e||void 0===e||null===(t=e.find((e=>e.key===a.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT)))||void 0===t?void 0:t.value)||""}function m(e){const t=new URL(e);return(0,i.xn)(t.origin,t.pathname)}async function f(e){try{if(!s()(e))return!1;const t=m(e),n=(0,i.xn)(t,"space/api/did/one-click-authorization/token"),{status:o,data:a}=await l.hi.get(n,{timeout:5e3});return 200===o&&(0,r.isObject)(a)}catch(t){return console.error(t),!1}}async function x(e){let{timeout:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e3};try{if(!s()(e))return"";const{headers:n}=await l.hi.head(e,{timeout:t}),o=n["x-space-name"];return o?decodeURIComponent(o):""}catch(n){return console.error(n),""}}function g(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,i.xn)(t,"/api/space/nft/display?spaceDid=".concat(n))}const v=e=>{var t;return(null===e||void 0===e||null===(t=e.configs)||void 0===t||null===(t=t.find((e=>e.key===a.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===t?void 0:t.value)||null};async function y(e){const t={};return t.did=p(e),t.name=await x(e),t.url=function(e){return null===e||void 0===e?void 0:e.replace(/\/api\/space\/.+/,"")}(e),t.endpoint=e,t}async function w(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e4,withSearchParams:!0};if(!(0,r.isString)(e))throw new Error("url(".concat(e,") must be a string"));const o=e.startsWith("http")?e:"https://".concat(e),s=new URL(o),{data:a}=await l.hi.get((0,i.xn)(s.origin,"/__blocklet__.js?type=json"),{timeout:n.timeout}),c=null===(t=a.componentMountPoints.findLast((e=>"z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf"===e.did)))||void 0===t?void 0:t.mountPoint;if(!c)throw new Error("MountPoint(".concat(c,") not found"));const d=(0,i.xn)(s.origin,c);return n.withSearchParams&&s.searchParams.get("spaceDid")?(0,i.xn)(d,"?spaceDid=".concat(s.searchParams.get("spaceDid"))):d}},35701:(e,t,n)=>{"use strict";t.Z=void 0;(o=n(5057))&&o.__esModule;var o,s=n(96266);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=function(e){return(0,s.jsx)("svg",r(r({},e),{},{children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.361 2.4a.8.8 0 0 0-.728.469L.873 15.54a.8.8 0 0 0-.072.33V27.393a.8.8 0 0 0 .8.8h28.8a.8.8 0 0 0 .8-.8v-11.52a.8.8 0 0 0-.072-.331L25.37 2.869a.8.8 0 0 0-.728-.47H7.361zm-4.96 14.4v9.792h27.2v-9.799a.814.814 0 0 1-.104.007h-7.098l-2.066 3.1a.8.8 0 0 1-.666.356h-8.064a.8.8 0 0 1-.665-.356L8.87 16.8h-6.47zm26.816-1.6H21.97a.8.8 0 0 0-.665.356l-2.067 3.1h-7.208l-2.066-3.1a.8.8 0 0 0-.666-.356H2.785L7.876 4h16.25l5.09 11.2z",fill:"currentColor"})}))};l.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.displayName="empty";t.Z=l},25710:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var o,s=n(71171),a=n(55898),r=n.n(a),i=n(39948),l=n(35701),c=n(47685),d=n(96266);const p=(0,c.zo)(i.Z)(o||(o=(0,s.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n height: 100%;\n min-height: 100px;\n color: #999;\n .empty-icon {\n margin: 10px 0;\n }\n"])));function u(e){let{color:t,size:n,children:o,...s}=e;return(0,d.jsxs)(p,{...s,children:[(0,d.jsx)(l.Z,{style:{width:n,height:n,color:t},className:"empty-icon"}),(0,d.jsx)(i.Z,{className:"empty-content",children:o})]})}u.propTypes={color:r().string,size:r().number,children:r().any},u.defaultProps={color:"inherit",size:36,children:null};const h=u},47595:(e,t,n)=>{"use strict";var o=n(71600);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=o(n(56930)),a=n(96266);t.default=(0,s.default)((0,a.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline")},94552:(e,t,n)=>{"use strict";var o=n(71600);t.Z=void 0;var s=o(n(56930)),a=n(96266);t.Z=(0,s.default)((0,a.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch")},83294:(e,t,n)=>{"use strict";var o=n(71600);t.Z=void 0;var s=o(n(56930)),a=n(96266);t.Z=(0,s.default)((0,a.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert")},53616:(e,t,n)=>{var o=n(26849);e.exports=function(e){return o(e).toLowerCase()}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[833],{56742:(e,n,i)=>{const{toBuffer:t,toAddress:o,toBase58:r,toHex:a}=i(49394),{base32:s}=i(46422);e.exports={encode:e=>{if(!e)return e;const n=t(o(e));return s.encode(n)},decode:e=>{if(!e)return e;const n=s.decode(e),i=r(n);return i.length>30?i:a(n)}}},27472:(e,n,i)=>{const t=i(6352),o=i(94874),r="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p";e.exports={DID_DOMAIN_SERVICE_DID:r,getDidDomainServiceURL:async e=>{var n;if(!e||null===e||void 0===e||!e.trim())return null;const i=new URL(e);i.pathname="__blocklet__.js",i.searchParams.set("type","json");const{data:a}=await o.get(i.toString()),s=null===a||void 0===a||null===(n=a.componentMountPoints)||void 0===n?void 0:n.find((e=>e.did===r)),l=new URL(e);l.pathname=null===s||void 0===s?void 0:s.mountPoint;const d=l.toString(),c=t(d,"/api");return{base:d,api:c,domain:t(c,"/domains")}}}},44543:(e,n,i)=>{const t=i(57156);e.exports=(e,n)=>t(e)===t(n)},60501:(e,n,i)=>{"use strict";i.d(n,{Z:()=>x});var t,o=i(71171),r=i(5057),a=i(55898),s=i.n(a),l=i(33518),d=i(67680),c=i(61533),m=i(74490),u=i(45267),p=i(46954),h=i(44067),f=i(96266);function x(e){let{actions:n,size:i,...t}=e;const[o,a]=(0,r.useState)(null),s=Boolean(o),l=e=>{try{e.stopPropagation(),e.preventDefault()}catch{}a(null)};return(0,f.jsxs)(g,{...t,children:[(0,f.jsx)(d.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"actions-menu-icon",onClick:e=>{try{e.stopPropagation(),e.preventDefault()}catch{}a(e.currentTarget)},size:i,children:(0,f.jsx)(u.Z,{})}),(0,f.jsx)(c.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:o,keepMounted:!0,open:s,onClose:l,slotProps:{paper:{}},children:n.map(((e,n)=>{if("function"===typeof e)return e({close:l});const{icon:i,text:t,onClick:o,disabled:a=!1,...s}=e;return(0,r.createElement)(m.Z,{...s,disabled:a,dense:!0,onClick:async e=>{await o(e),l()},key:n,"data-cy":"actions-menu-".concat(n)},(0,f.jsx)(p.Z,{style:{minWidth:24,marginRight:8},children:i}),(0,f.jsx)(h.Z,{primary:t}))}))})]})}x.propTypes={actions:s().array,size:s().oneOf(["small","medium","large"])},x.defaultProps={actions:[],size:"small"};const g=l.Z.div(t||(t=(0,o.Z)([""])))},40833:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>Qe});var t=i(71171),o=i(28726),r=i(33518),a=i(5057),s=i(17655),l=i(76720),d=i(64886),c=i(68420),m=i(19778),u=i(38242),p=i(11750),h=i(33650),f=i(22324),x=i(69972),g=i(64387),v=i(30746),y=i(47791),j=i(55898),Z=i.n(j),b=i(44919),D=i(76416),k=i(93938),P=i(39948),C=i(38763),w=i(75392),T=i(67680),S=i(11819),R=i(75239),E=i(96366),I=i(15715),A=i(56742),q=i(49714),z=i(18067),F=i(25710),_=i(44846),L=i(73881),N=i(74511),B=i(88574),M=i(86229),O=i(77277),W=i(10032),U=i(96266);const H=e=>["waiting","creating","renewaling"].includes(e);function V(e){var n,i;const{t:t}=(0,c.PE)(),[o,r]=(0,a.useState)(!1),{inService:s}=(0,f.h6)(),[l,d]=(0,a.useState)(null),{siteId:m,domain:u,onAdd:p,children:x,did:g}=e,[v,y]=(0,a.useState)(!1),{api:j,ws:{useSubscription:Z}}=(0,f.h6)(),{mode:b,actions:{refreshDomainStatus:D}}=(0,h.y0)(),k=(0,N.Z)((async()=>{const{cert:e}=await j.findCertificateByDomain({input:{domain:u,did:g}});return e})),P=(e,n)=>{e.domain===u&&(y(!1),r(!1),s&&"setup"!==b&&("success"===n?M.Z.success(t("setup.domain.genCertSuccess",{domain:e.domain})):"error"===n&&M.Z.error(t("setup.domain.genCertFailed",{domain:e.domain,message:e.message}))))};if((0,a.useEffect)((()=>{var e;k.loading||y(H(null===(e=k.value)||void 0===e?void 0:e.status))}),[k.loading,null===(n=k.value)||void 0===n?void 0:n.status]),Z(O.BlockletEvents.certError,(e=>P(e,"error"))),Z(O.BlockletEvents.certIssued,(e=>{k.retry(),D(e.domain),P(e,"success")})),k.loading)return"";if("normal"===(null===(i=k.value)||void 0===i?void 0:i.status))return"";const C={title:t("router.cert.genLetsEncryptCert.title"),description:(0,U.jsxs)("div",{children:[(0,U.jsx)(B.Z,{type:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:async()=>{r(!0);try{await j.issueLetsEncryptCert({input:{siteId:m,domain:u,did:g,inBlockletSetup:"setup"===b}}),p(),y(!0)}catch(e){console.error(e),y(!1)}finally{r(!1),d(null)}},onCancel:()=>{r(!1),d(null)}};return(0,U.jsxs)(U.Fragment,{children:[v?(0,U.jsx)(R.Z,{title:t("router.cert.issuing"),children:(0,U.jsx)(_.Z,{size:12})}):x({loading:o,open:e=>{e.stopPropagation(),d(C)}}),l&&(0,U.jsx)(W.Z,{color:"primary",title:l.title,description:l.description,confirm:l.confirm,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}function K(e){const{domain:n,domainStatus:i,...t}=e;return!(0,g.rM)(n)||null!==i&&void 0!==i&&i.isHttps?"":(0,U.jsx)(V,{domain:n,...t})}V.propTypes={domain:Z().string.isRequired,did:Z().string.isRequired,siteId:Z().string.isRequired,onAdd:Z().func,children:Z().any},V.defaultProps={onAdd:()=>{},children:null},K.propTypes={domain:Z().string.isRequired,domainStatus:Z().shape({isHttps:Z().bool}).isRequired,did:Z().string.isRequired,onAdd:Z().func,children:Z().any},K.defaultProps={onAdd:()=>{},children:null};var Q=i(11593),Y=i(74490),G=i(31853),X=i(11854),J=i.n(X);const $=(0,a.createContext)({}),{Provider:ee,Consumer:ne}=$;function ie(e){let{children:n}=e;const[i,t]=(0,G.Z)({domain:"",error:null}),{locale:o,t:r}=(0,c.PE)(),{api:a}=(0,f.h6)(),s={error:i.error,domain:i.domain,setError:e=>{t({error:e})},setDomain:e=>{const n=J()(e),i=(0,g.ub)(n,o);t({domain:n,error:i})},validateDomain:async(e,n)=>{if(!i.error&&n&&"nftDomain"!==n){if(!0===(await a.isDidDomain({input:{domain:e}})).value)return t({error:r("router.domainAlias.add.isDidDomainError")}),!1}return!0}};return(0,U.jsx)(ee,{value:{value:s},children:n})}function te(){const{value:e}=(0,a.useContext)($);return e}var oe=i(27472),re=i(88577),ae=i(35966),se=i(41297),le=i(34966),de=i(96538),ce=i(39067),me=i(38898),ue=i(47020),pe=i(92706),he=i.n(pe),fe=i(26796),xe=i(80676),ge=i(12937);function ve(e){let{domain:n,resolvedTarget:i,...t}=e;const{t:o,locale:r}=(0,c.PE)();return(0,U.jsxs)(P.Z,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...t,children:[(0,U.jsxs)(P.Z,{display:"flex",children:[o("router.domain.setup.tipStart"),n&&(0,U.jsx)(P.Z,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:n}),o("router.domain.setup.tipEnd"),":"]}),(0,U.jsxs)(P.Z,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[(0,U.jsx)(ye,{label:o("router.domain.setup.recordType"),value:"CNAME",locale:r}),(0,U.jsx)(ye,{label:o("router.domain.setup.recordValue"),value:i,locale:r})]})]})}function ye(e){let{locale:n,label:i,value:t}=e;const o=(0,I.Z)((e=>e.breakpoints.down("md"))),r=(0,E.Z)();return(0,U.jsx)(d.Z,{name:i,nameWidth:120,children:(0,U.jsxs)(P.Z,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[(0,U.jsx)(p.Z,{component:"span",color:"primary.main",overflow:"auto",sx:o?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"},children:t}),(0,U.jsx)(ge.q,{content:t,locale:n,style:{marginLeft:"4px",color:r.palette.text.secondary}})]})})}ve.propTypes={domain:Z().string,resolvedTarget:Z().string.isRequired},ve.defaultProps={domain:""},ye.propTypes={locale:Z().string.isRequired,label:Z().string.isRequired,value:Z().string.isRequired};var je=i(35110);function Ze(e){let{siteId:n,teamDid:i,cnameDomain:t,defaultCustomDomain:o,onInputDomain:r,appId:a,appPk:s,onSuccess:l,disabled:d,autoFocus:m,inBlockletSetup:u,...h}=e;const{t:x,locale:v}=(0,c.PE)(),{api:y,info:j}=(0,f.h6)(),Z=te(),b=(0,E.Z)(),D=(0,se.Z)({key:"sm"}),[k,C]=(0,G.Z)({loading:!1,domain:o,error:null,type:null!==j&&void 0!==j&&j.nftDomainUrl?"nftDomain":"inputDomain",showNFTDomainAuth:!1,showDnsTip:!1}),w=(0,fe.default)((()=>(0,oe.getDidDomainServiceURL)(null===j||void 0===j?void 0:j.nftDomainUrl)));if(null!==j&&void 0!==j&&j.nftDomainUrl&&w.loading)return(0,U.jsx)(P.Z,{...h,children:(0,U.jsx)(ae.Z,{relative:"parent",children:(0,U.jsx)(_.Z,{})})});if(w.error)return(0,U.jsx)(P.Z,{...h,children:(0,U.jsx)(ae.Z,{relative:"parent",children:w.error.message})});const T=w.value,S=Z.error||k.error,R={inputDomain:{name:x("router.domainAlias.inputDomain"),component:(0,U.jsxs)(P.Z,{sx:{display:"flex",flexDirection:"column",gap:"8px"},children:[j.nftDomainUrl&&T&&(0,U.jsxs)(P.Z,{sx:{maxWidth:"640px",color:b.palette.text.primary},children:[(0,U.jsx)(p.Z,{children:x("router.domainAlias.addDomainNFT.tips")}),(0,U.jsxs)(p.Z,{component:"div",children:[x("router.domainAlias.addDomainNFT.buyTip"),(0,U.jsxs)(me.Z,{href:T.base,sx:{display:"inline-flex",alignItems:"center"},target:"_blank",children:[(0,U.jsx)("i",{children:x("router.domainAlias.addDomainNFT.buy")}),(0,U.jsx)(de.Z,{fontSize:"small"})]})]})]}),(0,U.jsx)(ue.Z,{sx:{display:"block"},label:x("router.domainAlias.add.domainDescription"),helperText:"inputDomain"===k.type&&S||x("router.domainAlias.add.helperText"),inputProps:{"data-cy":"domain-name-input"},fullWidth:!0,disabled:d,value:k.domain,size:"small",variant:"outlined",error:!!S&&"inputDomain"===k.type,onChange:e=>{var n;const i=J()(null===(n=e.target)||void 0===n?void 0:n.value);Z.setDomain(i);const t=(0,g.ub)(i,v);C({domain:i,error:t,type:"inputDomain"}),r({domain:i,error:t,type:"inputDomain"})},autoFocus:m,onBlur:()=>{Z.domain||(C({error:null}),Z.setError(null))}}),(0,U.jsx)(P.Z,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:(0,U.jsx)(ce.Z,{"data-cy":"confirm-add-domain",fullWidth:D,variant:"contained",loading:k.loading,onClick:async()=>{try{C({loading:!0});const e=(0,je.sf)(k.domain);if(j.nftDomainUrl&&T){if(!0===(await y.isDidDomain({input:{domain:e}})).value)return void C({showNFTDomainAuth:!0})}await y.addDomainAlias({input:{id:n,domainAlias:e,teamDid:i}}),await(0,g._v)(2e3),C({loading:!1,domain:""}),l({domain:e,type:k.type})}catch(S){Z.setError(S.message),C({loading:!1})}},children:x("common.add")})}),(0,U.jsxs)(P.Z,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",lineHeight:1,color:b.palette.primary.main},onClick:()=>C({showDnsTip:!k.showDnsTip}),children:[(0,U.jsx)(le.Z,{fontSize:"1em"}),x("router.domainAlias.showTipHint")]}),k.showDnsTip&&(0,U.jsx)(ve,{domain:k.domain,resolvedTarget:t,style:{marginTop:"4px"}})]})}},I=Object.keys(R);return I.sort((e=>"inputDomain"===e?1:-1)),(0,U.jsx)(P.Z,{...h,children:(0,U.jsxs)(P.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:[I.map(((e,n)=>{var i,t;return(0,U.jsxs)(P.Z,{children:[I.length>1&&(0,U.jsx)(P.Z,{sx:{fontWeight:700,color:b.palette.text.primary},children:"".concat(x("optionsOrder.".concat(n+1)),": ").concat(null===(i=R[e])||void 0===i?void 0:i.name)}),(0,U.jsx)(P.Z,{sx:{marginTop:"8px"},children:null===(t=R[e])||void 0===t?void 0:t.component})]},e)})),T&&(0,U.jsx)(re.Z,{open:k.showNFTDomainAuth,popup:!0,useSocket:!1,action:"authorize",baseUrl:T.api,checkFn:xe.od.create({baseURL:T.api}).get,extraParams:{delegatee:a,delegateePk:s,domain:k.domain},onSuccess:async e=>{let{domain:t,nftDid:o,chainHost:r}=e;try{const e=(0,je.sf)(t);await y.addDomainAlias({input:{id:n,type:"nft-domain",domainAlias:e,nftDid:o,chainHost:r,teamDid:i,inBlockletSetup:u}}),await(0,g._v)(2e3),C({showNFTDomainAuth:!1,type:"nftDomain"}),l({domain:e,type:k.type,nftDid:o,chainHost:r})}catch(S){M.Z.error(S.message)}finally{C({showNFTDomainAuth:!1})}},onClose:()=>C({showNFTDomainAuth:!1,loading:!1}),checkTimeout:3e5,showDownload:!1,messages:{title:x("router.domainAlias.addDomainNFT.connect.title"),scan:x("router.domainAlias.addDomainNFT.connect.scan"),confirm:x("router.domainAlias.addDomainNFT.connect.confirm"),success:x("router.domainAlias.addDomainNFT.connect.success")}})]})})}function be(e){let{id:n,children:i,title:t,teamDid:o,systemDomains:r,appId:a,appPk:s}=e;const{t:l}=(0,c.PE)(),{api:d}=(0,f.h6)(),[m,u]=(0,G.Z)({loading:!1,confirmSetting:null}),p=r.find((e=>(0,q.isDidDomain)(e))),h=te(),x={title:t||l("router.domainAlias.add.title"),description:function(e,i,t){return(0,U.jsx)(Ze,{siteId:n,teamDid:o,cnameDomain:p,onSuccess:()=>u({confirmSetting:null}),onInputDomain:n=>{let{domain:o,type:r,error:a}=n;i({...e,domain:o,type:r,__disableConfirm:!!a}),t(a)},appId:a,appPk:s})},confirm:l("common.confirm"),cancel:l("common.cancel"),params:{domain:"",__disableConfirm:!0},onConfirm:async e=>{if(!m.loading){u({loading:!0});try{const i=(0,je.sf)(e.domain);if(!await h.validateDomain(i,e.type))return!1;await d.addDomainAlias({input:{id:n,domainAlias:i,teamDid:o}}),await(0,g._v)(2e3),u({confirmSetting:null})}catch(i){return h.setError(i.message),!1}finally{u({loading:!1})}}},onCancel:()=>{u({loading:!1,confirmSetting:null})}},v=e=>{e.stopPropagation(),u({confirmSetting:x})};return(0,U.jsxs)(U.Fragment,{children:["function"===typeof i?i({loading:m.loading,open:v}):(0,U.jsxs)(Y.Z,{onClick:v,className:"rule-action","data-cy":"action-add-domain-alias",children:[m.loading?(0,U.jsx)(_.Z,{size:16}):(0,U.jsx)(Q.Z,{style:{fontSize:18,marginRight:5}}),l("router.domainAlias.add.title")]}),m.confirmSetting&&(0,U.jsx)(W.Z,{title:m.confirmSetting.title,description:m.confirmSetting.description,confirm:m.confirmSetting.confirm,cancel:m.confirmSetting.cancel,params:m.confirmSetting.params,onConfirm:m.confirmSetting.onConfirm,onCancel:m.confirmSetting.onCancel,showConfirm:!1,showCancel:!0,displayError:!1,color:"primary",loading:m.loading,maxWidth:"lg"})]})}function De(e){return(0,U.jsx)(ie,{children:(0,U.jsx)(be,{...e})})}Ze.propTypes={siteId:Z().string.isRequired,teamDid:Z().string.isRequired,cnameDomain:Z().string.isRequired,defaultCustomDomain:Z().string,onInputDomain:Z().func,onSuccess:Z().func,appId:Z().string,appPk:Z().string,disabled:Z().bool,autoFocus:Z().bool,inBlockletSetup:Z().bool},Ze.defaultProps={defaultCustomDomain:"",onInputDomain:he(),onSuccess:he(),appId:"",appPk:"",disabled:!1,autoFocus:!0,inBlockletSetup:!1},be.propTypes={id:Z().string.isRequired,children:Z().any,title:Z().string,teamDid:Z().string,systemDomains:Z().arrayOf(Z().string).isRequired,appId:Z().string,appPk:Z().string.isRequired},be.defaultProps={children:null,title:"",teamDid:"",appId:null};var ke=i(46954),Pe=i(44067),Ce=i(27773),we=i(60501);function Te(e){const{t:n}=(0,c.PE)(),[i,t]=(0,a.useState)(!1),[r,s]=(0,a.useState)(null),{id:l,domain:d,children:m,teamDid:u}=e,{api:p}=(0,f.h6)(),h={title:n("router.domainAlias.delete.title"),description:n("router.domainAlias.delete.description"),confirm:n("common.confirm"),onConfirm:async()=>{t(!0);try{await p.deleteDomainAlias({input:{id:l,domainAlias:d,teamDid:u}}),await(0,g._v)(2e3)}catch(e){M.Z.error(e.message)}finally{s(null),t(!1)}},onCancel:()=>{t(!1),s(null)}},x=e=>{e.stopPropagation(),s(h)};return(0,U.jsxs)(U.Fragment,{children:["function"===typeof m?m({loading:i,open:x}):(0,U.jsxs)(o.Z,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[i?(0,U.jsx)(_.Z,{size:16}):(0,U.jsx)(Ce.default,{style:{fontSize:16}}),n("router.domainAlias.delete.title")]}),r&&(0,U.jsx)(W.Z,{title:r.title,description:r.description,confirm:r.confirm,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}function Se(e){let{site:n,domain:i,blocklet:t}=e;const{t:o}=(0,c.PE)(),r=i.value===window.location.hostname;return(0,U.jsx)(we.Z,{"data-cy":"domain-actions",size:"large",actions:[e=>{var a;let{close:s}=e;return(0,U.jsx)(Te,{id:n.id,domain:i.value,teamDid:null===t||void 0===t||null===(a=t.meta)||void 0===a?void 0:a.did,children:e=>{let{open:n}=e;return(0,U.jsx)(R.Z,{title:r?o("blocklet.router.currentDomainTip"):"",children:(0,U.jsx)("span",{children:(0,U.jsxs)(Y.Z,{disabled:i.isProtected||r,dense:!0,onClick:e=>{s(),n(e)},"data-cy":"action-toggle-block",children:[(0,U.jsx)(ke.Z,{style:{minWidth:24,marginRight:8},children:(0,U.jsx)(Ce.default,{})}),(0,U.jsx)(Pe.Z,{primary:o("common.delete")})]},"remove")})})}})}]})}Te.propTypes={id:Z().string.isRequired,domain:Z().string.isRequired,children:Z().any,teamDid:Z().string},Te.defaultProps={children:null,teamDid:""},Se.propTypes={site:Z().object.isRequired,domain:Z().object.isRequired,blocklet:Z().object.isRequired},Se.defaultProps={};var Re=i(31942),Ee=i(238);const Ie=Z().shape({href:Z().string,accessibility:Z().shape({loading:Z().bool,accessible:Z().bool}),domainStatus:Z().shape({isHttps:Z().bool,matchedCert:Z().object}),dns:Z().shape({resolved:Z().bool,ip:Z().string})});var Ae,qe=i(43681),ze=i.n(qe);function Fe(e){let{certificate:n}=e;const[i,t]=(0,a.useState)(null),o=(0,f.h6)(),{t:r,locale:s}=(0,c.PE)(),l=()=>{t(null)},d=Boolean(i);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Re.Z,{"aria-owns":d?"mouse-over-popover":void 0,onMouseEnter:e=>{t(e.currentTarget)},onMouseLeave:l,style:{color:"#44cdc6",fontSize:20,cursor:"pointer"}}),(0,U.jsx)(S.ZP,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:d,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:(0,U.jsx)(C.Z,{children:(0,U.jsxs)(w.Z,{style:{display:"flex"},children:[(0,U.jsx)("div",{children:(0,U.jsx)("img",{src:"".concat(o.imgPrefix,"/https-certificate-icon.png"),alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),(0,U.jsxs)(p.Z,{component:"div",style:{marginLeft:"16px"},children:[(0,U.jsx)(p.Z,{component:"div",style:{fontWeight:"bold"},children:n.domain}),(0,U.jsx)(p.Z,{component:"div",children:"".concat(r("common.issuer"),": ").concat(ze()(n,"issuer.commonName",""))}),(0,U.jsx)(p.Z,{component:"div",children:"".concat(r("router.cert.issuedOn"),": ").concat((0,g.pz)(n.validFrom,s))}),(0,U.jsx)(p.Z,{component:"div",children:"".concat(r("router.cert.expiryOn"),": ").concat((0,g.pz)(n.validTo,s))})]})]})})})]})}function _e(e){let{domain:n,filters:i}=e;const{t:t}=(0,c.PE)(),{value:o,domainStatus:r}=n;if(!(0,g.rM)(o))return null;let s=null,l=null;const{isHttps:d,matchedCert:m}=r;if(!(0,g.ao)(o)){const{dns:{resolved:e,ip:n}={}}=r;s=e||"127.0.0.1"===n?(0,U.jsx)(R.Z,{title:t("router.domain.verify.ok"),children:(0,U.jsx)(Ee.Z,{color:"success"})}):(0,U.jsx)(R.Z,{title:t("router.domain.verify.notResolved"),children:(0,U.jsx)(Ee.Z,{color:"error"})})}l=d?(0,U.jsx)(Fe,{certificate:m}):(0,U.jsx)(R.Z,{title:t("router.domain.https.bad"),children:(0,U.jsx)(Re.Z,{style:{color:"#D0021B",fontSize:20,cursor:"pointer"}})});const u=i.map((e=>"domain"===e?s:"http"===e?l:null));return(0,a.createElement)(a.Fragment,null,...u)}Fe.propTypes={certificate:Z().object},Fe.defaultProps={certificate:{}},_e.propTypes={domain:Ie.isRequired,filters:Z().array},_e.defaultProps={filters:["domain","http"]};const Le=(0,L.V)(Me,"mutate_blocklets"),Ne=(0,L.V)(Me,"",g.Wf);function Be(e){const{inService:n}=(0,f.h6)(),{blocklet:i,loadingRuntimeInfo:t}=(0,h.y0)();let o=Le;return n&&(o=Ne),(0,U.jsx)(o,{...e,blocklet:i,inService:n,loadingRuntimeInfo:t})}function Me(e){var n,i,t;let{hasPermission:r,blocklet:d,loadingRuntimeInfo:m,inService:p,listOnly:h}=e;const{t:f}=(0,c.PE)(),[x,v]=(0,a.useState)(!1),j=(0,I.Z)((e=>e.breakpoints.down("md"))),Z=(0,a.useMemo)((()=>{let e=r;return(0,y.ep)(d)&&(e=e&&p),e}),[r,p,d]),{site:D}=d,C=(0,a.useMemo)((()=>{var e;return(0,g.oE)(null===(e=d.site)||void 0===e?void 0:e.domainAliases)}),[null===(n=d.site)||void 0===n?void 0:n.domainAliases]),w=[],T=[],S=(0,A.encode)(d.appPid),R=null===(i=d.environments)||void 0===i||null===(i=i.find((e=>"BLOCKLET_APP_PK"===e.key)))||void 0===i?void 0:i.value,E=(0,g.M6)(C);return C.forEach((e=>{const n=e.value||"";(0,q.isDidDomain)(n)&&!n.startsWith(S)?T.push(e):w.push(e)})),(0,U.jsxs)(U.Fragment,{children:[!h&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(P.Z,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,U.jsx)(P.Z,{children:f("common.domain")}),Z&&(0,U.jsx)(De,{id:D.id,title:f("router.domain.add.title"),teamDid:null===(t=d.meta)||void 0===t?void 0:t.did,appId:d.appPid,appPk:R,systemDomains:null===E||void 0===E?void 0:E.map((e=>e.value)),children:e=>{let{open:n}=e;return(0,U.jsxs)(o.Z,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:n,disabled:(0,u.isInProgress)(d.status),children:[(0,U.jsx)(b.Z,{style:{fontSize:"1.3em",marginRight:4}}),f("common.add")]})}})]}),!1===(0,u.isAccessible)(d.status)&&(0,U.jsx)(P.Z,{mt:1.5,mb:1.5,children:(0,U.jsx)(k.Z,{severity:"warning",children:f("blocklet.router.noRunning")})})]}),(0,U.jsx)(P.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:(x?C:w).map((e=>{var n,i;const t=e.value;return(0,U.jsxs)(a.Fragment,{children:[j&&(0,U.jsxs)(P.Z,{display:"flex",flexDirection:"column",children:[(0,U.jsx)(P.Z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:(0,U.jsx)(Oe,{domain:e,target:"_blank",children:e.value})}),(0,U.jsxs)(P.Z,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,U.jsxs)(P.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[(0,U.jsx)(_e,{domain:e,filters:["domain"]},"".concat(e.value,"-domain")),(0,U.jsx)(He,{siteId:null===(n=d.site)||void 0===n?void 0:n.id,domain:e,blocklet:d,hasMutatePermission:Z})]}),(0,U.jsx)(P.Z,{sx:{button:{padding:0}},children:(0,U.jsx)(Ue,{hasMutatePermission:Z,site:D,domain:e,blocklet:d})})]})]},t),!j&&(0,U.jsxs)(P.Z,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,U.jsxs)(P.Z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[(0,U.jsx)(_e,{domain:e,filters:["domain"]},"".concat(e.value,"-domain")),(0,U.jsx)(P.Z,{sx:{ml:2,mr:.5},children:(0,U.jsx)(Oe,{domain:e,target:"_blank",children:e.value})}),(0,U.jsx)(He,{siteId:null===(i=d.site)||void 0===i?void 0:i.id,domain:e,blocklet:d,hasMutatePermission:Z})]}),(0,U.jsx)(P.Z,{sx:{button:{padding:0}},children:(0,U.jsx)(Ue,{hasMutatePermission:Z,site:D,domain:e,blocklet:d})})]},t)]},t)}))}),T.length>0&&(0,U.jsx)("div",{style:{marginLeft:"20px",marginTop:"12px"},children:(0,U.jsx)(o.Z,{endIcon:x?(0,U.jsx)(s.Z,{}):(0,U.jsx)(l.Z,{}),onClick:()=>v(!x),children:f(x?"common.collapseAll":"blocklet.router.showAllDomains")})}),!C.length&&(m?(0,U.jsx)(_.Z,{size:16}):(0,U.jsx)(F.Z,{children:f("common.empty")}))]})}function Oe(e){let{domain:n,children:i,...t}=e;const{t:o}=(0,c.PE)(),{href:r,accessibility:a}=n;return!a||a.loading?(0,U.jsxs)(We,{...t,children:[i,(0,U.jsx)(R.Z,{title:o("blocklet.router.checkUrlAccessible"),placement:"top-end",children:(0,U.jsx)("span",{className:"status",children:(0,U.jsx)(_.Z,{size:12})})})]}):a.accessible?(0,U.jsx)(We,{...t,children:(0,U.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:i})}):(0,U.jsx)(We,{...t,children:(0,U.jsx)(R.Z,{title:o("blocklet.router.urlInaccessible"),placement:"top-end",children:(0,U.jsx)("span",{children:i})})})}Be.propTypes={listOnly:Z().bool},Be.defaultProps={listOnly:!1},Me.propTypes={hasPermission:Z().bool,blocklet:Z().object.isRequired,loadingRuntimeInfo:Z().bool,inService:Z().bool.isRequired,listOnly:Z().bool},Me.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,listOnly:!1},Oe.propTypes={domain:Ie.isRequired,children:Z().any.isRequired};const We=r.Z.span(Ae||(Ae=(0,t.Z)(["\n &,\n & > * {\n color: #222;\n font-size: 18px;\n word-break: break-all;\n }\n\n .status {\n margin-left: 8px;\n }\n"])));function Ue(e){let{hasMutatePermission:n,site:i,domain:t,blocklet:o}=e;const r=(0,E.Z)(),{t:a}=(0,c.PE)();return n&&!t.isProtected?(0,U.jsx)(Se,{site:i,domain:t,blocklet:o}):(0,U.jsx)(R.Z,{title:a("blocklet.router.domainLockTooltip"),placement:"top",children:(0,U.jsx)(T.Z,{disabled:!0,size:"large",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0},children:(0,U.jsx)(z.Z,{style:{fill:r.palette.text.disabled}})})})}function He(e){let{siteId:n,domain:i,blocklet:t,hasMutatePermission:r}=e;const s=(0,E.Z)(),{t:l}=(0,c.PE)(),[d,m]=(0,a.useState)(null),u=()=>{m(null)};return(0,U.jsxs)(P.Z,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:1},children:["nft-domain"===i.type&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(D.Z,{onMouseEnter:e=>{m(e.currentTarget)},onMouseLeave:u,style:{cursor:"pointer",fill:s.palette.primary.main}}),(0,U.jsx)(S.ZP,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:Boolean(d),anchorEl:d,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:u,disableRestoreFocus:!0,children:(0,U.jsx)(C.Z,{children:(0,U.jsxs)(w.Z,{style:{display:"flex",flexDirection:"column"},children:[(0,U.jsxs)(p.Z,{component:"div",style:{display:"flex",alignItems:"center"},children:[(0,U.jsx)(D.Z,{style:{fill:s.palette.primary.main}}),(0,U.jsx)(p.Z,{component:"span",style:{marginLeft:"8px",fontSize:"18px",fontWeight:"bolder"},children:l("router.domainAlias.nftDomain")})]}),(0,U.jsxs)(p.Z,{component:"div",style:{display:"flex",marginTop:"12px"},children:[(0,U.jsx)(p.Z,{component:"span",style:{width:"80px",marginRight:"8px"},children:l("common.domain")}),(0,U.jsx)(p.Z,{component:"span",children:i.value})]}),(0,U.jsxs)(p.Z,{component:"div",style:{display:"flex"},children:[(0,U.jsx)(p.Z,{component:"span",style:{width:"80px",marginRight:"8px"},children:"NFT"}),(0,U.jsx)(x.Z,{did:i.nftDid})]})]})})})]}),(0,U.jsx)(_e,{domain:i,filters:["http"]},"".concat(i.value,"-http")),r&&(0,U.jsx)(K,{siteId:n,domain:i.value,domainStatus:i.domainStatus,did:t.meta.did,children:e=>{let{open:n}=e;return(0,U.jsx)(o.Z,{sx:{padding:0},size:"small",onClick:e=>n(e),children:l("router.cert.genLetsEncryptCert.title")})}})]})}var Ve;Ue.propTypes={hasMutatePermission:Z().bool.isRequired,site:Z().object.isRequired,domain:Ie.isRequired,blocklet:Z().object.isRequired},He.propTypes={siteId:Z().string.isRequired,domain:Ie.isRequired,blocklet:Z().object.isRequired,hasMutatePermission:Z().bool.isRequired};const Ke={arcblock:"ArcBlock",ethereum:"Ethereum"};function Qe(){var e,n,i,t,r;const{t:p,locale:j}=(0,c.PE)(),{info:Z,inService:b}=(0,f.h6)(),[D,k]=(0,a.useState)(!1),{blocklet:P}=(0,h.y0)(),{appDid:C,appPid:w,migratedFrom:T=[]}=P,S=null===(e=P.environments.find((e=>"BLOCKLET_APP_CHAIN_TYPE"===e.key)))||void 0===e?void 0:e.value,R=[C?{name:p("blocklet.appId"),value:(0,U.jsx)(x.Z,{did:C,showQrcode:!0})}:null,w?{name:p("blocklet.appPid"),value:(0,U.jsx)(x.Z,{did:w,showQrcode:!0})}:null,(null===T||void 0===T?void 0:T.length)>1?{name:p("blocklet.alsoKnownAs"),value:(0,U.jsxs)("div",{children:[(D?T.slice(1):T.slice(1,2)).map((e=>(0,U.jsx)(x.Z,{did:e.appDid,showQrcode:!0}))),T.length>2&&(0,U.jsx)(o.Z,{style:{marginLeft:"18px"},endIcon:D?(0,U.jsx)(s.Z,{}):(0,U.jsx)(l.Z,{}),onClick:()=>k(!D),children:p(D?"common.collapseAll":"blocklet.router.showAllDIDs")})]})}:null,{name:p("common.name"),value:(0,u.getDisplayName)(P,!0)},{name:p("common.status"),value:(0,U.jsx)(v.Z,{status:P.status,source:P.source,progress:P.progress})},(0,y.ep)(P)?{name:"NFT",value:(0,U.jsx)(x.Z,{external:!0,href:(0,g.E8)(null===P||void 0===P||null===(n=P.controller)||void 0===n?void 0:n.chainHost,null===P||void 0===P||null===(i=P.controller)||void 0===i?void 0:i.nftId,"asset"),did:null===P||void 0===P||null===(t=P.controller)||void 0===t?void 0:t.nftId,showQrcode:!0})}:null,{name:p("blocklet.installedAt"),value:(0,g.B2)(P.installedAt,j)},{name:p("blocklet.overview.accessControl"),value:p("team.whoCanAccess.".concat((0,u.getWhoCanAccess)(P),".title"))},{name:p("common.owner"),value:null!==(r=P.settings)&&void 0!==r&&r.owner?(0,U.jsx)(x.Z,{did:P.settings.owner.did,showQrcode:!0}):"-"},{name:p("blocklet.config.walletType.name"),value:Ke[S||"arcblock"]||S},P.externalSkSource?{name:p("blocklet.skSource"),value:P.externalSkSource}:null].filter(Boolean);b&&R.push({name:p("common.serverDid"),value:(0,U.jsx)(x.Z,{did:Z.did,showQrcode:!0})},{name:p("common.serverVersion"),value:(0,U.jsx)(m.Z,{children:Z.version})});return(0,U.jsxs)(Ye,{component:"div",children:[(0,U.jsx)(Be,{}),(0,U.jsx)("div",{className:"title",children:(0,U.jsx)("span",{children:p("common.basicInfo")})}),(0,U.jsx)("div",{className:"basicInfo",children:(E=R,E.map((e=>(0,U.jsx)(d.Z,{style:{display:"flex",alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>e.name,children:e.value},e.name))))})]});var E}Qe.propTypes={};const Ye=(0,r.Z)(p.Z)(Ve||(Ve=(0,t.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n margin-top: ",";\n margin-bottom: ",";\n\n &.first {\n margin-top: 0;\n }\n }\n"])),(e=>e.theme.spacing(5)),(e=>e.theme.spacing(3)))},35110:(e,n,i)=>{"use strict";i.d(n,{Rw:()=>c,fX:()=>d,sf:()=>m});var t=i(35432),o=i(44543),r=i.n(o),a=i(77277),s=i(32828);const l=(e,n)=>{if(e.type===t.ROUTING_RULE_TYPES.REDIRECT){if(!e.url)return new Error("".concat(n("router.validation.redirectUrlRequired")));if(!e.redirectCode)return new Error("redirect ".concat(n("router.validation.redirectCodeRequired")))}else if(e.type===t.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(n("router.validation.didRequired"));return null},d=(e,n)=>{const i=l(e,n);return i||(e.pathPrefix.length?e.pathPrefix.length>150?new Error(n("router.validation.pathPrefixTooLong",{length:150})):null:new Error(n("router.validation.pathPrefixCannotBeEmpty")))},c=e=>{let{params:n,blocklets:i,blocklet:t,locale:o="en"}=e;if(t){let e=(t.children||[]).find((e=>(0,s.default)(e.meta)&&r()(e.mountPoint,n.pathPrefix)));if("gateway"!==t.meta.group&&"/"===n.pathPrefix&&(e="/"),e)return{zh:"\u6302\u8f7d\u70b9 ".concat(n.pathPrefix," \u5df2\u5b58\u5728\uff0c\u8bf7\u4f7f\u7528\u5176\u4ed6\u6302\u8f7d\u70b9"),en:"The mount point ".concat(n.pathPrefix," already exist, please use another mount point")}[o]}const l=i.find((e=>e.meta.did===n.did));if(!l)return"";const d=l.meta.interfaces.find((e=>"web"===e.type));return d&&d.prefix!==a.BLOCKLET_DYNAMIC_PATH_PREFIX&&n.pathPrefix!==d.prefix?{zh:"\u8be5 blocklet \u53ea\u80fd\u6302\u8f7d\u5728 ".concat(d.prefix),en:"This blocklet can only be mounted on ".concat(d.prefix)}[o]:""},m=e=>{if(!e||"string"!==typeof e)return e;let n=e.trim();try{return n=n.toLowerCase(),n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n}catch(i){return console.error("format domain failed",i),n}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8399],{26362:(e,n,t)=>{t.d(n,{Z:()=>p});var i=t(55898),o=t.n(i),l=t(62681),a=t(72333),r=t(6352),s=t.n(r),c=t(35432),d=t(22324),u=t(64387);var m=t(96266);function p(e){let{blocklet:n,style:t,size:i,ancestors:o,...r}=e;const p=(0,d.h6)(),{logoUrl:h,inService:f}=function(e){var n;let{blocklet:t,ancestors:i=[]}=e;const o=(0,d.h6)(),{inService:l}=o,a="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,u.XN)(null===t||void 0===t?void 0:t.status)?"~":"");let r=l?s()(u.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",a):s()(o.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)r=s()(t.deployedFrom,(0,u.lk)(t.meta.bundleDid,t.meta.logo),a);else{const e=window.env.apiPrefix||"/",n=i.concat(t),o=l?n.slice(1):n;r=s()(e,"/blocklet/logo-bundle".concat(o.map((e=>"/".concat(e.meta.did))).join("")),a)}return{logoUrl:r,inService:l}}({blocklet:n,ancestors:o}),{variant:g}=r,x=f?()=>{}:e=>{e.target.src="".concat(p.imgPrefix,"/blocklet.png")};let v=(0,m.jsx)("img",{src:h,onError:x,alt:n.meta.name,style:{width:i}});return n.meta.logo||(v=(0,m.jsx)(a.Z,{did:n.meta.did||"",responsive:!0})),(0,m.jsx)(l.Z,{variant:g||"square",style:Object.assign({backgroundColor:"transparent",width:i,height:i,borderRadius:10},t),...r,children:v})}p.propTypes={blocklet:o().object.isRequired,style:o().object,size:o().oneOfType([o().number,o().string]),ancestors:o().array},p.defaultProps={style:{},size:40,ancestors:[]}},53777:(e,n,t)=>{t.d(n,{Z:()=>r});var i=t(55898),o=t.n(i),l=t(39948),a=t(96266);function r(e){let{depth:n,className:t}=e;return(0,a.jsx)(l.Z,{ml:Math.max(2*(n-1),0),className:t,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}r.propTypes={depth:o().number,className:o().string},r.defaultProps={depth:1,className:""}},67357:(e,n,t)=>{t.d(n,{Z:()=>d});var i,o=t(71171),l=t(33518),a=t(82790),r=t(96266);function s(e){let{labelProps:n,className:t,style:i,...o}=e;const l={...n,labelPlacement:(null===n||void 0===n?void 0:n.labelPlacement)||"start"};return(0,r.jsx)(c,{className:t,style:i,children:(0,r.jsx)(a.Z,{labelProps:l,...o})})}s.propTypes=a.Z.propTypes,s.defaultProps=a.Z.defaultProps;const c=l.Z.div(i||(i=(0,o.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"])),(e=>{let{theme:n}=e;return n.breakpoints.down("sm")})),d=s},19197:(e,n,t)=>{t.d(n,{Z:()=>Z});var i,o=t(71171),l=t(5057),a=t(55898),r=t.n(a),s=t(6352),c=t.n(s),d=t(33518),u=t(92706),m=t.n(u),p=t(39948),h=t(52277),f=t.n(h),g=t(68420),x=t(96266);const v=(0,l.lazy)((()=>Promise.all([t.e(6547),t.e(5760),t.e(6743),t.e(1697),t.e(1294),t.e(4804)]).then(t.bind(t,84804)).then((e=>({default:e.Uploader}))))),b="/blocklet/logo/upload";function Z(e){let{url:n,height:t,width:i,enabled:o,type:a,did:r,prefix:s,headers:d,onUploaded:u}=e;const{t:m}=(0,g.PE)(),h=(0,l.useRef)(null),Z={cursor:o?"pointer":"default","&::after":{content:'"'.concat(m("common.switch"),'"')}};return(0,x.jsxs)(j,{id:"uploader-".concat(r,"-").concat(a),children:[(0,x.jsx)(v,{ref:h,popup:!0,onUploadFinish:()=>{var e;u(),null===(e=h.current)||void 0===e||e.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:c()(s,b,a,r),disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".gif",".svg"],maxFileSize:10485760,maxNumberOfFiles:1}},tusProps:{headers:d}}),(0,x.jsx)(p.Z,{className:f()("uploader-wrapper",o&&"enabled"),sx:Z,onClick:()=>{var e;null===(e=h.current)||void 0===e||e.open()},children:(0,x.jsx)("img",{alt:"Logo",src:n,style:{height:t,width:i}})})]},"uploader-".concat(r,"-").concat(a))}Z.propTypes={url:r().string.isRequired,type:r().oneOf(["square","rect","favicon"]).isRequired,did:r().string.isRequired,prefix:r().string.isRequired,headers:r().func,onUploaded:r().func,height:r().number,width:r().any,enabled:r().bool},Z.defaultProps={height:80,width:"auto",enabled:!0,headers:()=>({}),onUploaded:m()};const j=d.Z.div(i||(i=(0,o.Z)(["\n .uploader-wrapper {\n display: inline-flex;\n position: relative;\n font-size: 0px;\n &.enabled {\n cursor: pointer;\n }\n &::after {\n display: none;\n }\n &.enabled::after {\n display: block;\n opacity: 0;\n position: absolute;\n bottom: 0;\n background: rgba(0, 0, 0, 0.2);\n left: 0;\n right: 0;\n height: 2.2em;\n color: white;\n text-align: center;\n font-size: 12px;\n line-height: 2em;\n transition: opacity 0.3s ease;\n }\n &:hover::after {\n opacity: 1;\n }\n }\n"])))},1515:(e,n,t)=>{t.r(n),t.d(n,{default:()=>_t});var i,o=t(71171),l=t(5057),a=t(33518),r=t(55898),s=t.n(r),c=t(96181),d=t(6352),u=t.n(d),m=t(35432),p=t(39948),h=t(55402),f=t(82275),g=t(96399),x=t(65688),v=t(37633),b=t(48037),Z=t(92273),j=t(76720),y=t(15849),k=t(68420),C=t(94464),S=t(38242),w=t(26362),E=t(54474),L=t(43681),P=t.n(L),T=t(50482),O=t.n(T),N=t(16147),R=t(29034),_=t(28726),A=t(80578),I=t(77277),B=t(86229),D=t(30629),F=t(44846),z=t(13727),U=t(56184),K=t(67680),W=t(19654),q=t(90067),M=t(39646),G=t(43897),V=t(47020),H=t(49020),Y=t(43449),J=t(37382),Q=t(90651),X=t(96266);function $(e){let{label:n,disabled:t,required:i,initialValue:o,onChange:a,style:r,onSubmit:s,triggers:c,options:d,formatterBeforeSubmit:u,helperText:m,placeholder:h,renderImage:f,renderLabel:g,filterKeys:x,noEmpty:v,...b}=e;const[Z,j]=(0,l.useState)(!1),[y,k]=(0,l.useState)(!1),[C,S]=l.useState(""),[w,E]=(0,l.useState)(o),[L,P]=(0,l.useState)(w),T=(0,l.useMemo)((()=>{if(!d)return{};const e={};return d.forEach((n=>{e[n.code]=n})),e}),[d]),O=Z?(0,X.jsx)(M.Z,{options:d,value:L,onChange:(e,n)=>{if(!Array.isArray(n))return P([]),void a([]);const t=n.filter((e=>T[e]));if(!t.length)return P([]),void a([]);P(t),a(t)},inputValue:C,onInputChange:(e,n)=>{S(n)},PopperComponent:ne,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:()=>{if(!d)return[];if(!C)return d.map((e=>e.code));const e=new RegExp(C.toLowerCase());return d.filter((n=>{for(let i=0;i<x.length;i++){var t;const o=x[i];if(e.test(null===(t=n[o])||void 0===t?void 0:t.toLowerCase()))return!0}return!1})).map((e=>e.code))},getOptionLabel:e=>{var n;return null===(n=T[e])||void 0===n?void 0:n.name},renderInput:e=>(0,X.jsx)(V.Z,{...e,label:"",placeholder:h}),renderOption:(e,n)=>{var t;const i=-1!==L.indexOf(n);return(0,l.createElement)(ee,{component:"li",...e,key:n},f(T[n]||{}),(0,X.jsx)(p.Z,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:i?"700":"normal"},children:g(n,T[n])||(null===(t=T[n])||void 0===t?void 0:t.name)}),(0,X.jsx)(p.Z,{component:z.default,sx:{opacity:.5,width:18,height:18},style:{visibility:i?"visible":"hidden"}}))},...b}):(0,X.jsx)(p.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:L.filter((e=>d.some((n=>n.code===e)))).map((e=>(0,X.jsx)(W.Z,{label:d.find((n=>n.code===e)).name,style:{marginRight:8},size:"small"},e)))});return(0,X.jsx)(J.Z,{className:"form",style:r,children:(0,X.jsxs)(p.Z,{className:"form-item",children:[(0,X.jsxs)(p.Z,{className:"form-item-label",children:[n,i&&(0,X.jsx)(Y.Z,{})]}),(0,X.jsxs)(p.Z,{className:"form-item-body",children:[(0,X.jsx)(p.Z,{className:"form-item-input",children:O}),(0,X.jsx)(p.Z,{className:"form-item-action",children:Z?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(K.Z,{"data-cy":"schema-form-item-confirm",onClick:async()=>{k(!0);try{!1===await s("function"===typeof u?u(L):L)?P(w):v&&!L.length?(P(o),E(o)):(P(L),E(L))}catch(e){P(w)}finally{k(!1),j(!1)}},disabled:t||y,size:"large",children:y?(0,X.jsx)(F.Z,{size:24}):(0,X.jsx)(U.Z,{})}),(0,X.jsx)(K.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{P(w),j(!1)},disabled:t||y,size:"large",children:(0,X.jsx)(z.default,{})})]}):(0,X.jsx)(Q.Z,{triggers:c,onEnterEdit:()=>j(!0),disabled:t})})]}),Z&&m&&(0,X.jsx)(q.Z,{children:m})]})})}$.propTypes={style:s().object,onSubmit:s().func,onChange:s().func,label:s().string,initialValue:s().string,required:s().bool,disabled:s().bool,triggers:s().array,options:s().array,helperText:s().string,formatterBeforeSubmit:s().func,placeholder:s().string,renderImage:s().func,filterKeys:s().arrayOf(s().string),noEmpty:s().bool,renderLabel:s().func},$.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:e=>e.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(e,n)=>"",noEmpty:!1};const ee=a.Z.div(i||(i=(0,o.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n font-size: 1.1em;\n"]))),ne=(0,a.Z)(H.Z)((()=>({["& .".concat(G.Z.paper)]:{boxShadow:"0px 8px 12px rgba(92, 92, 92, 0.04), 0px -10px 12px rgba(92, 92, 92, 0.04)",borderRadius:"6px",width:"100%",border:"1px solid rgba(0, 0, 0, 0.12)",color:"inherit",fontSize:13,position:"absolute",left:0,top:0},["& .".concat(G.Z.listbox)]:{padding:0}})));var te,ie=t(22324),oe=t(64387),le=t(78903),ae=t(73881),re=t(69058),se=t(31853),ce=t(88577),de=t(10032),ue=t(48208),me=t(33650);function pe(e){let{initialValue:n,onChange:t,disabled:i,loading:o}=e;const{t:l}=(0,k.PE)(),{api:a}=(0,ue.T)(),{blocklet:r}=(0,me.y0)(),[s,c]=(0,se.Z)({newAppSk:"",isConnectOpen:!1}),d=()=>c({isConnectOpen:!1}),u=r.structVersion===m.APP_STRUCT_VERSION?[{key:"rotate-with-did-wallet",title:"Migrate with DID Wallet",handler:()=>{(0,oe.An)(r.status)?B.Z.error(l("blocklet.error.isRunning")):(0,S.isInProgress)(r.status)?B.Z.error(l("blocklet.error.isInProgress")):c({isConnectOpen:!0})}}]:[];return[(0,X.jsx)(D.Z,{disabled:i,loading:o,initialValue:n,onSubmit:e=>(c({newAppSk:e}),!1),triggers:u,secure:!0}),s.newAppSk&&(0,X.jsx)(de.Z,{title:l("blocklet.config.appSkTitle"),description:(0,X.jsxs)(p.Z,{children:[(0,X.jsx)(p.Z,{children:l("blocklet.config.appSkChangeTip")}),(0,X.jsx)(p.Z,{fontWeight:"bold",mt:2,children:l("blocklet.config.appDidChangeTip")}),(0,X.jsxs)(he,{children:[(0,X.jsx)("li",{children:l("blocklet.config.appDidChangeTipL1")}),(0,X.jsx)("li",{children:l("blocklet.config.appDidChangeTipL2")})]})]}),confirm:l("confirm"),cancel:l("cancel"),onConfirm:()=>(async e=>{try{await t(e)}finally{c({newAppSk:""})}})(s.newAppSk),onCancel:()=>c({newAppSk:""})}),(0,X.jsx)(ce.Z,{popup:!0,open:s.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:a.get,checkTimeout:3e5,onSuccess:d,extraParams:{appDid:r.appDid},messages:{title:l("setup.keyPair.title"),scan:l("setup.keyPair.scan"),confirm:l("setup.keyPair.confirm"),success:l("setup.keyPair.success")},onClose:d})]}pe.propTypes={initialValue:s().string,onChange:s().func,disabled:s().bool,loading:s().bool},pe.defaultProps={initialValue:"default",onChange:()=>{},disabled:!1,loading:!1};const he=(0,a.Z)("ul")(te||(te=(0,o.Z)(["\n padding-left: 16px;\n li {\n margin-top: 8px;\n list-style: disk;\n font-weight: bold;\n }\n"])));var fe,ge=t(13128),xe=t(55372),ve=t(11750),be=t(88574),Ze=t(26174),je=t(88092),ye=t(69561),ke=t(84177);function Ce(e){let{onCancel:n,onSuccess:t,onError:i}=e;const{api:o}=(0,l.useContext)(ue.B),[a,r]=(0,l.useState)(!1),{t:s,locale:c}=(0,k.PE)(),[d,u]=(0,l.useState)(""),[m,h]=(0,l.useState)(!1),[f,g]=(0,l.useState)(0),[x,v]=(0,l.useState)(""),{endpoint:b}=(0,ke.DJ)(),[Z,j]=(0,l.useState)(!1),y=e=>{u(null),r(!0);try{v(e.result),g(S.length-1)}catch(n){const e=(0,oe.Z)(n);u(e),i(n)}finally{r(!1)}},C=()=>{h(!1),g(0)},S=[{body:(0,X.jsxs)(p.Z,{children:[(0,X.jsx)(ve.Z,{children:s("team.transferApp.transferDialog.tips.progress")}),(0,X.jsx)(ve.Z,{mt:3,mb:2,children:s("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:s("common.cancel"),confirm:s("team.transferApp.transferDialog.createTransferLink"),onCancel:n,onConfirm:()=>{h(!0),g(1)}},{body:()=>(0,X.jsx)(ce.Z,{action:"transfer-app-owner",open:m,locale:c,checkFn:o.get,onClose:C,onSuccess:y,checkTimeout:3e5,extraParams:{},messages:{title:s("team.transferApp.connectDialog.title"),scan:s("team.transferApp.connectDialog.scan"),confirm:s("team.transferApp.connectDialog.confirm"),success:s("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const e=(0,oe.VP)({transferId:x.transferId,endpoint:b});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(p.Z,{component:Se,dangerouslySetInnerHTML:{__html:s("team.transferApp.transferDialog.createSuccessTip1")}}),(0,X.jsx)(p.Z,{component:Se,mt:2,children:(0,X.jsx)(Se,{children:s("team.transferApp.transferDialog.createSuccessTip3")})}),(0,X.jsxs)(p.Z,{children:[(0,X.jsx)(p.Z,{component:Se,mt:2,children:(0,X.jsx)(Se,{children:s("team.transferApp.transferDialog.createSuccessTip2",{expireDate:(0,oe.B2)(x.expireDate,c)})})}),(0,X.jsx)(p.Z,{my:1,children:(0,X.jsx)(ye.Z,{children:e})})]}),(0,X.jsx)("div",{children:(0,X.jsx)(Ze.Z,{value:"end",control:(0,X.jsx)(je.Z,{checked:Z,onChange:e=>j(e.target.checked)}),label:s("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:s("common.confirm"),onConfirm:t}],w=S[f];return(0,X.jsxs)(ge.ZP,{title:(0,X.jsx)(Se,{className:"title",children:s("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,X.jsxs)(X.Fragment,{children:[w.cancel&&(0,X.jsx)(_.Z,{onClick:w.onCancel,color:"inherit",children:w.cancel}),(0,X.jsxs)(_.Z,{onClick:w.onConfirm,color:"error",disabled:a||f===S.length-1&&!Z,variant:"contained",autoFocus:!0,children:[a&&(0,X.jsx)(F.Z,{size:16}),w.confirm]})]}),children:[(0,X.jsx)(xe.Z,{component:"div",children:"function"===typeof w.body?w.body():w.body}),!!d&&(0,X.jsx)(be.Z,{type:"error",variant:"icon",children:d})]})}Ce.propTypes={onCancel:s().func.isRequired,onSuccess:s().func.isRequired,onError:s().func},Ce.defaultProps={onError:()=>{}};const Se=a.Z.div(fe||(fe=(0,o.Z)(["\n font-size: 16px;\n font-weight: bold;\n &.title {\n font-size: 20px;\n }\n"])));var we,Ee=t(74655),Le=t(19197);const Pe=Object.keys(I.SUPPORTED_LANGUAGES).map((e=>({code:e,name:I.SUPPORTED_LANGUAGES[e].nativeName,enName:I.SUPPORTED_LANGUAGES[e].name}))),Te=["name","enName","code"];function Oe(e){var n;let{blocklet:t,onUpdate:i,hasPermission:o,...a}=e;const{api:r,inService:s,prefix:c,getSessionInHeader:d,ws:{useSubscription:u}}=(0,ie.h6)(),{t:h}=(0,l.useContext)(k.RD),[f,g]=(0,l.useState)(""),[x,v]=(0,l.useState)(""),[b,Z]=(0,l.useState)(!1),j=(0,S.getWhoCanAccess)(t),y=null===t||void 0===t||null===(n=t.settings)||void 0===n?void 0:n.publicToStore,C=x||!o,{logoUrl:w,rectLogoUrl:E,faviconUrl:L}=(0,Ee.Z)({blocklet:t}),{did:T}=t.meta,{site:F}=t,z=P()(t.meta,"capabilities.clusterMode",!1);if(u(m.EVENTS.NODE_RUNTIME_INFO,(e=>{z&&g(P()(e,"cpu.physicalCores",""))})),(0,oe.wS)(t.status))return null;const U=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE)),K=!U||"yes"===U.value,W=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES)),q=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL)),M=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_TENANT_MODE)),G=(null===M||void 0===M?void 0:M.value)||I.BLOCKLET_TENANT_MODES.SINGLE,V=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER)),H=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR)),Y=[{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:h("blocklet.config.name"),value:t.environments.find((e=>"BLOCKLET_APP_NAME"===e.key)).value},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:h("blocklet.config.description"),value:t.environments.find((e=>"BLOCKLET_APP_DESCRIPTION"===e.key)).value},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,description:h("blocklet.config.appUrl"),value:q?q.value:""},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:h("blocklet.config.copyrightOwner"),value:V?V.value:""},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:h("blocklet.config.copyrightYear"),value:H?H.value:""}];if(z){const e=t.configs.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE)),n=e?e.value:f;Y.push({key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,description:h("blocklet.config.clusterSize"),value:n,cpuCores:f})}const J=async(e,n)=>{if(e===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const e=(0,oe.I)({value:n,cpuCores:f});if(e)return void B.Z.error(e)}const o=[{key:e,value:n}];try{v(!0);const{blocklet:e}=await r.configBlocklet({input:{did:t.meta.did,configs:o}});i(e)}catch(l){B.Z.error(l.message)}finally{v(!1)}},Q=(e,n)=>async o=>{if(!x){v(!0);try{const{checked:l}=o.target,{blocklet:a}=await r.configBlocklet({input:{did:t.meta.did,configs:[{key:I.BLOCKLET_CONFIGURABLE_KEY[e],value:n(l)}]}});i(a)}catch(l){B.Z.error(l.message)}finally{v(!1)}}},ee=Q("BLOCKLET_DELETABLE",(e=>e?"no":"yes")),ne=Q("BLOCKLET_APP_TENANT_MODE",(e=>e?I.BLOCKLET_TENANT_MODES.MULTIPLE:I.BLOCKLET_TENANT_MODES.SINGLE));return(0,X.jsxs)(Ae,{...a,children:[Y.map((e=>(0,X.jsxs)(p.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(p.Z,{className:"config-label",fontSize:14,mb:0,children:e.description}),(0,X.jsx)(D.Z,{style:{marginTop:0},disabled:C,loading:x,initialValue:e.value,onSubmit:n=>J(e.key,n)})]}))),(0,X.jsx)(p.Z,{className:"config-form",component:R.Z,my:3}),(0,X.jsx)(p.Z,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:h("blocklet.config.logoSquare")}),(0,X.jsx)(Le.Z,{did:t.meta.did,height:80,width:80,type:"square",prefix:c,url:w,enabled:o,headers:d}),(0,X.jsx)(p.Z,{className:"config-label",fontSize:14,mt:4,children:h("blocklet.config.logoRect")}),(0,X.jsx)(p.Z,{mb:1.5,className:"config-desc",children:h("blocklet.config.logoRectDesc")}),(0,X.jsx)(Le.Z,{did:t.meta.did,height:80,type:"rect",prefix:c,url:E,enabled:o,headers:d}),(0,X.jsx)(p.Z,{className:"config-label",fontSize:14,mt:4,children:h("blocklet.config.logoFavicon")}),(0,X.jsx)(p.Z,{mb:1.5,className:"config-desc",children:h("blocklet.config.logoFaviconDesc")}),(0,X.jsx)(Le.Z,{did:t.meta.did,height:25,width:25,type:"favicon",prefix:c,url:L,enabled:o,headers:d}),(0,X.jsx)(p.Z,{className:"config-form",children:"all"===j&&"registry"===t.source&&(0,X.jsxs)(p.Z,{className:"config-item",children:[(0,X.jsxs)(p.Z,{className:"config-label",children:[h("blocklet.config.access.publicToStore"),(0,X.jsx)(p.Z,{className:"config-desc",children:h("blocklet.config.access.publicInstanceTip")})]}),(0,X.jsx)(N.Z,{disabled:C,checked:y,defaultChecked:!0,onChange:async e=>{if(!x){v(!0);try{const{checked:n}=e.target,{blocklet:o}=await r.configPublicToStore({input:{did:t.meta.did,publicToStore:n}});i(o)}catch(n){B.Z.error(n.message)}finally{v(!1)}}}})]})}),(0,X.jsx)(p.Z,{className:"config-form",component:R.Z,my:3}),(0,X.jsxs)(p.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(p.Z,{className:"config-label",fontSize:14,mb:0,children:h("blocklet.config.languages")}),(0,X.jsx)($,{style:{marginTop:0},disabled:C,loading:x,options:Pe,noEmpty:!0,initialValue:W?W.value.split(","):["en","zh"],onSubmit:e=>J("BLOCKLET_APP_LANGUAGES",e),helperText:h("blocklet.config.selectLanguagesTip"),placeholder:h("blocklet.config.languagesSearch"),filterKeys:Te,renderLabel:(e,n)=>n.name===n.enName?"".concat(n.name," (").concat(e.toUpperCase(),")"):"".concat(n.name,", ").concat(n.enName," (").concat(e.toUpperCase(),")")})]}),(0,X.jsx)(p.Z,{className:"config-form",component:R.Z,my:3}),(0,X.jsx)(p.Z,{className:"config-form",mt:2,children:(0,X.jsx)(p.Z,{className:"config-label",mb:0,children:h("common.security")})}),(0,X.jsxs)(p.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(p.Z,{className:"config-label",fontSize:14,mb:0,children:h("router.domainSecurity.cors.title")}),(0,X.jsx)(p.Z,{mb:1.5,className:"config-desc",children:h("router.domainSecurity.cors.description",{name:"the blocklet"})}),(0,X.jsx)(D.Z,{style:{marginTop:0},disabled:C,loading:x,initialValue:(F.corsAllowedOrigins||[]).join(", "),onSubmit:async e=>{const n=F.corsAllowedOrigins||[],i=e.split(",").map((e=>e.trim())).filter(Boolean);if(O()(n,i))return!1;try{v(!0);const e=i.length?i:["__none__"];await r.updateRoutingSite({input:{id:F.id,corsAllowedOrigins:e,teamDid:t.meta.did}}),v(!1)}catch(o){return B.Z.error(o.message),v(!1),!1}return!0}})]}),(0,X.jsx)(p.Z,{className:"config-form",component:R.Z,my:3}),(0,X.jsx)(p.Z,{mb:2,className:"config-label",fontSize:20,children:h("blocklet.config.dangerZone")}),(0,X.jsxs)(p.Z,{px:2,py:1,sx:{border:"1px solid red",borderRadius:2},children:[(0,X.jsx)(p.Z,{className:"config-form",children:!s&&(0,X.jsxs)(p.Z,{className:"config-item",children:[(0,X.jsxs)(p.Z,{className:"config-label",children:[h("blocklet.config.deletable.name"),(0,X.jsx)(p.Z,{className:"config-desc",children:h(K?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable")})]}),(0,X.jsx)(N.Z,{disabled:C,checked:!K,defaultChecked:!0,onChange:ee})]})}),(0,X.jsxs)(p.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(p.Z,{className:"config-label",fontSize:14,mb:0,children:h("blocklet.config.sk")}),(0,X.jsx)(pe,{disabled:C,loading:x,initialValue:t.environments.find((e=>"BLOCKLET_APP_SK"===e.key)).value,onChange:async e=>{if(!x){v(!0);try{const{blocklet:n}=await r.configBlocklet({input:{did:t.meta.did,configs:[{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SK,value:e}]}});i(n)}catch(n){B.Z.error(n.message)}finally{v(!1)}}}})]}),s&&(0,X.jsx)(ae.Z,{role:"owner",children:e=>(e||le.C)&&(0,X.jsxs)(p.Z,{className:"config-form",mt:2,children:[(0,X.jsxs)(p.Z,{className:"config-item",children:[(0,X.jsx)(p.Z,{className:"config-label",mb:0,children:h("team.transferApp.name")}),(0,X.jsxs)(_.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"transfer-app",onClick:()=>Z(!0),children:[(0,X.jsx)(A.Z,{style:{fontSize:"1.3em",marginRight:4}}),h("team.transferApp.name")]})]}),b&&(0,X.jsx)(Ce,{onCancel:()=>Z(!1),onSuccess:()=>Z(!1)})]})}),(0,X.jsx)(p.Z,{className:"config-form",mt:2,children:(0,X.jsxs)(p.Z,{className:"config-item",children:[(0,X.jsxs)(p.Z,{className:"config-label",children:[h("blocklet.config.clearCache.name"),(0,X.jsx)(p.Z,{className:"config-desc",children:h("blocklet.config.clearCache.purpose")})]}),(0,X.jsx)(re.Z,{teamDid:T})]})}),(0,X.jsx)(p.Z,{className:"config-form",children:(0,X.jsxs)(p.Z,{className:"config-item",children:[(0,X.jsxs)(p.Z,{className:"config-label",children:[h("blocklet.config.tenantMode.name"),(0,X.jsx)(p.Z,{className:"config-desc",children:h("blocklet.config.tenantMode.".concat(G))})]}),(0,X.jsx)(N.Z,{disabled:C,checked:G===I.BLOCKLET_TENANT_MODES.MULTIPLE,onChange:ne})]})})]})]})}const Ne=(0,ae.V)(Oe,"mutate_blocklets"),Re=(0,ae.V)(Oe,"",oe.Wf);function _e(e){const{inService:n}=(0,ie.h6)();return n?(0,X.jsx)(Re,{...e}):(0,X.jsx)(Ne,{...e})}Oe.propTypes={blocklet:s().object.isRequired,onUpdate:s().func,hasPermission:s().bool},Oe.defaultProps={onUpdate:()=>{},hasPermission:!1};const Ae=a.Z.div(we||(we=(0,o.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 }\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"])),(e=>e.theme.breakpoints.down("md")));var Ie=t(25710),Be=t(93066),De=t(80576),Fe=t(8708),ze=t.n(Fe),Ue=t(12673),Ke=t(99360),We=t(80506),qe=t(766),Me=t.n(qe),Ge=t(24529),Ve=t.n(Ge),He=t(16727),Ye=t.n(He),Je=t(92706),Qe=t.n(Je);const Xe=(0,l.forwardRef)(((e,n)=>{const{t:t}=(0,l.useContext)(k.RD),i=(0,Ue.Z)({show:!1,title:"",content:"",onConfirm:Qe(),onCancel:Qe(),loading:!1}),o=(0,Ke.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.show=!0,i.title=e.title,i.content=e.content,i.onConfirm=e.onConfirm||Qe(),i.onCancel=e.onCancel||Qe(),i.loading=!1})),a=(0,Ke.Z)((()=>{i.title="",i.content="",i.onConfirm=Qe(),i.onCancel=Qe()})),r=(0,Ke.Z)((()=>{i.show=!1,setTimeout((()=>{a()}),300)})),s=(0,Ke.Z)((()=>{r(),null===i||void 0===i||i.onCancel()}),[]),c=(0,Ke.Z)((async()=>{i.loading=!0;try{await(null===i||void 0===i?void 0:i.onConfirm(r))}finally{i.loading=!1}}),[]);return(0,l.useImperativeHandle)(n,(()=>({open:o,close:r})),[o,r]),(0,X.jsx)(ge.I4,{open:i.show,title:i.title,onConfirm:c,onCancel:s,confirmButton:{text:t("common.confirm"),props:{variant:"contained",color:"primary",loading:i.loading}},cancelButton:{text:t("common.cancel"),props:{variant:"outlined",color:"primary"}},children:i.content instanceof Function?i.content():i.content})}));function $e(){const e=(0,l.useRef)(null),n=(0,Ke.Z)((function(){for(var n,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];null===(n=e.current)||void 0===n||n.open(...i)})),t=(0,Ke.Z)((function(){for(var n,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];null===(n=e.current)||void 0===n||n.close(...i)})),i={open:n,close:t};return{confirmHolder:(0,X.jsx)(Xe,{ref:e}),confirmApi:i}}const en={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:""};const nn=function(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,me.y0)(),{t:o}=(0,k.PE)(),{confirmApi:l,confirmHolder:a}=$e(),r=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,s=Object.assign({...en},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.notification)||void 0===n?void 0:n.email)||{}),{handleSubmit:c,control:d,formState:u,watch:m,reset:h}=(0,We.cI)({defaultValues:ze()(s,Object.keys(en))}),f=(0,Ue.Z)({testReceiver:"",testReceiverError:""}),g=m("enabled"),x=(0,Ke.Z)((async function(e,n){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];try{var l;const{blocklet:n}=await t.configNotification({input:{did:r,notification:JSON.stringify({email:e})}}),a=Object.assign({...en},(null===n||void 0===n||null===(l=n.settings)||void 0===l||null===(l=l.notification)||void 0===l?void 0:l.email)||{});h(a),i&&B.Z.success(o("oauth.saveSuccess"))}catch(a){if(!i)throw a;B.Z.error(a.message||o("oauth.saveFailed"))}})),v=(0,Ke.Z)((async(e,n,i)=>{try{u.isDirty&&await x(e,n,!1),await t.sendEmail({input:{did:r,receiver:i,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification"})}}),B.Z.success(o("notification.email.testSuccess"))}catch(l){B.Z.error(l.message||o("notification.email.testfailed"))}})),b=(0,Ke.Z)(((e,n)=>{f.testReceiver="",f.testReceiverError="",l.open({title:o("notification.email.testSendEmail"),content:()=>(0,X.jsx)(p.Z,{sx:{width:"300px"},children:(0,X.jsx)(V.Z,{fullWidth:!0,name:"testReceiver",label:o("notification.email.inputTestReceiver"),value:f.testReceiver,onChange:e=>{f.testReceiver=e.target.value},error:!!f.testReceiverError,helperText:f.testReceiverError||"\u3000"})}),async onConfirm(t){var i;const l=null===(i=f.testReceiver)||void 0===i?void 0:i.trim();l?Me()(l)?(f.testReceiverError="",await v(e,n,l),t()):f.testReceiverError=o("notification.email.receiverInvalid"):f.testReceiverError=o("notification.email.receiverRequired")}})})),Z=(0,Ke.Z)((e=>{const n=null===e||void 0===e?void 0:e.trim();return n?!!Me()(n)||o("notification.email.fromInvalid"):o("notification.email.fromRequired")})),j=(0,Ke.Z)((e=>{const n=null===e||void 0===e?void 0:e.trim();return n?!!Ve()(n,{require_host:!1,protocols:[]})||o("notification.email.hostInvalid"):o("notification.email.hostRequired")})),y=(0,Ke.Z)((e=>e?!!Ye()(e)||o("notification.email.portInvalid"):o("notification.email.portRequired"))),C=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("notification.email.userRequired"))),S=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("notification.email.passwordRequired"))),w=(0,Ke.Z)((()=>!0));return(0,X.jsxs)(p.Z,{children:[(0,X.jsxs)("form",{onSubmit:c(x),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:d,render:e=>{let{field:n}=e;return(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(N.Z,{checked:n.value,...n}),label:o("notification.email.enable"),sx:{marginBottom:"8px"}})}}),(0,X.jsx)(We.Qr,{name:"from",control:d,rules:{validate:g?Z:w},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,label:o("notification.email.from"),error:!!u.errors[t.name],helperText:(null===(n=u.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!g})})}}),(0,X.jsx)(We.Qr,{name:"host",control:d,rules:{validate:g?j:w},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,error:!!u.errors[t.name],label:o("notification.email.host"),helperText:(null===(n=u.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!g})})}}),(0,X.jsx)(We.Qr,{name:"port",control:d,rules:{validate:g?y:w},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,type:"number",error:!!u.errors[t.name],label:o("notification.email.port"),helperText:(null===(n=u.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!g})})}}),(0,X.jsx)(We.Qr,{name:"user",control:d,rules:{validate:g?C:w},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,error:!!u.errors[t.name],label:o("notification.email.user"),helperText:(null===(n=u.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!g})})}}),(0,X.jsx)(We.Qr,{name:"password",control:d,rules:{validate:g?S:w},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,type:"password",error:!!u.errors[t.name],label:o("notification.email.password"),helperText:(null===(n=u.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!g})})}}),(0,X.jsx)(We.Qr,{name:"secure",control:d,rules:{validate:w},render:e=>{let{field:n}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(N.Z,{checked:n.value,...n,disabled:!g}),label:o("notification.email.secure"),style:{marginBottom:16}})})}}),(0,X.jsx)(_.Z,{variant:"outlined",color:"warning",onClick:c(b),sx:{mr:2},disabled:!g,children:o("oauth.runTest")}),(0,X.jsx)(_.Z,{type:"submit",variant:"contained",disabled:!u.isDirty,children:o("oauth.save")})]}),a]})},tn=[{label:(0,X.jsx)(p.Z,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:(0,X.jsx)(p.Z,{textAlign:"center",width:"100%",children:"More"}),value:"more"}];const on=function(){const[e,n]=(0,l.useState)(tn[0].value),{t:t}=(0,l.useContext)(k.RD),i=(0,Be.Z)((()=>({email:(0,X.jsx)(nn,{}),more:(0,X.jsx)(p.Z,{children:(0,X.jsx)(Ie.Z,{children:t("notification.comingSoon")})})})),[t]);return(0,X.jsxs)(p.Z,{children:[(0,X.jsx)(C.Z,{tabs:tn,current:e,onChange:n}),(0,X.jsx)(p.Z,{marginTop:"10px",children:i[e]})]})};var ln=t(96366),an=t(75239),rn=t(48342),sn=t(94552),cn=t(24558),dn=t(53777),un=t(74490),mn=t(76667),pn=t(70648),hn=t(44067),fn=t(7664),gn=t(44123),xn=t(53906);const vn=[{value:m.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:m.WHO_CAN_ACCESS.INVITED,icon:gn.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:m.WHO_CAN_ACCESS.OWNER,icon:fn.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"}}];var bn,Zn;const jn="roles",yn=[...vn,{value:jn,icon:pn.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"}}],kn=(e,n)=>{if(e&&e.startsWith(m.WHO_CAN_ACCESS_PREFIX_ROLES)){const t=(0,S.getRolesFromAuthConfig)({whoCanAccess:e}),i=n.filter((e=>t.includes(e.name)));return{access:jn,roles:i}}return{access:e,roles:[]}},Cn=function(e,n){let{roles:t=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=(e.configs||[]).find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.COMPONENT_ACCESS_WHO));if(i)return kn(i.value,t);if(n&&P()(n,"settings.whoCanAccess")&&P()(n,"settings.whoCanAccess")!==m.WHO_CAN_ACCESS.ALL)return kn(P()(n,"settings.whoCanAccess"),t);const o=(0,S.findServiceFromMeta)(e.meta,m.NODE_SERVICES.AUTH);return P()(o,"config.whoCanAccess")?kn(o.config.whoCanAccess,t):{access:m.WHO_CAN_ACCESS.ALL,roles:[]}};function Sn(e){let{blocklet:n,ancestors:t,children:i}=e;const o=(0,ln.Z)(),[a,r]=(0,l.useState)(""),{t:s,locale:c}=(0,k.PE)(),{api:d}=(0,ie.h6)(),{roles:u}=(0,ke.DJ)(),[h,f]=(0,l.useState)(""),g=t[0]||n,{access:x,roles:v}=Cn(n,g,{roles:u}),[b,Z]=(0,l.useState)(x),[j,y]=(0,l.useState)(v),C=[...t.map((e=>e.meta.did)),n.meta.did],w={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:o.palette.text.secondary},E=t.concat(n).map((e=>(0,S.getDisplayName)(e,!0))).join(" / ");if((0,oe.wS)(n.status))return null;if("unknown"===n.status&&(0,oe.wS)(n.status))return null;const L=()=>{r(!1)},P=e=>{e.stopPropagation(),r(!0)},T=h||b===jn&&!j.length;return["function"===typeof i?i({open:P}):(0,X.jsx)(K.Z,{onClick:P,"data-cy":"action-config-component",children:(0,X.jsx)(mn.default,{})}),a&&(0,X.jsxs)(wn,{open:!0,fullWidth:!0,title:E,onClose:L,PaperProps:{style:{minHeight:"auto"}},actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(_.Z,{onClick:L,color:"inherit","data-cy":"config-access-cancel",children:s("common.cancel")}),(0,X.jsxs)(_.Z,{onClick:async()=>{if(!h){f(!0);try{let e=b;e===jn&&(e="".concat(m.WHO_CAN_ACCESS_PREFIX_ROLES).concat(j.map((e=>e.name)).join(","))),await d.updateWhoCanAccess({input:{did:C,whoCanAccess:e}}),B.Z.success(s("blocklet.config.access.updatedTip")),L(),f(!1)}catch(e){f(!1),B.Z.error((0,oe.Z)(e))}}},color:"primary",disabled:T,variant:"contained",autoFocus:!0,"data-cy":"config-access-confirm",children:[h&&(0,X.jsx)(F.Z,{size:16}),s("common.confirm")]})]}),children:[(0,X.jsx)(p.Z,{mt:4,mb:3,children:(0,X.jsx)(V.Z,{label:s("blocklet.config.access.description"),select:!0,fullWidth:!0,value:b,onChange:e=>{const{value:n}=e.target;Z(n)},"data-cy":"config-access-select",SelectProps:{renderValue:e=>{const n=yn.find((n=>n.value===e));return n?(0,X.jsxs)(p.Z,{children:[(0,X.jsx)(n.icon,{style:w}),n.title[c]]}):null}},children:yn.map((e=>(0,X.jsxs)(En,{value:e.value,sx:{display:"block"},"data-cy":"config-access-opt-".concat(e.value),children:[(0,X.jsxs)(p.Z,{display:"flex",alignItems:"center",children:[(0,X.jsx)(e.icon,{style:w}),(0,X.jsx)(p.Z,{children:e.title[c]})]}),(0,X.jsx)(p.Z,{children:(0,X.jsx)(p.Z,{className:"tip",children:e.description[c]})})]})))})}),b===jn&&(0,X.jsx)(p.Z,{mt:4,mb:3,children:(0,X.jsx)(V.Z,{label:s("blocklet.config.access.description"),select:!0,fullWidth:!0,value:j.map((e=>e.name)),onChange:e=>{y(u.filter((n=>(e.target.value||[]).includes(n.name))))},SelectProps:{multiple:!0,renderValue:e=>(0,X.jsx)(p.Z,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:e.map((e=>{const n=u.find((n=>n.name===e));return(0,X.jsx)(W.Z,{label:n.title},n.text)}))})},children:u.map((e=>{let{name:n,title:t}=e;return(0,X.jsxs)(un.Z,{value:n,children:[(0,X.jsx)(je.Z,{checked:j.some((e=>e.name===n))}),(0,X.jsx)(hn.Z,{primary:t})]},n)}))})})]})]}Sn.propTypes={blocklet:s().object.isRequired,ancestors:s().array,children:s().any},Sn.defaultProps={ancestors:[],children:null};const wn=(0,a.Z)(ge.ZP)(bn||(bn=(0,o.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"]))),En=(0,a.Z)(un.Z)(Zn||(Zn=(0,o.Z)(["\n .tip {\n font-size: 12px;\n color: ",";\n }\n"])),(e=>e.theme.palette.text.secondary));var Ln;function Pn(e){var n;let{blocklet:t,ancestors:i,depth:o}=e;const a=(0,ln.Z)(),{t:r,locale:s}=(0,k.PE)(),{roles:c}=(0,ke.DJ)(),[d,u]=(0,l.useState)(!0),{recommendedDomain:m}=(0,me.y0)(),h=i[0]||t,f="/".concat(i.map((e=>e.mountPoint||"/")).join("/"),"/").concat(t.mountPoint||"/").replace(/\/+/g,"/"),g=(0,oe.vH)({blocklet:h,domain:{value:m},mountPoint:f,params:(0,oe.f0)(h,s)}),x={fill:a.palette.text.secondary},v=o>0&&t.children.length>0,b=(0,X.jsx)(K.Z,{size:"small",children:d?(0,X.jsx)(j.Z,{fontSize:"inherit"}):(0,X.jsx)(Z.default,{fontSize:"inherit"})}),{access:y,roles:C}=Cn(t,h,{roles:c});let E;if("roles"!==y)E=vn.find((e=>e.value===y))||vn[2];else{const e=C.map((e=>e.title)).join("/");E={title:{zh:"\u53ea\u6709 ".concat(e," \u53ef\u4ee5\u8bbf\u95ee"),en:"Only ".concat(e," can access")}}}return[(o>0||"gateway"!==t.meta.group)&&(0,X.jsxs)(p.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,X.jsxs)(p.Z,{pl:Math.max(2*(o-1),0),width:{xs:300,md:400},display:"flex",alignItems:"center",style:{cursor:v?"pointer":"cursor"},onClick:()=>v&&u(!d),children:[v?b:(0,X.jsx)(p.Z,{width:28}),(0,X.jsx)(w.Z,{blocklet:t,ancestors:i}),(0,X.jsxs)(p.Z,{ml:"16px",children:[(0,X.jsx)(p.Z,{style:{color:"#222",fontSize:18},children:(0,S.getDisplayName)(t,!0)}),(0,X.jsx)(p.Z,{display:"flex",alignItems:"center",children:(0,X.jsx)(p.Z,{color:"text.secondary",children:E.title[s]})})]})]},t),(0,X.jsxs)(p.Z,{children:[(0,X.jsx)(an.Z,{title:r("common.visit"),children:(0,X.jsx)("a",{target:"_blank",href:g,rel:"noopener noreferrer",title:g,children:(0,X.jsx)(K.Z,{children:(0,X.jsx)(sn.Z,{})})})}),(0,X.jsx)(Sn,{blocklet:t,ancestors:i,children:e=>{let{open:n}=e;return(0,X.jsx)(an.Z,{title:r("common.edit"),children:(0,X.jsx)(K.Z,{onClick:n,"data-cy":"btn-edit-".concat(t.meta.did),children:(0,X.jsx)(cn.Z,{style:x})})})}})]},"actions")]},"group-not-gateway-box"),(0,X.jsx)(dn.Z,{depth:o},"line"),null!==(n=t.children)&&void 0!==n&&n.length?(0,X.jsx)(rn.Z,{in:d,children:t.children.map((e=>(0,X.jsx)(Pn,{blocklet:e,ancestors:[...i,t],depth:o+1},"".concat(o+1,"-").concat(e.meta.did))))},"blocklet-collapse"):null]}function Tn(){const{t:e}=(0,k.PE)(),{blocklet:n}=(0,me.y0)(),t=[...n.children]||[];return"gateway"!==n.meta.group&&t.unshift(n),(0,X.jsx)(On,{component:"div",children:t&&t.length?[(0,X.jsx)(p.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},style:{maxWidth:1080},children:(0,X.jsx)(Pn,{blocklet:n},"0-".concat(n.meta.did))},"top-blocklet-".concat(n.meta.did))]:(0,X.jsx)(p.Z,{mt:8,children:(0,X.jsx)(Ie.Z,{children:e("blocklet.component.noComponent")})})})}Pn.propTypes={blocklet:s().object.isRequired,ancestors:s().array,depth:s().number},Pn.defaultProps={ancestors:[],depth:0},Tn.propTypes={};const On=(0,a.Z)(p.Z)(Ln||(Ln=(0,o.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"])),(e=>e.theme.spacing(5)),(e=>e.theme.spacing(3)));var Nn=t(36095),Rn=t(20877),_n=t(55498),An=t(21764),In=t(25125),Bn=t(13573),Dn=t(69210),Fn=t(56556),zn=t(67357);const Un={enabled:!1,domain:"",clientId:"",clientSecret:""};const Kn=function(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,me.y0)(),{t:o}=(0,k.PE)(),l=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,a=Object.assign({...Un},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.oauth)||void 0===n?void 0:n.auth0)||{}),{handleSubmit:r,control:s,formState:c,watch:d,reset:u}=(0,We.cI)({defaultValues:ze()(a,Object.keys(Un))}),m=d("enabled"),h=(0,Ke.Z)((async e=>{try{var n;const{blocklet:i}=await t.configOAuth({input:{did:l,oauth:JSON.stringify({auth0:e})}}),a=Object.assign({...Un},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.oauth)||void 0===n?void 0:n.auth0)||{});u(a),B.Z.success(o("oauth.saveSuccess"))}catch(i){B.Z.error(i.message||o("oauth.saveFailed"))}})),f=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.auth0.domainDescription"))),g=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.auth0.clientIdDescription"))),x=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.auth0.clientSecretDescription"))),v=(0,Ke.Z)((()=>!0));return(0,X.jsx)(p.Z,{children:(0,X.jsxs)("form",{onSubmit:r(h),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:s,render:e=>{let{field:n}=e;return(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(zn.Z,{checked:n.value,style:{marginRight:"6px"},...n}),label:o("oauth.auth0.enable"),sx:{marginBottom:2,ml:1}})}}),(0,X.jsx)(We.Qr,{name:"domain",control:s,rules:{validate:m?f:v},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,label:o("oauth.auth0.domain"),error:!!c.errors[t.name],helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(We.Qr,{name:"clientId",control:s,rules:{validate:m?g:v},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,error:!!c.errors[t.name],label:o("oauth.auth0.clientId"),helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(We.Qr,{name:"clientSecret",control:s,rules:{validate:m?x:v},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,type:"password",error:!!c.errors[t.name],label:o("oauth.auth0.clientSecret"),helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(Fn.Z,{type:"submit",variant:"contained",onSubmit:r(h),disabled:!c.isDirty,children:o("oauth.save")})]})})},Wn={enabled:!1,clientId:"",clientSecret:""};const qn=function(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,me.y0)(),{t:o}=(0,k.PE)(),l=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,a=Object.assign({...Wn},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.oauth)||void 0===n?void 0:n.github)||{}),{handleSubmit:r,control:s,formState:c,watch:d,reset:u}=(0,We.cI)({defaultValues:ze()(a,Object.keys(Wn))}),m=d("enabled"),h=(0,Ke.Z)((async e=>{try{var n;const{blocklet:i}=await t.configOAuth({input:{did:l,oauth:JSON.stringify({github:e})}}),a=Object.assign({...Wn},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.oauth)||void 0===n?void 0:n.github)||{});u(a),B.Z.success(o("oauth.saveSuccess"))}catch(i){B.Z.error(i.message||o("oauth.saveFailed"))}})),f=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.github.clientIdDescription"))),g=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.github.clientSecretDescription"))),x=(0,Ke.Z)((()=>!0));return(0,X.jsx)(p.Z,{children:(0,X.jsxs)("form",{onSubmit:r(h),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:s,render:e=>{let{field:n}=e;return(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(zn.Z,{checked:n.value,style:{marginRight:"6px"},...n}),label:o("oauth.github.enable"),sx:{marginBottom:2,ml:1}})}}),(0,X.jsx)(We.Qr,{name:"clientId",control:s,rules:{validate:m?f:x},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,error:!!c.errors[t.name],label:o("oauth.github.clientId"),helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(We.Qr,{name:"clientSecret",control:s,rules:{validate:m?g:x},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,type:"password",label:o("oauth.github.clientSecret"),error:!!c.errors[t.name],helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(Fn.Z,{type:"submit",variant:"contained",onSubmit:r(h),disabled:!c.isDirty,children:o("oauth.save")})]})})},Mn={enabled:!1,clientId:"",clientSecret:""};const Gn=function(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,me.y0)(),{t:o}=(0,k.PE)(),l=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,a=Object.assign({...Mn},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.oauth)||void 0===n?void 0:n.google)||{}),{handleSubmit:r,control:s,formState:c,watch:d,reset:u}=(0,We.cI)({defaultValues:ze()(a,Object.keys(Mn))}),m=d("enabled"),h=(0,Ke.Z)((async e=>{try{var n;const{blocklet:i}=await t.configOAuth({input:{did:l,oauth:JSON.stringify({google:e})}}),a=Object.assign({...Mn},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.oauth)||void 0===n?void 0:n.google)||{});u(a),B.Z.success(o("oauth.saveSuccess"))}catch(i){B.Z.error(i.message||o("oauth.saveFailed"))}})),f=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.google.clientIdDescription"))),g=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.google.clientSecretDescription"))),x=(0,Ke.Z)((()=>!0));return(0,X.jsx)(p.Z,{children:(0,X.jsxs)("form",{onSubmit:r(h),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:s,render:e=>{let{field:n}=e;return(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(zn.Z,{checked:n.value,style:{marginRight:"6px"},...n}),label:o("oauth.google.enable"),sx:{marginBottom:2,ml:1}})}}),(0,X.jsx)(We.Qr,{name:"clientId",control:s,rules:{validate:m?f:x},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,error:!!c.errors[t.name],label:o("oauth.google.clientId"),helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(We.Qr,{name:"clientSecret",control:s,rules:{validate:m?g:x},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,type:"password",label:o("oauth.google.clientSecret"),error:!!c.errors[t.name],helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(Fn.Z,{type:"submit",variant:"contained",onSubmit:r(h),disabled:!c.isDirty,children:o("oauth.save")})]})})},Vn={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};const Hn=function(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,me.y0)(),{t:o}=(0,k.PE)(),l=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,a=Object.assign({...Vn},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.oauth)||void 0===n?void 0:n.apple)||{}),{handleSubmit:r,control:s,formState:c,watch:d,reset:u}=(0,We.cI)({defaultValues:ze()(a,Object.keys(Vn))}),m=d("enabled"),h=(0,Ke.Z)((async e=>{try{var n;const{blocklet:i}=await t.configOAuth({input:{did:l,oauth:JSON.stringify({apple:e})}}),a=Object.assign({...Vn},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.oauth)||void 0===n?void 0:n.apple)||{});u(a),B.Z.success(o("oauth.saveSuccess"))}catch(i){B.Z.error(i.message||o("oauth.saveFailed"))}})),f=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.apple.teamIdDescription"))),g=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.apple.serviceIdDescription"))),x=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.apple.keyIdDescription"))),v=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.apple.authKeyDescription"))),b=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.apple.bundleIdDescription"))),Z=(0,Ke.Z)((()=>!0));return(0,X.jsx)(p.Z,{children:(0,X.jsxs)("form",{onSubmit:r(h),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:s,render:e=>{let{field:n}=e;return(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(zn.Z,{checked:n.value,style:{marginRight:"6px"},...n}),label:o("oauth.apple.enable"),sx:{marginBottom:2,ml:1}})}}),(0,X.jsx)(We.Qr,{name:"teamId",control:s,rules:{validate:m?f:Z},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,error:!!c.errors[t.name],label:o("oauth.apple.teamId"),helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(We.Qr,{name:"bundleId",control:s,rules:{validate:m?b:Z},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,error:!!c.errors[t.name],label:o("oauth.apple.bundleId"),helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(We.Qr,{name:"serviceId",control:s,rules:{validate:m?g:Z},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,error:!!c.errors[t.name],label:o("oauth.apple.serviceId"),helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(We.Qr,{name:"keyId",control:s,rules:{validate:m?x:Z},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,error:!!c.errors[t.name],label:o("oauth.apple.keyId"),helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(We.Qr,{name:"authKey",control:s,rules:{validate:m?v:Z},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,children:(0,X.jsx)(V.Z,{...t,type:"password",multiline:!0,rows:4,label:o("oauth.apple.authKey"),error:!!c.errors[t.name],helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!m})})}}),(0,X.jsx)(Fn.Z,{type:"submit",variant:"contained",onSubmit:r(h),disabled:!c.isDirty,children:o("oauth.save")})]})})};var Yn=t(46711),Jn=t(2266),Qn=t(76223),Xn=t(34435),$n=t(6837);function et(e){let{title:n,id:t,children:i,index:o,onMove:a,defaultExpand:r,onEnd:s}=e;const[c,d]=(0,l.useState)(r),u=(0,l.useRef)(null),m=(0,l.useRef)(null),[{handlerId:h},f]=(0,Yn.L)({accept:"dragItem",collect:e=>({handlerId:e.getHandlerId()}),hover(e,n){var t,i;if(!u.current)return;const l=e.index,r=o;if(l===r)return;const s=null===(t=u.current)||void 0===t?void 0:t.getBoundingClientRect(),c=null===(i=m.current)||void 0===i?void 0:i.getBoundingClientRect(),d=(c.bottom-c.top)/2,p=n.getClientOffset().y-s.top;l<r&&p<d||l>r&&p>d||(a(l,r),e.index=r)}}),[{isDragging:g},x]=(0,Jn.c)({item:{index:o,type:"dragItem"},collect:e=>({isDragging:e.isDragging()}),end:s});x(m),f(u);const v=g?.5:1,b=(0,Ke.Z)((e=>{e.preventDefault(),e.stopPropagation(),d(!c)}));return(0,X.jsxs)(p.Z,{ref:u,sx:{borderBottom:"1px solid ".concat(Qn.E.lineBorderStrong)},children:[(0,X.jsx)(p.Z,{sx:{cursor:"pointer","&:hover":{backgroundColor:Qn.E.backgroundsBgSubtileHover},borderRadius:2},ref:m,"data-handler-id":h,children:(0,X.jsxs)(p.Z,{sx:{py:1.5,px:1,opacity:v,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:b,children:[(0,X.jsx)(p.Z,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:Qn.E.textMuted,"&:hover":{color:Qn.E.textSubtitle}},children:(0,X.jsx)(_n.JO,{fontSize:20,icon:Xn.Z})}),(0,X.jsx)(ve.Z,{sx:{flex:1},children:n}),(0,X.jsx)(K.Z,{size:"small",sx:{pointerEvents:"auto",transform:c?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:(0,X.jsx)(_n.JO,{icon:$n.Z,style:{transform:"scale(1.5)"}})})]})}),(0,X.jsx)(p.Z,{sx:{pl:4,py:1,display:c?"block":"none"},children:i})]})}et.propTypes={title:s().string.isRequired,id:s().string.isRequired,children:s().node.isRequired,index:s().number.isRequired,onMove:s().func.isRequired,onEnd:s().func.isRequired,defaultExpand:s().bool},et.defaultProps={defaultExpand:!0};const nt=[{name:"github",title:"GitHub",icon:(0,X.jsx)(_n.JO,{icon:In.Z}),component:(0,X.jsx)(qn,{})},{name:"google",title:"Google",icon:(0,X.jsx)(_n.JO,{icon:Bn.Z}),component:(0,X.jsx)(Gn,{})},{name:"apple",title:"Apple",icon:(0,X.jsx)(_n.JO,{icon:An.Z}),component:(0,X.jsx)(Hn,{})},{name:"auth0",title:"Auth0",icon:(0,X.jsx)(_n.JO,{icon:Dn.Z}),component:(0,X.jsx)(Kn,{})}],tt=["github","google","apple","auth0"];function it(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,me.y0)(),o=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,l=(null===i||void 0===i||null===(n=i.settings)||void 0===n?void 0:n.oauth)||{},a=Object.keys(l).sort(((e,n)=>{var t,i,o;return void 0!==(null===(t=l[e])||void 0===t?void 0:t.order)&&void 0!==(null===(i=l[n])||void 0===i?void 0:i.order)?l[e].order-l[n].order:void 0!==(null===(o=l[e])||void 0===o?void 0:o.order)?-1:1}));for(const p of tt)a.includes(p)||a.push(p);const r=(0,Ue.Z)(a.reduce(((e,n,t)=>Object.assign(e,{[n]:t})),{})),s=(0,Be.Z)((()=>{const e=[...nt];return e.sort(((e,n)=>r[e.name]-r[n.name])),e}),[r.auth0,r.github,r.google]),c={};"undefined"!==typeof window&&(c.context=window);const d=(0,Ke.Z)((async e=>{const n={};Object.keys(e).forEach((t=>{n[t]={order:e[t]}})),await t.configOAuth({input:{did:o,oauth:JSON.stringify(n)}})})),u=(0,Ke.Z)(((e,n)=>{const t=s[e],i=s[n];r[t.name]=n,r[i.name]=e})),m=(0,Ke.Z)((async()=>{await d(r)}));return(0,X.jsx)(p.Z,{children:(0,X.jsx)(Nn.W,{backend:Rn.HTML5Backend,...c,children:s.map(((e,n)=>(0,X.jsx)(et,{index:n,id:e.name,title:e.title,icon:e.icon,onMove:u,onEnd:m,defaultExpand:e.enabled,children:e.component},e.name)))})})}var ot=t(62362),lt=t(24103);const at={ttl:m.SESSION_TTL};function rt(e){const n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?86400*e.ttl:e.ttl/86400;return{...e,ttl:n}}function st(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,me.y0)(),o=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,l=Object.assign({},at,(null===i||void 0===i||null===(n=i.settings)||void 0===n?void 0:n.session)||{}),{handleSubmit:a,control:r,formState:s,reset:c}=(0,We.cI)({defaultValues:ze()(rt(l),["ttl"])}),{t:d}=(0,k.PE)(),u=(0,Ke.Z)((async e=>{try{var n;const{blocklet:i}=await t.updateAppSessionConfig({input:{did:o,config:rt(e,!0)}}),l=Object.assign({},at,ze()((null===i||void 0===i||null===(n=i.settings)||void 0===n?void 0:n.session)||{},["ttl"]));c(rt(l)),B.Z.success(d("common.configSuccess"))}catch(i){B.Z.error(i.message)}}));return(0,X.jsx)(p.Z,{children:(0,X.jsxs)("form",{onSubmit:a(u),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"ttl",control:r,render:e=>{let{field:n}=e;return(0,X.jsx)(De.Z,{fullWidth:!0,sx:{mb:2},children:(0,X.jsxs)(lt.Z,{px:3,children:[(0,X.jsx)(p.Z,{mx:-3,my:.5,children:d("blocklet.config.session.ttl",{day:n.value})}),(0,X.jsx)(ot.ZP,{...n,defaultValue:7,step:1,marks:[{value:1,label:d("blocklet.config.session.day",{day:1})},{value:7,label:d("blocklet.config.session.days",{day:7})},{value:14,label:d("blocklet.config.session.days",{day:14})},{value:21,label:d("blocklet.config.session.days",{day:21})},{value:30,label:d("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto",style:{maxWidth:"360px"}})]})})}}),(0,X.jsx)(Fn.Z,{type:"submit",variant:"contained",onSubmit:a(u),disabled:!s.isDirty,children:d("oauth.save")})]})})}var ct=t(82555),dt=t(30333),ut=t(75760),mt=t(97038),pt=t(64886),ht=t(42080),ft=t.n(ht),gt=t(75506),xt=t.n(gt),vt=t(47685),bt=t(13260),Zt=t(82434),jt=t.n(Zt);const yt=(0,l.forwardRef)(((e,n)=>{var t;const{t:i}=(0,l.useContext)(k.RD),{blocklet:o}=(0,me.y0)(),{api:a}=(0,ie.h6)(),r=(0,Ue.Z)({mode:"view",show:!1,data:{},callback:Qe()}),s=(0,vt.Fg)(),c=(null===s||void 0===s||null===(t=s.transitions)||void 0===t||null===(t=t.duration)||void 0===t?void 0:t.leavingScreen)||300,d=(0,Ke.Z)((()=>{r.mode="view",r.data={},r.callback=Qe()}),[]),m=(0,Ke.Z)((()=>{r.show=!1,setTimeout((()=>{d()}),c)}),[]),h=(0,Ke.Z)((e=>{r.mode="view",r.show=!0,r.data=e}),[]),f=(0,Ke.Z)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qe();r.mode="approve",r.show=!0,r.data=e,r.callback=n}),[]);(0,l.useImperativeHandle)(n,(()=>({open:h,close:m,approve:f})),[h,m,f]);const g=(0,Be.Z)((()=>{if(!r.show)return[];r.data.migratedFrom=[r.data.appId,r.data.appPid];const e=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return!1!==r.data.isMaster&&ft()(e,"appliedAt","status"),e.map((e=>{const n=i("federated.info.".concat(e));let t=r.data[e];if("appName"===e&&r.data.isMaster&&(t=(0,X.jsxs)(p.Z,{children:[(0,X.jsx)(ct.Z,{component:dt.Z}),t]})),["appId","appPid","serverId"].includes(e)&&(t=(0,X.jsx)(bt.kL,{children:t})),["appUrl"].includes(e)&&(t=(0,X.jsx)(p.Z,{component:"a",href:t,target:"_blank",children:t})),["appLogo"].includes(e)){const e=jt()(t)?t:u()(r.data.appUrl||"",t||"");try{const n=new URL(e);n.searchParams.set("imageFilter","resize"),n.searchParams.set("w","80"),n.searchParams.set("h","80"),t=(0,X.jsx)("img",{src:n.href,width:"60",height:"60",alt:r.data.appName})}catch{t=(0,X.jsx)("img",{src:e,width:"60",height:"60",alt:r.data.appName})}}if("status"===e&&(t=t&&i("federated.status.".concat(t))),"migratedFrom"===e){t=(r.data.migratedFrom||[]).filter((e=>![r.data.appId,r.data.appPid].includes(e))).map((e=>(0,X.jsx)(bt.kL,{children:e})))}return xt()(t)&&(t="-"),{name:n,value:t}}))}),[r.data]),x="approve"===r.mode,v=(0,Ke.Z)((async()=>{await a.auditFederatedLogin({input:{memberPid:r.data.appPid,did:o.appPid,status:"rejected"}}),m(),null===r||void 0===r||r.callback(!1)})),b=(0,Ke.Z)((async()=>{await a.auditFederatedLogin({input:{memberPid:r.data.appPid,did:o.appPid,status:"approved"}}),m(),null===r||void 0===r||r.callback(!0)}));return(0,X.jsx)(ge.ZP,{open:r.show,title:i(x?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:m,actions:x?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Fn.Z,{color:"error",variant:"contained",onClick:v,children:i("common.reject")}),(0,X.jsx)(Fn.Z,{variant:"contained",onClick:b,children:i("common.approve")})]}):(0,X.jsx)(Fn.Z,{variant:"outlined",onClick:m,children:i("common.close")}),children:g.map((e=>(0,X.jsx)(pt.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:e.name,children:e.value},e.name)))})}));var kt=t(79842),Ct=t(85408),St=t.n(Ct);const wt=(0,l.forwardRef)(((e,n)=>{var t;const i=(0,vt.Fg)(),o=(null===i||void 0===i||null===(t=i.transitions)||void 0===t||null===(t=t.duration)||void 0===t?void 0:t.leavingScreen)||300,{t:a}=(0,l.useContext)(k.RD),r=(0,Ue.Z)({show:!1,data:{link:""}}),s=(0,Ke.Z)((()=>{r.data.link=""}),[]),c=(0,Ke.Z)((()=>{r.show=!1,setTimeout((()=>{s()}),o)}),[]),d=(0,Ke.Z)((e=>{let{link:n}=e;r.show=!0,r.data.link=n}),[]);(0,l.useImperativeHandle)(n,(()=>({open:d,close:c})),[d,c]);const u=(0,Ke.Z)((()=>{St()(r.data.link),c()}),[c]);return(0,X.jsxs)(ge.ZP,{open:r.show,title:a("federated.joinFederatedLogin"),onClose:c,PaperProps:{style:{minHeight:"unset"}},actions:(0,X.jsx)(_.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:u,children:a("common.copyAndClose")}),children:[(0,X.jsx)(p.Z,{mb:1,children:a("federated.inviteJoinFederatedLoginDescription")}),(0,X.jsx)(p.Z,{sx:{"& .copy-button":{display:"none !important"}},children:(0,X.jsx)(kt.Z,{language:"shell",style:{marginBottom:0},children:r.data.link})})]})}));function Et(e){var n,t,i;let{mode:o}=e;const a=(0,l.useRef)(null),r=(0,l.useRef)(null),{t:s,locale:c}=(0,l.useContext)(k.RD),{blocklet:d,actions:{refreshBlocklet:u}}=(0,me.y0)(),{confirmApi:m,confirmHolder:h}=$e(),{api:f}=(0,ie.h6)(),g=(null===(n=d.settings.federated)||void 0===n?void 0:n.sites)||[],x=(null===(t=d.settings.federated)||void 0===t?void 0:t.config)||{},v=!1!==x.isMaster,b=(0,Ke.Z)((e=>{var n;null===(n=r.current)||void 0===n||n.open(e)})),Z=(0,Ke.Z)((e=>{var n;null===(n=r.current)||void 0===n||n.approve(e,u)})),j=(0,Ke.Z)((e=>{m.open({title:s("federated.disableFederatedLogin"),content:s("federated.disableFederatedLoginDescription"),async onConfirm(n){await f.auditFederatedLogin({input:{memberPid:e.appPid,did:d.appPid,status:"revoked"}}),n()}})})),y=(0,Ke.Z)((e=>{m.open({title:s("federated.enableFederatedLogin"),content:s("federated.enableFederatedLoginDescription"),async onConfirm(n){await f.auditFederatedLogin({input:{memberPid:e.appPid,did:d.appPid,status:"approved"}}),n()}})})),C=(0,Be.Z)((()=>{const e=[{label:s("common.name"),name:"appName",options:{customBodyRenderLite:e=>{const n=g[e],t=!1!==n.isMaster;return(0,X.jsx)(p.Z,{display:"inline-block",children:(0,X.jsxs)(p.Z,{component:"a",display:"flex",alignItems:"center",href:n.appUrl,target:"_blank",onClick:e=>{e.stopPropagation()},children:[t&&(0,X.jsx)(ct.Z,{component:dt.Z,style:{marginRight:"4px"}}),n.appName]})})}}},{label:s("common.did"),name:"appId",options:{customBodyRenderLite:e=>{const n=g[e];return(0,X.jsx)(mt.Z,{children:n.appId})}}},{label:s("common.status"),name:"status",options:{customBodyRenderLite:e=>{const n=g[e],t=!1!==n.isMaster;return(0,X.jsx)(p.Z,{children:t?"-":s("federated.status.".concat(n.status))})}}}];return v&&e.push({label:s("common.actions"),name:"actions",options:{customBodyRenderLite:e=>{const n=g[e],t=!1!==n.isMaster;return(0,X.jsx)(p.Z,{display:"flex",gap:1,children:t?(0,X.jsxs)(X.Fragment,{children:["rejected"===n.status&&(0,X.jsx)(_.Z,{variant:"contained",color:"error",size:"small",onClick:e=>{e.stopPropagation()},children:s("federated.status.rejected")}),"revoked"===n.status&&(0,X.jsx)(_.Z,{variant:"contained",color:"secondary",size:"small",onClick:e=>{e.stopPropagation()},children:s("federated.status.revoked")})]}):(0,X.jsxs)(X.Fragment,{children:["pending"===n.status&&(0,X.jsx)(_.Z,{variant:"contained",color:"primary",size:"small",onClick:e=>{e.stopPropagation(),Z(n)},children:s("federated.status.pending")}),"approved"===n.status&&(0,X.jsx)(_.Z,{variant:"contained",color:"error",size:"small",onClick:e=>{e.stopPropagation(),j(n)},style:{whiteSpace:"nowrap"},children:s("federated.revoke")}),"revoked"===n.status&&(0,X.jsx)(_.Z,{variant:"contained",color:"warning",size:"small",onClick:e=>{e.stopPropagation(),y(n)},style:{whiteSpace:"nowrap"},children:s("federated.approve")})]})})}}}),e}),[x.appId,g,v,s]),S=(0,Be.Z)((()=>({sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(e,n){let{dataIndex:t}=n;const i=g[t];b(i)}})),[]),w=(0,Ke.Z)((()=>{const e=d.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL));var n;null!==e&&void 0!==e&&e.value?null===(n=a.current)||void 0===n||n.open({link:e.value}):B.Z.error(s("federated.failedToGetFederatedLoginLink"))}),[null===(i=d.site)||void 0===i||null===(i=i.domainAliases)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.href]),E=(0,Ke.Z)((()=>{m.open({title:s("federated.quitFederatedLogin"),content:s("federated.quitFederatedLoginDescription"),async onConfirm(e){await f.quitFederatedLogin({input:{did:d.appPid}}),e()}})})),L=(0,Ke.Z)((()=>{m.open({title:s("federated.disbandFederatedLogin"),content:s("federated.disbandFederatedLoginDescription"),async onConfirm(e){await f.disbandFederatedLogin({input:{did:d.appPid}}),e()}})})),P=[];return"master"!==o?P.push((0,X.jsx)(_.Z,{size:"small",variant:"contained",color:"error",onClick:E,sx:{ml:1},children:s("federated.quitFederatedLogin")},"quitFederatedLogin")):(P.push((0,X.jsx)(_.Z,{size:"small",variant:"contained",onClick:w,sx:{ml:1},children:s("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),P.push((0,X.jsx)(_.Z,{color:"error",size:"small",variant:"contained",onClick:L,sx:{ml:1},children:s("federated.disbandFederatedLogin")},"disbandFederatedLogin"))),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ut.Z,{className:"main-table",locale:c,data:g,columns:C,customButtons:P,title:(0,X.jsx)(p.Z,{className:"table-toolbar-left",children:s("oauth.federated")}),options:S}),h,(0,X.jsx)(wt,{ref:a}),(0,X.jsx)(yt,{ref:r})]})}Et.propTypes={mode:s().oneOf(["member","master"])},Et.defaultProps={mode:"member"};const Lt=Et,Pt=(0,l.forwardRef)(((e,n)=>{var t;const{t:i}=(0,l.useContext)(k.RD),{api:o}=(0,ie.h6)(),{blocklet:a}=(0,me.y0)(),r=null===a||void 0===a?void 0:a.appPid,s=(0,vt.Fg)(),c=(null===s||void 0===s||null===(t=s.transitions)||void 0===t||null===(t=t.duration)||void 0===t?void 0:t.leavingScreen)||300,d=(0,Ue.Z)({show:!1,appUrl:"",appUrlError:"",callback:Qe()}),u=(0,Ke.Z)((()=>{d.appUrl="",d.appUrlError="",d.callback=Qe()}),[]),m=(0,Ke.Z)((()=>{d.show=!1,setTimeout((()=>{u()}),c)}),[]),h=(0,Ke.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qe();d.show=!0,d.callback=e}),[]);(0,l.useImperativeHandle)(n,(()=>({open:h,close:m})),[h,m]);const f=(0,Ke.Z)((e=>{if(!e)throw new Error(i("federated.federatedJoinAppUrlRequired"));if(!jt()(e))throw new Error(i("federated.federatedJoinAppUrlInvalid"))})),g=(0,Ke.Z)((async()=>{try{f(d.appUrl);const e=await o.joinFederatedLogin({input:{did:r,appUrl:d.appUrl}});d.show=!1,m(),null===d||void 0===d||d.callback(e)}catch(e){d.appUrlError=e.message}}),[m,r]);return(0,X.jsxs)(ge.ZP,{open:d.show,title:i("federated.joinFederatedLogin"),onClose:m,PaperProps:{style:{minHeight:"unset"}},actions:(0,X.jsx)(_.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:g,children:i("common.confirm")}),children:[(0,X.jsx)(p.Z,{mb:1,children:i("federated.joinFederatedLoginDescription")}),(0,X.jsx)(V.Z,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:i("federated.federatedJoinAppUrl"),label:i("federated.federatedJoinAppUrl"),value:d.appUrl,error:!!d.appUrlError,helperText:d.appUrlError||"eg: https://www.arcblock.io",onChange:e=>{d.appUrl=e.target.value}})]})}));function Tt(){var e,n;const t=(0,l.useRef)(null),i=(0,l.useRef)(null),{t:o}=(0,l.useContext)(k.RD),{blocklet:a,actions:{refreshBlocklet:r}}=(0,me.y0)(),s=(0,Ke.Z)((()=>{var e;const n=null===(e=a.site)||void 0===e||null===(e=e.domainAliases)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.href;if(n)try{var i;const e=new URL(n);null===(i=t.current)||void 0===i||i.open({link:e.origin})}catch{B.Z.error(o("federated.failedToGetFederatedLoginLink"))}}),[null===(e=a.site)||void 0===e||null===(e=e.domainAliases)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.href]),c=(0,Ke.Z)((()=>{var e;null===(e=i.current)||void 0===e||e.open((()=>{r()}))}),[r]);if((null===(n=a.settings.federated)||void 0===n?void 0:n.sites.length)>0){var d;const e=!1!==(null===(d=a.settings.federated)||void 0===d?void 0:d.config.isMaster);return(0,X.jsx)(Lt,{mode:e?"master":"member"})}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(p.Z,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:[(0,X.jsx)(_.Z,{variant:"contained",onClick:s,children:o("federated.inviteJoinFederatedLogin")}),(0,X.jsx)(R.Z,{sx:{width:"150px",color:"rgba(0, 0, 0, 0.3)"},children:"OR"}),(0,X.jsx)(_.Z,{variant:"outlined",onClick:c,children:o("federated.joinFederatedLogin")})]}),(0,X.jsx)(wt,{ref:t}),(0,X.jsx)(Pt,{ref:i})]})}const Ot=function(){const{t:e}=(0,l.useContext)(k.RD),n=[{label:(0,X.jsx)(p.Z,{textAlign:"center",width:"100%",children:e("oauth.commonSettings")}),value:"settings"},{label:(0,X.jsx)(p.Z,{textAlign:"center",width:"100%",children:e("oauth.federated")}),value:"federated"},{label:(0,X.jsx)(p.Z,{textAlign:"center",width:"100%",children:e("oauth.oauth")}),value:"oauth"},{label:(0,X.jsx)(p.Z,{textAlign:"center",width:"100%",children:e("oauth.moreLogin")}),value:"more"}],[t,i]=(0,l.useState)(n[0].value),o=(0,Be.Z)((()=>({oauth:(0,X.jsx)(it,{}),federated:(0,X.jsx)(Tt,{}),more:(0,X.jsx)(p.Z,{children:(0,X.jsx)(Ie.Z,{children:e("oauth.comingSoon")})}),settings:(0,X.jsx)(p.Z,{children:(0,X.jsx)(st,{})})})),[e]);return(0,X.jsxs)(p.Z,{children:[(0,X.jsx)(C.Z,{tabs:n,current:t,onChange:i}),(0,X.jsx)(p.Z,{marginTop:"10px",children:o[t]})]})};var Nt;const Rt=e=>{let{tabs:n,blocklet:t,ancestors:i=[],depth:o=1,t:l}=e;const a=[...i.map((e=>e.meta.did)),t.meta.did].join("/"),r=!(null!==i&&void 0!==i&&i.length);n.push({label:(0,X.jsxs)(p.Z,{pl:2*Math.max(1,o-1),display:"flex",alignItems:"center",justifyContent:"flex-start",children:[r?(0,X.jsx)(E.Z,{size:24,blocklet:t}):(0,X.jsx)(w.Z,{size:24,blocklet:t,ancestors:i}),(0,X.jsx)(p.Z,{ml:"16px",children:(0,X.jsx)(p.Z,{style:{color:"#222"},children:r?l("blocklet.component.container"):(0,S.getDisplayName)(t,!0)})})]},a),value:a}),t.children.length>0&&t.children.forEach((e=>{Rt({tabs:n,blocklet:e,ancestors:[...i,t],depth:o+1,t:l})}))};function _t(e){let{blocklet:n,onUpdate:t,...i}=e;const{t:o}=(0,l.useContext)(k.RD),{info:a,inService:r}=(0,ie.h6)(),[s,d]=(0,l.useState)(!0),[S,w]=(0,y.useSearchParams)(),E=S.get("tab")||"general",L=[{label:(0,X.jsxs)(p.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-general",children:[(0,X.jsx)(f.Z,{sx:{fontSize:24}}),(0,X.jsx)(p.Z,{ml:"16px",children:(0,X.jsx)(p.Z,{style:{color:"#222"},children:o("common.general")})})]},"general"),value:"general"},{label:(0,X.jsxs)(p.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-access",children:[(0,X.jsx)(g.Z,{sx:{fontSize:24}}),(0,X.jsx)(p.Z,{ml:"16px",children:(0,X.jsx)(p.Z,{style:{color:"#222"},children:o("common.access")})})]},"access"),value:"access"},{label:(0,X.jsxs)(p.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-authentication",children:[(0,X.jsx)(x.Z,{sx:{fontSize:24}}),(0,X.jsx)(p.Z,{ml:"16px",children:(0,X.jsx)(p.Z,{style:{color:"#222"},children:o("common.login")})})]},"authentication"),value:"authentication"},{label:(0,X.jsxs)(p.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-notification",children:[(0,X.jsx)(v.Z,{sx:{fontSize:24}}),(0,X.jsx)(p.Z,{ml:"16px",children:(0,X.jsx)(p.Z,{style:{color:"#222"},children:o("common.notification")})})]},"notification"),value:"notification"},{label:(0,X.jsxs)(p.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-preference",children:[(0,X.jsx)(p.Z,{ml:-2,style:{transform:"translateY(2px)"},children:s?(0,X.jsx)(j.Z,{fontSize:"inherit"}):(0,X.jsx)(Z.default,{fontSize:"inherit"})}),(0,X.jsx)(b.Z,{sx:{fontSize:24}}),(0,X.jsx)(p.Z,{ml:"16px",children:(0,X.jsx)(p.Z,{style:{color:"#222"},children:o("common.preferences")})})]},"preference"),value:"preference"}];s&&Rt({tabs:L,blocklet:n,t:o});let P=null;if("general"===E)P=(0,X.jsx)(_e,{blocklet:n,onUpdate:t});else if("access"===E)P=(0,X.jsx)(Tn,{});else if("authentication"===E)P=(0,X.jsx)(Ot,{});else if("notification"===E)P=(0,X.jsx)(on,{});else{const e=r?m.WELLKNOWN_SERVICE_PATH_PREFIX:a.routing.adminPath,n=new URLSearchParams;r||n.set("authKey","__sst"),n.set("schemaKey",u()(window.location.origin,e,"/api/preferences?id=".concat(encodeURIComponent(E)))),P=(0,X.jsx)(c.Z,{url:"".concat(u()(window.location.origin,e,"/hosted/form-collector/"),"?").concat(n.toString()),width:"100%",height:"100%",frameBorder:0,styles:{border:0}})}return(0,X.jsx)(At,{...i,children:(0,X.jsxs)(h.ZP,{container:!0,spacing:4,columns:24,children:[(0,X.jsx)(h.ZP,{item:!0,sm:7,md:5,children:(0,X.jsx)(C.Z,{tabs:L,current:E,orientation:"vertical",onChange:e=>{"preference"===e?d(!s):w((n=>("general"===e?n.delete("tab"):n.set("tab",e),n)))},sx:{borderRight:1,height:"100%",borderColor:"divider"}})}),(0,X.jsx)(h.ZP,{item:!0,sm:17,md:19,children:(0,X.jsx)(p.Z,{style:{minHeight:"66vh",height:"100%",position:"relative",overflow:"hidden"},children:P})})]})})}_t.propTypes={blocklet:s().object.isRequired,onUpdate:s().func},_t.defaultProps={onUpdate:()=>{}};const At=a.Z.div(Nt||(Nt=(0,o.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"])))},69058:(e,n,t)=>{t.d(n,{Z:()=>m});var i=t(5057),o=t(86229),l=t(28726),a=t(44846),r=t(68420),s=t(64387),c=t(22324),d=t(10032),u=t(96266);function m(e){let{teamDid:n,size:t="small",...m}=e;const{t:p}=(0,r.PE)(),{api:h}=(0,c.h6)(),[f,g]=(0,i.useState)(!1),[x,v]=(0,i.useState)(null),b={title:p("blocklet.config.clearCache.title"),description:p("blocklet.config.clearCache.description"),confirm:p("common.confirm"),cancel:p("common.cancel"),onConfirm:async()=>{try{var e;g(!0);const t=await h.clearCache({input:{teamDid:n}});o.Z.success(p("blocklet.config.clearCache.success",{count:(null===(e=t.removed)||void 0===e?void 0:e.length)||0}))}catch(t){o.Z.error((0,s.Z)(t))}finally{g(!1),v(null)}},onCancel:()=>{g(!1),v(null)}};return(0,u.jsxs)("div",{...m,children:[(0,u.jsxs)(l.Z,{onClick:()=>v(b),color:"error",variant:"outlined",size:t,children:[f?(0,u.jsx)(a.Z,{size:16,style:{marginRight:5}}):null,p("blocklet.config.clearCache.action")]}),x&&(0,u.jsx)(d.Z,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}},69561:(e,n,t)=>{t.d(n,{Z:()=>c});var i=t(5057),o=t(55898),l=t.n(o),a=t(12937),r=t(68420),s=t(96266);function c(e){let{children:n,...t}=e;const{t:o}=(0,i.useContext)(r.RD);return(0,s.jsx)(a.Z,{tip:o("common.copyTip"),copiedTip:o("common.copiedTip"),...t,children:n})}c.propTypes={children:l().any.isRequired}},30629:(e,n,t)=>{t.d(n,{Z:()=>x});var i=t(5057),o=t(55898),l=t.n(o),a=t(39948),r=t(47020),s=t(44846),c=t(13727),d=t(56184),u=t(67680),m=t(43449),p=t(37382),h=t(90651),f=t(96266);const g=(e,n,t)=>null===e&&n&&t?"******":e?n?"******":e:"";function x(e){let{label:n,disabled:t,required:o,initialValue:l,onChange:x,placeholder:v,style:b,onSubmit:Z,secure:j,triggers:y,formatterBeforeSubmit:k,...C}=e;const[S,w]=(0,i.useState)(!1),[E,L]=(0,i.useState)(!1),[P,T]=(0,i.useState)(j&&"__encrypted__"===l?null:l),[O,N]=(0,i.useState)(P),R=async()=>{L(!0);try{if(!1===await Z(O))N(P);else{let e=O;"function"===typeof k&&(e=k(O)),N(e),T(e)}}catch(e){N(P)}finally{L(!1),w(!1)}},_=S?(0,f.jsx)(r.Z,{style:{flex:1},fullWidth:!0,value:O,onChange:e=>{var n;n=e.target.value,N(n),x(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:v,onKeyDown:e=>{"Enter"===e.key&&R()},disabled:t,type:j?"password":"text",...C}):(0,f.jsx)(a.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:g(O,j,l)});return(0,f.jsx)(p.Z,{className:"form",style:b,children:(0,f.jsxs)(a.Z,{className:"form-item",children:[(0,f.jsxs)(a.Z,{className:"form-item-label",children:[n,o&&(0,f.jsx)(m.Z,{})]}),(0,f.jsxs)(a.Z,{className:"form-item-body",children:[(0,f.jsx)(a.Z,{className:"form-item-input",children:_}),(0,f.jsx)(a.Z,{className:"form-item-action",children:S?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(u.Z,{"data-cy":"schema-form-item-confirm",onClick:R,disabled:t||E,size:"large",children:E?(0,f.jsx)(s.Z,{size:24}):(0,f.jsx)(d.Z,{})}),(0,f.jsx)(u.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{N(P),w(!1)},disabled:t||E,size:"large",children:(0,f.jsx)(c.default,{})})]}):(0,f.jsx)(h.Z,{triggers:y,onEnterEdit:()=>w(!0),disabled:t})})]})]})})}x.propTypes={style:l().object,onSubmit:l().func,onChange:l().func,label:l().string,initialValue:l().string,placeholder:l().string,required:l().bool,disabled:l().bool,secure:l().bool,triggers:l().array,formatterBeforeSubmit:l().func},x.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},37382:(e,n,t)=>{t.d(n,{Z:()=>r});var i,o=t(71171),l=t(33518),a=t(39948);const r=(0,l.Z)(a.Z)(i||(i=(0,o.Z)(["\n width: 100%;\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n "," {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n "," {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n\n .MuiChip-root {\n margin-top: -4px;\n }\n }\n\n .MuiSelect-select {\n padding: 8px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n "," {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")))},90651:(e,n,t)=>{t.d(n,{Z:()=>x});var i=t(5057),o=t(55898),l=t.n(o),a=t(24558),r=t(67680),s=t(56556),c=t(80633),d=t(49390),u=t(72113),m=t(25228),p=t(49020),h=t(74490),f=t(1733),g=t(96266);function x(e){let{triggers:n,onEnterEdit:t,disabled:o}=e;const l=i.useRef(null),[x,v]=i.useState(!1);return 0===n.length?(0,g.jsx)(r.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(a.Z,{})}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(c.Z,{variant:"outlined",ref:l,"aria-label":"split button",children:[(0,g.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(a.Z,{})}),(0,g.jsx)(s.Z,{size:"small","aria-controls":x?"split-button-menu":void 0,"aria-expanded":x?"true":void 0,onClick:()=>{v((e=>!e))},children:(0,g.jsx)(d.Z,{})})]}),(0,g.jsx)(p.Z,{sx:{zIndex:9999},open:x,anchorEl:l.current,role:void 0,placement:"bottom-end",children:(0,g.jsx)(m.Z,{children:(0,g.jsx)(u.d,{onClickAway:e=>{l.current&&l.current.contains(e.target)||v(!1)},children:(0,g.jsx)(f.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((e=>(0,g.jsx)(h.Z,{onClick:()=>{return n=e.handler,v(!1),void n();var n},children:e.title},e.key)))})})})})]})}x.propTypes={triggers:l().arrayOf(l().shape({key:l().string.isRequired,title:l().string.isRequired,handler:l().func.isRequired})),onEnterEdit:l().func.isRequired,disabled:l().bool.isRequired},x.defaultProps={triggers:[]}},43449:(e,n,t)=>{t.d(n,{Z:()=>l});var i,o=t(71171);const l=t(33518).Z.span(i||(i=(0,o.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(e=>e.theme.palette.error.main))},78903:(e,n,t)=>{t.d(n,{C:()=>i});const i="true"===localStorage.getItem("enableDebug")}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[9085],{11997:(e,t,o)=>{var a=o(71600);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=a(o(56930)),l=o(96266);t.default=(0,s.default)((0,l.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear")},69902:(e,t,o)=>{var a=o(71600);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=a(o(56930)),l=o(96266);t.default=(0,s.default)((0,l.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList")},33225:(e,t,o)=>{var a=o(71600);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=a(o(56930)),l=o(96266);t.default=(0,s.default)((0,l.jsx)("path",{d:"M19 13H5v-2h14z"}),"Remove")},57201:(e,t,o)=>{var a=o(71600);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=a(o(56930)),l=o(96266);t.default=(0,s.default)((0,l.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search")},30770:(e,t,o)=>{var a=o(71600);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=a(o(56930)),l=o(96266);t.default=(0,s.default)((0,l.jsx)("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"}),"ViewColumn")},66816:(e,t,o)=>{o.r(t),o.d(t,{buttonClasses:()=>s.Z,default:()=>a.Z,getButtonUtilityClass:()=>s.F});var a=o(56556),s=o(11986)},77328:(e,t,o)=>{o.r(t),o.d(t,{checkboxClasses:()=>s.Z,default:()=>a.Z,getCheckboxUtilityClass:()=>s.y});var a=o(88092),s=o(88971)},13167:(e,t,o)=>{o.r(t),o.d(t,{chipClasses:()=>s.Z,default:()=>a.Z,getChipUtilityClass:()=>s.z});var a=o(19654),s=o(50465)},11302:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,formControlClasses:()=>l.Z,getFormControlUtilityClasses:()=>l.e,useFormControl:()=>s.Z});var a=o(80576),s=o(38038),l=o(89701)},12588:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,formControlLabelClasses:()=>s.Z,getFormControlLabelUtilityClasses:()=>s.r});var a=o(26174),s=o(34674)},90762:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,formGroupClasses:()=>s.Z,getFormGroupUtilityClass:()=>s.y});var a=o(25506),s=o(81937)},33321:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getIconButtonUtilityClass:()=>s.r,iconButtonClasses:()=>s.Z});var a=o(67680),s=o(25532)},41183:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getInputLabelUtilityClasses:()=>s.Y,inputLabelClasses:()=>s.Z});var a=o(6041),s=o(12823)},3909:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getListItemTextUtilityClass:()=>s.L,listItemTextClasses:()=>s.Z});var a=o(44067),s=o(15293)},51280:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getMenuItemUtilityClass:()=>s.K,menuItemClasses:()=>s.Z});var a=o(74490),s=o(11521)},66942:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getPaperUtilityClass:()=>s.J,paperClasses:()=>s.Z});var a=o(25228),s=o(56836)},90211:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getSelectUtilityClasses:()=>s.o,selectClasses:()=>s.Z});var a=o(51177),s=o(10688)},34126:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getTableUtilityClass:()=>s.K,tableClasses:()=>s.Z});var a=o(82266),s=o(94158)},6729:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getTableBodyUtilityClass:()=>s.j,tableBodyClasses:()=>s.Z});var a=o(30067),s=o(65378)},77105:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getTableCellUtilityClass:()=>s.U,tableCellClasses:()=>s.Z});var a=o(28627),s=o(80799)},32200:(e,t,o)=>{o.r(t),o.d(t,{default:()=>P,getTableFooterUtilityClass:()=>Z,tableFooterClasses:()=>v});var a=o(7896),s=o(31461),l=o(5057),n=o(9978),r=o(82261),i=o(27864),c=o(42908),u=o(62773),d=o(46849),p=o(96036);function Z(e){return(0,p.ZP)("MuiTableFooter",e)}const v=(0,d.Z)("MuiTableFooter",["root"]);var b=o(96266);const f=["className","component"],g=(0,u.ZP)("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),m={variant:"footer"},h="tfoot",P=l.forwardRef((function(e,t){const o=(0,c.Z)({props:e,name:"MuiTableFooter"}),{className:l,component:u=h}=o,d=(0,s.Z)(o,f),p=(0,a.Z)({},o,{component:u}),v=(e=>{const{classes:t}=e;return(0,r.Z)({root:["root"]},Z,t)})(p);return(0,b.jsx)(i.Z.Provider,{value:m,children:(0,b.jsx)(g,(0,a.Z)({as:u,className:(0,n.Z)(v.root,l),ref:t,role:u===h?null:"rowgroup",ownerState:p},d))})}))},88064:(e,t,o)=>{o.r(t),o.d(t,{default:()=>P,getTableHeadUtilityClass:()=>Z,tableHeadClasses:()=>v});var a=o(7896),s=o(31461),l=o(5057),n=o(9978),r=o(82261),i=o(27864),c=o(42908),u=o(62773),d=o(46849),p=o(96036);function Z(e){return(0,p.ZP)("MuiTableHead",e)}const v=(0,d.Z)("MuiTableHead",["root"]);var b=o(96266);const f=["className","component"],g=(0,u.ZP)("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),m={variant:"head"},h="thead",P=l.forwardRef((function(e,t){const o=(0,c.Z)({props:e,name:"MuiTableHead"}),{className:l,component:u=h}=o,d=(0,s.Z)(o,f),p=(0,a.Z)({},o,{component:u}),v=(e=>{const{classes:t}=e;return(0,r.Z)({root:["root"]},Z,t)})(p);return(0,b.jsx)(i.Z.Provider,{value:m,children:(0,b.jsx)(g,(0,a.Z)({as:u,className:(0,n.Z)(v.root,l),ref:t,role:u===h?null:"rowgroup",ownerState:p},d))})}))},9246:(e,t,o)=>{o.r(t),o.d(t,{default:()=>D,getTablePaginationUtilityClass:()=>R,tablePaginationClasses:()=>L});var a=o(31461),s=o(7896),l=o(5057),n=o(9978),r=o(89081),i=o(82261),c=o(62773),u=o(42908),d=o(58802),p=o(74490),Z=o(51177),v=o(28627),b=o(95301),f=o(13804),g=o(4601),m=o(50999),h=o(67680),P=o(54665),C=o(96646),x=o(96266);const y=["backIconButtonProps","count","disabled","getItemAriaLabel","nextIconButtonProps","onPageChange","page","rowsPerPage","showFirstButton","showLastButton","slots","slotProps"],w=l.forwardRef((function(e,t){var o,l,n,r,i,c,u,d;const{backIconButtonProps:p,count:Z,disabled:v=!1,getItemAriaLabel:b,nextIconButtonProps:w,onPageChange:I,page:B,rowsPerPage:M,showFirstButton:R,showLastButton:L,slots:j={},slotProps:S={}}=e,T=(0,a.Z)(e,y),U=(0,f.V)(),k=null!=(o=j.firstButton)?o:h.Z,F=null!=(l=j.lastButton)?l:h.Z,N=null!=(n=j.nextButton)?n:h.Z,z=null!=(r=j.previousButton)?r:h.Z,H=null!=(i=j.firstButtonIcon)?i:C.Z,_=null!=(c=j.lastButtonIcon)?c:P.Z,A=null!=(u=j.nextButtonIcon)?u:m.Z,D=null!=(d=j.previousButtonIcon)?d:g.Z,O=U?F:k,V=U?N:z,G=U?z:N,K=U?k:F,E=U?S.lastButton:S.firstButton,J=U?S.nextButton:S.previousButton,Q=U?S.previousButton:S.nextButton,X=U?S.firstButton:S.lastButton;return(0,x.jsxs)("div",(0,s.Z)({ref:t},T,{children:[R&&(0,x.jsx)(O,(0,s.Z)({onClick:e=>{I(e,0)},disabled:v||0===B,"aria-label":b("first",B),title:b("first",B)},E,{children:U?(0,x.jsx)(_,(0,s.Z)({},S.lastButtonIcon)):(0,x.jsx)(H,(0,s.Z)({},S.firstButtonIcon))})),(0,x.jsx)(V,(0,s.Z)({onClick:e=>{I(e,B-1)},disabled:v||0===B,color:"inherit","aria-label":b("previous",B),title:b("previous",B)},null!=J?J:p,{children:U?(0,x.jsx)(A,(0,s.Z)({},S.nextButtonIcon)):(0,x.jsx)(D,(0,s.Z)({},S.previousButtonIcon))})),(0,x.jsx)(G,(0,s.Z)({onClick:e=>{I(e,B+1)},disabled:v||-1!==Z&&B>=Math.ceil(Z/M)-1,color:"inherit","aria-label":b("next",B),title:b("next",B)},null!=Q?Q:w,{children:U?(0,x.jsx)(D,(0,s.Z)({},S.previousButtonIcon)):(0,x.jsx)(A,(0,s.Z)({},S.nextButtonIcon))})),L&&(0,x.jsx)(K,(0,s.Z)({onClick:e=>{I(e,Math.max(0,Math.ceil(Z/M)-1))},disabled:v||B>=Math.ceil(Z/M)-1,"aria-label":b("last",B),title:b("last",B)},X,{children:U?(0,x.jsx)(H,(0,s.Z)({},S.firstButtonIcon)):(0,x.jsx)(_,(0,s.Z)({},S.lastButtonIcon))}))]}))}));var I=o(80538),B=o(46849),M=o(96036);function R(e){return(0,M.ZP)("MuiTablePagination",e)}const L=(0,B.Z)("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var j;const S=["ActionsComponent","backIconButtonProps","className","colSpan","component","count","disabled","getItemAriaLabel","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onPageChange","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps","showFirstButton","showLastButton","slotProps","slots"],T=(0,c.ZP)(v.Z,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})((e=>{let{theme:t}=e;return{overflow:"auto",color:(t.vars||t).palette.text.primary,fontSize:t.typography.pxToRem(14),"&:last-child":{padding:0}}})),U=(0,c.ZP)(b.Z,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>(0,s.Z)({["& .".concat(L.actions)]:t.actions},t.toolbar)})((e=>{let{theme:t}=e;return{minHeight:52,paddingRight:2,["".concat(t.breakpoints.up("xs")," and (orientation: landscape)")]:{minHeight:52},[t.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},["& .".concat(L.actions)]:{flexShrink:0,marginLeft:20}}})),k=(0,c.ZP)("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),F=(0,c.ZP)("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})((e=>{let{theme:t}=e;return(0,s.Z)({},t.typography.body2,{flexShrink:0})})),N=(0,c.ZP)(Z.Z,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>(0,s.Z)({["& .".concat(L.selectIcon)]:t.selectIcon,["& .".concat(L.select)]:t.select},t.input,t.selectRoot)})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,["& .".concat(L.select)]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),z=(0,c.ZP)(p.Z,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),H=(0,c.ZP)("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})((e=>{let{theme:t}=e;return(0,s.Z)({},t.typography.body2,{flexShrink:0})}));function _(e){let{from:t,to:o,count:a}=e;return"".concat(t,"\u2013").concat(o," of ").concat(-1!==a?a:"more than ".concat(o))}function A(e){return"Go to ".concat(e," page")}const D=l.forwardRef((function(e,t){var o;const c=(0,u.Z)({props:e,name:"MuiTablePagination"}),{ActionsComponent:p=w,backIconButtonProps:Z,className:b,colSpan:f,component:g=v.Z,count:m,disabled:h=!1,getItemAriaLabel:P=A,labelDisplayedRows:C=_,labelRowsPerPage:y="Rows per page:",nextIconButtonProps:B,onPageChange:M,onRowsPerPageChange:L,page:D,rowsPerPage:O,rowsPerPageOptions:V=[10,25,50,100],SelectProps:G={},showFirstButton:K=!1,showLastButton:E=!1,slotProps:J={},slots:Q={}}=c,X=(0,a.Z)(c,S),Y=c,q=(e=>{const{classes:t}=e;return(0,i.Z)({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},R,t)})(Y),W=null!=(o=null==J?void 0:J.select)?o:G,$=W.native?"option":z;let ee;g!==v.Z&&"td"!==g||(ee=f||1e3);const te=(0,I.Z)(W.id),oe=(0,I.Z)(W.labelId);return(0,x.jsx)(T,(0,s.Z)({colSpan:ee,ref:t,as:g,ownerState:Y,className:(0,n.Z)(q.root,b)},X,{children:(0,x.jsxs)(U,{className:q.toolbar,children:[(0,x.jsx)(k,{className:q.spacer}),V.length>1&&(0,x.jsx)(F,{className:q.selectLabel,id:oe,children:y}),V.length>1&&(0,x.jsx)(N,(0,s.Z)({variant:"standard"},!W.variant&&{input:j||(j=(0,x.jsx)(d.ZP,{}))},{value:O,onChange:L,id:te,labelId:oe},W,{classes:(0,s.Z)({},W.classes,{root:(0,n.Z)(q.input,q.selectRoot,(W.classes||{}).root),select:(0,n.Z)(q.select,(W.classes||{}).select),icon:(0,n.Z)(q.selectIcon,(W.classes||{}).icon)}),disabled:h,children:V.map((e=>(0,l.createElement)($,(0,s.Z)({},!(0,r.X)($)&&{ownerState:Y},{className:q.menuItem,key:e.label?e.label:e,value:e.value?e.value:e}),e.label?e.label:e)))})),(0,x.jsx)(H,{className:q.displayedRows,children:C({from:0===m?0:D*O+1,to:-1===m?(D+1)*O:-1===O?m:Math.min(m,(D+1)*O),count:-1===m?-1:m,page:D})}),(0,x.jsx)(p,{className:q.actions,backIconButtonProps:Z,count:m,nextIconButtonProps:B,onPageChange:M,page:D,rowsPerPage:O,showFirstButton:K,showLastButton:E,slotProps:J.actions,slots:Q.actions,getItemAriaLabel:P,disabled:h})]})}))}))},23232:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getTableRowUtilityClass:()=>s.G,tableRowClasses:()=>s.Z});var a=o(83366),s=o(55865)},90363:(e,t,o)=>{o.r(t),o.d(t,{default:()=>x,getTableSortLabelUtilityClass:()=>g,tableSortLabelClasses:()=>m});var a=o(31461),s=o(7896),l=o(82261),n=o(9978),r=o(5057),i=o(66230),c=o(57471),u=o(96266);const d=(0,c.Z)((0,u.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");var p=o(62773),Z=o(42908),v=o(6285),b=o(46849),f=o(96036);function g(e){return(0,f.ZP)("MuiTableSortLabel",e)}const m=(0,b.Z)("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc"]),h=["active","children","className","direction","hideSortIcon","IconComponent"],P=(0,p.ZP)(i.Z,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.active&&t.active]}})((e=>{let{theme:t}=e;return{cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(t.vars||t).palette.text.secondary},"&:hover":{color:(t.vars||t).palette.text.secondary,["& .".concat(m.icon)]:{opacity:.5}},["&.".concat(m.active)]:{color:(t.vars||t).palette.text.primary,["& .".concat(m.icon)]:{opacity:1,color:(t.vars||t).palette.text.secondary}}}})),C=(0,p.ZP)("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.icon,t["iconDirection".concat((0,v.Z)(o.direction))]]}})((e=>{let{theme:t,ownerState:o}=e;return(0,s.Z)({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:t.transitions.create(["opacity","transform"],{duration:t.transitions.duration.shorter}),userSelect:"none"},"desc"===o.direction&&{transform:"rotate(0deg)"},"asc"===o.direction&&{transform:"rotate(180deg)"})})),x=r.forwardRef((function(e,t){const o=(0,Z.Z)({props:e,name:"MuiTableSortLabel"}),{active:r=!1,children:i,className:c,direction:p="asc",hideSortIcon:b=!1,IconComponent:f=d}=o,m=(0,a.Z)(o,h),x=(0,s.Z)({},o,{active:r,direction:p,hideSortIcon:b,IconComponent:f}),y=(e=>{const{classes:t,direction:o,active:a}=e,s={root:["root",a&&"active"],icon:["icon","iconDirection".concat((0,v.Z)(o))]};return(0,l.Z)(s,g,t)})(x);return(0,u.jsxs)(P,(0,s.Z)({className:(0,n.Z)(y.root,c),component:"span",disableRipple:!0,ownerState:x,ref:t},m,{children:[i,b&&!r?null:(0,u.jsx)(C,{as:f,className:(0,n.Z)(y.icon),ownerState:x})]}))}))},7037:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getTextFieldUtilityClass:()=>s.I,textFieldClasses:()=>s.Z});var a=o(47020),s=o(13421)},30542:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getToolbarUtilityClass:()=>s.N,toolbarClasses:()=>s.Z});var a=o(95301),s=o(28751)},15747:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getTooltipUtilityClass:()=>s.Q,tooltipClasses:()=>s.Z});var a=o(75239),s=o(79350)},67623:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a.Z,getTypographyUtilityClass:()=>s.f,typographyClasses:()=>s.Z});var a=o(11750),s=o(3737)},96646:(e,t,o)=>{o.d(t,{Z:()=>l});o(5057);var a=o(57471),s=o(96266);const l=(0,a.Z)((0,s.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage")},54665:(e,t,o)=>{o.d(t,{Z:()=>l});o(5057);var a=o(57471),s=o(96266);const l=(0,a.Z)((0,s.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage")}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[9733],{35701:(t,e,n)=>{"use strict";e.Z=void 0;(r=n(5057))&&r.__esModule;var r,o=n(96266);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c=function(t){return(0,o.jsx)("svg",a(a({},t),{},{children:(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.361 2.4a.8.8 0 0 0-.728.469L.873 15.54a.8.8 0 0 0-.072.33V27.393a.8.8 0 0 0 .8.8h28.8a.8.8 0 0 0 .8-.8v-11.52a.8.8 0 0 0-.072-.331L25.37 2.869a.8.8 0 0 0-.728-.47H7.361zm-4.96 14.4v9.792h27.2v-9.799a.814.814 0 0 1-.104.007h-7.098l-2.066 3.1a.8.8 0 0 1-.666.356h-8.064a.8.8 0 0 1-.665-.356L8.87 16.8h-6.47zm26.816-1.6H21.97a.8.8 0 0 0-.665.356l-2.067 3.1h-7.208l-2.066-3.1a.8.8 0 0 0-.666-.356H2.785L7.876 4h16.25l5.09 11.2z",fill:"currentColor"})}))};c.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c.displayName="empty";e.Z=c},18067:(t,e,n)=>{"use strict";e.Z=void 0;(r=n(5057))&&r.__esModule;var r,o=n(96266);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c=function(t){return(0,o.jsx)("svg",a(a({},t),{},{children:(0,o.jsx)("path",{d:"M11.78 2.25c-2.767 0-5.019 2.271-5.019 5.063v3.037H5.758a2.018 2.018 0 0 0-2.008 2.025v8.1c0 1.117.9 2.025 2.008 2.025h12.045a2.018 2.018 0 0 0 2.007-2.025v-8.1c0-1.117-.9-2.025-2.007-2.025h-1.004V7.313c0-2.792-2.251-5.063-5.019-5.063zm6.023 10.125l.002 8.1H5.758v-8.1h12.045zM8.769 10.35V7.313c0-1.675 1.35-3.038 3.011-3.038 1.66 0 3.011 1.363 3.011 3.037v3.038H8.77z"})}))};c.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},c.displayName="lock";e.Z=c},25710:(t,e,n)=>{"use strict";n.d(e,{Z:()=>p});var r,o=n(71171),i=n(55898),a=n.n(i),s=n(39948),c=n(35701),d=n(47685),l=n(96266);const u=(0,d.zo)(s.Z)(r||(r=(0,o.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n height: 100%;\n min-height: 100px;\n color: #999;\n .empty-icon {\n margin: 10px 0;\n }\n"])));function h(t){let{color:e,size:n,children:r,...o}=t;return(0,l.jsxs)(u,{...o,children:[(0,l.jsx)(c.Z,{style:{width:n,height:n,color:e},className:"empty-icon"}),(0,l.jsx)(s.Z,{className:"empty-content",children:r})]})}h.propTypes={color:a().string,size:a().number,children:a().any},h.defaultProps={color:"inherit",size:36,children:null};const p=h},64886:(t,e,n)=>{"use strict";n.d(e,{Z:()=>v});var r,o=n(71171),i=n(55898),a=n.n(i),s=n(51540),c=n.n(s),d=n(26538),l=n.n(d),u=n(11750),h=n(47685),p=n(96266);function f(t){let{name:e,nameFormatter:n,layout:r,children:o,valueComponent:i,nameWidth:a,...s}=t;return(0,p.jsxs)(g,{layout:r,width:a,...s,children:[(0,p.jsx)(u.Z,{color:"textSecondary",className:"info-row__name",children:n(e)}),o&&(0,p.jsx)(u.Z,{color:"textPrimary",component:i,className:"info-row__value",children:o})]})}f.propTypes={name:a().any.isRequired,layout:a().oneOf(["horizontal","vertical"]),children:a().any,nameFormatter:a().func,valueComponent:a().string,nameWidth:a().number},f.defaultProps={children:null,nameWidth:90,nameFormatter:t=>{const e=t.split(" ").map((t=>l()(c()(t)))).join(" ");return"string"===typeof t?e:t},valueComponent:"div",layout:"horizontal"};const g=(0,h.zo)("div")(r||(r=(0,o.Z)(["\n display: flex;\n flex-direction: ",";\n justify-content: flex-start;\n align-items: ",";\n margin-bottom: 16px;\n\n .info-row__name {\n width: ","px;\n margin-right: ",";\n margin-bottom: ",";\n text-transform: capitalize;\n }\n\n .info-row__value {\n flex: 1;\n overflow: auto;\n word-wrap: break-word;\n font-weight: 500;\n }\n\n @media (max-width: ","px) {\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n .info-row__name {\n font-weight: bold;\n }\n\n .info-row__value {\n width: 100%;\n font-size: 12px;\n margin-top: 8px;\n }\n }\n"])),(t=>"vertical"===t.layout?"column":"row"),(t=>"vertical"===t.layout?"flex-start":"center"),(t=>t.width),(t=>"vertical"===t.layout?"0":"8px"),(t=>"vertical"===t.layout?"8px":"0"),(t=>t.theme.breakpoints.values.md)),v=f},41297:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(96366),o=n(15715);function i(t){let{key:e="sm"}=t;const n=(0,r.Z)();return(0,o.Z)(n.breakpoints.down(e))}},44919:(t,e,n)=>{"use strict";var r=n(71600);e.Z=void 0;var o=r(n(56930)),i=n(96266);e.Z=(0,o.default)((0,i.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add")},11593:(t,e,n)=>{"use strict";var r=n(71600);e.Z=void 0;var o=r(n(56930)),i=n(96266);e.Z=(0,o.default)((0,i.jsx)("path",{d:"M17 20.41 18.41 19 15 15.59 13.59 17zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5z"}),"CallMerge")},76416:(t,e,n)=>{"use strict";var r=n(71600);e.Z=void 0;var o=r(n(56930)),i=n(96266);e.Z=(0,o.default)((0,i.jsx)("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond")},17655:(t,e,n)=>{"use strict";var r=n(71600);e.Z=void 0;var o=r(n(56930)),i=n(96266);e.Z=(0,o.default)((0,i.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess")},31942:(t,e,n)=>{"use strict";var r=n(71600);e.Z=void 0;var o=r(n(56930)),i=n(96266);e.Z=(0,o.default)((0,i.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Https")},34966:(t,e,n)=>{"use strict";var r=n(71600);e.Z=void 0;var o=r(n(56930)),i=n(96266);e.Z=(0,o.default)((0,i.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined")},96538:(t,e,n)=>{"use strict";var r=n(71600);e.Z=void 0;var o=r(n(56930)),i=n(96266);e.Z=(0,o.default)((0,i.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"OpenInNew")},39067:(t,e,n)=>{"use strict";n.d(e,{Z:()=>P});var r=n(31461),o=n(7896),i=n(5057),a=n(6285),s=n(80538),c=n(82261),d=n(62773),l=n(42908),u=n(56556),h=n(17681),p=n(44846),f=n(39621),g=n(96036);function v(t){return(0,g.ZP)("MuiLoadingButton",t)}const b=(0,n(46849).Z)("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]);var m=n(96266);const x=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],y=(0,d.ZP)(u.Z,{shouldForwardProp:t=>(t=>"ownerState"!==t&&"theme"!==t&&"sx"!==t&&"as"!==t&&"classes"!==t)(t)||"classes"===t,name:"MuiLoadingButton",slot:"Root",overridesResolver:(t,e)=>[e.root,e.startIconLoadingStart&&{["& .".concat(b.startIconLoadingStart)]:e.startIconLoadingStart},e.endIconLoadingEnd&&{["& .".concat(b.endIconLoadingEnd)]:e.endIconLoadingEnd}]})((t=>{let{ownerState:e,theme:n}=t;return(0,o.Z)({["& .".concat(b.startIconLoadingStart,", & .").concat(b.endIconLoadingEnd)]:{transition:n.transitions.create(["opacity"],{duration:n.transitions.duration.short}),opacity:0}},"center"===e.loadingPosition&&{transition:n.transitions.create(["background-color","box-shadow","border-color"],{duration:n.transitions.duration.short}),["&.".concat(b.loading)]:{color:"transparent"}},"start"===e.loadingPosition&&e.fullWidth&&{["& .".concat(b.startIconLoadingStart,", & .").concat(b.endIconLoadingEnd)]:{transition:n.transitions.create(["opacity"],{duration:n.transitions.duration.short}),opacity:0,marginRight:-8}},"end"===e.loadingPosition&&e.fullWidth&&{["& .".concat(b.startIconLoadingStart,", & .").concat(b.endIconLoadingEnd)]:{transition:n.transitions.create(["opacity"],{duration:n.transitions.duration.short}),opacity:0,marginLeft:-8}})})),w=(0,d.ZP)("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.loadingIndicator,e["loadingIndicator".concat((0,a.Z)(n.loadingPosition))]]}})((t=>{let{theme:e,ownerState:n}=t;return(0,o.Z)({position:"absolute",visibility:"visible",display:"flex"},"start"===n.loadingPosition&&("outlined"===n.variant||"contained"===n.variant)&&{left:"small"===n.size?10:14},"start"===n.loadingPosition&&"text"===n.variant&&{left:6},"center"===n.loadingPosition&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},"end"===n.loadingPosition&&("outlined"===n.variant||"contained"===n.variant)&&{right:"small"===n.size?10:14},"end"===n.loadingPosition&&"text"===n.variant&&{right:6},"start"===n.loadingPosition&&n.fullWidth&&{position:"relative",left:-10},"end"===n.loadingPosition&&n.fullWidth&&{position:"relative",right:-10})})),P=i.forwardRef((function(t,e){const n=i.useContext(h.Z),d=(0,f.Z)(n,t),u=(0,l.Z)({props:d,name:"MuiLoadingButton"}),{children:g,disabled:b=!1,id:P,loading:j=!1,loadingIndicator:Z,loadingPosition:O="center",variant:L="text"}=u,I=(0,r.Z)(u,x),z=(0,s.Z)(P),S=null!=Z?Z:(0,m.jsx)(p.Z,{"aria-labelledby":z,color:"inherit",size:16}),E=(0,o.Z)({},u,{disabled:b,loading:j,loadingIndicator:S,loadingPosition:O,variant:L}),C=(t=>{const{loading:e,loadingPosition:n,classes:r}=t,i={root:["root",e&&"loading"],startIcon:[e&&"startIconLoading".concat((0,a.Z)(n))],endIcon:[e&&"endIconLoading".concat((0,a.Z)(n))],loadingIndicator:["loadingIndicator",e&&"loadingIndicator".concat((0,a.Z)(n))]},s=(0,c.Z)(i,v,r);return(0,o.Z)({},r,s)})(E),M=j?(0,m.jsx)(w,{className:C.loadingIndicator,ownerState:E,children:S}):null;return(0,m.jsxs)(y,(0,o.Z)({disabled:b||j,id:z,ref:e},I,{variant:L,classes:C,ownerState:E,children:["end"===E.loadingPosition?g:M,"end"===E.loadingPosition?M:g]}))}))},48191:(t,e,n)=>{var r=n(54305);t.exports=function(t,e){for(var n=-1,o=t.length;++n<o&&r(e,t[n],0)>-1;);return n}},11854:(t,e,n)=>{var r=n(57333),o=n(39594),i=n(69123),a=n(38828),s=n(48191),c=n(38554),d=n(26849);t.exports=function(t,e,n){if((t=d(t))&&(n||void 0===e))return o(t);if(!t||!(e=r(e)))return t;var l=c(t),u=c(e),h=s(l,u),p=a(l,u)+1;return i(l,h,p).join("")}},46422:(t,e,n)=>{"use strict";n.r(e),n.d(e,{base32:()=>l,base32hex:()=>f,base32hexpad:()=>v,base32hexpadupper:()=>b,base32hexupper:()=>g,base32pad:()=>h,base32padupper:()=>p,base32upper:()=>u,base32z:()=>m});new Uint8Array(0);class r{constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(t));throw Error("Unknown type, must be binary type")}}class o{constructor(t,e,n){if(this.name=t,this.prefix=e,void 0===e.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if("string"===typeof t){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error("Unable to decode multibase string ".concat(JSON.stringify(t),", ").concat(this.name," decoder only supports inputs prefixed with ").concat(this.prefix));return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return a(this,t)}}class i{constructor(t){this.decoders=t}or(t){return a(this,t)}decode(t){const e=t[0],n=this.decoders[e];if(n)return n.decode(t);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(t),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}const a=(t,e)=>new i({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class s{constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new r(t,e,n),this.decoder=new o(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const c=t=>{let{name:e,prefix:n,encode:r,decode:o}=t;return new s(e,n,r,o)},d=t=>{let{name:e,prefix:n,bitsPerChar:r,alphabet:o}=t;return c({prefix:n,name:e,encode:t=>((t,e,n)=>{const r="="===e[e.length-1],o=(1<<n)-1;let i="",a=0,s=0;for(let c=0;c<t.length;++c)for(s=s<<8|t[c],a+=8;a>n;)a-=n,i+=e[o&s>>a];if(a&&(i+=e[o&s<<n-a]),r)for(;i.length*n&7;)i+="=";return i})(t,o,r),decode:t=>((t,e,n,r)=>{const o={};for(let l=0;l<e.length;++l)o[e[l]]=l;let i=t.length;for(;"="===t[i-1];)--i;const a=new Uint8Array(i*n/8|0);let s=0,c=0,d=0;for(let l=0;l<i;++l){const e=o[t[l]];if(void 0===e)throw new SyntaxError("Non-".concat(r," character"));c=c<<n|e,s+=n,s>=8&&(s-=8,a[d++]=255&c>>s)}if(s>=n||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return a})(t,o,r,e)})},l=d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),u=d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),h=d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),p=d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),f=d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),g=d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),v=d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),b=d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),m=d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}}]);
|