!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).OneLogin={})}(this,(function(e){"use strict";var t=function(e,t,o){return e(o={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&o.path)}},o.exports),o.exports}((function(e,t){var o;o=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var o=arguments[e];for(var n in o)t[n]=o[n]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function o(n){function r(){}function l(t,o,l){if("undefined"!=typeof document){"number"==typeof(l=e({path:"/"},r.defaults,l)).expires&&(l.expires=new Date(1*new Date+864e5*l.expires)),l.expires=l.expires?l.expires.toUTCString():"";try{var s=JSON.stringify(o);/^[\{\[]/.test(s)&&(o=s)}catch(e){}o=n.write?n.write(o,t):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var i="";for(var a in l)l[a]&&(i+="; "+a,!0!==l[a]&&(i+="="+l[a].split(";")[0]));return document.cookie=t+"="+o+i}}function s(e,o){if("undefined"!=typeof document){for(var r={},l=document.cookie?document.cookie.split("; "):[],s=0;s<l.length;s++){var i=l[s].split("="),a=i.slice(1).join("=");o||'"'!==a.charAt(0)||(a=a.slice(1,-1));try{var d=t(i[0]);if(a=(n.read||n)(a,d)||t(a),o)try{a=JSON.parse(a)}catch(e){}if(r[d]=a,e===d)break}catch(e){}}return e?r[e]:r}}return r.set=l,r.get=function(e){return s(e,!1)},r.getJSON=function(e){return s(e,!0)},r.remove=function(t,o){l(t,"",e(o,{expires:-1}))},r.defaults={},r.withConverter=o,r}((function(){}))},e.exports=o()}));const o={error:{priority:3,method:(...e)=>console.error(...e)},warn:{priority:2,method:(...e)=>console.warn(...e)},info:{priority:1,method:(...e)=>console.info(...e)},debug:{priority:0,method:(...e)=>console.debug(...e)}},n=["%c 1L Widget ","background: #2019f5; color: #fff"],r="olw_loglvl";const l=new class{constructor(){this.level=(()=>{const e=t.get(r);return e&&e in o?e:"info"})(),this.setLevel=e=>{if(!e||!(e in o))return this.error("Incorrect log level.");this.level=e,t.set(r,e),this.info(`Log level changed to "${e}".`)},this.log=(e,...t)=>{if(o[e].priority>=o[this.level].priority)return o[e].method(...n,`[${e.toUpperCase()}] `,...t)},this.error=(...e)=>this.log("error",...e),this.warn=(...e)=>this.log("warn",...e),this.info=(...e)=>this.log("info",...e),this.debug=(...e)=>this.log("debug",...e)}},s=1024,i=window.crypto||window.msCrypto,a=e=>JSON.parse(decodeURIComponent(escape(atob(e.split(".")[1])))),d=e=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";return Array(e).fill(null).map(()=>t.charAt(Math.floor((()=>{const[e]=i.getRandomValues(new Uint32Array(1));return e/2**32})()*t.length))).join("")},c=e=>String.fromCharCode.apply(null,new Uint8Array(e)),u=e=>{const t=(new TextEncoder).encode(e),o=i.subtle.digest("SHA-256",t);return o instanceof Promise?o:new Promise((e,t)=>{const n=o;n.oncomplete=t=>e(t.target.result),n.onerror=e=>t(e.toString())})},_=e=>window.btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),p=e=>e.split("/").slice(0,3).join("/");let m;const g="ONELOGIN_ID_TOKEN",h="ONELOGIN_PKCE_STATE",w="ONELOGIN_PKCE_CODE_VERIFIER",f="ONELOGIN_ACCESS_TOKEN",v="ONELOGIN_REFRESH_TOKEN",y="https://1login.wp.pl",b=()=>t.get("OL_ID"),x=(e,t)=>{const o=d(111),n=d(111);return u(n).then(r=>{const l=_(c(r));return(({clientId:e,redirectUrl:t,scope:o,state:n,codeChallenge:r})=>{const l=new URLSearchParams("");return l.set("response_type","code"),l.set("client_id",e),l.set("redirect_uri",t),l.set("scope",o),l.set("state",n),l.set("code_challenge",r),l.set("code_challenge_method","S256"),window.location.href.length<=s&&l.set("continue_url",window.location.href),fetch(`${m.authProviderUrl}/auth/silent?${l.toString()}`,{credentials:"include"})})({...t,olId:e,state:o,codeChallenge:l}).then(r=>{if(401===r.status){const o=b();return!(e===o||!o)&&x(o,t)}return 200===r.status&&r.json().then(e=>{const t=e.data.redirectUrl,[,r]=t.split("?"),l=new URLSearchParams(r),s=l.get("code"),i=l.get("state");return!(!s||o!=i)&&{code:s,codeVerifier:n}})})})},E=(e,o)=>{const{authUrl:n,clientId:r,redirectUrl:i,scope:y,postLogoutRedirectUrl:E,passContinueUrl:L,autologinDomain:k}=e;let $;const C=()=>{l.debug("clearing storage"),o.clear(g),o.clear(f),o.clear(v),document.dispatchEvent(new CustomEvent("ol-not-logged"))},S=()=>{const e=o.load(g);if(!e)throw C(),new Error("No token in storage");return a(e)},B=()=>{const e=o.load(v);return e?(({clientId:e,refreshToken:t})=>fetch(m.authProviderUrl+"/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"grant_type=refresh_token&client_id="+e+"&refresh_token="+t}))({clientId:r,refreshToken:e}).then(e=>200!==e.status?(l.debug("current session is invalid"),C(),!1):e.json().then(e=>(o.save(f,e.access_token),o.save(v,e.refresh_token),!0))):Promise.resolve(!1)},z=e=>{clearTimeout($),$=setTimeout(B,1e3*(e-30))},O=({code:e,codeVerifier:s,continueUrl:d})=>(({clientId:e,redirectUrl:t,code:o,codeVerifier:n})=>fetch(m.authProviderUrl+"/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"grant_type=authorization_code&client_id="+e+"&redirect_uri="+t+"&code="+o+"&code_verifier="+n}))({clientId:r,code:e,codeVerifier:s,redirectUrl:i}).then(e=>e.json()).then(e=>{if(!e.id_token)throw new Error("No token from response");const s=a(e.id_token);if(!s.aud.includes(r))throw new Error("Aud differs from clientId!");if(s.iss!==p(n)+"/api/v1/public/ol-authprovider")throw new Error("Wrong ISS");((e,o=".wp.pl")=>{const n=Date.now()+12096e5;t.set("OL_ID",e,{domain:o,expires:n})})(s.ad_id,k),o.save(f,e.access_token),o.save(v,e.refresh_token),z(e.expires_in),(e=>{l.debug("setting user token"),o.save(g,e),document.dispatchEvent(new CustomEvent("ol-login"))})(e.id_token),d&&window.location.assign(decodeURIComponent(d))}),I=()=>{const e=o.load(f);return e?(e=>fetch(m.authProviderUrl+"/introspect",{headers:{Authorization:"Bearer "+e},method:"POST"}))(e).then(e=>200===e.status?e.json().then(e=>{const t=Math.floor(Date.now()/1e3),o=e.exp-t;return z(o),!0}):e.status.toString().startsWith("4")?B():(l.error("invalid response during introspect"),C(),!1)):Promise.resolve(!1)};return(()=>{(e=>{const t=p(e.authUrl);m=Object.freeze({origin:t,authProviderUrl:t+"/api/v1/public/ol-authprovider"})})(e),setInterval(I,6e4);const t=window.location.href;t.startsWith(decodeURI(i))&&t.includes("code=")?(()=>{const e=new URLSearchParams(window.location.search),t=e.get("state"),n=e.get("code"),r=e.get("error"),l=e.get("continue_url");if(!n)throw new Error("No code from response");if(r)throw new Error(r);history.replaceState({},"Logowanie 1L",i);const s=o.load(h),a=o.load(w);if(o.clear(h),o.clear(w),t!==s)throw console.error({state:t,storageState:s}),new Error("State differs from storage");if(!a)throw new Error("There is no `code_verifier` in storage");if(!s)throw new Error("There is no `state` in storage");O({code:n,codeVerifier:a,continueUrl:l})})():I().then(t=>{t?(l.debug("user logged in"),document.dispatchEvent(new CustomEvent("ol-login"))):(l.debug("no active session found"),(({storage:e,callback:t,config:o})=>{if(e.load(f))return void l.debug("Token in storage - autologin denied");const n=b();n?(l.debug("autologin - data found; initializing..."),x(n,o).then(e=>{e?(l.debug("autologin - accepted; token granted"),t(e)):l.debug("autologin - denied; session no longer active")})):l.debug("autologin - no data found")})({config:e,storage:o,callback:O}),document.dispatchEvent(new CustomEvent("ol-not-logged")))})})(),{login:e=>{const t=d(111);o.save(h,t);const l=d(111);return o.save(w,l),u(l).then(o=>{const l=_(c(o)),a=new URLSearchParams("");e&&a.set("flow","select_account"),a.set("response_type","code"),a.set("client_id",r),a.set("redirect_uri",i),a.set("scope",y),a.set("state",t),a.set("code_challenge",l),a.set("code_challenge_method","S256"),L&&window.location.href.length<=s&&a.set("continue_url",window.location.href),window.location.assign(`${n}?${a.toString()}`)})},logout:()=>{l.debug("logout initiated");try{const e=S().l_hint;C(),l.debug("removing autologin cookie"),t.remove("OL_ID"),window.location.assign(p(n)+"/api/v1/public/ol-authprovider/logout?l_hint="+e+"&post_logout_redirect_uri="+E)}catch(e){console.error(e)}},getUserData:()=>{const{first_name:e,last_name:t,sub:o,avatar_url:n}=S();return{first_name:e,last_name:t,email:o,avatar_url:n}}}},L=(e,t)=>"PKCE"===e.flow?E(e,t):(({passContinueUrl:e,logout:{url:t,method:o="GET"},authUrl:n})=>{let r=void 0;return{login:t=>{const o=new URLSearchParams("");t&&o.set("flow","select_account"),e&&window.location.href.length<=s&&o.set("continue_url",window.location.href);const r=o.toString();window.location.assign(`${n}${r?"?"+r:""}`)},logout:()=>{const e=document.createElement("form");e.setAttribute("method",o),e.setAttribute("action",t),document.body.appendChild(e),e.submit()},getUserData:()=>{if(!r)throw new Error("No UserData in storage");return r},setUserData:e=>{r=e,document.dispatchEvent(new CustomEvent("ol-login"))}}})(e),k={COOKIE:{clear:e=>{document.cookie=`${e}=;path=/;expires=${(new Date).getTime()-1e5}`},load:e=>{const t=document.cookie.match("(^|;) ?"+e+"=([^;]*)(;|$)");return t?t[2]:null},save:(e,t)=>{document.cookie=`${e}=${t};path=/`}},LOCAL_STORAGE:{clear:e=>localStorage.removeItem(e),load:e=>localStorage.getItem(e),save:(e,t)=>{localStorage.setItem(e,t)}}},$=(e,...t)=>e.map((e,o)=>`${e}${t[o]||""}`).join("");function C(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}var S="styles-module_Button__1bJy1",B="styles-module_Icon__1t6X6";C(".styles-module_Button__1bJy1{display:flex;align-items:center;justify-content:center;border:none;border-radius:4px;background-color:#2019f5;color:#fff;font-size:14px;outline:none;padding:10px 12px 10px 30px;max-width:270px;width:100%;position:relative;cursor:pointer}.styles-module_Button__1bJy1 span{position:relative}.styles-module_Button__1bJy1:hover{background-color:#333cf6}.styles-module_Icon__1t6X6{position:absolute;top:50%;left:12px;transform:translateY(-50%)}");var z="styles-module_Text__2N4ci",O="styles-module_Overlay__aUjWP",I="styles-module_Bold__27ljj",U="styles-module_Button__3Bq4n",T="styles-module_TextWrapper__3szJT";C(".styles-module_Text__2N4ci{display:block;max-width:95px}.styles-module_Text__2N4ci.styles-module_Overlay__aUjWP{position:absolute;left:50%;transform:translateX(-50%)}.styles-module_Text__2N4ci.styles-module_Bold__27ljj{font-weight:600;visibility:hidden}.styles-module_Button__3Bq4n{display:flex;justify-content:center;align-items:center;flex-direction:column;background:none;border:0;font-size:12px;font-weight:500;cursor:pointer;outline:0;text-transform:uppercase}.styles-module_Button__3Bq4n>*{position:relative}.styles-module_Button__3Bq4n:hover .styles-module_Overlay__aUjWP{visibility:hidden}.styles-module_Button__3Bq4n:hover .styles-module_Bold__27ljj{visibility:visible}.styles-module_Button__3Bq4n .styles-module_TextWrapper__3szJT{margin-top:8px}@media (max-width:768px){.styles-module_Button__3Bq4n .styles-module_TextWrapper__3szJT{display:none}}");const A=(e,t,o,n=!0)=>{const r=t.length<=10?t:t.substring(0,10).replace(/...$/,"...");return $`<button type="button" id="${e}" class="olw__button${n?"":"--login"} ${U}">${o}<div class="olw__button__text ${T}"><span class="olw__button__text--overlay ${z} ${O}">${r}</span> <span class="olw__button__text--bold ${z} ${I}">${r}</span></div></button>`};var P="styles-module_Wrapper__28I5v",D="styles-module_Link__7LnyB",N="styles-module_Icon__2j5nC";C(".styles-module_Wrapper__28I5v{display:flex;flex-direction:column;padding:0 20px 10px;border-top:1px solid rgba(0,0,0,.1)}.styles-module_Link__7LnyB{display:flex;align-items:center;margin-top:10px;font-size:14px;cursor:pointer;color:#1a1a1a}.styles-module_Link__7LnyB:hover{text-decoration:underline}.styles-module_Icon__2j5nC{display:flex;align-items:center;justify-content:center;width:20px;margin-right:15px}");const j=()=>"true"===t.get("mobileApp");var M="styles-module_Wrapper__2g7OW",W="styles-module_AvatarWrapper__pJPgY",R="styles-module_Avatar__2n7RQ",q="styles-module_OneLoginLogo__2RFnu",F="styles-module_PersonalData__p1q4n",G="styles-module_Email__3ZhPR",V="styles-module_Link__1nZwl",J="styles-module_DisplayNone__1dBmu";C(".styles-module_Wrapper__2g7OW{display:flex;flex-direction:column;width:100%;align-items:center;padding:20px 20px 0;box-sizing:border-box}.styles-module_AvatarWrapper__pJPgY{position:relative}.styles-module_Avatar__2n7RQ{height:60px;width:60px;border-radius:50%}@media (max-width:768px){.styles-module_Avatar__2n7RQ{height:43px;width:43px}}.styles-module_OneLoginLogo__2RFnu{position:absolute;bottom:0;left:-10px}.styles-module_PersonalData__p1q4n{margin-top:10px;font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.styles-module_Email__3ZhPR{font-size:12px;color:#656565;margin-bottom:10px}.styles-module_Link__1nZwl{font-size:14px;font-weight:600;color:#2019f5;margin-bottom:15px;cursor:pointer;text-decoration:none}.styles-module_Link__1nZwl:hover{text-decoration:underline}.styles-module_Link__1nZwl:last-child{margin-bottom:10px}.styles-module_DisplayNone__1dBmu{display:none}");const Z=({size:e=30,class:t=""}={})=>$`<svg xmlns="http://www.w3.org/2000/svg" class="${t}" width="${e}" height="${e}" viewBox="0 0 41 40"><g fill="none" fill-rule="evenodd" transform="translate(5.24 5)"><circle cx="15" cy="15" r="17.4" fill="#E3E8FE" stroke="#E3E8FE" stroke-width="4.8"/><path fill="#2019F5" fill-rule="nonzero" d="M20.487 22.274v-1.796c0-2.115-1.687-3.38-3.309-4.615-.224-.17-.509-.493-.509-.986s.257-.974.51-1.18c1.577-1.286 3.308-2.5 3.308-4.615V7.726h1.273V6h-14v1.726h1.273v1.356c0 2.116 1.73 3.329 3.309 4.615.252.206.509.687.509 1.18 0 .493-.285.816-.51.986-1.62 1.234-3.308 2.5-3.308 4.615v1.796H7.76V24h14v-1.726h-1.273zm-8.941-11.59c-.47-.513-.731-1.009-.731-1.602V7.726h7.89v1.356c0 .593-.262 1.089-.73 1.603h-6.43zm7.16 11.109l-2.997-1.133c-.522-.197-1.376-.197-1.897 0l-2.997 1.133v-1.315c0-1.197.982-2.005 2.584-3.225l.043-.032c.608-.462 1.003-1.106 1.137-1.815.12.026.243.026.362 0 .134.71.529 1.353 1.136 1.814l.044.033c1.602 1.22 2.584 2.028 2.584 3.225v1.315z"/></g></svg>`;var H="styles-module_Wrapper__3Ue2n",K="styles-module_Dropdown__22z2G",Q="styles-module_Open__qza-y",X="styles-module_Closed__12SQg",Y="styles-module_Backdrop__3E_yg",ee="styles-module_Visible__3WocK",te="styles-module_Content__2QMnt",oe="styles-module_CloseButton__OZ9N-",ne="styles-module_Placeholder__GOJhG",re="styles-module_AvatarWrapper__2IFqp";C(".styles-module_Wrapper__3Ue2n{color:#1a1a1a;position:relative}.styles-module_Dropdown__22z2G{position:absolute;width:350px;right:0;background-color:#fff;border-radius:5px;box-shadow:0 0 10px 0 rgba(0,0,0,.2);z-index:999;top:-5px;opacity:0;transform:scale(.2);transform-origin:top right;transition:transform .2s ease-in-out,opacity .2s ease-in-out,top .2s ease-in-out}.styles-module_Dropdown__22z2G.styles-module_Open__qza-y{top:100%;opacity:1;transform:scale(1)}.styles-module_Dropdown__22z2G.styles-module_Closed__12SQg{display:none}@media (max-width:768px){.styles-module_Dropdown__22z2G{position:fixed;transform-origin:top center;transform:scale(.2) translateX(-50%);top:10px;left:50%}.styles-module_Dropdown__22z2G.styles-module_Open__qza-y{top:10px;transform:scale(1) translateX(-50%)}}.styles-module_Backdrop__3E_yg{display:none;position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(88,88,88,.83);z-index:998}@media (max-width:768px){.styles-module_Backdrop__3E_yg.styles-module_Visible__3WocK{display:block}}.styles-module_Content__2QMnt{position:relative}.styles-module_CloseButton__OZ9N-{display:none;position:absolute;background:none;border:none;padding:0;margin:0;top:20px;right:20px;outline:none}@media (max-width:768px){.styles-module_CloseButton__OZ9N-{display:block}}.styles-module_Placeholder__GOJhG:not(:empty){border-top:1px solid rgba(0,0,0,.1)}.styles-module_AvatarWrapper__2IFqp{display:flex;align-items:center;justify-content:center;width:30px;height:30px;background-color:#e0e0e0;border-radius:50%}.styles-module_AvatarWrapper__2IFqp img{height:24px;width:24px;border-radius:50%}");const le=(e,t)=>{const o=e.flow.getUserData(),{first_name:n,avatar_url:r}=o;t.innerHTML=$`<div id="olw-db-backdrop" class="${Y}"></div><div class="${H}">${A("olw-db-button",n,r?$`<div class="olw__button__avatar ${re}"><img src="${r}" alt="avatar"></div>`:Z())}<div id="olw-db-dropdown" class="olw__dropdown ${K} ${X}"><div class="${te}"><div id="olw-db-user">a</div><div class="${ne}" id="olw-db-user-actions-placeholder"></div><div id="olw-db-actions">b</div><button type="button" id="olw-db-x-button" class="${oe}"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="#A1A1A1" fill-rule="evenodd" d="M11.414 10l4.293-4.293c.391-.391.391-1.023 0-1.414-.39-.391-1.023-.391-1.414 0L10 8.586 5.707 4.293c-.39-.391-1.023-.391-1.414 0-.39.391-.39 1.023 0 1.414L8.586 10l-4.293 4.293c-.39.391-.39 1.023 0 1.414.195.195.451.293.707.293.256 0 .512-.098.707-.293L10 11.414l4.293 4.293c.195.195.451.293.707.293.256 0 .512-.098.707-.293.391-.391.391-1.023 0-1.414L11.414 10z"/></svg></button></div></div></div>`;const l=document.getElementById("olw-db-dropdown"),s=document.getElementById("olw-db-backdrop"),i=document.getElementById("olw-db-button"),a=document.getElementById("olw-db-x-button"),d=Array.from(t.querySelectorAll("a")),c=t.querySelector("#olw-db-user"),u=t.querySelector("#olw-db-actions");if(!(l&&s&&c&&u))throw new Error("Missing element during dropdown-button render");const _=((e,t,{avatar_url:o,first_name:n,last_name:r,email:l})=>{t.innerHTML=$`<div class="${M}"><div class="olw__avatarwrapper ${W}">${o?`<img class="${R}" src="${o}" alt="avatar" />`:Z({class:R})} <svg xmlns="http://www.w3.org/2000/svg" width="24" height="23" viewBox="0 0 24 23" class="${q}"><g fill="none" fill-rule="evenodd" transform="translate(.754)"><ellipse cx="11.475" cy="11.4" fill="#FFF" rx="11.475" ry="11.4"/><g fill="#2019F5"><path d="M14.765 1.87c-.348 0-.672.108-.94.291-.104.059-.202.127-.294.21l-4.84 4.962c-.672.609-.718 1.651-.102 2.315.616.665 1.67.71 2.342.1l2.165-2.13v8.307c0 .907.751 1.65 1.67 1.65.918 0 1.669-.743 1.669-1.65V3.52c0-.907-.75-1.65-1.67-1.65" transform="translate(2.416 2.4)"/><path d="M6.587 11.8c-.743-.586-1.222-1.278-1.441-2.16-.196-.796-.115-1.46.153-2.26.038-.094.042-.105.01-.032.022-.052.046-.103.07-.154.036-.075.074-.15.115-.223.108-.195.229-.385.365-.562-.084.109.068-.076.08-.088.073-.085.15-.165.23-.244.08-.08.163-.155.248-.228.021-.018.206-.162.092-.078.183-.136.377-.256.578-.361.217-.116.263-.133.43-.193.454-.16.823-.223 1.25-.238.46-.014.852-.376.852-.841 0-.446-.39-.859-.853-.843-1.784.057-3.385.902-4.429 2.331-1 1.368-1.27 3.245-.723 4.84.339.987.943 1.876 1.768 2.526.36.285.854.348 1.205 0 .297-.293.362-.905 0-1.192M10.223 12.288c-.644.222-1.281.288-1.959.209-.457-.054-.852.425-.852.842 0 .5.393.789.852.843.808.095 1.645-.005 2.412-.268.435-.15.723-.577.596-1.036-.116-.418-.612-.74-1.049-.59" transform="translate(2.416 2.4)"/><path d="M1.774 9.804c-.129-.99-.085-1.865.132-2.728.055-.22.12-.437.194-.652.037-.106.076-.212.118-.317.02-.053.04-.106.063-.157-.058.134.051-.107.052-.108.19-.406.418-.796.676-1.165.064-.09.13-.183.198-.272-.064.084.096-.115.132-.156.164-.192.337-.378.52-.554.37-.361.603-.548.983-.799.836-.553 1.536-.847 2.515-1.06 1.296-.282 2.68-.173 3.966.271.435.15.933-.171 1.048-.589.13-.464-.158-.886-.594-1.036-2.452-.846-5.242-.568-7.47.754C2.443 2.343 1.035 4.126.39 6.178.023 7.343-.087 8.596.069 9.804c.059.452.35.843.853.843.415 0 .91-.387.852-.843M10.129 15.724c-1.498.27-3.112.04-4.43-.616-1.392-.692-2.444-1.715-3.177-3.06-.22-.401-.78-.527-1.166-.303-.41.237-.526.75-.307 1.153.864 1.584 2.234 2.915 3.872 3.706 1.774.856 3.725 1.095 5.66.746.455-.082.71-.626.597-1.037-.131-.472-.594-.67-1.049-.589" transform="translate(2.416 2.4)"/></g></g></svg></div><div class="olw__personaldata ${F}">${n} ${r}</div><div class="olw__email ${G}">${l}</div><a class="olw__link ${V} ${j()||window.location.href.startsWith(y)?J:""}" href="${y}" target="_blank" rel="noreferrer noopener">Zarządzaj kontem </a><a class="olw__link ${V}" id="olw-link-login">Przełącz konto</a></div>`;const s=t.querySelector("#olw-link-login");if(!s)throw new Error("User link login element not found");const i=()=>{j()?window.location.assign("onelogin://profile/choose"):e.flow.login(!0)};return s.addEventListener("click",i),()=>{s.removeEventListener("click",i)}})(e,c,o),p=((e,t)=>{t.innerHTML=$`<div class="olw__action--logout ${P}"><a class="olw__action--link ${D}" id="olw-actions-logout"><span class="olw__action--icon ${N}"><svg xmlns="http://www.w3.org/2000/svg" width="17" height="19" viewBox="0 0 17 19"><path fill="#2019F5" stroke="#2019F5" d="M7 1c4.791 0 8.675 3.884 8.675 8.675S11.791 18.35 7 18.35c-.373 0-.675-.302-.675-.675 0-.373.302-.675.675-.675 4.045 0 7.325-3.28 7.325-7.325S11.045 2.35 7 2.35c-.373 0-.675-.302-.675-.675C6.325 1.302 6.627 1 7 1zM4.632 5.873l.084-.071.092-.056c.252-.126.568-.084.779.127h0l.071.083c.19.264.166.634-.071.871h0L3.305 9.11h6.412l.1.008c.325.048.575.329.575.668 0 .372-.302.675-.675.675h0l-6.412-.001 2.282 2.283.071.084c.19.263.166.633-.071.87-.264.264-.691.264-.955 0h0l-3.448-3.448-.057-.07-.053-.085-.04-.095-.026-.11L1 9.784c0-.07.01-.137.03-.2h0l.038-.096.052-.088h0l.026-.036.044-.05 3.442-3.442z"/></svg> </span>Wyloguj</a></div>`;const o=t.querySelector("#olw-actions-logout");if(!o)throw new Error("Actions logout link element not found");const n=()=>{j()?window.location.assign("onelogin://profile/logout"):e.flow.logout()};return o.addEventListener("click",n),()=>{o.removeEventListener("click",n)}})(e,u),m=()=>{l.classList.remove(Q),s.classList.remove(ee),"none"===getComputedStyle(s).display&&document.body.removeAttribute("style"),setTimeout(()=>l.classList.add(X),250)};document.addEventListener("ol-close-dropdown",m);const g=()=>{l.classList.contains(X)?(l.classList.remove(X),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{"none"!==getComputedStyle(s).display&&(document.body.style.overflow="hidden"),l.classList.add(Q)})}),s.classList.add(ee)):m()},h=e=>{"Escape"===e.code&&m()},w=e=>{if(l&&i&&e.target){l.contains(e.target)||i.contains(e.target)||m()}};return null==i||i.addEventListener("click",g),null==a||a.addEventListener("click",m),document.addEventListener("keyup",h),document.addEventListener("click",w),d.forEach(e=>e.addEventListener("click",g)),()=>{_(),p(),null==i||i.removeEventListener("click",g),null==a||a.addEventListener("click",m),document.removeEventListener("keyup",h),document.removeEventListener("click",w),d.forEach(e=>e.removeEventListener("click",g)),document.removeEventListener("ol-close-dropdown",m),t.innerHTML=""}},se=(e,t)=>{const o=[],n=()=>{o.push(le(e,t))},r=()=>{o.push(((e,t)=>{t.innerHTML=A("ol-widget-login-button","Zaloguj",$`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="28" viewBox="0 0 32 28"><path class="olw__button--icon" d="M12.698 3.048c1.806 0 3.523.376 5.078 1.055-.168.484-.297.985-.383 1.5-1.426-.662-3.017-1.032-4.695-1.032-6.171 0-11.174 5.003-11.174 11.175 0 6.172 5.003 11.175 11.174 11.175 6.122 0 11.094-4.922 11.174-11.025.49.142.997.243 1.517.301-.237 6.804-5.828 12.247-12.69 12.247C5.684 28.444 0 22.76 0 15.746 0 8.733 5.685 3.048 12.698 3.048zm2.477 14.349c2.279 0 4.127 1.848 4.127 4.127 0 .456-.37.825-.826.825-.423 0-.772-.318-.82-.729l-.01-.242c-.072-1.251-1.074-2.254-2.326-2.326l-.145-.004h-4.953c-1.367 0-2.476 1.108-2.476 2.476 0 .456-.37.825-.825.825-.456 0-.826-.37-.826-.825 0-2.22 1.752-4.03 3.948-4.123l.18-.004h4.952zm-2.477-8.254c2.28 0 4.127 1.848 4.127 4.127 0 2.28-1.847 4.127-4.127 4.127-2.279 0-4.127-1.848-4.127-4.127 0-2.28 1.848-4.127 4.127-4.127zm0 1.65c-1.367 0-2.476 1.11-2.476 2.477 0 1.367 1.109 2.476 2.476 2.476 1.368 0 2.477-1.109 2.477-2.476 0-1.368-1.109-2.476-2.477-2.476z"/><path class="olw__button--logo" d="M31.166 1.514c.739 0 1.342.601 1.342 1.336v10.037c0 .734-.603 1.335-1.342 1.335-.737 0-1.34-.601-1.34-1.335V6.164L28.084 7.89c-.54.493-1.386.456-1.882-.081-.495-.538-.458-1.381.082-1.874l3.89-4.016c.073-.067.152-.122.235-.169.216-.148.476-.235.756-.235zm-10.775 7.99c.31-.18.76-.079.937.245.59 1.09 1.434 1.917 2.553 2.477 1.059.53 2.356.717 3.56.499.365-.066.737.094.842.476.092.333-.114.773-.478.84-1.556.281-3.124.088-4.549-.604-1.317-.64-2.417-1.717-3.111-3-.176-.325-.083-.74.246-.932zm7.126.44c.35-.12.749.14.842.477.102.372-.129.718-.478.839-.617.213-1.29.293-1.939.216-.369-.043-.684-.277-.684-.681 0-.338.317-.726.684-.682.545.064 1.057.01 1.575-.169zm-1.171-7.278c.371-.012.685.321.685.682 0 .377-.315.67-.685.681-.343.013-.64.064-1.004.193-.135.048-.171.062-.345.156-.162.085-.318.182-.465.292l.028-.02c.005-.004-.002 0-.028.02l.027-.019-.036.03-.05.04-.015.012c-.068.06-.135.12-.2.184-.063.064-.125.13-.185.198l-.07.083-.01.012.008-.012-.01.013c-.002.004-.002.004 0 .002l-.087.12c-.067.1-.13.203-.188.308l-.093.18-.039.087c.002-.003-.006.019-.024.064-.215.648-.281 1.185-.123 1.829.176.714.56 1.274 1.158 1.748.29.232.239.727 0 .965-.282.281-.68.23-.969 0-.663-.526-1.148-1.246-1.42-2.044-.44-1.291-.223-2.81.58-3.917.84-1.157 2.126-1.84 3.56-1.887zM22.763 1c1.79-1.07 4.032-1.294 6.002-.61.35.121.582.463.478.839-.093.337-.493.597-.843.476-1.033-.359-2.145-.448-3.186-.22-.787.173-1.35.411-2.022.859-.305.203-.492.354-.79.646-.147.142-.286.293-.418.448-.028.033-.157.195-.105.127l-.01.01-.071.1-.079.11c-.207.298-.39.614-.543.943l-.045.098-.01.018-.012.034-.026.064c-.033.085-.064.17-.094.256-.06.175-.112.35-.156.528-.175.698-.21 1.406-.106 2.208.047.368-.351.682-.685.682-.404 0-.638-.317-.685-.682-.126-.978-.037-1.992.257-2.934.52-1.661 1.65-3.104 3.149-4z"/></svg>`,!1);const o=document.querySelector("#ol-widget-login-button"),n=()=>{e.flow.login()};if(!o)throw new Error("Login button not exists");return o.addEventListener("click",n),()=>{o.removeEventListener("click",n)}})(e,t))};try{n()}catch(e){r()}return document.addEventListener("ol-login",n),document.addEventListener("ol-not-logged",r),()=>{document.removeEventListener("ol-login",n),document.removeEventListener("ol-not-logged",r),o.forEach(e=>e()),o.length=0}},ie=()=>{document.dispatchEvent(new CustomEvent("ol-close-dropdown"))},ae=e=>({renderDropdown:t=>se(e,t),renderButton:(t,o)=>((e,t,o)=>{const n=()=>{e.flow.login(o)};return t.innerHTML=$`<button type="button" class="${S}"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" viewBox="0 0 18 20" class="${B}"><g fill="#FFF" fill-rule="evenodd"><path d="M15.891 2.026c-.375 0-.723.117-1.012.315-.111.064-.217.137-.315.227l-5.21 5.376c-.724.66-.773 1.789-.11 2.508.664.72 1.797.77 2.52.11l2.331-2.31v9c0 .982.808 1.787 1.796 1.787.99 0 1.798-.805 1.798-1.787V3.815c0-.983-.808-1.789-1.798-1.789"/><path d="M7.09 12.784c-.8-.635-1.316-1.385-1.551-2.341-.212-.862-.124-1.58.164-2.448.04-.102.045-.114.01-.035l.075-.166c.04-.082.081-.162.125-.242.116-.211.247-.417.393-.609-.09.118.073-.082.085-.095.08-.092.163-.18.249-.265.086-.086.175-.167.267-.247.022-.019.221-.175.099-.084.196-.147.406-.277.622-.392.234-.124.282-.144.463-.208.488-.173.885-.242 1.344-.258.496-.015.917-.407.917-.911 0-.484-.42-.93-.917-.913-1.92.061-3.644.977-4.767 2.525-1.076 1.482-1.366 3.515-.778 5.243.364 1.07 1.014 2.033 1.902 2.737.388.308.92.376 1.298 0 .32-.318.39-.981 0-1.291M11.003 13.313c-.693.24-1.38.31-2.108.225-.493-.058-.918.46-.918.913 0 .541.423.854.918.913.87.102 1.77-.005 2.596-.29.468-.162.777-.625.64-1.123-.124-.452-.657-.8-1.128-.638"/><path d="M1.91 10.621c-.14-1.073-.093-2.02.14-2.955.06-.238.13-.473.21-.707.04-.115.082-.23.127-.343.022-.058.044-.115.068-.17-.062.145.055-.116.056-.117.205-.44.45-.863.727-1.262.069-.099.14-.198.214-.295-.07.092.103-.125.141-.17.177-.207.363-.409.56-.599.399-.391.65-.594 1.058-.865.9-.6 1.654-.918 2.708-1.149 1.394-.306 2.884-.187 4.267.294.469.162 1.005-.186 1.129-.638.14-.503-.171-.96-.64-1.123-2.639-.916-5.641-.615-8.04.817C2.63 2.539 1.116 4.47.42 6.693c-.395 1.261-.513 2.62-.344 3.928.063.49.376.913.917.913.447 0 .98-.42.917-.913M10.902 17.035c-1.612.292-3.35.042-4.768-.668-1.499-.75-2.63-1.857-3.42-3.316-.236-.434-.838-.57-1.255-.327-.441.257-.565.813-.33 1.25.93 1.715 2.404 3.156 4.168 4.014 1.908.927 4.009 1.185 6.092.808.488-.089.764-.678.641-1.123-.14-.511-.639-.727-1.128-.638"/></g></svg> <span>Zaloguj z 1login od WP</span></button>`,t.addEventListener("click",n),()=>{t.removeEventListener("click",n)}})(e,t,o),closeDropdown:ie});let de=!1;const ce=l.setLevel;e.createWidget=e=>{if(de)throw new Error("Creating multiple widgets not allowed");de=!0,l.debug("widget created");const t=(e=>{const t=e.stateStorage||"LOCAL_STORAGE";return l.debug(`storage ${t} initialized`),k[t]})(e),o=L(e,t),n=ae({flow:o});return{...o,...n}},e.setLogLevel=ce,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=olwidget.es6.js.map
