@abtnode/blocklet-services 1.16.16-beta-ca17cc31 → 1.16.16-beta-cfa95fa6
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/api/emails/components/copyright.js +3 -1
- package/api/socket/channel/component.js +18 -19
- package/build/asset-manifest.json +97 -97
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/service-worker.js.map +1 -1
- package/build/static/js/{1013.48b6d77d.chunk.js → 1013.7b9f0d1c.chunk.js} +3 -3
- package/build/static/js/{1480.88c590c2.chunk.js → 1480.4d4dda1b.chunk.js} +2 -2
- package/build/static/js/1565.ba7ad6c9.chunk.js +2 -0
- package/build/static/js/2291.1627e4db.chunk.js +2 -0
- package/build/static/js/{2393.c5bbedfd.chunk.js → 2393.29558f48.chunk.js} +2 -2
- package/build/static/js/{2631.54f86f84.chunk.js → 2631.58f5f3bd.chunk.js} +2 -2
- package/build/static/js/2653.e7392aa1.chunk.js +2 -0
- package/build/static/js/{2686.7ae70bfd.chunk.js → 2686.890b32ed.chunk.js} +2 -2
- package/build/static/js/{2838.6fa46760.chunk.js → 2838.777de983.chunk.js} +3 -3
- package/build/static/js/{3038.8cbed218.chunk.js → 3038.40d611d1.chunk.js} +2 -2
- package/build/static/js/3593.4d68c718.chunk.js +2 -0
- package/build/static/js/3595.e2b52a55.chunk.js +3 -0
- package/build/static/js/3688.a821d97e.chunk.js +2 -0
- package/build/static/js/4023.c145cf94.chunk.js +2 -0
- package/build/static/js/{4355.42023420.chunk.js → 4355.7ff96d41.chunk.js} +2 -2
- package/build/static/js/4420.8b69d6e7.chunk.js +2 -0
- package/build/static/js/4706.d0c07efb.chunk.js +3 -0
- package/build/static/js/4716.bd8bed1b.chunk.js +2 -0
- package/build/static/js/{476.1f6135d6.chunk.js → 476.f196e88a.chunk.js} +2 -2
- package/build/static/js/4802.c534aa74.chunk.js +2 -0
- package/build/static/js/{5465.e0965b1d.chunk.js → 5465.19cd4b1f.chunk.js} +2 -2
- package/build/static/js/5628.8e4d578c.chunk.js +2 -0
- package/build/static/js/{5673.ab67c509.chunk.js → 5673.24aec022.chunk.js} +2 -2
- package/build/static/js/{5683.7e5d47f1.chunk.js → 5683.19dfa1f2.chunk.js} +2 -2
- package/build/static/js/{5960.adcd2848.chunk.js → 5960.e6da30ae.chunk.js} +2 -2
- package/build/static/js/{5982.89bdb419.chunk.js → 5982.27671e0b.chunk.js} +2 -2
- package/build/static/js/6186.99068c82.chunk.js +2 -0
- package/build/static/js/6452.8510e39f.chunk.js +2 -0
- package/build/static/js/{6498.bd96fa39.chunk.js → 6498.698608f8.chunk.js} +2 -2
- package/build/static/js/6576.2afa44eb.chunk.js +2 -0
- package/build/static/js/6737.16a327aa.chunk.js +2 -0
- package/build/static/js/{6771.acc94e01.chunk.js → 6771.fae30b2e.chunk.js} +3 -3
- package/build/static/js/6856.2eb98754.chunk.js +2 -0
- package/build/static/js/{6868.f2fd5c29.chunk.js → 6868.b4a7c4d1.chunk.js} +2 -2
- package/build/static/js/{6640.f40cecbd.chunk.js → 6919.aa19f009.chunk.js} +2 -2
- package/build/static/js/{7465.babf76bb.chunk.js → 6974.9fe85473.chunk.js} +3 -3
- package/build/static/js/{7006.b72aff66.chunk.js → 7006.8f0645e5.chunk.js} +2 -2
- package/build/static/js/{7367.60cb10e0.chunk.js → 7367.c5adfbb1.chunk.js} +2 -2
- package/build/static/js/7516.eb541f26.chunk.js +2 -0
- package/build/static/js/{8143.e1c8ca20.chunk.js → 8143.34374ce2.chunk.js} +2 -2
- package/build/static/js/{8497.0cf2247d.chunk.js → 8497.e83aa0c8.chunk.js} +2 -2
- package/build/static/js/{8604.ad77a749.chunk.js → 8604.ad426a4a.chunk.js} +3 -3
- package/build/static/js/9088.4313ac38.chunk.js +3 -0
- package/build/static/js/9102.ff87def5.chunk.js +2 -0
- package/build/static/js/9409.c853d69d.chunk.js +2 -0
- package/build/static/js/941.94668382.chunk.js +2 -0
- package/build/static/js/{9899.af2e4f43.chunk.js → 9899.277d673f.chunk.js} +2 -2
- package/build/static/js/main.adbd79ef.js +3 -0
- package/package.json +25 -25
- package/build/static/js/1565.6df974b9.chunk.js +0 -2
- package/build/static/js/2291.4b1a6a86.chunk.js +0 -2
- package/build/static/js/2653.5dc29ed5.chunk.js +0 -2
- package/build/static/js/3593.c1eddcd6.chunk.js +0 -2
- package/build/static/js/3595.cbf763c8.chunk.js +0 -3
- package/build/static/js/3688.9bb1c7a8.chunk.js +0 -2
- package/build/static/js/4023.6d1a7ac8.chunk.js +0 -2
- package/build/static/js/4420.55971847.chunk.js +0 -2
- package/build/static/js/4706.212c92c8.chunk.js +0 -3
- package/build/static/js/4716.88f32cf2.chunk.js +0 -2
- package/build/static/js/4802.cf122fc7.chunk.js +0 -2
- package/build/static/js/50.cbaa5a4e.chunk.js +0 -3
- package/build/static/js/5628.e46ecc79.chunk.js +0 -2
- package/build/static/js/6186.6c16ec07.chunk.js +0 -2
- package/build/static/js/6452.143af37a.chunk.js +0 -2
- package/build/static/js/6576.f78daf32.chunk.js +0 -2
- package/build/static/js/6700.5dfd9c70.chunk.js +0 -2
- package/build/static/js/6737.7d135225.chunk.js +0 -2
- package/build/static/js/6856.e185e317.chunk.js +0 -2
- package/build/static/js/9102.828066ce.chunk.js +0 -2
- package/build/static/js/9409.62a2aee0.chunk.js +0 -2
- package/build/static/js/941.6a4ed4dd.chunk.js +0 -2
- package/build/static/js/main.8ae2fba0.js +0 -3
- /package/build/static/js/{1013.48b6d77d.chunk.js.LICENSE.txt → 1013.7b9f0d1c.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{2838.6fa46760.chunk.js.LICENSE.txt → 2838.777de983.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{3595.cbf763c8.chunk.js.LICENSE.txt → 3595.e2b52a55.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{4706.212c92c8.chunk.js.LICENSE.txt → 4706.d0c07efb.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{6771.acc94e01.chunk.js.LICENSE.txt → 6771.fae30b2e.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7465.babf76bb.chunk.js.LICENSE.txt → 6974.9fe85473.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{8604.ad77a749.chunk.js.LICENSE.txt → 8604.ad426a4a.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{50.cbaa5a4e.chunk.js.LICENSE.txt → 9088.4313ac38.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.8ae2fba0.js.LICENSE.txt → main.adbd79ef.js.LICENSE.txt} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[4023],{94785:function(n,e,t){var i=t(38636).default,o=t(73408).default,r=t(814).default,a=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.splitNavigationBySection=e.flattenNavigation=e.checkLink=e.joinLink=e.cleanOrphanNavigation=e.filterNavigation=e.nestNavigationList=e.isMatchSection=e.deepWalk=e.parseNavigation=void 0;var l=a(t(8566)),c=a(t(15888)),s=a(t(49735)),u=a(t(60523)),d=a(t(88674)),f=a(t(74082)),v=a(t(19611)),m=a(t(22523)),p=a(t(34155)),h=t(50576),g="header",x="/",k="/",b="/",j=function(n){return!(!(0,p.default)(n)&&!function(n){return/^\/(?:[^/]+\/)*$/.test(n)||/^\/(?:[^/]+\/)*[^/]+$/.test(n)}(n))};function Z(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.key,o=void 0===i?"children":i,r=t.order,a=void 0===r?"first":r;!function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.index,l=void 0===r?0:r,c=i.parent,s=void 0===c?null:c,u=i.level,d=void 0===u?0:u;Array.isArray(t)?t.forEach((function(e,t){n(e,{index:t,parent:s,level:d+1})})):t&&("first"===a&&e(t,s,{index:l,level:d}),n(t[o],{parent:t,level:d}),"last"===a&&e(t,s,{index:l,level:d}))}(n)}function y(n,e){return!(e!==g||!(0,u.default)(n))||(Array.isArray(n)?n.includes(e):n===e)}function L(n){try{return JSON.parse(n)}catch(e){return n}}function N(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,p.default)(e||""))return e;var t=m.default.join(n,e||k);return t.length>1&&t.endsWith("/")?t.slice(0,t.length-1):t}function S(n,e){var t=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).strict,i=n,r=e;return void 0===t||t||(i=i||"/",r=r||"/"),(0,h.isObject)(i)&&(0,h.isString)(r)&&j(r)?Object.keys(i).reduce((function(n,e){return n[e]=N(i[e],r),n}),{}):(0,h.isString)(i)&&j(i)&&(0,h.isObject)(r)?Object.keys(r).reduce((function(n,e){return n[e]=N(i,r[e]),n}),{}):(0,h.isString)(i)&&(0,h.isString)(r)?j(i)||j(r)?N(i,r):r:(0,h.isObject)(i)&&(0,h.isObject)(r)?o(new Set([].concat(o(Object.keys(i)),o(Object.keys(r))))).reduce((function(n,e){return n[e]=N(i[e],r[e]),n}),{}):r}function w(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.depth,i=void 0===t?1:t,r=e.transform,a=void 0===r?function(n){return n}:r,l=(0,f.default)(n),c=[];return Z(l,(function(n,e,t){var r=t.level;if(r>=i){var l=n.items,s=void 0===l?[]:l;if(s&&Array.isArray(s)&&s.length>0){delete n.items;var u=s.map((function(e){return a(e,n)}));if(e){var f;(f=e.items).push.apply(f,o(u))}else{var v=a((0,d.default)(n,["items"]),e);c.push.apply(c,[v].concat(o(u)))}}else if(1===r){var m=a((0,d.default)(n,["items"]),e);c.push(m)}}else 1===r&&c.push(n)}),{key:"items",order:"last"}),c}function C(n){var e,t=(0,f.default)(n),a=[],l=i(t);try{var c=function(){var n=e.value,t=(0,f.default)((0,d.default)(n,["items"])),l=[];function c(n,e){var i=function(n,e){return e&&Array.isArray(n.items)?n.items.filter((function(t){return(0,u.default)(t.section)?y(n.section,e):!!y(t.section,e)})).map((function(n){return r(r({},n),{},{section:e})})):[]}(n,e);l.push(r(r({},t),{},{section:e,items:i}))}if(Array.isArray(n.section)){var s,v=i(n.section);try{for(v.s();!(s=v.n()).done;){c(n,s.value)}}catch(k){v.e(k)}finally{v.f()}}else if(n.section){c(n,n.section)}else if(n.items&&n.items.length>0){var m,p=n.items.reduce((function(n,e){var t=(e||{}).section,i=void 0===t?[g]:t;return n.push.apply(n,o(i)),n}),[]),h=o(new Set(p)),x=i(h);try{for(x.s();!(m=x.n()).done;){c(n,m.value)}}catch(k){x.e(k)}finally{x.f()}}else l.push(r(r({},n),{},{section:g}));a.push.apply(a,l)};for(l.s();!(e=l.n()).done;)c()}catch(s){l.e(s)}finally{l.f()}return a}function P(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=(0,f.default)(n);return e.reduceRight((function(n,t,i){if(t.parent){var r=e.find((function(n){return t.section&&n.section?n.section===t.section&&n.id===t.parent:n.id===t.parent}));r&&(r.items||(r.items=[]),r.items=[t].concat(o(r.items))),e.splice(i,1)}return null}),null),e}e.checkLink=j,e.deepWalk=Z,e.isMatchSection=y,e.joinLink=function(n,e){var t=(0,f.default)(n);return Z(t,(function(n,t){var i=n.component||n.child;if(i){var o=e.find((function(n){return n.name===i}));o&&(n.link=S(o.link,n.link,{strict:!1}))}else t&&(n.link=S(t.link,n.link))}),{key:"items"}),t},e.flattenNavigation=w,e.splitNavigationBySection=C,e.nestNavigationList=P,e.filterNavigation=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=P(n);return Z(t,(function(n){if(null!==n&&void 0!==n&&n.component&&(e.some((function(e){return e.name===n.component}))||(n.visible=!1)),n.items&&n.items.length)for(var t=n.items.length-1;t>=0;t--)!1===n.items[t].visible&&n.items.splice(t,1)}),{key:"items"}),t.filter((function(n){var e;return!1!==n.visible&&!(n.items&&Array.isArray(n.items)&&n.items.length>0&&null!==(e=n.items)&&void 0!==e&&e.every((function(n){return!1===n.visible})))}))},e.cleanOrphanNavigation=function(n){return n.map((function(n){return n.items&&Array.isArray(n.items)&&1===n.items.length&&["header","footer","",void 0,null].includes(n.section)?n.items[0]:n}))},e.parseNavigation=function(){var n,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).beforeProcess,a=void 0===t?function(n){return n}:t,u=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],t=function t(a){var l,c,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=[],d=a.children,m=void 0===d?[]:d,p=a.meta,h=void 0===p?{}:p,b=(0,f.default)((null===h||void 0===h?void 0:h.navigation)||[]);!1!==(null===(l=a.meta)||void 0===l||null===(c=l.capabilities)||void 0===c?void 0:c.navigation)&&u.push.apply(u,o(b));var j,Z=s.name||"",y=s.mountPoint||x,L=a===n?"":h.name||"",N=a===n?"":a.mountPoint||x,S=i(m);try{var w=function(){var n,i,a,l,c=j.value,s=c.meta.name,d=c.mountPoint,f=[Z,L,s].filter(Boolean).join("."),m=c.meta.navigation||[],p=(0,v.default)(y,N,d);!1!==(null===(n=c.meta)||void 0===n||null===(i=n.capabilities)||void 0===i?void 0:i.navigation)&&e.push({did:c.meta.did,name:f,link:p,title:c.meta.title||"",navigation:m.map((function(n){return r({section:g},n)}))});var h=b.find((function(n){return!!n.component&&n.component===s}));if(h){if(!h.link)if(c.meta.navigation&&c.meta.navigation.length>0){var x,S,w=t(c,{mountPoint:N,name:L});w.length>0&&(h.items=null!==(x=h.items)&&void 0!==x?x:[],(S=h.items).push.apply(S,o(w)))}else h.link=k}else if(!1!==(null===(a=c.meta)||void 0===a||null===(l=a.capabilities)||void 0===l?void 0:l.navigation)){var C=t(c,{mountPoint:N,name:L}),P={title:c.meta.title,component:s,id:c.meta.did};C.length>0?(P.items=C,P.link=void 0):P.link=k,u.push(P)}};for(S.s();!(j=S.n()).done;)w()}catch(C){S.e(C)}finally{S.f()}return u}(n);return{navigationList:t,components:e}}(e),d=u.navigationList,m=u.components,p=(null===e||void 0===e||null===(n=e.settings)||void 0===n?void 0:n.navigations)||[],h=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=w((0,f.default)(n),{depth:e,transform:function(n,e){var t;return e&&(n._parent||(n._parent=e.id,e.component||(n.link=S(e.link,n.link))),n.section=n.section||e.section||[g],n.visible=null!==(t=n.visible)&&void 0!==t?t:e.visible),n.component=[e.component,n.component].filter(Boolean).join("."),n}});return Z(t,(function(n){n.items&&n.items.length>0&&n.items.reduceRight((function(e,t){if(t._parent){var i=n.items.findIndex((function(n){return n.id===t._parent}));i>=0&&n.items.splice(i,1),delete t._parent}return null}),null)}),{key:"items"}),t}(a(d)),j=w(C(function(n){var e=(0,f.default)(n).filter((function(n){return n.id}));return Z(e,(function(n,e){var t;if(n.items&&n.items.length){for(var i=n.items.length-1;i>=0;i--)n.items[i].id||n.items.splice(i,1);0===n.items.length&&n.component&&(n.link=n.link||k)}e&&(n.parent=e.id,n.id=[e.id,n.id].join(b)),n.from=n.from||"yaml",n.visible=null===(t=n.visible)||void 0===t||t}),{key:"items"}),e}(h)).reduce((function(n,e){var t=["bottom","social","sessionManager"].includes(e.section),i=!1,a=m.find((function(n){return"/"===n.link}));if(a&&e.id===a.did&&(i=!0),t||i){if(e.items&&e.items.length>0)return n.push.apply(n,o(e.items.map((function(n){var t=e.section,i=S(e.link,n.link),o=[e.component,n.component].filter(Boolean).join(".");return r(r({},n),{},{section:t,link:i,component:o,parent:""})})))),n;if(i)return n}return n.push(e),n}),[]),{transform:function(n,e){var t=n.component;return null!==e&&void 0!==e&&e.component&&(t=[e.component,n.component].filter(Boolean).join(".")),r(r({},n),{},{component:t})}});return{navigationList:(0,l.default)(p.map((function(n){var e=r({},n);return e.role&&(e.role=L(e.role)),e.section&&(e.section=L(e.section)),e.title&&(e.title=L(e.title)),e.link&&(e.link=L(e.link)),e})),j,(function(n,e){var t=["id","section"];return(0,c.default)((0,s.default)(n,t),(0,s.default)(e,t))})),components:m,builtinList:j}}},4023:function(n,e,t){t.r(e),t.d(e,{default:function(){return ge}});var i=t(33028),o=t(32723),r=t(34795),a=t(30969),l=t(38361),c=t(72097),s=t(89667),u=t(87535),d=t(51385),f=t(2689),v=t(46672),m=t(39130),p=t(56277),h=t(33359),g=t(39491),x=t(94984),k=t(96628),b=t(28595),j=t(50496),Z=t(26022),y=t(82972),L=t(61398),N=t.n(L),S=t(24974),w=t.n(S),C=t(53626),P=t(69241),O=t.n(P),E=t(74274),A=t.n(E),R=t(15888),T=t.n(R),_=t(96605),I=t(42821),M=t(37574);function D(n){var e=n.prevPath,t=n.nextPath,i=e.length,o=t.length;return!(i!==o||!T()(e.slice(0,i-1),t.slice(0,o-1)))}function W(n){var e=n.treeNode,t=(0,Z.PE)().locale;return(0,M.jsxs)(M.Fragment,{children:[e.icon&&(0,M.jsx)(k.JO,{style:{marginRight:4},icon:e.icon}),function(){var n=e.title,i=e.subtitle,o=n,r=i;return A()(n)&&(o=n[t]),!(0,a.isValidElement)(i)&&A()(i)&&(r=i[t]),(0,M.jsxs)(l.Z,{display:"flex",alignItems:"center",children:[(0,M.jsx)(h.Z,{variant:"subtitle1",fontSize:16,children:o}),i&&(0,M.jsx)(h.Z,{variant:"body2",color:"gray",ml:1.5,lineHeight:1,children:r})]})}()]})}function z(n){var e=n.treeData,t=n.setTreeData,o=n.renderActions,r=e.map((function(n){return(0,i.Z)((0,i.Z)({},n),{},{expanded:!0})})),a={};return"undefined"!==typeof window&&(a.context=window),(0,M.jsx)(I.W,(0,i.Z)((0,i.Z)({backend:_.HTML5Backend},a),{},{children:(0,M.jsx)(C.oP,{generateNodeProps:function(n){return{buttons:o({data:n.node,className:"list-item-actions"}),icons:(0,M.jsx)(k.JO,{icon:"ic:round-drag-indicator"}),title:(0,M.jsx)(W,{treeNode:n.node})}},maxDepth:2,isVirtualized:!1,treeData:r,onChange:t,canDrop:D,theme:O()})}))}W.propTypes={treeNode:w().object.isRequired},z.propTypes={treeData:w().object.isRequired,setTreeData:w().func,renderActions:w().func},z.defaultProps={setTreeData:function(){},renderActions:function(){}};var J=z,F=t(96234),B=t(56666),q=t(29996),G=t(74202),V=t(94551),K=t(4953),H=t(87006),U=t(57982),Q=t(14546),Y=t(88674),X=t.n(Y),$=t(49735),nn=t.n($),en=t(9669),tn=t.n(en),on=t(75359),rn=t.n(on),an=t(76032),ln=t.n(an),cn=t(86446),sn=t.n(cn),un=t(74082),dn=t.n(un),fn=t(14764),vn=t(94785),mn=t(19611),pn=t.n(mn),hn=t(43430),gn=t(34155),xn=t.n(gn),kn=t(59505),bn=t(68079),jn=t(15914),Zn=t(50576),yn=t(3672),Ln=t(8288),Nn=t(83176),Sn=t(59740),wn=t(7173),Cn=t(98123),Pn=t(86008),On=t(33656),En=["fullWidth","multiple","required","label","placeholer","options","helperText","error","margin"];function An(n){var e=n.fullWidth,t=n.multiple,o=n.required,r=n.label,a=n.placeholer,c=n.options,s=n.helperText,v=n.error,p=n.margin,g=(0,Sn.Z)(n,En),x=c.find((function(n){return n.value===g.value})),k=null===x||void 0===x?void 0:x.title;return(0,M.jsxs)(u.Z,{margin:p,fullWidth:e,error:v,children:[(0,M.jsx)(d.Z,{children:"".concat(r).concat(o?"*":"")}),(0,M.jsxs)(m.Z,(0,i.Z)((0,i.Z)({multiple:t,input:(0,M.jsx)(On.Z,{defaultValue:k,sx:{flex:1},required:o,label:r,inputProps:{margin:p}}),renderValue:function(n){if(t)return(0,M.jsx)(l.Z,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:n.map((function(n){var e=c.find((function(e){return e.value===n}));return e&&e.title&&(0,M.jsx)(wn.Z,{size:"small",label:e.title},n)}))});var e=c.find((function(e){return e.value===n}));return e&&e.title&&(0,M.jsxs)(l.Z,{children:[(0,M.jsx)(h.Z,{component:"span",children:e.title}),(0,M.jsx)(h.Z,{marginLeft:1,component:"span",variant:"body2",color:"text.secondary",children:e.description})]})}},g),{},{children:[(0,M.jsx)(f.Z,{disabled:!0,children:(0,M.jsx)("em",{children:a})}),!t&&(0,M.jsx)(f.Z,{value:"",children:"None"}),c.map((function(n){return n&&n.value&&(0,M.jsxs)(f.Z,{value:n.value,children:[(0,M.jsx)(Pn.Z,{children:n.title}),n.description&&(0,M.jsx)(h.Z,{variant:"body2",color:"text.secondary",children:n.description})]},n.value)}))]})),(0,M.jsx)(Cn.Z,{children:s})]})}An.propTypes={error:w().bool,required:w().bool,multiple:w().bool,fullWidth:w().bool,label:w().string,placeholer:w().string,options:w().array,helperText:w().string,margin:w().string},An.defaultProps={error:!1,required:!1,multiple:!1,fullWidth:!1,label:"",placeholer:"",options:[],helperText:"",margin:""};var Rn=An,Tn="en";function _n(n){var e=n.sx,t=n.onAdd,i=n.onChange,o=n.locales,r=n.localeMap,s=n.onRemoveLocale,u=(0,Z.PE)().t,d=(0,a.useRef)(),f=(0,a.useState)(null),v=(0,F.Z)(f,2),m=v[0],p=v[1],g=(0,b.Z)({currentLocale:Tn,localeList:[],inputLocale:"",localeError:""}),x=(0,a.useMemo)((function(){return!!m}),[m]),j=(0,a.useMemo)((function(){return o.includes(g.currentLocale)?g.currentLocale:Tn}),[o,g.currentLocale]),y=(0,a.useMemo)((function(){return Object.keys((0,Zn.omit)(r,[].concat((0,bn.Z)(g.localeList),[Tn]))).map((function(n){return{title:r[n],value:n}}))}),[g.localeList]);function L(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=function(n){return n?"en"!==n&&!g.localeList.includes(n)||u("navigation.form.localeExists",{value:n}):u("common.requiredErrorText",{name:"Locale"})}(null===n||void 0===n?void 0:n.trim());return g.localeError=!0!==e?e:"",e}function N(){var n,e=null===(n=g.inputLocale)||void 0===n?void 0:n.trim();!0===L(e)&&(S(),g.localeList.push(e),g.currentLocale=e,t(e))}function S(){p(null),g.inputLocale="",g.localeError=""}return(0,a.useEffect)((function(){g.localeList=(0,bn.Z)(o)}),[o,g]),(0,jn.Z)("enter",(function(){setTimeout((function(){N()}))}),{target:d}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(yn.Z,{sx:e,value:j,onChange:function(n,e){g.currentLocale=e,i(e)},children:[(0,M.jsx)(Ln.Z,{label:"Default (".concat(r[Tn],")"),value:"en"}),g.localeList.map((function(n){return(0,M.jsx)(Ln.Z,{sx:{position:"relative"},label:(0,M.jsxs)(M.Fragment,{children:[r[n],(0,M.jsx)(V.Z,{size:"small",color:"inherit",sx:{position:"absolute",top:0,right:0},onClick:function(e){!function(n,e){n.preventDefault(),n.stopPropagation(),g.localeList=(0,Zn.without)(g.localeList,e),s(e),e===g.currentLocale&&(g.currentLocale=Tn)}(e,n)},children:(0,M.jsx)(k.JO,{icon:"mdi:close",height:14})})]}),value:n},n)})),(0,M.jsx)(V.Z,{color:"primary",disableFocusRipple:!0,sx:{width:"48px"},onClick:function(n){p(n.currentTarget)},children:(0,M.jsx)(k.JO,{icon:"mdi:plus"})})]}),(0,M.jsx)(Nn.ZP,{open:x,anchorEl:m,onClose:S,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:(0,M.jsxs)(l.Z,{sx:{p:2,width:"270px"},children:[(0,M.jsx)(h.Z,{variant:"subtitle2",children:u("navigation.form.localePlaceholder")}),(0,M.jsx)(l.Z,{mt:1,children:(0,M.jsx)(Rn,{required:!0,fullWidth:!0,label:"Locale",value:g.inputLocale,options:y,onChange:function(n){var e=n.target.value;L(e),g.inputLocale=e},error:!!g.localeError,helperText:g.localeError||" "})}),(0,M.jsx)(l.Z,{display:"flex",justifyContent:"flex-end",children:(0,M.jsx)(c.Z,{size:"small",variant:"contained",onClick:N,children:u("common.confirm")})})]})})]})}_n.propTypes={sx:w().any,onAdd:w().func,onChange:w().func,onRemoveLocale:w().func,localeMap:w().object,locales:w().array},_n.defaultProps={sx:null,onAdd:function(){},onChange:function(){},onRemoveLocale:function(){},localeMap:{},locales:[]};var In=_n,Mn=t(80670),Dn=t(45008),Wn="en",zn={title:(0,B.Z)({},Wn,""),link:(0,B.Z)({},Wn,"")};function Jn(n){var e=n.icon,t=(0,a.useState)(!1),i=(0,F.Z)(t,2),l=i[0],c=i[1];return(0,U.Z)((0,r.Z)((0,o.Z)().mark((function n(){return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return c(!1),n.next=3,(0,k.GL)(e);case 3:c(!0);case 4:case"end":return n.stop()}}),n)}))),[e]),e?l?(0,M.jsx)(k.JO,{icon:e}):(0,M.jsx)(k.JO,{color:"#f06f6e",icon:"ic:baseline-error"}):(0,M.jsx)(k.JO,{icon:"codicon:blank"})}Jn.propTypes={icon:w().string.isRequired};var Fn=(0,a.forwardRef)((function(n,e){var t=n.section,c=n.components,s=n.rawNavigations,d=(0,Mn.DJ)().roles,f=(0,Z.PE)(),v=f.t,m=f.locale,p=(0,Dn.y0)().blocklet.environments.find((function(n){return"BLOCKLET_APP_LANGUAGES"===n.key})),g=(p?p.value.split(","):["en","zh"]).filter((function(n){return kn.SUPPORTED_LANGUAGES[n]})).reduce((function(n,e){return n[e]=kn.SUPPORTED_LANGUAGES[e].nativeName,n}),{}),y=(0,a.useRef)((function(){})),L=(0,Q.Z)(!1),N=(0,F.Z)(L,2),S=N[0],w=N[1],C=w.setFalse,P=w.setTrue,O=(0,b.Z)({isRoot:!0,type:"add",linkDisabled:!1,locale:Wn,formState:dn()(zn),get localeList(){return rn()(Object.keys(this.formState.title),Wn)}}),E=(0,fn.cI)({mode:"onChange",defaultValues:{id:void 0,title:void 0,icon:void 0,link:void 0,component:void 0,parent:void 0,role:[]}}),R=E.handleSubmit,T=E.control,_=E.watch,I=E.setValue,D=E.clearErrors,W=E.formState.errors;(0,a.useEffect)((function(){I("title",O.formState.title[O.locale]),I("link",O.formState.link[O.locale])}),[I,O.locale,S]);var z=_("component"),J=_("title"),U=_("link"),Y=_("icon"),$=_("parent");(0,a.useEffect)((function(){O.formState.title[O.locale]=J}),[J]),(0,a.useEffect)((function(){O.formState.link[O.locale]=U}),[U]);var en=(0,a.useMemo)((function(){return s.find((function(n){return z?c.find((function(n){return n.name===z})).did===n.id:n.id===$}))}),[c,s,z,$]),on=(0,a.useMemo)((function(){if(null!==en&&void 0!==en&&en.component){var n=(c.find((function(n){return n.name===en.component}))||{}).link,e=A()(n)?n[O.locale]:n;if(z)return(0,hn.QT)(e);var t=A()(en.link)?en.link[O.locale]:en.link;return(0,hn.QT)(pn()(e,t||"/"))}return null}),[c,O.locale,en,z]),an=(0,a.useMemo)((function(){var n=(en||{}).component,e=(c.find((function(e){return e.name===n}))||{}).navigation,i=void 0===e?[]:e;return(0,vn.flattenNavigation)(i,{transform:function(n,e){return null!==e&&void 0!==e&&e.section&&(n.section=n.section||e.section),n}}).filter((function(n){return n.link})).filter((function(n){return(0,vn.isMatchSection)(n.section,t)})).map((function(n){return{label:n.link,title:n.title[m]||n.title}}))}),[en,c,t,m]),cn=(0,a.useMemo)((function(){var n={add:v("common.create"),edit:v("common.edit")}[O.type];return n?"".concat(n," ").concat(v("navigation.navigation")):"--"}),[O.type,v]),un=(0,a.useCallback)((function(){O.isRoot=!0,O.locale=Wn,O.type="add",O.linkDisabled=!1,y.current=function(){},I("id",void 0),I("icon",void 0),I("title",void 0),I("link",void 0),I("component",void 0),I("parent",void 0),I("role",[]),O.formState=dn()(zn),D()}),[D,I,O]),mn=(0,a.useCallback)((function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return O.localeList.length>0&&(new Set(tn()(O.formState.title)).size>1&&(n.title=O.formState.title),new Set(tn()(O.formState.link)).size>1&&(n.link=O.formState.link)),ln()(n.role)&&(n.role=void 0),n}),[O.formState.link,O.formState.title,O.localeList]),gn=(0,a.useCallback)((function(){C(),setTimeout((function(){un()}))}),[un,C]),bn=(0,a.useCallback)((function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).parent,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};O.type="add",O.isRoot=!n,I("parent",null===n||void 0===n?void 0:n.id),y.current=function(n){e(gn,n)},P()}),[gn,P,I,O]),jn=(0,a.useCallback)((function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},t=n.id,i=n.title,o=n.icon,r=n.link,a=n.parent,l=n.component,c=n.role,s=void 0===c?[]:c;I("id",t),I("icon",o),"tmpl"===n.from&&(O.linkDisabled=!0),sn()(i)?O.formState.title=O.localeList.reduce((function(n,e){return n[e]=i,n}),(0,B.Z)({},Wn,i)):A()(i)?O.formState.title=dn()(i):O.formState.title={},sn()(r)?O.formState.link=O.localeList.reduce((function(n,e){return n[e]=r,n}),(0,B.Z)({},Wn,r)):A()(r)?O.formState.link=dn()(r):O.formState.link={},I("component",l),I("parent",a),I("role",s||[]),P(),O.type="edit",O.isRoot=!a,y.current=function(n){var t=nn()(n,["id","title","icon","link","role"]);e(gn,t)}}),[gn,P,I,O]);function Zn(n){var e=null===n||void 0===n?void 0:n.trim();return e?!(e.length>24)||v("navigation.form.titleTooLong",{len:24}):v("common.requiredErrorText",{name:v("navigation.form.title")})}function yn(){return(yn=(0,r.Z)((0,o.Z)().mark((function n(e){var t;return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(t=null===e||void 0===e?void 0:e.trim())){n.next=10;break}return n.prev=2,n.next=5,(0,k.GL)(t);case 5:n.next=10;break;case 7:return n.prev=7,n.t0=n.catch(2),n.abrupt("return",v("navigation.form.invalidIcon"));case 10:return n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n,null,[[2,7]])})))).apply(this,arguments)}function Ln(n){var e=null===n||void 0===n?void 0:n.trim();return e?!!(0,vn.checkLink)(e)||v("navigation.form.invalidLink"):!!O.isRoot||v("common.requiredErrorText",{name:v("navigation.form.link")})}(0,a.useImperativeHandle)(e,(function(){return{add:bn,edit:jn,close:gn}}),[bn,gn,jn]);var Nn=(0,a.useCallback)((function(n){O.locale=n,O.formState.title[n]||(O.formState.title[n]=""),O.formState.link[n]||(O.formState.link[n]=""),setTimeout((function(){D()}))}),[D,O]),Sn=(0,a.useCallback)((function(){for(var n=O.formState,e=n.title,t=n.link,i=0,o=Object.keys(e);i<o.length;i++){var r=Zn(e[o[i]]);if(!0!==r)return r}for(var a=0,l=Object.keys(t);a<l.length;a++){var c=Ln(t[l[a]]);if(!0!==c)return c}return!0}),[O.formState]),wn=(0,a.useCallback)((function(n){var e=Sn();!0===e?y.current(mn(n)):x.Z.error(e)}),[Sn,mn]),Cn=(0,a.useCallback)((function(n){O.formState.title=X()(O.formState.title,n),O.formState.link=X()(O.formState.link,n)}),[O.formState]),Pn=(0,a.useCallback)((function(n){var e,t;O.locale=n,O.formState.title[n]=null===(e=O.formState.title)||void 0===e?void 0:e[Wn],O.formState.link[n]=null===(t=O.formState.link)||void 0===t?void 0:t[Wn],setTimeout((function(){D()}))}),[D,O]);return(0,M.jsxs)(j.ZP,{open:S,title:cn,onClose:gn,actions:(0,M.jsx)(q.Z,{onClick:R(wn),color:"primary",autoFocus:!0,variant:"contained",children:v("common.confirm")}),children:[(0,M.jsx)(In,{sx:{mb:1},onAdd:Pn,onChange:Nn,onRemoveLocale:Cn,localeMap:g,locales:O.localeList}),(0,M.jsxs)("form",{noValidate:!0,autoComplete:"off",children:[(0,M.jsx)(fn.Qr,{name:"title",control:T,rules:{validate:Zn},render:function(n){var e,t,o=n.field;return(0,M.jsx)(H.Z,(0,i.Z)({fullWidth:!0,variant:"outlined",margin:"dense",required:!0,placeholder:v("navigation.form.titlePlaceholder"),label:v("navigation.form.title"),disabled:O.isEdit,error:!(null===W||void 0===W||null===(e=W.title)||void 0===e||!e.message),helperText:(null===W||void 0===W||null===(t=W.title)||void 0===t?void 0:t.message)||" "},o))}}),(0,M.jsx)(fn.Qr,{name:"icon",control:T,rules:{validate:function(n){return yn.apply(this,arguments)}},render:function(n){var e,t,o=n.field;return(0,M.jsx)(H.Z,(0,i.Z)((0,i.Z)({fullWidth:!0,variant:"outlined",margin:"dense",placeholder:v("navigation.form.iconPlaceholder"),label:v("navigation.form.icon"),error:!(null===W||void 0===W||null===(e=W.icon)||void 0===e||!e.message),disabled:O.locale!==Wn,helperText:(null===W||void 0===W||null===(t=W.icon)||void 0===t?void 0:t.message)||(0,M.jsx)(l.Z,{display:"flex",children:(0,M.jsxs)(l.Z,{component:"a",href:"https://icones.js.org",target:"_blank",display:"flex",alignItems:"center",children:[v("navigation.form.findMoreIcon")," ",(0,M.jsx)(k.JO,{style:{marginLeft:4},icon:"radix-icons:external-link"})]})})},o),{},{InputProps:{endAdornment:(0,M.jsx)(K.Z,{position:"end",children:(0,M.jsx)(V.Z,{sx:{cursor:"default"},disableFocusRipple:!0,disableRipple:!0,children:Y&&(0,M.jsx)(Jn,{icon:Y})})})}}))}}),O.isRoot&&(0,M.jsx)(fn.Qr,{name:"component",control:T,render:function(n){var e,t,o=n.field;return(0,M.jsx)(Rn,(0,i.Z)({fullWidth:!0,margin:"dense",disabled:"edit"===O.type||O.locale!==Wn,label:v("navigation.form.component"),placeholer:v("navigation.form.componentPlaceholder"),options:c.map((function(n){return{title:n.title,value:n.name,description:n.link}})),error:!(null===W||void 0===W||null===(e=W.component)||void 0===e||!e.message),helperText:(null===W||void 0===W||null===(t=W.component)||void 0===t?void 0:t.message)||" "},X()(o,"ref")))}}),(0,M.jsx)(fn.Qr,{name:"link",control:T,rules:{validate:Ln},render:function(n){var e=n.field;return(0,M.jsx)(u.Z,{fullWidth:!0,margin:"dense",children:(0,M.jsx)(G.Z,(0,i.Z)((0,i.Z)({disablePortal:!0,freeSolo:!0,blurOnSelect:!0,autoSelect:!0,fullWidth:!0,disabled:O.linkDisabled,isOptionEqualToValue:function(n){return n.label},options:an,renderInput:function(n){var e,t;return(0,M.jsx)(H.Z,(0,i.Z)((0,i.Z)({},n),{},{placeholder:v("navigation.form.linkPlaceholder"),label:v("navigation.form.link"),error:!(null===W||void 0===W||null===(e=W.link)||void 0===e||!e.message),helperText:(null===W||void 0===W||null===(t=W.link)||void 0===t?void 0:t.message)||"/abc/bcd or /abc or https://arcblock.io",InputProps:{startAdornment:on?(0,M.jsx)(K.Z,{position:"start",sx:{textDecoration:xn()(U||"")?"line-through":""},children:on}):null}}))},renderOption:function(n,e){return(0,M.jsxs)(l.Z,(0,i.Z)((0,i.Z)({component:"li"},n),{},{children:[e.label,(0,M.jsx)(h.Z,{marginLeft:1,component:"span",variant:"body2",color:"text.secondary",children:e.title})]}))},margin:"dense"},e),{},{onChange:function(){},onInputChange:function(n,t){e.onChange(t)}}))})}}),["dashboard","sessionManager"].includes(t)&&(0,M.jsx)(fn.Qr,{name:"role",control:T,render:function(n){var e,t,o=n.field;return(0,M.jsx)(Rn,(0,i.Z)({fullWidth:!0,multiple:!0,margin:"dense",label:v("navigation.form.role"),placeholer:v("navigation.form.rolePlaceholder"),options:d.map((function(n){return{title:n.title,value:n.name}})),error:!(null===W||void 0===W||null===(e=W.role)||void 0===e||!e.message),helperText:(null===W||void 0===W||null===(t=W.role)||void 0===t?void 0:t.message)||" "},X()(o,"ref")))}})]})]})}));Fn.propTypes={section:w().string,components:w().array,rawNavigations:w().array},Fn.defaultProps={section:"",components:[],rawNavigations:[]};var Bn=Fn;function qn(n){var e=n.className,t=n.add,i=n.edit,o=n.toggle,r=n.del,l=n.data,c=n.section,s=(0,Z.PE)().t,u=["yaml","tmpl"].includes(l.from),d=(0,a.isValidElement)(l.subtitle);function f(n){n.preventDefault(),n.stopPropagation()}var v=(0,a.useCallback)((function(n){f(n),t(l)}),[t,l]),m=(0,a.useCallback)((function(n){f(n),i(l)}),[i,l]),p=(0,a.useCallback)((function(n){f(n),o(l)}),[o,l]),h=(0,a.useCallback)((function(n){f(n),r(l)}),[r,l]);return(0,M.jsxs)("div",{className:e,children:[!l.parent&&["header","footer","dashboard"].includes(c)&&(0,M.jsx)("span",{title:s(d?"navigation.action.noAddSub":"navigation.action.addSub"),children:(0,M.jsx)(V.Z,{size:"small",color:"success",onClick:v,disabled:d,children:(0,M.jsx)(k.JO,{icon:"mdi:plus-box-outline"})})}),(0,M.jsx)("span",{title:s(d?"navigation.action.noEdit":"navigation.action.edit"),children:(0,M.jsx)(V.Z,{size:"small",color:"primary",onClick:m,disabled:d,children:(0,M.jsx)(k.JO,{icon:"mdi:pencil"})})}),(0,M.jsx)("span",{title:d?s("navigation.action.noEdit"):l.visible?s("navigation.action.hide"):s("navigation.action.show"),children:(0,M.jsx)(V.Z,{size:"small",color:"warning",onClick:p,disabled:d,children:!1===l.visible?(0,M.jsx)(k.JO,{icon:"mdi:eye-off-outline"}):(0,M.jsx)(k.JO,{icon:"mdi:eye-outline"})})}),(0,M.jsx)("span",{title:s(u&&!d?"navigation.action.noDel":"navigation.action.del"),children:(0,M.jsx)(V.Z,{disabled:u&&!d,size:"small",color:"error",onClick:h,children:(0,M.jsx)(k.JO,{icon:"mdi:delete"})})})]})}qn.propTypes={data:w().object.isRequired,className:w().string,add:w().func,edit:w().func,toggle:w().func,del:w().func,section:w().string},qn.defaultProps={className:"",add:function(){},edit:function(){},toggle:function(){},del:function(){},section:""};var Gn=qn,Vn=t(60523),Kn=t.n(Vn),Hn=t(70306),Un=t.n(Hn),Qn=t(20244),Yn=t(24891),Xn="/",$n="header",ne={sessionManager:[{id:"/sessionManager",title:{en:"Manage",zh:"\u7ba1\u7406"},section:["sessionManager"],icon:"ion:settings-outline",link:"".concat(Qn.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin"),role:["owner","admin"],from:"tmpl"}],dashboard:[{id:"/access",title:{en:"Access",zh:"\u8bbf\u95ee\u63a7\u5236"},role:["owner","admin","member"],section:["dashboard"],link:"",from:"tmpl",items:[{id:"member",title:{en:"Members",zh:"\u6210\u5458"},icon:"ant-design:user-outlined",link:"".concat(Qn.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/members"),from:"tmpl"},{id:"passport",title:{en:"Passport",zh:"\u901a\u884c\u8bc1"},icon:"icon-park-outline:passport",link:"".concat(Qn.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/passports"),from:"tmpl"}]},{id:"/dashboard",title:"Blocklet",role:["owner","admin"],section:["dashboard"],link:"",from:"tmpl",items:[{id:"dashboard",title:{en:"Dashboard",zh:"\u4eea\u8868\u76d8"},icon:"ant-design:dashboard-outlined",link:"".concat(Qn.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin"),from:"tmpl"}]}]};function ee(n,e){return n.section&&e.section?n.section===e.section&&n.id===e.id:n.id===e.id}function te(){var n=(0,Dn.y0)(),e=n.blocklet,t=n.actions,l=(0,vn.parseNavigation)(e,{beforeProcess:function(n){var e=dn()(n);return ne.dashboard.forEach((function(n){e.some((function(e){return e.id===n.id}))||e.push(n)})),e.some((function(n){return n.id&&(n.section||[]).includes("sessionManager")}))||e.push.apply(e,(0,bn.Z)(ne.sessionManager)),e}}),c=l.navigationList,s=l.components,u=l.builtinList,d=(0,b.Z)({rawNavigation:dn()(c),activeSection:$n,components:s}),f=(0,a.useMemo)((function(){return(0,vn.nestNavigationList)(d.rawNavigation)}),[d.rawNavigation]),v=(0,a.useMemo)((function(){var n=(0,vn.filterNavigation)(d.rawNavigation,s),e=(0,vn.joinLink)(n,s);return(0,vn.cleanOrphanNavigation)(e)}),[s,d.rawNavigation]);function m(n){if(!n.id)return"";var e=(0,vn.flattenNavigation)((0,vn.joinLink)(f,s)),t=e.find((function(e){return e.id===n.id}));function i(n){var e=n.name;return(0,M.jsx)(wn.Z,{label:"Uninstalled: ".concat(e),color:"error",size:"small",variant:"outlined",sx:{fontSize:10,height:20}})}if(null!==t&&void 0!==t&&t.component){if(!s.some((function(n){return n.name===t.component})))return(0,M.jsx)(i,{name:t.component})}else if(t.parent){var o=e.find((function(n){return n.id===t.parent}));if(null!==o&&void 0!==o&&o.component&&!s.some((function(n){return n.name===o.component})))return(0,M.jsx)(i,{name:o.component})}return null===t||void 0===t?void 0:t.link}function p(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xn;return n.map((function(n){var t=s.find((function(e){return e.name===n.component})),i=(null===t||void 0===t?void 0:t.link)||e,o=n.items||[],r=n.link;return{title:n.title,subtitle:m(n),link:r,icon:n.icon,children:p(o,r||Xn),section:n.section,visible:n.visible,parent:n.parent,component:n.component,id:n.id,role:n.role,from:n.from,__base:i}}))}function h(n){return g.apply(this,arguments)}function g(){return(g=(0,r.Z)((0,o.Z)().mark((function n(e){var r,a;return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.map((function(n){return Un()(n,Kn())})),a=r.map((function(n){var e=(0,i.Z)({},n);return e.role&&Array.isArray(e.role)&&(e.role=JSON.stringify(e.role)),e.section&&Array.isArray(e.section)&&(e.section=JSON.stringify(e.section)),e.title&&e.title instanceof Object&&(e.title=JSON.stringify(e.title)),e.link&&e.link instanceof Object&&(e.link=JSON.stringify(e.link)),e})),n.next=4,t.configNavigations(a);case 4:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function x(){return(x=(0,r.Z)((0,o.Z)().mark((function n(){return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,h([]);case 2:d.rawNavigation=dn()(u);case 3:case"end":return n.stop()}}),n)})))).apply(this,arguments)}return{state:d,navigation:v,components:s,getNavigationFullLink:m,updateActiveSection:function(n){d.activeSection=n},updateNavigationItem:function(n){!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=d.rawNavigation.map((function(e){var t=n.find((function(n){return ee((0,i.Z)((0,i.Z)({},n),{},{section:d.activeSection}),e)}));return t?(0,i.Z)((0,i.Z)({},e),t):e}));d.rawNavigation=e}([n])},delNavigationItem:function(n){var e=d.rawNavigation.filter((function(e){return e.id===n||e.parent===n})).map((function(n){return n.id}));d.rawNavigation=d.rawNavigation.filter((function(n){return!e.includes(n.id)}))},addNavigationItem:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,i.Z)((0,i.Z)({},n),{},{id:(0,Yn.x0)(),section:d.activeSection,visible:!0});d.rawNavigation=[].concat((0,bn.Z)(d.rawNavigation),[e])},updateNavigationTree:function(n){var e=[];(0,vn.deepWalk)(n,(function(n,t){var o=(0,i.Z)((0,i.Z)({},X()(n,["children","expand"])),{},{parent:null===t||void 0===t?void 0:t.id});e.push(o)}));var t=d.rawNavigation.filter((function(n){if(!d.activeSection)return!1;var t=e.find((function(e){return ee(e,n)}));return!t||!(0,vn.isMatchSection)(t.section,d.activeSection)}));d.rawNavigation=[].concat((0,bn.Z)(t),e)},getNavigation:function(n){return p(dn()(f).filter((function(e){return(0,vn.isMatchSection)(e.section,n)})))},saveNavigationList:h,resetNavigation:function(){return x.apply(this,arguments)}}}var ie,oe=t(71171),re=t(65321),ae=t(28834),le=t(39563),ce=t(77930),se=t(3994),ue=t(75402),de=t(16380),fe=t(15300);function ve(n){var e,t,i,o,r=n.className,a=n.navigation,c=(0,Dn.y0)().blocklet,s=(0,fe.Z)({blocklet:c}).logoUrl,u=null===c||void 0===c||null===(e=c.environments)||void 0===e||null===(t=e.find((function(n){return n.key===kn.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER})))||void 0===t?void 0:t.value,d=null===c||void 0===c||null===(i=c.environments)||void 0===i||null===(o=i.find((function(n){return n.key===kn.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR})))||void 0===o?void 0:o.value,f=u||d?{owner:u,year:d}:void 0,v={appId:c.appDid,appLogo:s,appName:c.meta.title,enableConnect:!0,enableLocale:!1,navigation:a,copyright:f};return(0,M.jsx)(ce.Z,{children:(0,M.jsxs)(l.Z,{className:r,children:[(0,M.jsx)(re.Z,{meta:v}),(0,M.jsx)(l.Z,{children:(0,M.jsx)(le.Z,{meta:v,invalidPathFallback:function(){},headerProps:{style:{display:"none"}},children:(0,M.jsx)(se.ZP,{container:!0,spacing:2,children:new Array(6).fill().map((function(n,e){return(0,M.jsxs)(se.ZP,{item:!0,xs:4,children:[(0,M.jsx)(ue.Z,{animation:!1,variant:"rectangular",width:"100%",height:120}),(0,M.jsxs)(l.Z,{sx:{pt:.5},children:[(0,M.jsx)(ue.Z,{animation:!1}),(0,M.jsx)(ue.Z,{width:"60%",animation:!1})]})]},e)}))})})}),(0,M.jsx)(ae.Z,{meta:v})]})})}ve.propTypes={className:w().string,navigation:w().array},ve.defaultProps={className:"",navigation:[]};var me=(0,de.Z)(ve)(ie||(ie=(0,oe.Z)(["\n .dashboard {\n height: auto !important;\n }\n .dashboard-content + div {\n display: none;\n }\n"]))),pe={login:N(),logout:N(),switch:N(),switchDid:N(),switchProfile:N(),switchPassport:N(),useDid:function(){return{walletDid:"abcdefghijklmnopqrstuvwxyz"}},useOAuth:function(){return{logoutOAuth:N(),bindOAuth:N(),configs:{},switchOAuthPassport:N()}}},he={header:"Header",footer:"Footer",bottom:"Footer Link",social:"Footer Social",dashboard:"Dashboard",sessionManager:"SessionManager"};var ge=function(){var n=(0,Z.PE)().t,e=(0,Dn.y0)().blocklet,t=(0,a.useRef)(null),L=(0,Mn.DJ)().roles,N=(0,b.Z)({saveLoading:!1,resetLoading:!1,showResetConfirm:!1,mockRole:"owner"}),S=te(),w=S.state,C=S.navigation,P=S.getNavigation,O=S.saveNavigationList,E=S.resetNavigation,A=S.updateActiveSection,R=S.updateNavigationTree,T=S.updateNavigationItem,_=S.delNavigationItem,I=S.addNavigationItem,D=(0,a.useCallback)((function(n){t.current.add({parent:n},(function(n,e){I(e),n()}))}),[I]),W=(0,a.useCallback)((function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(n){case"edit":t.current.edit(e,(function(n,e){T(e),n()}));break;case"toggle":T({id:e.id,visible:!e.visible});break;case"del":_(e.id)}}),[_,T]),z=(0,a.useCallback)((0,r.Z)((0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,N.saveLoading=!0,e.next=4,O(w.rawNavigation);case 4:x.Z.success(n("common.succeeded")),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),x.Z.error((0,M.jsxs)(l.Z,{children:[(0,M.jsx)(h.Z,{variant:"subtitle2",children:n("navigation.actionFailed")}),(0,M.jsx)(h.Z,{variant:"body1",children:(0,Yn.Z)(e.t0)||e.t0.error})]}));case 10:return e.prev=10,N.saveLoading=!1,e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[0,7,10,13]])}))),[w.rawNavigation,N,O,n]),F=(0,a.useCallback)((0,r.Z)((0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,N.resetLoading=!0,e.next=4,E();case 4:x.Z.success("\u91cd\u7f6e\u6210\u529f",{variant:"success"}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),x.Z.error((0,M.jsxs)(l.Z,{children:[(0,M.jsx)(h.Z,{variant:"subtitle2",children:n("navigation.actionFailed")}),(0,M.jsx)(h.Z,{variant:"body1",children:(0,Yn.Z)(e.t0)||e.t0.error})]}));case 10:return e.prev=10,N.resetLoading=!1,e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[0,7,10,13]])}))),[N,E,n]),B=(0,a.useMemo)((function(){return{session:(0,i.Z)((0,i.Z)({},pe),{},{user:{did:e.appDid,fullName:"Preview User",role:N.mockRole}})}}),[e.appDid,N.mockRole]);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(s.Z,{variant:"outlined",children:Object.keys(he).map((function(n){return(0,M.jsxs)(c.Z,{variant:w.activeSection===n?"contained":void 0,onClick:function(){return A(n)},children:[he[n]," (".concat(P(n).length,")")]},n)}))}),(0,M.jsxs)(p.Z,{variant:"dense",sx:{paddingLeft:"0px !important",paddingRight:"0px !important",mt:2},children:[(0,M.jsx)(h.Z,{variant:"h6",component:"div",sx:{flexGrow:1},children:"Config"}),(0,M.jsx)(s.Z,{variant:"outlined",children:(0,M.jsx)(g.Z,{size:"small",variant:"outlined",color:"error",startIcon:(0,M.jsx)(k.JO,{icon:"system-uicons:reset"}),sx:{mr:2},loading:N.resetLoading,loadingPosition:"start",onClick:function(){N.showResetConfirm=!0},children:"\u91cd\u7f6e"})}),(0,M.jsxs)(s.Z,{variant:"outlined",children:[(0,M.jsx)(c.Z,{size:"small",variant:"outlined",startIcon:(0,M.jsx)(k.JO,{icon:"mdi:plus"}),onClick:function(){return D()},children:"\u65b0\u5efa"}),(0,M.jsx)(g.Z,{size:"small",variant:"contained",startIcon:(0,M.jsx)(k.JO,{icon:"mdi:content-save"}),loading:N.saveLoading,loadingPosition:"start",onClick:z,children:"\u4fdd\u5b58"})]})]}),(0,M.jsx)(v.Z,{variant:"outlined",sx:{display:"flex",height:280,overflow:"hidden"},children:(0,M.jsx)(v.Z,{elevation:0,sx:{flex:1,overflow:"auto"},children:(0,M.jsx)(J,{treeData:P(w.activeSection),setTreeData:R,renderActions:function(n){var e=n.data,t=n.className;return(0,M.jsx)(Gn,{data:e,className:t,section:w.activeSection,add:function(){return D.apply(void 0,arguments)},del:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return W.apply(void 0,["del"].concat(e))},edit:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return W.apply(void 0,["edit"].concat(e))},toggle:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return W.apply(void 0,["toggle"].concat(e))}})}})})}),(0,M.jsxs)(p.Z,{variant:"dense",sx:{paddingLeft:"0px !important",paddingRight:"0px !important",mt:3},children:[(0,M.jsx)(h.Z,{variant:"h6",component:"div",sx:{flexGrow:1},children:"Preview"}),(0,M.jsxs)(u.Z,{sx:{m:1,minWidth:120},size:"small",children:[(0,M.jsx)(d.Z,{children:"Role"}),(0,M.jsx)(m.Z,{value:N.mockRole,label:"Role",onChange:function(n){N.mockRole=n.target.value},children:L.map((function(n){return(0,M.jsx)(f.Z,{value:n.name,children:n.title},n.name)}))})]})]}),(0,M.jsx)(v.Z,{variant:"outlined",children:(0,M.jsx)(y.B3.Provider,{value:B,children:(0,M.jsx)(me,{navigation:C})})}),(0,M.jsx)(Bn,{ref:t,section:w.activeSection,components:w.components,rawNavigations:w.rawNavigation}),(0,M.jsx)(j.I4,{open:N.showResetConfirm,title:"\u662f\u5426\u6e05\u7a7a\u6240\u6709\u81ea\u5b9a\u4e49\u5bfc\u822a",onConfirm:function(){var n=(0,r.Z)((0,o.Z)().mark((function n(){return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,F();case 2:N.showResetConfirm=!1;case 3:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),onCancel:function(){N.showResetConfirm=!1},children:(0,M.jsx)("p",{children:"\u6e05\u7a7a\u540e\uff0c\u5bfc\u822a\u4f1a\u6062\u590d\u5230 Blocklet \u539f\u6709\u9ed8\u8ba4\u7684\u914d\u7f6e"})})]})}}}]);
|
|
2
|
-
//# sourceMappingURL=4023.6d1a7ac8.chunk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[4420],{56552:function(n,e,t){"use strict";t.d(e,{Z:function(){return a}});var i=t(33028),r=t(33665),o=t(29996),c=t(37574);function a(n){var e=Object.assign({},((0,r.Z)(n),n));return(0,c.jsx)(o.Z,(0,i.Z)({className:"bottom-button",variant:"contained",color:"primary"},e))}},91654:function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return K}});var i,r=t(32723),o=t(59740),c=t(34795),a=t(68079),l=t(33028),s=t(96234),u=t(30969),d=t(88674),f=t.n(d),p=t(12700),m=t.n(p),h=t(43260),x=t.n(h),g=t(38361),v=t(75255),b=t(26022),Z=t(8016),y=t(94984),w=t(71171),k=t(16380),j=t(24974),C=t.n(j),P=t(37574);function T(n){var e=n.children,t=n.bottom,i=n.onBottomFix,r=(0,u.useRef)(null),o=(0,u.useRef)(null),c=(0,u.useRef)(null),a=(0,u.useRef)(null),l=(0,u.useState)(!1),d=(0,s.Z)(l,2),f=d[0],p=d[1];return(0,u.useEffect)((function(){var n,e,t=function(){n||(n=setTimeout((function(){o.current&&(o.current.scrollHeight>r.current.clientHeight-c.current.clientHeight?("fix"!==a.current&&(i("fix"),a.current="fix"),p(!0)):("scroll"!==a.current&&(i("scroll"),a.current="scroll"),p(!1))),n=null}),50))};return window.ResizeObserver?e=new ResizeObserver(t):window.addEventListener("resize",t),e.observe(r.current),e.observe(o.current),function(){e?e.disconnect():window.removeEventListener("resize",t),n&&clearTimeout(n)}}),[i]),(0,P.jsxs)(N,{ref:r,className:"".concat(f?"scroll-mode":""),children:[(0,P.jsx)("div",{className:"compact-context",ref:o,children:e}),(0,P.jsx)("div",{className:"fix-container",ref:c,children:t})]})}var N=k.Z.div(i||(i=(0,w.Z)(["\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n animation: fadein ease 0.5s;\n\n .fix-container {\n margin-top: auto;\n width: 100%;\n }\n\n &.scroll-mode {\n .compact-context {\n flex: 1;\n overflow-y: auto;\n }\n .fix-container {\n margin-top: auto;\n flex-shrink: 0;\n }\n }\n\n @keyframes fadein {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n"])));T.propTypes={children:C().any,bottom:C().element.isRequired,onBottomFix:C().func},T.defaultProps={children:[],onBottomFix:function(){}};var _=T,L=t(99398),E=t(7017),O=t(59505),R=t(64864),B=t(62975),I=t(96699),S=t(56552),z=["childDid"],D=["value"];function K(n){var e=n.onNext,t=n.onPrevious,i=(0,v.Z)((function(n){return n.breakpoints.down("md")})),d=(0,b.PE)().t,p=(0,u.useState)(!1),h=(0,s.Z)(p,2),w=h[0],k=h[1],j=(0,u.useState)(null),C=(0,s.Z)(j,2),T=C[0],N=C[1],K=(0,R.y0)(),A=K.blocklet,F=K.actions,q=(A.configs||[]).filter((function(n){return!O.BLOCKLET_CONFIGURABLE_KEY[n.key]})),M=A.environments.find((function(n){return"BLOCKLET_PASSPORT_COLOR"===n.key})),G=[{key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:d("blocklet.config.name"),value:A.environments.find((function(n){return"BLOCKLET_APP_NAME"===n.key})).value},{key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:d("blocklet.config.description"),value:A.environments.find((function(n){return"BLOCKLET_APP_DESCRIPTION"===n.key})).value},{key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,description:d("blocklet.config.passportColor"),value:M?M.value:"auto",componentType:"passport",componentProps:{blocklet:A}}],V=[];(0,E.forEachChildSync)(A,(function(n,e){var t=e.ancestors.slice(1).map((function(n){return n.meta.did}));V.push((n.configs||[]).map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{childDid:t.concat(n.meta.did)})})))})),A.meta.group===O.BlockletGroup.gateway&&(q=q.filter((function(n){return!n.secure&&n.shared})));var Y=m()(x()([].concat((0,a.Z)(q),V)),"key").filter((function(n){return!!n.key})).sort((function(n,e){return n.required&&!e.required?-1:e.required&&!n.required?1:0})),H=(0,E.getAppMissingConfigs)(A).length,U=function(){var n=(0,c.Z)((0,r.Z)().mark((function n(e){var t,i,c;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=T.childDid,i=(0,o.Z)(T,z),c=[(0,l.Z)((0,l.Z)({},f()(i,["componentType","componentProps"])),{},{value:e})],n.prev=2,k(!0),n.next=6,F.configBlocklet({configs:c,childDid:t});case 6:n.next=11;break;case 8:n.prev=8,n.t0=n.catch(2),y.Z.error(n.t0.message);case 11:return n.prev=11,k(!1),n.finish(11);case 14:case"end":return n.stop()}}),n,null,[[2,8,11,14]])})));return function(e){return n.apply(this,arguments)}}(),W={},J=[].concat(G,(0,a.Z)(Y)).map((function(n){var e=n.value,t=(0,o.Z)(n,D);return W[n.key]=e,(0,l.Z)({},t)}));return(0,P.jsxs)(B.Z,{children:[(0,P.jsx)("div",{className:"header",style:{marginBottom:16},children:(0,P.jsx)(L.Z,{title:d("setup.config.title"),subTitle:d("setup.config.subTitle"),onClickBack:function(){t()}})}),(0,P.jsx)("div",{className:"container-main",children:(0,P.jsx)("div",{className:"container-inner",children:(0,P.jsx)(_,{bottom:(0,P.jsx)(I.Z,{mt:8,disabled:w||T,blocklet:A,onStartNow:function(){return e("complete")},children:(0,P.jsx)(g.Z,{display:"flex",alignItems:"center",children:(0,P.jsx)(S.Z,{variant:"outlined",disabled:w||H||T,onClick:function(){F.refreshFuel({showError:!1}),e()},children:d("setup.next")})})}),children:(0,P.jsx)(Z.Z,{style:{margin:"0 auto 20px",paddingTop:i?0:38},loading:w,schema:J,defaultValue:W,onChange:function(n,e){var t=e.action,i=e.currentItem;"edit"===t?N(i):["cancel","confirm"].includes(t)&&N(null),"confirm"===t&&U(n[i.key])}})})})})]})}K.defaultProps={onNext:function(){},onPrevious:function(){}}},62975:function(n,e,t){"use strict";t.d(e,{Z:function(){return h}});var i,r=t(71171),o=t(16380),c=t(33028),a=t(59740),l=t(24974),s=t.n(l),u=t(37574),d=["children"];function f(n){var e=n.children,t=(0,a.Z)(n,d);return(0,u.jsx)(m,(0,c.Z)((0,c.Z)({},t),{},{children:e}))}f.propTypes={children:s().any.isRequired};var p,m=o.Z.div(i||(i=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n\n .header {\n text-align: center;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 30px;\n width: 100%;\n min-height: 200px;\n flex: 1;\n\n "," {\n padding: 24px;\n }\n\n "," {\n padding: 0 16px 16px;\n }\n }\n\n .footer {\n display: flex;\n justify-content: center;\n\n "," {\n padding-bottom: 34px;\n }\n\n "," {\n margin-top: auto;\n padding-bottom: 10px;\n }\n }\n"])),(function(n){return n.theme.breakpoints.up("md")}),(function(n){return n.theme.breakpoints.down("md")}),(function(n){return n.theme.breakpoints.up("sm")}),(function(n){return n.theme.breakpoints.down("md")})),h=(0,o.Z)(f)(p||(p=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n padding-bottom: 16px;\n "," {\n padding-top: 34px;\n padding-bottom: 34px;\n }\n .header {\n width: 100%;\n margin-bottom: 34px;\n "," {\n margin-bottom: 64px;\n }\n }\n .container-main {\n position: relative;\n flex: 1;\n width: 100%;\n }\n .container-inner {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n overflow-y: auto;\n }\n"])),(function(n){return n.theme.breakpoints.up("md")}),(function(n){return n.theme.breakpoints.up("md")}))},96699:function(n,e,t){"use strict";t.d(e,{Z:function(){return f}});var i,r,o=t(71171),c=t(16380),a=t(38361),l=t(26022),s=t(29996),u=t(38507),d=t(37574);function f(n){var e=n.blocklet,t=n.onStartNow,i=n.children,r=n.disabled,o=(0,l.PE)().t;return!e||(0,u.bg)(e.meta)?(0,d.jsx)(p,{children:i}):(0,d.jsxs)(m,{children:[(0,d.jsx)(s.Z,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:function(){return t()},children:o("setup.startNow")}),(0,d.jsx)(a.Z,{display:"flex",alignItems:"center",children:i})]})}f.defaultProps={blocklet:null,onStartNow:function(){},children:null,disabled:!1};var p=(0,c.Z)(a.Z)(i||(i=(0,o.Z)(["\n padding-top: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n .bottom-button {\n min-width: 200px;\n }\n "," {\n .bottom-button {\n min-width: 150px;\n }\n }\n"])),(function(n){return n.theme.breakpoints.down("md")})),m=(0,c.Z)(a.Z)(r||(r=(0,o.Z)(["\n padding-bottom: 48px;\n padding-top: 24px;\n margin: 0 auto;\n width: 80%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n .start-now {\n min-width: 140px;\n }\n .bottom-button {\n min-width: 120px;\n }\n "," {\n width: 100%;\n }\n\n "," {\n .start-now {\n min-width: 100px;\n }\n .bottom-button {\n min-width: 80px;\n }\n }\n"])),(function(n){return n.theme.breakpoints.down("lg")}),(function(n){return n.theme.breakpoints.down("md")}))},28412:function(n,e,t){"use strict";var i,r=t(71171),o=t(16380),c=t(38361);e.Z=(0,o.Z)(c.Z)(i||(i=(0,r.Z)(["\n width: 100%;\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n "," {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n "," {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n\n .MuiChip-root {\n margin-top: -4px;\n }\n }\n\n .MuiSelect-select {\n padding: 8px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n "," {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])),(function(n){return n.theme.breakpoints.down("md")}),(function(n){return n.theme.breakpoints.down("md")}),(function(n){return n.theme.breakpoints.down("md")}),(function(n){return n.theme.breakpoints.down("md")}))},14458:function(n,e,t){"use strict";var i,r=t(71171),o=t(16380).Z.span(i||(i=(0,r.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(function(n){return n.theme.palette.error.main}));e.Z=o},8016:function(n,e,t){"use strict";t.d(e,{Z:function(){return I}});var i=t(71171),r=t(56666),o=t(33028),c=t(96234),a=t(30969),l=t(24974),s=t.n(l),u=t(16380),d=t(38361),f=t(1484),p=t(88581),m=t(27724),h=t(94551),x=t(94308),g=t(83176),v=t(98545),b={description:s().string,editing:s().bool,onChange:s().func,required:s().bool,value:s().any,componentProps:s().object,render:s().func,renderFormItem:s().func},Z=t(37574);function y(n){var e=n.editing,t=n.value,i=n.onChange,r=(0,a.useState)(!1),o=(0,c.Z)(r,2),l=o[0],s=o[1],u=(0,a.useRef)(),f=(0,a.useRef)(t);(0,a.useEffect)((function(){var n=null;return e&&(n=setTimeout((function(){s(!0)}),50)),function(){clearTimeout(n)}}),[e]);var p=function(n){f.current=n,i(n)},m=(0,Z.jsx)(d.Z,{className:"form-item-input slot",px:1,children:(0,Z.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[t,"auto"!==t&&(0,Z.jsx)("div",{style:{marginLeft:4,backgroundColor:t,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),h=(0,Z.jsxs)(d.Z,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:function(){s(!1),i(f.current)},children:[(0,Z.jsx)(d.Z,{display:"flex",alignItems:"center",onClick:function(){return s(!0)},children:(0,Z.jsx)("div",{ref:u,style:{flexShrink:0,marginLeft:"8px",backgroundColor:t,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:"auto"===t?"default":"pointer"}})}),(0,Z.jsx)(g.ZP,{open:l,anchorEl:u.current,onClose:function(){return s(!1)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:(0,Z.jsx)(v.AI,{color:t,onChange:function(n){return p(n.hex)}})})]});return e?h:m}y.propTypes=b;var w=t(59740),k=t(87006),j=["editing","description","value","onChange","componentProps"];function C(n){var e=n.editing,t=n.description,i=n.value,r=n.onChange,c=n.componentProps,l=(0,w.Z)(n,j),s=c.placeholder,u=(0,a.useRef)(i),f=function(n){u.current=n,r(n)};return e?(0,Z.jsx)(k.Z,(0,o.Z)({style:{flex:1},fullWidth:!0,value:i,onChange:function(n){n.persist(),f(n.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:t||s,onKeyDown:function(n){"Enter"===n.key&&r(u.current,"confirm")}},l)):(0,Z.jsx)(d.Z,{px:1,className:"form-item-input slot",children:i})}C.propTypes=b,C.defaultProps={componentProps:{}};var P=t(52469),T=t.n(P),N=t(84938),_=t(7017),L=["editing","value","onChange","componentProps"];function E(n){var e=n.editing,t=n.value,i=n.onChange,r=n.componentProps,c=(0,w.Z)(n,L),a=r.blocklet,l="auto"===t?(0,N.getPassportColorFromDid)(a.appDid):t;return(0,Z.jsxs)(d.Z,{display:"flex",alignItems:"center",children:[(0,Z.jsx)("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:T()({title:"Owner",issuer:(0,_.getDisplayName)(a),issuerDid:a.appDid,ownerName:"Your Name",ownerDid:a.appDid,preferredColor:t||"auto"})}}),(0,Z.jsx)(y,(0,o.Z)((0,o.Z)({},c),{},{editing:e,value:e?l:t,onChange:i,componentProps:r}))]})}E.propTypes=(0,o.Z)((0,o.Z)({},b),{},{componentProps:s().shape({blocklet:s().object.isRequired}).isRequired}),E.defaultProps={};var O,R=t(14458),B=t(28412);function I(n){var e=n.schema,t=n.loading,i=n.value,l=n.defaultValue,s=n.onChange,u=n.style,g=n.disabled,v="[object Object]"===Object.prototype.toString.call(i),b=(0,a.useState)(null),w=(0,c.Z)(b,2),k=w[0],j=w[1],P=(0,a.useState)(v?i:l),T=(0,c.Z)(P,2),N=T[0],_=T[1],L=(0,a.useRef)();function O(n,e,t){var i=n.key,c=n.secure,a=N[i]!==e,l=(0,o.Z)((0,o.Z)({},N),{},(0,r.Z)({},i,e));a&&_(l),s((0,r.Z)({},i,e),{allValues:l,action:t,currentItem:n}),"confirm"===t&&c&&_((0,o.Z)((0,o.Z)({},N),{},(0,r.Z)({},i,"__encrypted__"))),["confirm","cancel"].includes(t)?B(null):B(n)}function B(n){if(n)return L.current=N[n.key],void j(n);L.current=null,j(null)}return(0,Z.jsx)(S,{className:"form",style:u,children:null===e||void 0===e?void 0:e.map((function(n){var e=n.key,r=n.description,c=n.required,a=n.hidden,l=void 0!==a&&a,s=n.componentProps,u=void 0===s?{}:s;if(l)return null;var b=!(!k||e!==k.key),w=function(n,e){var t=e.editing,r=void 0!==t&&t,o=n.key,c=v?i[o]:N[o];return"__encrypted__"===c?r?"":"******":c}(n,{editing:b}),j=function(n,e){var t=e.editing,i=void 0!==t&&t,r=n.componentType,o=void 0===r?"input":r,c=n.render,a=n.renderFormItem;return i&&a?a:!i&&c?c:{input:C,color:y,passport:E}[null===o||void 0===o?void 0:o.toLowerCase()]}(n,{editing:b}),P={inputProps:{"data-cy":"schema-form-item-component"},key:e,description:r,editing:b,value:w,onChange:function(e){return O(n,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"change")},componentProps:u};return(0,Z.jsxs)(d.Z,{className:"form-item",children:[(0,Z.jsxs)(d.Z,{className:"form-item-label",style:{color:c&&!w?"#ff0000":"#333"},children:[r,c&&(0,Z.jsx)(R.Z,{})]}),(0,Z.jsxs)(d.Z,{className:"form-item-body",children:[(0,Z.jsx)(d.Z,{className:"form-item-input",children:(0,Z.jsx)(j,(0,o.Z)({},P))}),(0,Z.jsx)(d.Z,{className:"form-item-action",children:b?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(h.Z,{"data-cy":"schema-form-item-confirm",onClick:function(){O(n,w,"confirm")},disabled:g||t,size:"large",children:t?(0,Z.jsx)(x.Z,{size:24}):(0,Z.jsx)(m.Z,{})}),(0,Z.jsx)(h.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){O(n,L.current,"cancel")},disabled:g||t,size:"large",children:(0,Z.jsx)(p.default,{})})]}):(0,Z.jsx)(h.Z,{"data-cy":"schema-form-item-edit",onClick:function(){O(n,N[e],"edit")},disabled:g||k,size:"large",children:(0,Z.jsx)(f.Z,{})})})]})]},e)}))})}I.propTypes={schema:s().array.isRequired,loading:s().bool,onChange:s().func.isRequired,value:s().object,defaultValue:s().object,style:s().object,disabled:s().bool},I.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};var S=(0,u.Z)(B.Z)(O||(O=(0,i.Z)([""])))},99398:function(n,e,t){"use strict";var i,r=t(71171),o=t(33028),c=t(59740),a=t(16380),l=t(24974),s=t.n(l),u=t(15405),d=t(37574),f=["title","subTitle","onClickBack"];function p(n){var e=n.title,t=n.subTitle,i=n.onClickBack,r=(0,c.Z)(n,f);return(0,d.jsxs)(m,(0,o.Z)((0,o.Z)({},r),{},{children:[i&&(0,d.jsx)(u.Z,{className:"back-btn",onClick:i}),(0,d.jsx)("div",{className:"title",children:e}),(0,d.jsx)("div",{className:"sub-title",children:t})]}))}var m=a.Z.div(i||(i=(0,r.Z)(["\n position: relative;\n width: 100%;\n text-align: center;\n\n .title {\n font-size: 24px;\n font-weight: 700;\n color: ",";\n\n "," {\n font-size: 20px;\n }\n }\n\n .sub-title {\n font-size: 14px;\n color: ",";\n padding: 0 14px;\n font-weight: 400;\n }\n\n .back-btn {\n position: absolute;\n left: 0;\n top: 8px;\n color: #9397a1;\n font-size: 18px;\n cursor: pointer;\n }\n"])),(function(n){return n.theme.palette.common.black}),(function(n){return n.theme.breakpoints.down("md")}),(function(n){return n.theme.palette.grey[600]}));e.Z=p,p.propTypes={title:s().string,subTitle:s().string,onClickBack:s().oneOfType([s().func,s().string])},p.defaultProps={title:"",subTitle:"",onClickBack:""}},15405:function(n,e,t){"use strict";var i=t(71600);e.Z=void 0;var r=i(t(48035)),o=t(37574),c=(0,r.default)((0,o.jsx)("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}),"ArrowBackIos");e.Z=c},27724:function(n,e,t){"use strict";var i=t(71600);e.Z=void 0;var r=i(t(48035)),o=t(37574),c=(0,r.default)((0,o.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}),"Done");e.Z=c},43611:function(n,e,t){"use strict";var i=t(30969).createContext(void 0);e.Z=i},42641:function(n,e,t){"use strict";function i(n){var e=n.props,t=n.states,i=n.muiFormControl;return t.reduce((function(n,t){return n[t]=e[t],i&&"undefined"===typeof e[t]&&(n[t]=i[t]),n}),{})}t.d(e,{Z:function(){return i}})},86171:function(n,e,t){"use strict";t.d(e,{Z:function(){return o}});var i=t(30969),r=t(43611);function o(){return i.useContext(r.Z)}},12700:function(n,e,t){var i=t(48311),r=t(53970);n.exports=function(n,e){return n&&n.length?r(n,i(e,2)):[]}},33665:function(n,e,t){"use strict";function i(n){if(null==n)throw new TypeError("Cannot destructure "+n)}t.d(e,{Z:function(){return i}})}}]);
|
|
2
|
-
//# sourceMappingURL=4420.55971847.chunk.js.map
|