@everymatrix/pam-logout 1.85.17 → 1.85.19
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/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{pam-logout-bba672a3.js → pam-logout-00dae1d5.js} +2 -0
- package/dist/cjs/pam-logout.cjs.entry.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/{pam-logout-ca67c66d.js → pam-logout-a6f6b541.js} +2 -0
- package/dist/esm/pam-logout.entry.js +1 -1
- package/dist/pam-logout/index.esm.js +1 -1
- package/dist/pam-logout/pam-logout-a6f6b541.js +1 -0
- package/dist/pam-logout/pam-logout.entry.js +1 -1
- package/package.json +1 -1
- package/dist/pam-logout/pam-logout-ca67c66d.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -23,6 +23,8 @@ function setClientStyling(stylingContainer, clientStyling) {
|
|
|
23
23
|
* @param {string} clientStylingUrl The URL of the style content
|
|
24
24
|
*/
|
|
25
25
|
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
26
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
27
|
+
|
|
26
28
|
const url = new URL(clientStylingUrl);
|
|
27
29
|
|
|
28
30
|
fetch(url.href)
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { P as PamLogout } from './pam-logout-
|
|
1
|
+
export { P as PamLogout } from './pam-logout-a6f6b541.js';
|
|
2
2
|
import './index-1abc369e.js';
|
|
@@ -21,6 +21,8 @@ function setClientStyling(stylingContainer, clientStyling) {
|
|
|
21
21
|
* @param {string} clientStylingUrl The URL of the style content
|
|
22
22
|
*/
|
|
23
23
|
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
24
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
25
|
+
|
|
24
26
|
const url = new URL(clientStylingUrl);
|
|
25
27
|
|
|
26
28
|
fetch(url.href)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { P as pam_logout } from './pam-logout-
|
|
1
|
+
export { P as pam_logout } from './pam-logout-a6f6b541.js';
|
|
2
2
|
import './index-1abc369e.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as PamLogout}from"./pam-logout-
|
|
1
|
+
export{P as PamLogout}from"./pam-logout-a6f6b541.js";import"./index-1abc369e.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e}from"./index-1abc369e.js";function o(t,e){if(t){const o=document.createElement("style");o.innerHTML=e,t.appendChild(o)}}function n(t,e){if(!t||!e)return;const o=new URL(e);fetch(o.href).then((t=>t.text())).then((e=>{const o=document.createElement("style");o.innerHTML=e,t&&t.appendChild(o)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function i(t,e){if(window.emMessageBus){const o=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{o.innerHTML=e,t&&t.appendChild(o)}))}}const a={en:{logoutButton:"Logout"},hu:{logoutButton:"Logout"},ro:{logoutButton:"Logout"},fr:{logoutButton:"Déconnexion"},tr:{logoutButton:"Çıkış Yap"},hr:{logoutButton:"Logout"},"pt-br":{logoutButton:"Logout"},"es-mx":{logoutButton:"Logout"}},s=class{constructor(e){t(this,e),this.device=function(){const t=navigator.userAgent.toLowerCase(),e=screen.availWidth,o=screen.availHeight;if(t.includes("iphone"))return"mobile";if(t.includes("android")){if(o>e&&e<800)return"mobile";if(e>o&&o<800)return"tablet"}return"desktop"}(),this.handleLogout=async()=>{var t,e;try{const o=new Headers;o.append("accept","text/plain"),o.append("X-SessionId",this.session);const n={method:"POST",headers:o},i=await fetch(`${this.endpoint}/api/pam/v1/logout`,n);if(!i.ok)throw new Error(`Logout failed with status: ${i.status}`);{let o=await i.json();"LOGGEDOFF"===(null===(e=null===(t=null==o?void 0:o.session)||void 0===t?void 0:t.details)||void 0===e?void 0:e.exitReason)&&(window.postMessage({type:"LogoutSuccessfull"},window.location.href),((t,e={})=>{const o=new CustomEvent("track-custom-event",{detail:{type:"logged_out",data:e},bubbles:!0,composed:!0});document.dispatchEvent(o)})(0,{}))}}catch(t){console.error("Logout error:",t),window.postMessage({type:"LogoutFailed"},window.location.href)}},this.endpoint=void 0,this.session=void 0,this.language="en",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl=""}handleClientStylingChange(t,e){t!==e&&this.stylingContainer&&o(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!==e&&this.stylingContainer&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!==e&&this.stylingContainer&&i(this.stylingContainer,`${this.mbSource}.Style`)}async componentWillLoad(){if(!this.endpoint||!this.session)throw new Error("endpoint and session props are required");var t;this.translationUrl&&this.translationUrl.length>2&&await(t=this.translationUrl,new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let o in t[e])a[e][o]=t[e][o]})),e(!0)}))})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&i(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return e("div",{key:"ebbb1f2c1c2950f00444fb899235a42c1fbcb10e",class:"LogoutContainer",ref:t=>this.stylingContainer=t},e("p",{key:"891bd35bc62a23c4b3668faacd1015364a252fb5",class:{PlayerAccountMenuItemBox:!0,PlayerAccountMenuItemBoxMobile:"mobile"===this.device,PlayerAccountMenuItemBoxTablet:"tablet"===this.device},onClick:this.handleLogout},e("span",{key:"93e18c0751156d5f4e5085229dc9b68a946ec35a",style:{width:"tablet"===this.device?"24px":"20px"}},e("svg",{key:"d77c42b64be06052f72da3867f84dd8408fc8f3b",id:"bbfaf345-72af-4296-bf4b-2fd41fc03d5d","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 150 150",width:"100%",height:"100%"},e("path",{key:"771a1db24255b9817c462a034550f04bb0754e57",class:"icon-path",d:"M147.16,67.69,115.42,36a9.6,9.6,0,1,0-13.58,13.58l15.32,15.31H49.58a9.63,9.63,0,1,0,0,19.26h67.58L101.84,99.42a9.64,9.64,0,0,0,6.79,16.43,9.41,9.41,0,0,0,6.79-2.85l31.74-31.73a9.53,9.53,0,0,0,0-13.58Z"}),e("path",{key:"5e0592b92da57312febec43af1b8360f5f76abdb",class:"icon-path",d:"M45.16,122.16H19.26V26.79H45.32a9.63,9.63,0,1,0,0-19.26H9.63A9.56,9.56,0,0,0,0,17.16V131.63a9.57,9.57,0,0,0,9.63,9.64H45.32A9.57,9.57,0,0,0,55,131.63a9.78,9.78,0,0,0-9.79-9.47Z"}))),"mobile"!==this.device&&e("span",{key:"eb1d8a4430b07418db8de665f98b3e8a9d9def75",class:"PlayerLogoutText"},((t,e)=>{let o=a[void 0!==e?e:"en"].logoutButton;return o})(0,this.language))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};s.style=":host{display:block}:host *,:host *::before,:host *::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.PlayerAccountMenuItemBox{padding:20px;font-size:16px;display:inline-flex;width:100%;box-sizing:border-box;align-items:center;cursor:pointer}.PlayerAccountMenuItemBox .PlayerLogoutText{margin-left:20px}.PlayerAccountMenuItemBox svg{display:block;width:100%;height:100%}.PlayerAccountMenuItemBox svg .logout-icon-path{fill:var(--emw--pam-typography-color-nav-bg, var(--emw--color-white, #FFFFFF))}.PlayerAccountMenuItemBoxMobile.PlayerAccountMenuItemBox{height:auto;justify-content:center;position:relative;display:flex;width:unset;padding:0}.PlayerAccountMenuItemBoxMobile.PlayerAccountMenuItemBox svg .logout-icon-path{fill:var(--emw--pam-typography-color-nav-bg, var(--emw--color-white, #FFFFFF))}";export{s as P}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as pam_logout}from"./pam-logout-
|
|
1
|
+
export{P as pam_logout}from"./pam-logout-a6f6b541.js";import"./index-1abc369e.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e}from"./index-1abc369e.js";function o(t,e){if(t){const o=document.createElement("style");o.innerHTML=e,t.appendChild(o)}}function n(t,e){const o=new URL(e);fetch(o.href).then((t=>t.text())).then((e=>{const o=document.createElement("style");o.innerHTML=e,t&&t.appendChild(o)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function i(t,e){if(window.emMessageBus){const o=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{o.innerHTML=e,t&&t.appendChild(o)}))}}const a={en:{logoutButton:"Logout"},hu:{logoutButton:"Logout"},ro:{logoutButton:"Logout"},fr:{logoutButton:"Déconnexion"},tr:{logoutButton:"Çıkış Yap"},hr:{logoutButton:"Logout"},"pt-br":{logoutButton:"Logout"},"es-mx":{logoutButton:"Logout"}},s=class{constructor(e){t(this,e),this.device=function(){const t=navigator.userAgent.toLowerCase(),e=screen.availWidth,o=screen.availHeight;if(t.includes("iphone"))return"mobile";if(t.includes("android")){if(o>e&&e<800)return"mobile";if(e>o&&o<800)return"tablet"}return"desktop"}(),this.handleLogout=async()=>{var t,e;try{const o=new Headers;o.append("accept","text/plain"),o.append("X-SessionId",this.session);const n={method:"POST",headers:o},i=await fetch(`${this.endpoint}/api/pam/v1/logout`,n);if(!i.ok)throw new Error(`Logout failed with status: ${i.status}`);{let o=await i.json();"LOGGEDOFF"===(null===(e=null===(t=null==o?void 0:o.session)||void 0===t?void 0:t.details)||void 0===e?void 0:e.exitReason)&&(window.postMessage({type:"LogoutSuccessfull"},window.location.href),((t,e={})=>{const o=new CustomEvent("track-custom-event",{detail:{type:"logged_out",data:e},bubbles:!0,composed:!0});document.dispatchEvent(o)})(0,{}))}}catch(t){console.error("Logout error:",t),window.postMessage({type:"LogoutFailed"},window.location.href)}},this.endpoint=void 0,this.session=void 0,this.language="en",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl=""}handleClientStylingChange(t,e){t!==e&&this.stylingContainer&&o(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!==e&&this.stylingContainer&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!==e&&this.stylingContainer&&i(this.stylingContainer,`${this.mbSource}.Style`)}async componentWillLoad(){if(!this.endpoint||!this.session)throw new Error("endpoint and session props are required");var t;this.translationUrl&&this.translationUrl.length>2&&await(t=this.translationUrl,new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let o in t[e])a[e][o]=t[e][o]})),e(!0)}))})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&i(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&o(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return e("div",{key:"ebbb1f2c1c2950f00444fb899235a42c1fbcb10e",class:"LogoutContainer",ref:t=>this.stylingContainer=t},e("p",{key:"891bd35bc62a23c4b3668faacd1015364a252fb5",class:{PlayerAccountMenuItemBox:!0,PlayerAccountMenuItemBoxMobile:"mobile"===this.device,PlayerAccountMenuItemBoxTablet:"tablet"===this.device},onClick:this.handleLogout},e("span",{key:"93e18c0751156d5f4e5085229dc9b68a946ec35a",style:{width:"tablet"===this.device?"24px":"20px"}},e("svg",{key:"d77c42b64be06052f72da3867f84dd8408fc8f3b",id:"bbfaf345-72af-4296-bf4b-2fd41fc03d5d","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 150 150",width:"100%",height:"100%"},e("path",{key:"771a1db24255b9817c462a034550f04bb0754e57",class:"icon-path",d:"M147.16,67.69,115.42,36a9.6,9.6,0,1,0-13.58,13.58l15.32,15.31H49.58a9.63,9.63,0,1,0,0,19.26h67.58L101.84,99.42a9.64,9.64,0,0,0,6.79,16.43,9.41,9.41,0,0,0,6.79-2.85l31.74-31.73a9.53,9.53,0,0,0,0-13.58Z"}),e("path",{key:"5e0592b92da57312febec43af1b8360f5f76abdb",class:"icon-path",d:"M45.16,122.16H19.26V26.79H45.32a9.63,9.63,0,1,0,0-19.26H9.63A9.56,9.56,0,0,0,0,17.16V131.63a9.57,9.57,0,0,0,9.63,9.64H45.32A9.57,9.57,0,0,0,55,131.63a9.78,9.78,0,0,0-9.79-9.47Z"}))),"mobile"!==this.device&&e("span",{key:"eb1d8a4430b07418db8de665f98b3e8a9d9def75",class:"PlayerLogoutText"},((t,e)=>{let o=a[void 0!==e?e:"en"].logoutButton;return o})(0,this.language))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};s.style=":host{display:block}:host *,:host *::before,:host *::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.PlayerAccountMenuItemBox{padding:20px;font-size:16px;display:inline-flex;width:100%;box-sizing:border-box;align-items:center;cursor:pointer}.PlayerAccountMenuItemBox .PlayerLogoutText{margin-left:20px}.PlayerAccountMenuItemBox svg{display:block;width:100%;height:100%}.PlayerAccountMenuItemBox svg .logout-icon-path{fill:var(--emw--pam-typography-color-nav-bg, var(--emw--color-white, #FFFFFF))}.PlayerAccountMenuItemBoxMobile.PlayerAccountMenuItemBox{height:auto;justify-content:center;position:relative;display:flex;width:unset;padding:0}.PlayerAccountMenuItemBoxMobile.PlayerAccountMenuItemBox svg .logout-icon-path{fill:var(--emw--pam-typography-color-nav-bg, var(--emw--color-white, #FFFFFF))}";export{s as P}
|