@abtnode/blocklet-services 1.16.18-beta-bb4ebacc → 1.16.18-beta-41b7fdb1
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/libs/image.js +19 -12
- package/api/routes/federated.js +4 -1
- package/api/routes/oauth.js +11 -2
- package/api/routes/user.js +4 -4
- package/build/asset-manifest.json +17 -17
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/static/css/{5547.5f9be15f.chunk.css → 5547.e016de4c.chunk.css} +3 -3
- package/build/static/js/4076.f5369a1d.chunk.js +2 -0
- package/build/static/js/{4461.26253c6a.chunk.js → 4461.3cd698bf.chunk.js} +2 -2
- package/build/static/js/5547.570ded36.chunk.js +3 -0
- package/build/static/js/{5547.d68bfde3.chunk.js.LICENSE.txt → 5547.570ded36.chunk.js.LICENSE.txt} +2 -3
- package/build/static/js/{5569.a7e151fc.chunk.js → 5569.e4bfe697.chunk.js} +2 -2
- package/build/static/js/6218.4f3036a7.chunk.js +2 -0
- package/build/static/js/{6629.376863d2.chunk.js → 6629.a4a3fb70.chunk.js} +3 -3
- package/build/static/js/main.bf370e0c.js +3 -0
- package/build/static/js/{main.36b0deea.js.LICENSE.txt → main.bf370e0c.js.LICENSE.txt} +1 -1
- package/package.json +23 -23
- package/build/static/js/4076.5ca97365.chunk.js +0 -2
- package/build/static/js/5547.d68bfde3.chunk.js +0 -3
- package/build/static/js/6218.9a4feced.chunk.js +0 -2
- package/build/static/js/main.36b0deea.js +0 -3
- /package/build/static/js/{6629.376863d2.chunk.js.LICENSE.txt → 6629.a4a3fb70.chunk.js.LICENSE.txt} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[6218],{36218:function(e,n,o){o.r(n),o.d(n,{default:function(){return B}});var t=o(32723),i=o(34795),r=o(35147),a=o(49476),s=o(30969),c=o(30734),l=o(19611),d=o.n(l),u=o(94308),p=o(38361),f=o(238),h=o(1986),m=o(26022),v=o(48164),x=o(86776),g=o(32263),w=o(85300),Z=o(4485),j=o(38507),b=o(33028),k=o(59740),P=o(33359),I=o(6779),y=o(72097),C=o(70898),T=o(22797),L=o(23586),N=o(37574);function R(e){var n=e.blocklet;return(0,N.jsxs)(p.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between"},children:[(0,N.jsx)(T.Z,{variant:"rounded",shape:"square",did:n.appPid,src:n.appLogo,size:80}),(0,N.jsx)(P.Z,{component:"h2",variant:"h6",children:n.appName}),(0,N.jsx)(L.Z,{did:n.appPid})]})}var U=(0,s.memo)(R);R.defaultProps={blocklet:window.blocklet};var W=["children","cta"],S=["passports","onConnect","onClose","redirect"],_=function(){var e,n,o=null===(e=window.blocklet)||void 0===e||null===(n=e.componentMountPoints)||void 0===n?void 0:n.find((function(e){return"z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk"===e.did}));return null===o||void 0===o?void 0:o.mountPoint};function z(e){var n=e.children,o=e.cta,t=(0,k.Z)(e,W);return(0,N.jsxs)(p.Z,(0,b.Z)((0,b.Z)({},t),{},{children:[n?(0,N.jsx)(p.Z,{sx:{maxHeight:"50vh",overflow:"hidden",position:"relative",":after":{content:'""',position:"absolute",left:0,right:0,bottom:0,height:"80%",background:"linear-gradient(transparent, #fff 85%)"}},children:n}):null,o?(0,N.jsx)(p.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:4,borderRadius:2},children:o}):null]}))}function D(e){var n=e.passports,o=e.onConnect,t=(e.onClose,e.redirect),i=(0,k.Z)(e,S),r=(0,m.PE)().t,a=_();return(0,N.jsxs)(p.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",maxWidth:"400px",margin:"auto",paddingBottom:{sx:0,md:15}},children:[(0,N.jsx)(U,{}),(0,N.jsx)(z,(0,b.Z)((0,b.Z)({},i),{},{cta:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(P.Z,{variant:"h4",sx:{mx:2,textAlign:"center",fontWeight:"bold",color:"warning.main"},children:r("login.accessLimit.title")}),(0,N.jsx)(P.Z,{variant:"body1",sx:{maxWidth:620,mt:2,mx:2,textAlign:"center",color:"gray"},children:r("login.accessLimit.description")}),(0,N.jsx)(p.Z,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:1,mt:5},children:null===n||void 0===n?void 0:n.map((function(e){var n=function(e){var n=null===e||void 0===e?void 0:e.payable;return a&&n?d()(a,"/api/redirect/checkout/".concat(n,"?redirect=").concat(t)):null}(e);return n?(0,N.jsx)(I.Z,{title:r("login.buyPassport"),arrow:!0,placement:"top",children:(0,N.jsx)(y.Z,{color:"primary",variant:"contained",endIcon:(0,N.jsx)(C.Z,{}),href:n,target:"_blank",children:e.title||e.name})},e.name):(0,N.jsx)(I.Z,{title:r("login.connectWithPassport"),arrow:!0,placement:"top",children:(0,N.jsx)(y.Z,{color:"inherit",variant:"contained",onClick:o,children:e.title||e.name})},e.name)}))}),(0,N.jsxs)(P.Z,{variant:"body1",sx:{mt:2,color:"grey.400"},children:[(0,N.jsx)(p.Z,{component:"span",sx:{display:"inline-block",mr:1},children:r("login.accessLimit.alreadyHavePassport")}),(0,N.jsx)(p.Z,{component:"span",sx:{textDecoration:"underline",cursor:"pointer",color:"primary.main"},onClick:o,children:r("common.connect")})]})]})}))]})}z.defaultProps={children:null,cta:null},D.defaultProps={passports:[],onConnect:function(){},onClose:function(){}};var H=function(e){setTimeout((function(){var n=new URL(window.location.href).searchParams.get("redirect");if(n){var o=decodeURIComponent(n);o.startsWith(w.Bu)?e(o,{replace:!0}):window.location=o}else window.location=window.env.pathPrefix||"/"}),50)};function B(){var e=(0,s.useRef)(null),n=(0,Z.Tt)().session,o=(0,m.PE)(),l=o.t,b=o.locale,k=(0,x.Z)().getPassportId,P=(0,c.useNavigate)(),I=(0,g.OP)(),y=new URL(window.location.href).searchParams,C={passportId:k()},T=y.get("componentId"),L=y.get("authenticated"),R=y.get("sessionToken"),U=y.get("refreshToken"),W=y.get("requiredRoles"),S=y.get("redirect");T&&(C.componentId=T),I&&(C.visitorId=I);var _=[];try{_=JSON.parse(W)}catch(M){}var z=function(){var e=(0,i.Z)((0,t.Z)().mark((function e(o,i){return(0,t.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,j.ZB)(i(o.sessionToken)),(0,j.zI)(i(o.refreshToken)),o.visitorId&&(0,g.IA)(i(o.visitorId)),e.next=5,n.refresh();case 5:H(P);case 6:case"end":return e.stop()}}),e)})));return function(n,o){return e.apply(this,arguments)}}(),B=(0,r.Z)((function(){var e,n=null===(e=window)||void 0===e?void 0:e.blocklet,o={className:"connect",popup:!1,action:"login",onSuccess:z,onError:q,locale:b,messages:{title:l("login.dialog.title"),scan:l("login.dialog.scan"),confirm:l("login.dialog.confirm"),success:l("login.dialog.success")},extraParams:C,baseUrl:window.location.origin,prefix:window.location.origin+d()(w.Bu,w.nC)},t=(0,v.CF)(),i=(0,v.pS)()?t.appUrl:window.location.origin,r=new URL(d()(w.Bu,"connect"),i);r.searchParams.set("params",btoa(encodeURIComponent(JSON.stringify(o)))),r.searchParams.set("appPid",null===n||void 0===n?void 0:n.appPid),r.searchParams.set("appName",null===n||void 0===n?void 0:n.appName),r.searchParams.set("locale",b),r.searchParams.set("redirect",window.location.href),window.location.href=r.href}));(0,a.Z)((function(){y.get("sessionToken")?z({sessionToken:R,refreshToken:U,visitorId:y.get("visitorId")},(function(e){return e})):n.user?L||y.get("sessionToken")||H(P):B()}));var q=function(e){h.Z.error(e.message)};if(n.loading||n.user){if(!L||y.get("sessionToken"))return(0,N.jsx)(f.Z,{children:(0,N.jsx)(u.Z,{})});var A=S?new URL(S,window.location.origin).href:window.location.href;return(0,N.jsx)(D,{onConnect:B,passports:_,redirect:A})}return(0,N.jsx)(p.Z,{sx:{"box-sizing":"border-box",width:"100%",height:"100vh",position:"relative",display:"flex","flex-direction":"column",".connect":{background:"#fafafa"}},ref:e})}},86776:function(e,n,o){function t(){return{getPassportId:function(){var e=localStorage.getItem("passportId")||"";return localStorage.removeItem("passportId"),e},setPassportId:function(e){localStorage.setItem("passportId",e)}}}o.d(n,{Z:function(){return t}})},70898:function(e,n,o){var t=o(71600);n.Z=void 0;var i=t(o(48035)),r=o(37574),a=(0,i.default)((0,r.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-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"LaunchOutlined");n.Z=a}}]);
|
|
2
|
-
//# sourceMappingURL=6218.9a4feced.chunk.js.map
|