/*! For license information please see sdk.js.LICENSE.txt */ var t,e,n={382:(t,e,n)=>{var r=n(6964);t.exports=function(t,e){return new Promise((function(n,o){var i,a=e||{};function c(t){o(t||new Error("Aborted"))}function u(t,e){t.bail?c(t):i.retry(t)?a.onRetry&&a.onRetry(t,e):o(i.mainError())}"randomize"in a||(a.randomize=!0),(i=r.operation(a)).attempt((function(e){var r;try{r=t(c,e)}catch(t){return void u(t,e)}Promise.resolve(r).then(n).catch((function(t){u(t,e)}))}))}))}},6964:(t,e,n)=>{t.exports=n(8074)},8074:(t,e,n)=>{var r=n(5804);e.operation=function(t){var n=e.timeouts(t);return new r(n,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},e.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in t)e[n]=t[n];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o{function e(t,e){"boolean"==typeof e&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=(new Date).getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(void 0===n){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout((function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout((function(){r._operationTimeoutCb(r._attempts)}),r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)}),n),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){n._operationTimeoutCb()}),n._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(0===this._errors.length)return null;for(var t={},e=null,n=0,r=0;r=n&&(e=o,n=a)}return e}},6178:t=>{var e=window.console||{};function n(t,n){for(t=t.split(",");t.length;){var r=t.pop();e[r]||(e[r]=n)}}n("memory",{}),n("assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn",(function(){})),t.exports=e},562:function(t,e,n){var r;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=n.nmd(t),function(i,a){var c="function",u="undefined",s="object",l="string",f="major",p="model",h="name",d="type",g="vendor",y="version",b="architecture",v="console",m="mobile",I="tablet",x="smarttv",w="wearable",C="embedded",A="Amazon",G="Apple",E="ASUS",O="BlackBerry",k="Browser",L="Chrome",B="Firefox",N="Google",S="Huawei",Z="LG",_="Microsoft",Q="Motorola",j="Opera",R="Samsung",X="Sharp",W="Sony",F="Xiaomi",U="Zebra",D="Facebook",T="Chromium OS",Y="Mac OS",P=function(t){for(var e={},n=0;n0?2===u.length?o(u[1])==c?this[u[0]]=u[1].call(this,f):this[u[0]]=u[1]:3===u.length?o(u[1])!==c||u[1].exec&&u[1].test?this[u[0]]=f?f.replace(u[1],u[2]):a:this[u[0]]=f?u[1].call(this,f,u[2]):a:4===u.length&&(this[u[0]]=f?u[3].call(this,f.replace(u[1],u[2])):a):this[u]=f||a;p+=2}},z=function(t,e){for(var n in e)if(o(e[n])===s&&e[n].length>0){for(var r=0;r2&&(t[p]="iPad",t[d]=I),t},this.getEngine=function(){var t={};return t[h]=a,t[y]=a,J.call(t,v,w.engine),t},this.getOS=function(){var t={};return t[h]=a,t[y]=a,J.call(t,v,w.os),C&&!t[h]&&x&&x.platform&&"Unknown"!=x.platform&&(t[h]=x.platform.replace(/chrome os/i,T).replace(/macos/i,Y)),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(t){return v=o(t)===l&&t.length>500?H(t,500):t,this},this.setUA(v),this};$.VERSION="1.0.38",$.BROWSER=P([h,y,f]),$.CPU=P([b]),$.DEVICE=P([p,g,d,v,m,x,I,w,C]),$.ENGINE=$.OS=P([h,y]),o(e)!==u?(o(t)!==u&&t.exports&&(e=t.exports=$),e.UAParser=$):o(n.amdD)===c&&n.amdO?(r=function(){return $}.call(e,n,e,t))===a||(t.exports=r):o(i)!==u&&(i.UAParser=$);var tt=o(i)!==u&&(i.jQuery||i.Zepto);if(tt&&!tt.ua){var et=new $;tt.ua=et.getResult(),tt.ua.get=function(){return et.getUA()},tt.ua.set=function(t){et.setUA(t);var e=et.getResult();for(var n in e)tt.ua[n]=e[n]}}}("object"===("undefined"==typeof window?"undefined":o(window))?window:this)},4531:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={content:{nodes:[{type:"TEXT",name:"TEXT_MAIN",value:"Enjoy Buyer Protection with Klarna"},{type:"ACTION",name:"ACTION_LEARN_MORE",label:"See payment options",url:""},{type:"ACTION",name:"ACTION_OPEN_BUYERS_PROTECTION_LINK",label:"Buyer Protection",url:"https://www.klarna.com/uk/buyer-protection-description/"}]},impression_url:""}},4868:(t,e,n)=>{var r={"./cs-CZ.ts":[8116,8116],"./da-DK.ts":[6331,6331],"./de-AT.ts":[4579,4579],"./de-CH.ts":[1845,1845],"./de-DE.ts":[7821,7821],"./el-GR.ts":[8261,8261],"./en-AT.ts":[2079,2079],"./en-AU.ts":[3056,3056],"./en-BE.ts":[6091,6091],"./en-CA.ts":[7562,7562],"./en-CH.ts":[6489,6489],"./en-CZ.ts":[5319,5319],"./en-DE.ts":[81,81],"./en-DK.ts":[5731,5731],"./en-ES.ts":[8170,8170],"./en-FI.ts":[4587,4587],"./en-FR.ts":[9774,9774],"./en-GB.ts":[4531],"./en-GR.ts":[7379,7379],"./en-HU.ts":[9437,9437],"./en-IE.ts":[9096,9096],"./en-IT.ts":[4679,4679],"./en-MX.ts":[3247,3247],"./en-NL.ts":[7992,7992],"./en-NO.ts":[8441,8441],"./en-NZ.ts":[7294,7294],"./en-PL.ts":[278,278],"./en-PT.ts":[3806,3806],"./en-RO.ts":[2469,2469],"./en-SE.ts":[7270,7270],"./en-SK.ts":[6664,6664],"./en-US.ts":[3818,3818],"./es-ES.ts":[1467,1467],"./es-MX.ts":[4422,4422],"./es-US.ts":[6059,6059],"./fi-FI.ts":[4881,4881],"./fr-BE.ts":[2930,2930],"./fr-CA.ts":[6611,6611],"./fr-CH.ts":[2476,2476],"./fr-FR.ts":[8543,8543],"./hu-HU.ts":[277,277],"./it-CH.ts":[3859,3859],"./it-IT.ts":[2101,2101],"./nb-NO.ts":[1428,1428],"./nl-BE.ts":[3636,3636],"./nl-NL.ts":[9207,9207],"./no-NO.ts":[829,829],"./pl-PL.ts":[2715,2715],"./pt-PT.ts":[2667,2667],"./ro-RO.ts":[6789,6789],"./sk-SK.ts":[6315,6315],"./sv-FI.ts":[7345,7345],"./sv-SE.ts":[7772,7772]};function o(t){if(!n.o(r,t))return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=r[t],o=e[0];return Promise.all(e.slice(1).map(n.e)).then((()=>n(o)))}o.keys=()=>Object.keys(r),o.id=4868,t.exports=o},1187:(t,e)=>{var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.Device=e.IFRAMEID=e.InteractionModes=void 0,function(t){t.DEVICE_BEST="DEVICE_BEST",t.ON_PAGE="ON_PAGE",t.IFRAME="IFRAME",t.REDIRECT="REDIRECT"}(n||(e.InteractionModes=n={})),e.IFRAMEID="klarna-flow-interaction-mode-iframe",function(t){t.MOBILE="MOBILE",t.DESKTOP="DESKTOP",t.WEBVIEW="WEBVIEW",t.UNKNOWN="UNKNOWN"}(r||(e.Device=r={}))},5890:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Popup=e.WindowBlockedError=e.detectDeviceBest=e.triggerOnPage=e.triggerIframe=e.triggerRedirect=e.InteractionModes=void 0,e.closeInteractionMode=function(){c.default.ACTIVE_OVERLAY&&c.default.ACTIVE_OVERLAY.destroy();var t=l.Popup.getInstance();t.getOpenedWindow()&&t.closeOpenedWindow()},e.getPopup=function(){return l.Popup.getInstance().getOpenedWindow()};var o=n(1187);Object.defineProperty(e,"InteractionModes",{enumerable:!0,get:function(){return o.InteractionModes}});var i=n(375);Object.defineProperty(e,"triggerOnPage",{enumerable:!0,get:function(){return i.triggerOnPage}});var a=n(1745);Object.defineProperty(e,"triggerIframe",{enumerable:!0,get:function(){return a.triggerIframe}});var c=r(n(7819)),u=n(857);Object.defineProperty(e,"triggerRedirect",{enumerable:!0,get:function(){return u.triggerRedirect}});var s=n(4961);Object.defineProperty(e,"detectDeviceBest",{enumerable:!0,get:function(){return s.detectDeviceBest}});var l=n(8531);Object.defineProperty(e,"Popup",{enumerable:!0,get:function(){return l.Popup}}),Object.defineProperty(e,"WindowBlockedError",{enumerable:!0,get:function(){return l.WindowBlockedError}})},8414:(t,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){var e="function"==typeof Map?new Map:void 0;return r=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var a=new(t.bind.apply(t,r));return n&&i(a,n.prototype),a}(t,arguments,a(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,t)},r(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(o=function(){return!!t})()}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.WindowBlockedError=void 0;var c=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=a(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],a(t).constructor):e.apply(t,r))}(this,e,[t]),Object.setPrototypeOf(r,e.prototype),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(Error));e.WindowBlockedError=c},8531:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WindowBlockedError=e.Popup=void 0;var r=n(8414);Object.defineProperty(e,"WindowBlockedError",{enumerable:!0,get:function(){return r.WindowBlockedError}});var o=n(5597);Object.defineProperty(e,"Popup",{enumerable:!0,get:function(){return o.Popup}})},5597:function(t,e,n){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function o(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:window;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.keepOverlayOpen=!1,this.openOverlay=function(t,n){var r=n.overlayContent,o=n.previousActiveElement,i=n.onOverlayClose;new u.default({windowOpener:e.windowOpener,overlayContent:r,onOverlayClick:t,onOverlayClose:i,previousActiveElement:o}).create()},this.openWindow=function(t,n){var r=n.id,o=void 0===r?"Klarna":r,i=n.hideOverlay,a=void 0!==i&&i,l=n.keepOverlayOpen,f=void 0!==l&&l,g=n.overlayContent,y=n.previousActiveElement,b=n.onOverlayClose,v=void 0===b?function(){}:b,m=n.onOverlayClick,I=n.onPopupClose,x=void 0===I?function(){}:I,w=n.styles,C=void 0===w?{}:w,A=C.width,G=void 0===A?h:A,E=C.height,O=void 0===E?p:E;e.keepOverlayOpen=f;var k,L=function(){var n,r;if(e.keepOverlayOpen&&(!e.openedWindow||null!==(n=e.openedWindow)&&void 0!==n&&n.closed)){var i,a,s=(null===(i=u.default.ACTIVE_OVERLAY)||void 0===i?void 0:i.getLastPopupUrl())||t,l=d(G,O),f=l.top,p=l.left,h=window.open(s,o,"resizable=yes, width=".concat(G,", height=").concat(O,", top=").concat(f,", left=").concat(p));if(!h)throw console.error("Popup blocked"),new c.WindowBlockedError("Popup blocked");e.openedWindow=h,null===(a=u.default.ACTIVE_OVERLAY)||void 0===a||a.connectPopup(e.openedWindow),"about:blank"===s&&e.injectKlarnaHeartbeat()}null===(r=e.openedWindow)||void 0===r||r.focus()};if(u.default.ACTIVE_OVERLAY&&a&&u.default.ACTIVE_OVERLAY.hide(),e.openedWindow&&!e.openedWindow.closed)e.updateWindowURL(t),e.openedWindow.focus();else{var B=d(G,O),N=B.top,S=B.left,Z=window.open(t,o,"resizable=yes, width=".concat(G,", height=").concat(O,", top=").concat(N,", left=").concat(S));if(!Z)throw new c.WindowBlockedError("Popup blocked");e.openedWindow=Z,"about:blank"===t&&e.injectKlarnaHeartbeat(),e.addUnloadListener()}a||(u.default.ACTIVE_OVERLAY?u.default.ACTIVE_OVERLAY.update({windowOpener:e.windowOpener,overlayContent:g,popupUrl:t,onOverlayClick:m||L,onOverlayClose:v,previousActiveElement:y}):new u.default({windowOpener:e.windowOpener,overlayContent:g,popupUrl:t,onOverlayClick:m||L,onOverlayClose:v,previousActiveElement:y}).create(),null===(k=u.default.ACTIVE_OVERLAY)||void 0===k||k.connectPopup(e.openedWindow));new s.WindowPoll(e.openedWindow,(function(){var t;x(),e.keepOverlayOpen||null===(t=u.default.ACTIVE_OVERLAY)||void 0===t||t.destroy(),e.removeUnloadListener()})).start()},this.closeOpenedWindow=function(){var t,n,r;null!==(t=e.openedWindow)&&void 0!==t&&t.closed||(null===(n=e.openedWindow)||void 0===n||n.close(),e.keepOverlayOpen||(e.removeUnloadListener(),null===(r=u.default.ACTIVE_OVERLAY)||void 0===r||r.destroy()))},this.getOpenedWindow=function(){return e.openedWindow||null},this.updateWindowURL=function(t){if(!e.openedWindow||e.openedWindow.closed)throw new Error("Popup is closed");var n;null===(n=u.default.ACTIVE_OVERLAY)||void 0===n||n.updateLastPopupUrl(t),e.openedWindow.location.href=t,"about:blank"!==t&&""!==t||e.injectKlarnaHeartbeat()},this.windowOpener=n}return e=t,r=[{key:"getInstance",value:function(e){return t.instance||(t.instance=new t(e)),t.instance}}],(n=[{key:"addUnloadListener",value:function(){this.windowOpener.addEventListener("unload",this.closeOpenedWindow)}},{key:"removeUnloadListener",value:function(){this.windowOpener.removeEventListener("unload",this.closeOpenedWindow)}},{key:"injectKlarnaHeartbeat",value:function(){var t;null===(t=this.openedWindow)||void 0===t||t.document.write('\n \n
\n \n
\n ')}}])&&o(e.prototype,n),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();e.Popup=g},4324:(t,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);n{Object.defineProperty(e,"__esModule",{value:!0}),e.triggerOnPage=function(t,e){try{var n=r.Popup.getInstance(e.fullscreenWindow);return n.openWindow(t,e),{getOpenedWindow:n.getOpenedWindow,updateUrl:n.updateWindowURL}}catch(t){throw t}};var r=n(8531)},857:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.triggerRedirect=function(t){try{window.location.href=t}catch(t){throw t}}},4343:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.detectDevice=function(){var t=navigator.userAgent;return/((wv|sdk) \([^\)]+\))|WebView/i.test(t)||(0,o.isWebView)()?r.Device.WEBVIEW:(0,o.isMobile)()?r.Device.MOBILE:(0,o.isDesktopOs)()?r.Device.DESKTOP:r.Device.UNKNOWN};var r=n(1187),o=n(5623)},4961:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.detectDeviceBest=function(){switch((0,o.detectDevice)()){case r.Device.MOBILE:case r.Device.DESKTOP:return r.InteractionModes.ON_PAGE;case r.Device.WEBVIEW:default:return r.InteractionModes.REDIRECT}};var r=n(1187),o=n(4343)},2569:(t,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return o(o(o({display:"block",background:"".concat(null!==(t=e.background)&&void 0!==t?t:"white")},e.width&&{width:"".concat(e.width,"px")}),e.height&&{height:"".concat(e.height,"px")}),(e.borderRadius||0===e.borderRadius)&&{borderRadius:"".concat(e.borderRadius,"px")})}},7819:function(t,e,n){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function o(t,e){for(var n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.default="\n@keyframes overlay-open-animation {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n \n @keyframes overlay-close-animation {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n \n .overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 2147483647;\n background-image: radial-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.8));\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .overlay-open {\n @extend .overlay;\n animation: overlay-open-animation 0.3s linear;\n opacity: 1;\n }\n \n .overlay-close {\n @extend .overlay;\n animation: overlay-close-animation 0.3s linear;\n opacity: 0;\n }\n \n .close-button {\n position: absolute;\n top: 10px;\n right: 10px;\n width: 48px;\n height: 48px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .content {\n width: 100%;\n max-width: 350px;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n \n .klarna-button {\n background-color: white;\n border: none;\n cursor: pointer;\n outline: 0;\n -webkit-tap-highlight-color: transparent;\n border-radius: 20px;\n height: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 9px 14px 9px 16px;\n color: rgb(23, 23, 23);\n font-family: 'Klarna Text', 'Klarna Sans', Helvetica, Arial, sans-serif;\n font-weight: 500;\n font-size: 14px;\n text-rendering: geometricPrecision;\n -webkit-font-smoothing: antialiased;\n line-height: 20px;\n }\n \n .klarna-logo {\n width: 120px;\n max-width: 100%;\n height: auto;\n }\n \n .text-content {\n color: white;\n font-family: 'Klarna Text', 'Klarna Sans', Helvetica, Arial, sans-serif;\n font-size: 14px;\n text-rendering: geometricPrecision;\n -webkit-font-smoothing: antialiased;\n line-height: 20px;\n text-align: center;\n margin: 20px 0;\n }\n \n"},3925:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(6853));e.default=function(t,e,n){return n?"\n\n
\n ').concat(n.outerHTML,"\n
\n"):"\n\n
\n
\n \n ').concat(t?'

'.concat(t,"

"):"","\n ").concat(e?'"):"",'\n
\n
\n \n \n \n
\n
\n')}},5623:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isAndroidWebView=e.isIosWebView=e.isWebView=e.isFirefox=e.isSamsungBrowser=e.isChrome=e.isMobileSafari=e.isDesktopOs=e.isAndroid=e.isIos=e.isMobile=e.UBUNTU=e.LINUX=e.CHROMIUM_OS=e.WINDOWS=e.MAC_OS=e.DUCKDUCKGO=e.BRAVE=e.SAMSUNG_BROWSER=e.SAFARI=e.MOBILE_SAFARI=e.CHROME=e.EDGE=e.FIREFOX=e.IOS_WEBVIEW=e.ANDROID_WEBVIEW=e.ANDROID=e.IOS=void 0,e.parseUserAgent=i;var r=n(562);e.IOS="ios",e.ANDROID="android",e.ANDROID_WEBVIEW="chrome webview",e.IOS_WEBVIEW="webkit",e.FIREFOX="firefox",e.EDGE="edge",e.CHROME="chrome",e.MOBILE_SAFARI="mobile safari",e.SAFARI="safari",e.SAMSUNG_BROWSER="samsung browser",e.BRAVE="brave",e.DUCKDUCKGO="duckduckgo",e.MAC_OS="mac os",e.WINDOWS="windows",e.CHROMIUM_OS="chromium os",e.LINUX="linux",e.UBUNTU="ubuntu";var o=new Set(["tiktok","instagram","linkedin","facebook","gsa"]);function i(){try{var t,e,n=window.navigator.userAgent,o=new r.UAParser(n);return{browser:{name:null===(t=o.getBrowser().name)||void 0===t?void 0:t.toLowerCase()},os:{name:null===(e=o.getOS().name)||void 0===e?void 0:e.toLowerCase()}}}catch(t){return}}e.isMobile=function(){var t=window.navigator.userAgent;return"mobile"===new r.UAParser(t).getResult().device.type},e.isIos=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i();return(null==t?void 0:t.os.name)===e.IOS},e.isAndroid=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i();return(null==t?void 0:t.os.name)===e.ANDROID},e.isDesktopOs=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i(),n=null==t?void 0:t.os.name;return"string"==typeof n&&new RegExp("".concat(e.CHROMIUM_OS,"|").concat(e.LINUX,"|").concat(e.MAC_OS,"|").concat(e.UBUNTU,"|").concat(e.WINDOWS),"iu").test(n)},e.isMobileSafari=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i();return(null==t?void 0:t.browser.name)===e.MOBILE_SAFARI},e.isChrome=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i();return(null==t?void 0:t.browser.name)===e.CHROME},e.isSamsungBrowser=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i();return(null==t?void 0:t.browser.name)===e.SAMSUNG_BROWSER},e.isFirefox=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i();return(null==t?void 0:t.browser.name)===e.FIREFOX},e.isWebView=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i(),r=null==n?void 0:n.browser.name;return!("string"!=typeof r||!o.has(r)&&(!(0,e.isIos)()||![e.SAFARI,e.MOBILE_SAFARI].includes(r)||void 0===(null===(t=window.webkit)||void 0===t?void 0:t.messageHandlers))&&[e.SAFARI,e.MOBILE_SAFARI,e.CHROME,e.FIREFOX,e.EDGE,e.SAMSUNG_BROWSER,e.BRAVE,e.DUCKDUCKGO].includes(r))},e.isIosWebView=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i();return(0,e.isIos)(t)&&(0,e.isWebView)(t)},e.isAndroidWebView=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i();return(0,e.isAndroid)(t)&&(0,e.isWebView)(t)}},69:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.useStyles=void 0;var o=r(n(6678)).default.viewport,i=o.midResolutionHeight,a=o.lowResolutionWidth,c=o.preferredAppWidth,u=o.framedModeMinMargin,s=o.maxAppHeight,l=function(t){var e=window.matchMedia(t),n=e.matches,r=function(t){n=t.matches},o=function(t){return t.addEventListener("change",r),function(){t.removeEventListener("change",r)}}(e);return window.addEventListener("resize",o),n};e.useStyles=function(){var t=l("(max-width: ".concat(a,"px)")),e=l("(min-height: ".concat(i,"px)")),n=t?"100%":"".concat(c,"px"),r=t?"100%":e?"70%":"calc(100% - ".concat(u,"px)"),o=l("(orientation: portrait)"),f=t&&o?void 0:s;return{width:n,height:r,maxHeight:f?"".concat(f,"px"):void 0,borderRadius:t?"0px":"16px",transition:"height 0.5s ease"}}},6678:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={viewport:{preferredAppWidth:480,minHalfPanelHeight:590,lowResolutionWidth:560,midResolutionHeight:800,highResolutionHeight:1200,framedModeMinMargin:40,maxAppHeight:960}}},8752:(t,e,n)=>{function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return c=t.done,t},e:function(t){u=!0,a=t},f:function(){try{c||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nM,AH:()=>y,W3:()=>T,Ec:()=>Y});var u,s,l,f=globalThis,p=f.ShadowRoot&&(void 0===f.ShadyCSS||f.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,h=Symbol(),d=new WeakMap,g=function(){return function(t,e,n){return e&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,n,r){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._$cssResult$=!0,r!==h)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}),[{key:"styleSheet",get:function(){var t=this.o,e=this.t;if(p&&void 0===t){var n=void 0!==e&&1===e.length;n&&(t=d.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&d.set(e,t))}return t}},{key:"toString",value:function(){return this.cssText}}])}(),y=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),B(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;B(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:S(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function C(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function A(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=G(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function G(t,e){if(t){if("string"==typeof t)return E(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&(this._$Ep=e)}},{key:"createRenderRoot",value:function(){var t,e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return b(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function(){var t,e;null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$EO)||void 0===e||e.forEach((function(t){var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}},{key:"enableUpdating",value:function(){}},{key:"disconnectedCallback",value:function(){var t;null===(t=this._$EO)||void 0===t||t.forEach((function(t){var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}},{key:"attributeChangedCallback",value:function(t,e,n){this._$AK(t,n)}},{key:"_$EC",value:function(t,e){var n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(void 0!==r&&!0===n.reflect){var o,i=(void 0!==(null===(o=n.converter)||void 0===o?void 0:o.toAttribute)?n.converter:T).toAttribute(e,n.type);this._$Em=t,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}},{key:"_$AK",value:function(t,e){var n=this.constructor,r=n._$Eh.get(t);if(void 0!==r&&this._$Em!==r){var o,i=n.getPropertyOptions(r),a="function"==typeof i.converter?{fromAttribute:i.converter}:void 0!==(null===(o=i.converter)||void 0===o?void 0:o.fromAttribute)?i.converter:T;this._$Em=r,this[r]=a.fromAttribute(e,i.type),this._$Em=null}}},{key:"requestUpdate",value:function(t,e,n){if(void 0!==t){var r,o;if(null!==(r=n)&&void 0!==r||(n=this.constructor.getPropertyOptions(t)),!(null!==(o=n.hasChanged)&&void 0!==o?o:Y)(this[t],e))return;this.P(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}},{key:"P",value:function(t,e,n){var r;this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$Em!==t&&(null!==(r=this._$Ej)&&void 0!==r?r:this._$Ej=new Set).add(t)}},{key:"_$ET",value:(n=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){C(i,r,o,a,c,"next",t)}function c(t){C(i,r,o,a,c,"throw",t)}a(void 0)}))}}(w().mark((function t(){var e;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.isUpdatePending=!0,t.prev=1,t.next=4,this._$ES;case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),Promise.reject(t.t0);case 9:if(e=this.scheduleUpdate(),t.t1=null!=e,!t.t1){t.next=14;break}return t.next=14,e;case 14:return t.abrupt("return",!this.isUpdatePending);case 15:case"end":return t.stop()}}),t,this,[[1,6]])}))),function(){return n.apply(this,arguments)})},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var t;if(null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this._$Ep){var e,n=A(this._$Ep);try{for(n.s();!(e=n.n()).done;){var r=x(e.value,2),o=r[0],i=r[1];this[o]=i}}catch(t){n.e(t)}finally{n.f()}this._$Ep=void 0}var a=this.constructor.elementProperties;if(a.size>0){var c,u=A(a);try{for(u.s();!(c=u.n()).done;){var s=x(c.value,2),l=s[0],f=s[1];!0!==f.wrapped||this._$AL.has(l)||void 0===this[l]||this.P(l,this[l],f)}}catch(t){u.e(t)}finally{u.f()}}}var p=!1,h=this._$AL;try{var d;(p=this.shouldUpdate(h))?(this.willUpdate(h),null!==(d=this._$EO)&&void 0!==d&&d.forEach((function(t){var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(h)):this._$EU()}catch(h){throw p=!1,this._$EU(),h}p&&this._$AE(h)}}},{key:"willUpdate",value:function(t){}},{key:"_$AE",value:function(t){var e;null!==(e=this._$EO)&&void 0!==e&&e.forEach((function(t){var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}},{key:"_$EU",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(t){return!0}},{key:"update",value:function(t){var e=this;this._$Ej&&(this._$Ej=this._$Ej.forEach((function(t){return e._$EC(t,e[t])}))),this._$EU()}},{key:"updated",value:function(t){}},{key:"firstUpdated",value:function(t){}}],[{key:"addInitializer",value:function(t){var e;this._$Ei(),(null!==(e=this.l)&&void 0!==e?e:this.l=[]).push(t)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&I(this._$Eh.keys())}},{key:"createProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P;if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),r=this.getPropertyDescriptor(t,n,e);void 0!==r&&_(this.prototype,t,r)}}},{key:"getPropertyDescriptor",value:function(t,e,n){var r,o=null!==(r=Q(this.prototype,t))&&void 0!==r?r:{get:function(){return this[e]},set:function(t){this[e]=t}},i=o.get,a=o.set;return{get:function(){return null==i?void 0:i.call(this)},set:function(e){var r=null==i?void 0:i.call(this);a.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(t){var e;return null!==(e=this.elementProperties.get(t))&&void 0!==e?e:P}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty("elementProperties")){var t=X(this);t.finalize(),void 0!==t.l&&(this.l=I(t.l)),this.elementProperties=new Map(t.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty("finalized")){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){var t,e=this.properties,n=A([].concat(I(j(e)),I(R(e))));try{for(n.s();!(t=n.n()).done;){var r=t.value;this.createProperty(r,e[r])}}catch(t){n.e(t)}finally{n.f()}}var o=this[Symbol.metadata];if(null!==o){var i=litPropertyMetadata.get(o);if(void 0!==i){var a,c=A(i);try{for(c.s();!(a=c.n()).done;){var u=x(a.value,2),s=u[0],l=u[1];this.elementProperties.set(s,l)}}catch(t){c.e(t)}finally{c.f()}}}this._$Eh=new Map;var f,p=A(this.elementProperties);try{for(p.s();!(f=p.n()).done;){var h=x(f.value,2),d=h[0],g=h[1],y=this._$Eu(d,g);void 0!==y&&this._$Eh.set(y,d)}}catch(t){p.e(t)}finally{p.f()}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(t){var e=[];if(Array.isArray(t)){var n,r=A(new Set(t.flat(1/0).reverse()));try{for(r.s();!(n=r.n()).done;){var o=n.value;e.unshift(v(o))}}catch(t){r.e(t)}finally{r.f()}}else void 0!==t&&e.push(v(t));return e}},{key:"_$Eu",value:function(t,e){var n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}}]);var n}(L(HTMLElement));M.elementStyles=[],M.shadowRootOptions={mode:"open"},M.elementProperties=new Map,M.finalized=new Map,null!=D&&D({ReactiveElement:M}),(null!==(l=W.reactiveElementVersions)&&void 0!==l?l:W.reactiveElementVersions=[]).push("2.0.4")},3450:(t,e,n)=>{var r;function o(t,e,n){return e=a(e),function(t,e){if(e&&("object"==y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,i()?Reflect.construct(e,n||[],a(t).constructor):e.apply(t,n))}function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(i=function(){return!!t})()}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}function s(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=l(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function l(t,e){if(t){if("string"==typeof t)return f(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nX,XX:()=>et,c0:()=>W,qy:()=>R,s6:()=>F});var b=globalThis,v=b.trustedTypes,m=v?v.createPolicy("lit-html",{createHTML:function(t){return t}}):void 0,I="$lit$",x="lit$".concat(Math.random().toFixed(9).slice(2),"$"),w="?"+x,C="<".concat(w,">"),A=document,G=function(){return A.createComment("")},E=function(t){return null===t||"object"!=y(t)&&"function"!=typeof t},O=Array.isArray,k="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,N=/>/g,S=RegExp(">|".concat(k,"(?:([^\\s\"'>=/]+)(").concat(k,"*=").concat(k,"*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),Z=/'/g,_=/"/g,Q=/^(?:script|style|textarea|title)$/i,j=function(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o":"",a=L,c=0;c"===l[0]?(a=null!==(h=n)&&void 0!==h?h:L,f=-1):void 0===l[1]?f=-2:(f=a.lastIndex-l[2].length,s=l[1],a=void 0===l[3]?S:'"'===l[3]?_:Z):a===_||a===Z?a=S:a===B||a===N?a=L:(a=S,n=void 0)}var d=a===S&&t[c+1].startsWith("/>")?" ":"";i+=a===L?u+C:f>=0?(o.push(s),u.slice(0,f)+I+u.slice(f)+x+d):u+x+(-2===f?c:d)}return[T(t,i+(t[r]||"")+(2===e?"":"")),o]},P=function(){return d((function t(e,n){var r,o=e.strings,i=e._$litType$;p(this,t),this.parts=[];var a=0,c=0,u=o.length-1,h=this.parts,d=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Y(o,i),2),g=d[0],y=d[1];if(this.el=t.createElement(g,n),D.currentNode=this.el.content,2===i){var b=this.el.content.firstChild;b.replaceWith.apply(b,function(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(b.childNodes))}for(;null!==(r=D.nextNode())&&h.length0){r.textContent=v?v.emptyScript:"";for(var N=0;N2&&void 0!==arguments[2]?arguments[2]:t,u=arguments.length>3?arguments[3]:void 0;if(e===W)return e;var s=void 0!==u?null===(n=c._$Co)||void 0===n?void 0:n[u]:c._$Cl,l=E(e)?void 0:e._$litDirective$;return(null===(r=s)||void 0===r?void 0:r.constructor)!==l&&(null!==(o=s)&&void 0!==o&&null!==(i=o._$AO)&&void 0!==i&&i.call(o,!1),void 0===l?s=void 0:(s=new l(t))._$AT(t,c,u),void 0!==u?(null!==(a=c._$Co)&&void 0!==a?a:c._$Co=[])[u]=s:c._$Cl=s),void 0!==s&&(e=M(t,s._$AS(t,e.values),s,u)),e}var V=function(){return d((function t(e,n){p(this,t),this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}),[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"u",value:function(t){var e,n=this._$AD,r=n.el.content,o=n.parts,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:A).importNode(r,!0);D.currentNode=i;for(var a=D.nextNode(),c=0,u=0,s=o[0];void 0!==s;){var l;if(c===s.index){var f=void 0;2===s.type?f=new H(a,a.nextSibling,this,t):1===s.type?f=new s.ctor(a,s.name,s.strings,this,t):6===s.type&&(f=new $(a,this,t)),this._$AV.push(f),s=o[++u]}c!==(null===(l=s)||void 0===l?void 0:l.index)&&(a=D.nextNode(),c++)}return D.currentNode=A,i}},{key:"p",value:function(t){var e,n=0,r=s(this._$AV);try{for(r.s();!(e=r.n()).done;){var o=e.value;void 0!==o&&(void 0!==o.strings?(o._$AI(t,o,n),n+=o.strings.length-2):o._$AI(t[n])),n++}}catch(t){r.e(t)}finally{r.f()}}}])}(),H=function(){function t(e,n,r,o){var i;p(this,t),this.type=2,this._$AH=F,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=o,this._$Cv=null===(i=null==o?void 0:o.isConnected)||void 0===i||i}return d(t,[{key:"_$AU",get:function(){var t,e;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cv}},{key:"parentNode",get:function(){var t,e=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===(null===(t=e)||void 0===t?void 0:t.nodeType)&&(e=n.parentNode),e}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(t){t=M(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),E(t)?t===F||null==t||""===t?(this._$AH!==F&&this._$AR(),this._$AH=F):t!==this._$AH&&t!==W&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):function(t){return O(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator])}(t)?this.k(t):this._(t)}},{key:"S",value:function(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}},{key:"T",value:function(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}},{key:"_",value:function(t){this._$AH!==F&&E(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}},{key:"$",value:function(t){var e,n=t.values,r=t._$litType$,o="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=P.createElement(T(r.h,r.h[0]),this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.p(n);else{var i=new V(o,this),a=i.u(this.options);i.p(n),this.T(a),this._$AH=i}}},{key:"_$AC",value:function(t){var e=U.get(t.strings);return void 0===e&&U.set(t.strings,e=new P(t)),e}},{key:"k",value:function(e){O(this._$AH)||(this._$AH=[],this._$AR());var n,r,o=this._$AH,i=0,a=s(e);try{for(a.s();!(r=a.n()).done;){var c=r.value;i===o.length?o.push(n=new t(this.S(G()),this.S(G()),this,this.options)):n=o[i],n._$AI(c),i++}}catch(t){a.e(t)}finally{a.f()}i0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,e);t&&t!==this._$AB;){var n,r=t.nextSibling;t.remove(),t=r}}},{key:"setConnected",value:function(t){var e;void 0===this._$AM&&(this._$Cv=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}])}(),J=function(){return d((function t(e,n,r,o,i){p(this,t),this.type=1,this._$AH=F,this._$AN=void 0,this.element=e,this.name=n,this._$AM=o,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=F}),[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=this.strings,i=!1;if(void 0===o)t=M(this,t,e,0),(i=!E(t)||t!==this._$AH&&t!==W)&&(this._$AH=t);else{var a,c,u=t;for(t=o[0],a=0;a1&&void 0!==arguments[1]?arguments[1]:this,0))&&void 0!==e?e:F)!==W){var n=this._$AH,r=t===F&&n!==F||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==F&&(n===F||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}}},{key:"handleEvent",value:function(t){var e,n;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(n=this.options)||void 0===n?void 0:n.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}])}(J),$=function(){return d((function t(e,n,r){p(this,t),this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}),[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){M(this,t)}}])}(),tt=b.litHtmlPolyfillSupport;null!=tt&&tt(P,H),(null!==(r=b.litHtmlVersions)&&void 0!==r?r:b.litHtmlVersions=[]).push("3.1.4");var et=function(t,e,n){var r,o=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:e,i=o._$litPart$;if(void 0===i){var a,c=null!==(a=null==n?void 0:n.renderBefore)&&void 0!==a?a:null;o._$litPart$=i=new H(e.insertBefore(G(),c),c,void 0,null!=n?n:{})}return i._$AI(t),i}},5542:(t,e,n)=>{n.d(e,{EM:()=>r,MZ:()=>f,wk:()=>y});var r=function(t){return function(e,n){void 0!==n?n.addInitializer((function(){customElements.define(t,e)})):customElements.define(t,e)}},o=n(8752);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:s,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=n.kind,o=n.metadata,i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),i.set(n.name,t),"accessor"===r){var a=n.name;return{set:function(n){var r=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,r,t)},init:function(e){return void 0!==e&&this.P(a,void 0,t),e}}}if("setter"===r){var c=n.name;return function(n){var r=this[c];e.call(this,n),this.requestUpdate(c,r,t)}}throw Error("Unsupported decorator location: "+r)};function f(t){return function(e,n){return"object"==u(n)?l(t,e,n):function(t,e,n){var r=e.hasOwnProperty(n);return e.constructor.createProperty(n,r?a(a({},t),{},{wrapped:!0}):t),r?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;e{n.d(e,{WF:()=>y,AH:()=>i.AH,qy:()=>a.qy,JW:()=>a.JW});var r,o,i=n(8752),a=n(3450);function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){for(var n=0;n{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((e,n)=>(o.f[n](t,e),e)),[])),o.u=t=>"0.0.291/"+(4328===t?"klarna-test-drive-badge":t)+".js",o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="@klarna-web-sdk/lib:",o.l=(n,r,i,a)=>{if(t[n])t[n].push(r);else{var c,u;if(void 0!==i)for(var s=document.getElementsByTagName("script"),l=0;l{c.onerror=c.onload=null,clearTimeout(h);var o=t[n];if(delete t[n],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((t=>t(r))),e)return e(r)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=p.bind(null,c.onerror),c.onload=p.bind(null,c.onload),u&&document.head.appendChild(c)}},o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;if("string"==typeof import.meta.url&&(t=import.meta.url),!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t+"../"})(),(()=>{var t={1249:0};o.f.j=(e,n)=>{var r=o.o(t,e)?t[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,o)=>r=t[e]=[n,o]));n.push(r[2]=i);var a=o.p+o.u(e),c=new Error;o.l(a,(n=>{if(o.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;c.message="Loading chunk "+e+" failed.\n("+i+": "+a+")",c.name="ChunkLoadError",c.type=i,c.request=a,r[1](c)}}),"chunk-"+e,e)}};var e=(e,n)=>{var r,i,[a,c,u]=n,s=0;if(a.some((e=>0!==t[e]))){for(r in c)o.o(c,r)&&(o.m[r]=c[r]);u&&u(o)}for(e&&e(n);sAI});var a,c,u={};function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||L(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(){l=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new N(r||[]);return o(a,"_invoke",{value:O(t,n,c)}),a}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",d="executing",g="completed",y={};function b(){}function v(){}function m(){}var I={};s(I,a,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(S([])));w&&w!==n&&r.call(w,a)&&(I=w);var A=m.prototype=b.prototype=Object.create(I);function G(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==C(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,n,r){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=k(c,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var s=p(e,n,r);if("normal"===s.type){if(o=r.done?g:"suspendedYield",s.arg===y)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=g,r.method="throw",r.arg=s.arg)}}}function k(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function S(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),B(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;B(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:S(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function f(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function p(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){f(i,r,o,a,c,"next",t)}function c(t){f(i,r,o,a,c,"throw",t)}a(void 0)}))}}function h(t){return function(t){if(Array.isArray(t))return B(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||L(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function L(t,e){if(t){if("string"==typeof t)return B(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(t,e):void 0}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nCr,DEBUG:()=>Gr,ERROR:()=>kr,FATAL:()=>Lr,INFO:()=>Er,OFF:()=>Br,TRACE:()=>Ar,WARN:()=>Or}),function(t){t.assertEqual=function(t){return t},t.assertIs=function(){},t.assertNever=function(){throw new Error},t.arrayToEnum=function(t){var e,n={},r=k(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;n[o]=o}}catch(t){r.e(t)}finally{r.f()}return n},t.getValidEnumValues=function(e){var n,r=t.objectKeys(e).filter((function(t){return"number"!=typeof e[e[t]]})),o={},i=k(r);try{for(i.s();!(n=i.n()).done;){var a=n.value;o[a]=e[a]}}catch(t){i.e(t)}finally{i.f()}return t.objectValues(o)},t.objectValues=function(e){return t.objectKeys(e).map((function(t){return e[t]}))},t.objectKeys="function"==typeof Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e},t.find=function(t,e){var n,r=k(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(e(o))return o}}catch(t){r.e(t)}finally{r.f()}},t.isInteger="function"==typeof Number.isInteger?function(t){return Number.isInteger(t)}:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},t.joinValues=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" | ";return t.map((function(t){return"string"==typeof t?"'".concat(t,"'"):t})).join(e)},t.jsonStringifyReplacer=function(t,e){return"bigint"==typeof e?e.toString():e}}(a||(a={})),function(t){t.mergeShapes=function(t,e){return G(G({},t),e)}}(c||(c={}));var N=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),S=function(t){switch(C(t)){case"undefined":return N.undefined;case"string":return N.string;case"number":return isNaN(t)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":return Array.isArray(t)?N.array:null===t?N.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?N.promise:"undefined"!=typeof Map&&t instanceof Map?N.map:"undefined"!=typeof Set&&t instanceof Set?N.set:"undefined"!=typeof Date&&t instanceof Date?N.date:N.object;default:return N.unknown}},Z=a.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),_=function(t){function e(t){var n;d(this,e),(n=b(this,e)).issues=[],n.addIssue=function(t){n.issues=[].concat(h(n.issues),[t])},n.addIssues=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];n.issues=[].concat(h(n.issues),h(t))};var r=(this instanceof e?this.constructor:void 0).prototype;return Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r,n.name="ZodError",n.issues=t,n}return v(e,m(Error)),y(e,[{key:"errors",get:function(){return this.issues}},{key:"format",value:function(t){var e=t||function(t){return t.message},n={_errors:[]},r=function(t){var o,i=k(t.issues);try{for(i.s();!(o=i.n()).done;){var a=o.value;if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(e(a));else for(var c=n,u=0;u0&&void 0!==arguments[0]?arguments[0]:function(t){return t.message},n={},r=[],o=k(this.issues);try{for(o.s();!(t=o.n()).done;){var i=t.value;i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i))}}catch(t){o.e(t)}finally{o.f()}return{formErrors:r,fieldErrors:n}}},{key:"formErrors",get:function(){return this.flatten()}}],[{key:"assert",value:function(t){if(!(t instanceof e))throw new Error("Not a ZodError: ".concat(t))}}])}();_.create=function(t){return new _(t)};var Q=function(t,e){var n;switch(t.code){case Z.invalid_type:n=t.received===N.undefined?"Required":"Expected ".concat(t.expected,", received ").concat(t.received);break;case Z.invalid_literal:n="Invalid literal value, expected ".concat(JSON.stringify(t.expected,a.jsonStringifyReplacer));break;case Z.unrecognized_keys:n="Unrecognized key(s) in object: ".concat(a.joinValues(t.keys,", "));break;case Z.invalid_union:n="Invalid input";break;case Z.invalid_union_discriminator:n="Invalid discriminator value. Expected ".concat(a.joinValues(t.options));break;case Z.invalid_enum_value:n="Invalid enum value. Expected ".concat(a.joinValues(t.options),", received '").concat(t.received,"'");break;case Z.invalid_arguments:n="Invalid function arguments";break;case Z.invalid_return_type:n="Invalid function return type";break;case Z.invalid_date:n="Invalid date";break;case Z.invalid_string:"object"===C(t.validation)?"includes"in t.validation?(n='Invalid input: must include "'.concat(t.validation.includes,'"'),"number"==typeof t.validation.position&&(n="".concat(n," at one or more positions greater than or equal to ").concat(t.validation.position))):"startsWith"in t.validation?n='Invalid input: must start with "'.concat(t.validation.startsWith,'"'):"endsWith"in t.validation?n='Invalid input: must end with "'.concat(t.validation.endsWith,'"'):a.assertNever(t.validation):n="regex"!==t.validation?"Invalid ".concat(t.validation):"Invalid";break;case Z.too_small:n="array"===t.type?"Array must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"more than"," ").concat(t.minimum," element(s)"):"string"===t.type?"String must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"over"," ").concat(t.minimum," character(s)"):"number"===t.type?"Number must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(t.minimum):"date"===t.type?"Date must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(t.minimum))):"Invalid input";break;case Z.too_big:n="array"===t.type?"Array must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"less than"," ").concat(t.maximum," element(s)"):"string"===t.type?"String must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"under"," ").concat(t.maximum," character(s)"):"number"===t.type?"Number must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):"bigint"===t.type?"BigInt must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):"date"===t.type?"Date must be ".concat(t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(t.maximum))):"Invalid input";break;case Z.custom:n="Invalid input";break;case Z.invalid_intersection_types:n="Intersection results could not be merged";break;case Z.not_multiple_of:n="Number must be a multiple of ".concat(t.multipleOf);break;case Z.not_finite:n="Number must be finite";break;default:n=e.defaultError,a.assertNever(t)}return{message:n}},j=Q;function R(){return j}var X=function(t){var e=t.data,n=t.path,r=t.errorMaps,o=t.issueData,i=[].concat(h(n),h(o.path||[])),a=G(G({},o),{},{path:i});if(void 0!==o.message)return G(G({},o),{},{path:i,message:o.message});var c,u="",s=k(r.filter((function(t){return!!t})).slice().reverse());try{for(s.s();!(c=s.n()).done;)u=(0,c.value)(a,{data:e,defaultError:u}).message}catch(t){s.e(t)}finally{s.f()}return G(G({},o),{},{path:i,message:u})};function W(t,e){var n=R(),r=X({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Q?void 0:Q].filter((function(t){return!!t}))});t.common.issues.push(r)}var F,U,D,T=function(){function t(){d(this,t),this.value="valid"}return y(t,[{key:"dirty",value:function(){"valid"===this.value&&(this.value="dirty")}},{key:"abort",value:function(){"aborted"!==this.value&&(this.value="aborted")}}],[{key:"mergeArray",value:function(t,e){var n,r=[],o=k(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if("aborted"===i.status)return Y;"dirty"===i.status&&t.dirty(),r.push(i.value)}}catch(t){o.e(t)}finally{o.f()}return{status:t.value,value:r}}},{key:"mergeObjectAsync",value:(e=p(l().mark((function e(n,r){var o,i,a,c,u,s;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],i=k(r),e.prev=2,i.s();case 4:if((a=i.n()).done){e.next=15;break}return c=a.value,e.next=8,c.key;case 8:return u=e.sent,e.next=11,c.value;case 11:s=e.sent,o.push({key:u,value:s});case 13:e.next=4;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(2),i.e(e.t0);case 20:return e.prev=20,i.f(),e.finish(20);case 23:return e.abrupt("return",t.mergeObjectSync(n,o));case 24:case"end":return e.stop()}}),e,null,[[2,17,20,23]])}))),function(t,n){return e.apply(this,arguments)})},{key:"mergeObjectSync",value:function(t,e){var n,r={},o=k(e);try{for(o.s();!(n=o.n()).done;){var i=n.value,a=i.key,c=i.value;if("aborted"===a.status)return Y;if("aborted"===c.status)return Y;"dirty"===a.status&&t.dirty(),"dirty"===c.status&&t.dirty(),"__proto__"===a.value||void 0===c.value&&!i.alwaysSet||(r[a.value]=c.value)}}catch(t){o.e(t)}finally{o.f()}return{status:t.value,value:r}}}]);var e}(),Y=Object.freeze({status:"aborted"}),P=function(t){return{status:"dirty",value:t}},M=function(t){return{status:"valid",value:t}},V=function(t){return"aborted"===t.status},H=function(t){return"dirty"===t.status},J=function(t){return"valid"===t.status},z=function(t){return"undefined"!=typeof Promise&&t instanceof Promise};function q(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function K(t,e,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,n):o?o.value=n:e.set(t,n),n}"function"==typeof SuppressedError&&SuppressedError,function(t){t.errToObj=function(t){return"string"==typeof t?{message:t}:t||{}},t.toString=function(t){return"string"==typeof t?t:null==t?void 0:t.message}}(F||(F={}));var $=function(){return y((function t(e,n,r,o){d(this,t),this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}),[{key:"path",get:function(){var t,e;return this._cachedPath.length||(this._key instanceof Array?(t=this._cachedPath).push.apply(t,h(this._path).concat(h(this._key))):(e=this._cachedPath).push.apply(e,h(this._path).concat([this._key]))),this._cachedPath}}])}(),tt=function(t,e){if(J(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;var e=new _(t.common.issues);return this._error=e,this._error}}};function et(t){if(!t)return{};var e=t.errorMap,n=t.invalid_type_error,r=t.required_error,o=t.description;if(e&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:o}:{errorMap:function(e,o){var i,a,c=t.message;return"invalid_enum_value"===e.code?{message:null!=c?c:o.defaultError}:void 0===o.data?{message:null!==(i=null!=c?c:r)&&void 0!==i?i:o.defaultError}:"invalid_type"!==e.code?{message:o.defaultError}:{message:null!==(a=null!=c?c:n)&&void 0!==a?a:o.defaultError}},description:o}}var nt,rt=function(){return y((function t(e){d(this,t),this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}),[{key:"description",get:function(){return this._def.description}},{key:"_getType",value:function(t){return S(t.data)}},{key:"_getOrReturnCtx",value:function(t,e){return e||{common:t.parent.common,data:t.data,parsedType:S(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}},{key:"_processInputParams",value:function(t){return{status:new T,ctx:{common:t.parent.common,data:t.data,parsedType:S(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}},{key:"_parseSync",value:function(t){var e=this._parse(t);if(z(e))throw new Error("Synchronous parse encountered promise.");return e}},{key:"_parseAsync",value:function(t){var e=this._parse(t);return Promise.resolve(e)}},{key:"parse",value:function(t,e){var n=this.safeParse(t,e);if(n.success)return n.data;throw n.error}},{key:"safeParse",value:function(t,e){var n,r={common:{issues:[],async:null!==(n=null==e?void 0:e.async)&&void 0!==n&&n,contextualErrorMap:null==e?void 0:e.errorMap},path:(null==e?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:S(t)},o=this._parseSync({data:t,path:r.path,parent:r});return tt(r,o)}},{key:"parseAsync",value:(e=p(l().mark((function t(e,n){var r;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.safeParseAsync(e,n);case 2:if(!(r=t.sent).success){t.next=5;break}return t.abrupt("return",r.data);case 5:throw r.error;case 6:case"end":return t.stop()}}),t,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"safeParseAsync",value:(t=p(l().mark((function t(e,n){var r,o,i;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={common:{issues:[],contextualErrorMap:null==n?void 0:n.errorMap,async:!0},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:S(e)},o=this._parse({data:e,path:r.path,parent:r}),t.next=4,z(o)?o:Promise.resolve(o);case 4:return i=t.sent,t.abrupt("return",tt(r,i));case 6:case"end":return t.stop()}}),t,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"refine",value:function(t,e){return this._refinement((function(n,r){var o=t(n),i=function(){return r.addIssue(G({code:Z.custom},function(t){return"string"==typeof e||void 0===e?{message:e}:"function"==typeof e?e(t):e}(n)))};return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return!!t||(i(),!1)})):!!o||(i(),!1)}))}},{key:"refinement",value:function(t,e){return this._refinement((function(n,r){return!!t(n)||(r.addIssue("function"==typeof e?e(n,r):e),!1)}))}},{key:"_refinement",value:function(t){return new Jt({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:t}})}},{key:"superRefine",value:function(t){return this._refinement(t)}},{key:"optional",value:function(){return zt.create(this,this._def)}},{key:"nullable",value:function(){return qt.create(this,this._def)}},{key:"nullish",value:function(){return this.nullable().optional()}},{key:"array",value:function(){return Bt.create(this,this._def)}},{key:"promise",value:function(){return Ht.create(this,this._def)}},{key:"or",value:function(t){return Zt.create([this,t],this._def)}},{key:"and",value:function(t){return Rt.create(this,t,this._def)}},{key:"transform",value:function(t){return new Jt(G(G({},et(this._def)),{},{schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:t}}))}},{key:"default",value:function(t){var e="function"==typeof t?t:function(){return t};return new Kt(G(G({},et(this._def)),{},{innerType:this,defaultValue:e,typeName:ae.ZodDefault}))}},{key:"brand",value:function(){return new ne(G({typeName:ae.ZodBranded,type:this},et(this._def)))}},{key:"catch",value:function(t){var e="function"==typeof t?t:function(){return t};return new $t(G(G({},et(this._def)),{},{innerType:this,catchValue:e,typeName:ae.ZodCatch}))}},{key:"describe",value:function(t){return new(0,this.constructor)(G(G({},this._def),{},{description:t}))}},{key:"pipe",value:function(t){return re.create(this,t)}},{key:"readonly",value:function(){return oe.create(this)}},{key:"isOptional",value:function(){return this.safeParse(void 0).success}},{key:"isNullable",value:function(){return this.safeParse(null).success}}]);var t,e}(),ot=/^c[^\s-]{8,}$/i,it=/^[0-9a-z]+$/,at=/^[0-9A-HJKMNP-TV-Z]{26}$/,ct=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ut=/^[a-z0-9_-]{21}$/i,st=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ft=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ht=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",gt=new RegExp("^".concat(dt,"$"));function yt(t){var e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e="".concat(e,"\\.\\d{").concat(t.precision,"}"):null==t.precision&&(e="".concat(e,"(\\.\\d+)?")),e}function bt(t){var e="".concat(dt,"T").concat(yt(t)),n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(n.join("|"),")"),new RegExp("^".concat(e,"$"))}var vt=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==N.string){var e=this._getOrReturnCtx(t);return W(e,{code:Z.invalid_type,expected:N.string,received:e.parsedType}),Y}var n,r,o,i=new T,c=void 0,u=k(this._def.checks);try{for(u.s();!(n=u.n()).done;){var s=n.value;if("min"===s.kind)t.data.lengths.value&&(W(c=this._getOrReturnCtx(t,c),{code:Z.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if("length"===s.kind){var l=t.data.length>s.value,f=t.data.lengthe)&&(e=r.value)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"maxLength",get:function(){var t,e=null,n=k(this._def.checks);try{for(n.s();!(t=n.n()).done;){var r=t.value;"max"===r.kind&&(null===e||r.valuep.value:t.data>=p.value)&&(W(s=this._getOrReturnCtx(t,s),{code:Z.too_big,maximum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),l.dirty()):"multipleOf"===p.kind?0!=(r=t.data,o=p.value,void 0,void 0,void 0,u=(i=(r.toString().split(".")[1]||"").length)>(c=(o.toString().split(".")[1]||"").length)?i:c,parseInt(r.toFixed(u).replace(".",""))%parseInt(o.toFixed(u).replace(".",""))/Math.pow(10,u))&&(W(s=this._getOrReturnCtx(t,s),{code:Z.not_multiple_of,multipleOf:p.value,message:p.message}),l.dirty()):"finite"===p.kind?Number.isFinite(t.data)||(W(s=this._getOrReturnCtx(t,s),{code:Z.not_finite,message:p.message}),l.dirty()):a.assertNever(p)}}catch(t){f.e(t)}finally{f.f()}return{status:l.value,value:t.data}}},{key:"gte",value:function(t,e){return this.setLimit("min",t,!0,F.toString(e))}},{key:"gt",value:function(t,e){return this.setLimit("min",t,!1,F.toString(e))}},{key:"lte",value:function(t,e){return this.setLimit("max",t,!0,F.toString(e))}},{key:"lt",value:function(t,e){return this.setLimit("max",t,!1,F.toString(e))}},{key:"setLimit",value:function(t,n,r,o){return new e(G(G({},this._def),{},{checks:[].concat(h(this._def.checks),[{kind:t,value:n,inclusive:r,message:F.toString(o)}])}))}},{key:"_addCheck",value:function(t){return new e(G(G({},this._def),{},{checks:[].concat(h(this._def.checks),[t])}))}},{key:"int",value:function(t){return this._addCheck({kind:"int",message:F.toString(t)})}},{key:"positive",value:function(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(t)})}},{key:"negative",value:function(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(t)})}},{key:"nonpositive",value:function(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(t)})}},{key:"nonnegative",value:function(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(t)})}},{key:"multipleOf",value:function(t,e){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(e)})}},{key:"finite",value:function(t){return this._addCheck({kind:"finite",message:F.toString(t)})}},{key:"safe",value:function(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(t)})}},{key:"minValue",get:function(){var t,e=null,n=k(this._def.checks);try{for(n.s();!(t=n.n()).done;){var r=t.value;"min"===r.kind&&(null===e||r.value>e)&&(e=r.value)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"maxValue",get:function(){var t,e=null,n=k(this._def.checks);try{for(n.s();!(t=n.n()).done;){var r=t.value;"max"===r.kind&&(null===e||r.valuen)&&(n=o.value):"max"===o.kind&&(null===e||o.valuec.value:t.data>=c.value)&&(W(r=this._getOrReturnCtx(t,r),{code:Z.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):"multipleOf"===c.kind?t.data%c.value!==BigInt(0)&&(W(r=this._getOrReturnCtx(t,r),{code:Z.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):a.assertNever(c)}}catch(t){i.e(t)}finally{i.f()}return{status:o.value,value:t.data}}},{key:"gte",value:function(t,e){return this.setLimit("min",t,!0,F.toString(e))}},{key:"gt",value:function(t,e){return this.setLimit("min",t,!1,F.toString(e))}},{key:"lte",value:function(t,e){return this.setLimit("max",t,!0,F.toString(e))}},{key:"lt",value:function(t,e){return this.setLimit("max",t,!1,F.toString(e))}},{key:"setLimit",value:function(t,n,r,o){return new e(G(G({},this._def),{},{checks:[].concat(h(this._def.checks),[{kind:t,value:n,inclusive:r,message:F.toString(o)}])}))}},{key:"_addCheck",value:function(t){return new e(G(G({},this._def),{},{checks:[].concat(h(this._def.checks),[t])}))}},{key:"positive",value:function(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F.toString(t)})}},{key:"negative",value:function(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(t)})}},{key:"nonpositive",value:function(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(t)})}},{key:"nonnegative",value:function(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(t)})}},{key:"multipleOf",value:function(t,e){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(e)})}},{key:"minValue",get:function(){var t,e=null,n=k(this._def.checks);try{for(n.s();!(t=n.n()).done;){var r=t.value;"min"===r.kind&&(null===e||r.value>e)&&(e=r.value)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"maxValue",get:function(){var t,e=null,n=k(this._def.checks);try{for(n.s();!(t=n.n()).done;){var r=t.value;"max"===r.kind&&(null===e||r.valuec.value&&(W(o=this._getOrReturnCtx(t,o),{code:Z.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),r.dirty()):a.assertNever(c)}}catch(t){i.e(t)}finally{i.f()}return{status:r.value,value:new Date(t.data.getTime())}}},{key:"_addCheck",value:function(t){return new e(G(G({},this._def),{},{checks:[].concat(h(this._def.checks),[t])}))}},{key:"min",value:function(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:F.toString(e)})}},{key:"max",value:function(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:F.toString(e)})}},{key:"minDate",get:function(){var t,e=null,n=k(this._def.checks);try{for(n.s();!(t=n.n()).done;){var r=t.value;"min"===r.kind&&(null===e||r.value>e)&&(e=r.value)}}catch(t){n.e(t)}finally{n.f()}return null!=e?new Date(e):null}},{key:"maxDate",get:function(){var t,e=null,n=k(this._def.checks);try{for(n.s();!(t=n.n()).done;){var r=t.value;"max"===r.kind&&(null===e||r.valueo.exactLength.value,a=n.data.lengtho.maxLength.value&&(W(n,{code:Z.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all(h(n.data).map((function(t,e){return o.type._parseAsync(new $(n,t,n.path,e))}))).then((function(t){return T.mergeArray(r,t)}));var c=h(n.data).map((function(t,e){return o.type._parseSync(new $(n,t,n.path,e))}));return T.mergeArray(r,c)}},{key:"element",get:function(){return this._def.type}},{key:"min",value:function(t,n){return new e(G(G({},this._def),{},{minLength:{value:t,message:F.toString(n)}}))}},{key:"max",value:function(t,n){return new e(G(G({},this._def),{},{maxLength:{value:t,message:F.toString(n)}}))}},{key:"length",value:function(t,n){return new e(G(G({},this._def),{},{exactLength:{value:t,message:F.toString(n)}}))}},{key:"nonempty",value:function(t){return this.min(1,t)}}])}();function Nt(t){if(t instanceof St){var e={};for(var n in t.shape){var r=t.shape[n];e[n]=zt.create(Nt(r))}return new St(G(G({},t._def),{},{shape:function(){return e}}))}return t instanceof Bt?new Bt(G(G({},t._def),{},{type:Nt(t.element)})):t instanceof zt?zt.create(Nt(t.unwrap())):t instanceof qt?qt.create(Nt(t.unwrap())):t instanceof Xt?Xt.create(t.items.map((function(t){return Nt(t)}))):t}Bt.create=function(t,e){return new Bt(G({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray},et(e)))};var St=function(t){function e(){var t;return d(this,e),(t=b(this,e,arguments))._cached=null,t.nonstrict=t.passthrough,t.augment=t.extend,t}return v(e,rt),y(e,[{key:"_getCached",value:function(){if(null!==this._cached)return this._cached;var t=this._def.shape(),e=a.objectKeys(t);return this._cached={shape:t,keys:e}}},{key:"_parse",value:function(t){if(this._getType(t)!==N.object){var e=this._getOrReturnCtx(t);return W(e,{code:Z.invalid_type,expected:N.object,received:e.parsedType}),Y}var n=this._processInputParams(t),r=n.status,o=n.ctx,i=this._getCached(),a=i.shape,c=i.keys,u=[];if(!(this._def.catchall instanceof kt&&"strip"===this._def.unknownKeys))for(var s in o.data)c.includes(s)||u.push(s);var f,h=[],d=k(c);try{for(d.s();!(f=d.n()).done;){var g=f.value,y=a[g],b=o.data[g];h.push({key:{status:"valid",value:g},value:y._parse(new $(o,b,o.path,g)),alwaysSet:g in o.data})}}catch(t){d.e(t)}finally{d.f()}if(this._def.catchall instanceof kt){var v=this._def.unknownKeys;if("passthrough"===v){var m,I=k(u);try{for(I.s();!(m=I.n()).done;){var x=m.value;h.push({key:{status:"valid",value:x},value:{status:"valid",value:o.data[x]}})}}catch(t){I.e(t)}finally{I.f()}}else if("strict"===v)u.length>0&&(W(o,{code:Z.unrecognized_keys,keys:u}),r.dirty());else if("strip"!==v)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{var w,C=this._def.catchall,A=k(u);try{for(A.s();!(w=A.n()).done;){var G=w.value,E=o.data[G];h.push({key:{status:"valid",value:G},value:C._parse(new $(o,E,o.path,G)),alwaysSet:G in o.data})}}catch(t){A.e(t)}finally{A.f()}}return o.common.async?Promise.resolve().then(p(l().mark((function t(){var e,n,r,o,i,a;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=[],n=k(h),t.prev=2,n.s();case 4:if((r=n.n()).done){t.next=15;break}return o=r.value,t.next=8,o.key;case 8:return i=t.sent,t.next=11,o.value;case 11:a=t.sent,e.push({key:i,value:a,alwaysSet:o.alwaysSet});case 13:t.next=4;break;case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(2),n.e(t.t0);case 20:return t.prev=20,n.f(),t.finish(20);case 23:return t.abrupt("return",e);case 24:case"end":return t.stop()}}),t,null,[[2,17,20,23]])})))).then((function(t){return T.mergeObjectSync(r,t)})):T.mergeObjectSync(r,h)}},{key:"shape",get:function(){return this._def.shape()}},{key:"strict",value:function(t){var n=this;return F.errToObj,new e(G(G({},this._def),{},{unknownKeys:"strict"},void 0!==t?{errorMap:function(e,r){var o,i,a,c,u=null!==(a=null===(i=(o=n._def).errorMap)||void 0===i?void 0:i.call(o,e,r).message)&&void 0!==a?a:r.defaultError;return"unrecognized_keys"===e.code?{message:null!==(c=F.errToObj(t).message)&&void 0!==c?c:u}:{message:u}}}:{}))}},{key:"strip",value:function(){return new e(G(G({},this._def),{},{unknownKeys:"strip"}))}},{key:"passthrough",value:function(){return new e(G(G({},this._def),{},{unknownKeys:"passthrough"}))}},{key:"extend",value:function(t){var n=this;return new e(G(G({},this._def),{},{shape:function(){return G(G({},n._def.shape()),t)}}))}},{key:"merge",value:function(t){var n=this;return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:function(){return G(G({},n._def.shape()),t._def.shape())},typeName:ae.ZodObject})}},{key:"setKey",value:function(t,e){return this.augment(E({},t,e))}},{key:"catchall",value:function(t){return new e(G(G({},this._def),{},{catchall:t}))}},{key:"pick",value:function(t){var n=this,r={};return a.objectKeys(t).forEach((function(e){t[e]&&n.shape[e]&&(r[e]=n.shape[e])})),new e(G(G({},this._def),{},{shape:function(){return r}}))}},{key:"omit",value:function(t){var n=this,r={};return a.objectKeys(this.shape).forEach((function(e){t[e]||(r[e]=n.shape[e])})),new e(G(G({},this._def),{},{shape:function(){return r}}))}},{key:"deepPartial",value:function(){return Nt(this)}},{key:"partial",value:function(t){var n=this,r={};return a.objectKeys(this.shape).forEach((function(e){var o=n.shape[e];t&&!t[e]?r[e]=o:r[e]=o.optional()})),new e(G(G({},this._def),{},{shape:function(){return r}}))}},{key:"required",value:function(t){var n=this,r={};return a.objectKeys(this.shape).forEach((function(e){if(t&&!t[e])r[e]=n.shape[e];else{for(var o=n.shape[e];o instanceof zt;)o=o._def.innerType;r[e]=o}})),new e(G(G({},this._def),{},{shape:function(){return r}}))}},{key:"keyof",value:function(){return Pt(a.objectKeys(this.shape))}}])}();St.create=function(t,e){return new St(G({shape:function(){return t},unknownKeys:"strip",catchall:kt.create(),typeName:ae.ZodObject},et(e)))},St.strictCreate=function(t,e){return new St(G({shape:function(){return t},unknownKeys:"strict",catchall:kt.create(),typeName:ae.ZodObject},et(e)))},St.lazycreate=function(t,e){return new St(G({shape:t,unknownKeys:"strip",catchall:kt.create(),typeName:ae.ZodObject},et(e)))};var Zt=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){var e=this._processInputParams(t).ctx,n=this._def.options;if(e.common.async)return Promise.all(n.map(function(){var t=p(l().mark((function t(n){var r;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=G(G({},e),{},{common:G(G({},e.common),{},{issues:[]}),parent:null}),t.next=3,n._parseAsync({data:e.data,path:e.path,parent:r});case 3:return t.t0=t.sent,t.t1=r,t.abrupt("return",{result:t.t0,ctx:t.t1});case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())).then((function(t){var n,r=k(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;if("valid"===o.result.status)return o.result}}catch(t){r.e(t)}finally{r.f()}var i,a=k(t);try{for(a.s();!(i=a.n()).done;){var c,u=i.value;if("dirty"===u.result.status)return(c=e.common.issues).push.apply(c,h(u.ctx.common.issues)),u.result}}catch(t){a.e(t)}finally{a.f()}var s=t.map((function(t){return new _(t.ctx.common.issues)}));return W(e,{code:Z.invalid_union,unionErrors:s}),Y}));var r,o,i=void 0,a=[],c=k(n);try{for(c.s();!(r=c.n()).done;){var u=r.value,s=G(G({},e),{},{common:G(G({},e.common),{},{issues:[]}),parent:null}),f=u._parseSync({data:e.data,path:e.path,parent:s});if("valid"===f.status)return f;"dirty"!==f.status||i||(i={result:f,ctx:s}),s.common.issues.length&&a.push(s.common.issues)}}catch(t){c.e(t)}finally{c.f()}if(i)return(o=e.common.issues).push.apply(o,h(i.ctx.common.issues)),i.result;var d=a.map((function(t){return new _(t)}));return W(e,{code:Z.invalid_union,unionErrors:d}),Y}},{key:"options",get:function(){return this._def.options}}])}();Zt.create=function(t,e){return new Zt(G({options:t,typeName:ae.ZodUnion},et(e)))};var _t=function t(e){return e instanceof Tt?t(e.schema):e instanceof Jt?t(e.innerType()):e instanceof Yt?[e.value]:e instanceof Mt?e.options:e instanceof Vt?a.objectValues(e.enum):e instanceof Kt?t(e._def.innerType):e instanceof At?[void 0]:e instanceof Gt?[null]:e instanceof zt?[void 0].concat(h(t(e.unwrap()))):e instanceof qt?[null].concat(h(t(e.unwrap()))):e instanceof ne||e instanceof oe?t(e.unwrap()):e instanceof $t?t(e._def.innerType):[]},Qt=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){var e=this._processInputParams(t).ctx;if(e.parsedType!==N.object)return W(e,{code:Z.invalid_type,expected:N.object,received:e.parsedType}),Y;var n=this.discriminator,r=e.data[n],o=this.optionsMap.get(r);return o?e.common.async?o._parseAsync({data:e.data,path:e.path,parent:e}):o._parseSync({data:e.data,path:e.path,parent:e}):(W(e,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Y)}},{key:"discriminator",get:function(){return this._def.discriminator}},{key:"options",get:function(){return this._def.options}},{key:"optionsMap",get:function(){return this._def.optionsMap}}],[{key:"create",value:function(t,n,r){var o,i=new Map,a=k(n);try{for(a.s();!(o=a.n()).done;){var c=o.value,u=_t(c.shape[t]);if(!u.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));var s,l=k(u);try{for(l.s();!(s=l.n()).done;){var f=s.value;if(i.has(f))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(f)));i.set(f,c)}}catch(t){l.e(t)}finally{l.f()}}}catch(t){a.e(t)}finally{a.f()}return new e(G({typeName:ae.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i},et(r)))}}])}();function jt(t,e){var n=S(t),r=S(e);if(t===e)return{valid:!0,data:t};if(n===N.object&&r===N.object){var o,i=a.objectKeys(e),c=a.objectKeys(t).filter((function(t){return-1!==i.indexOf(t)})),u=G(G({},t),e),s=k(c);try{for(s.s();!(o=s.n()).done;){var l=o.value,f=jt(t[l],e[l]);if(!f.valid)return{valid:!1};u[l]=f.data}}catch(t){s.e(t)}finally{s.f()}return{valid:!0,data:u}}if(n===N.array&&r===N.array){if(t.length!==e.length)return{valid:!1};for(var p=[],h=0;hthis._def.items.length&&(W(o,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());var i=h(o.data).map((function(t,n){var r=e._def.items[n]||e._def.rest;return r?r._parse(new $(o,t,o.path,n)):null})).filter((function(t){return!!t}));return o.common.async?Promise.all(i).then((function(t){return T.mergeArray(r,t)})):T.mergeArray(r,i)}},{key:"items",get:function(){return this._def.items}},{key:"rest",value:function(t){return new e(G(G({},this._def),{},{rest:t}))}}])}();Xt.create=function(t,e){if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xt(G({items:t,typeName:ae.ZodTuple,rest:null},et(e)))};var Wt=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"keySchema",get:function(){return this._def.keyType}},{key:"valueSchema",get:function(){return this._def.valueType}},{key:"_parse",value:function(t){var e=this._processInputParams(t),n=e.status,r=e.ctx;if(r.parsedType!==N.object)return W(r,{code:Z.invalid_type,expected:N.object,received:r.parsedType}),Y;var o=[],i=this._def.keyType,a=this._def.valueType;for(var c in r.data)o.push({key:i._parse(new $(r,c,r.path,c)),value:a._parse(new $(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?T.mergeObjectAsync(n,o):T.mergeObjectSync(n,o)}},{key:"element",get:function(){return this._def.valueType}}],[{key:"create",value:function(t,n,r){return new e(n instanceof rt?G({keyType:t,valueType:n,typeName:ae.ZodRecord},et(r)):G({keyType:vt.create(),valueType:t,typeName:ae.ZodRecord},et(n)))}}])}(),Ft=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"keySchema",get:function(){return this._def.keyType}},{key:"valueSchema",get:function(){return this._def.valueType}},{key:"_parse",value:function(t){var e=this._processInputParams(t),n=e.status,r=e.ctx;if(r.parsedType!==N.map)return W(r,{code:Z.invalid_type,expected:N.map,received:r.parsedType}),Y;var o=this._def.keyType,i=this._def.valueType,a=h(r.data.entries()).map((function(t,e){var n=s(t,2),a=n[0],c=n[1];return{key:o._parse(new $(r,a,r.path,[e,"key"])),value:i._parse(new $(r,c,r.path,[e,"value"]))}}));if(r.common.async){var c=new Map;return Promise.resolve().then(p(l().mark((function t(){var e,r,o,i,u;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=k(a),t.prev=1,e.s();case 3:if((r=e.n()).done){t.next=17;break}return o=r.value,t.next=7,o.key;case 7:return i=t.sent,t.next=10,o.value;case 10:if(u=t.sent,"aborted"!==i.status&&"aborted"!==u.status){t.next=13;break}return t.abrupt("return",Y);case 13:"dirty"!==i.status&&"dirty"!==u.status||n.dirty(),c.set(i.value,u.value);case 15:t.next=3;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(1),e.e(t.t0);case 22:return t.prev=22,e.f(),t.finish(22);case 25:return t.abrupt("return",{status:n.value,value:c});case 26:case"end":return t.stop()}}),t,null,[[1,19,22,25]])}))))}var u,f=new Map,d=k(a);try{for(d.s();!(u=d.n()).done;){var g=u.value,y=g.key,b=g.value;if("aborted"===y.status||"aborted"===b.status)return Y;"dirty"!==y.status&&"dirty"!==b.status||n.dirty(),f.set(y.value,b.value)}}catch(t){d.e(t)}finally{d.f()}return{status:n.value,value:f}}}])}();Ft.create=function(t,e,n){return new Ft(G({valueType:e,keyType:t,typeName:ae.ZodMap},et(n)))};var Ut=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){var e=this._processInputParams(t),n=e.status,r=e.ctx;if(r.parsedType!==N.set)return W(r,{code:Z.invalid_type,expected:N.set,received:r.parsedType}),Y;var o=this._def;null!==o.minSize&&r.data.sizeo.maxSize.value&&(W(r,{code:Z.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());var i=this._def.valueType;function a(t){var e,r=new Set,o=k(t);try{for(o.s();!(e=o.n()).done;){var i=e.value;if("aborted"===i.status)return Y;"dirty"===i.status&&n.dirty(),r.add(i.value)}}catch(t){o.e(t)}finally{o.f()}return{status:n.value,value:r}}var c=h(r.data.values()).map((function(t,e){return i._parse(new $(r,t,r.path,e))}));return r.common.async?Promise.all(c).then((function(t){return a(t)})):a(c)}},{key:"min",value:function(t,n){return new e(G(G({},this._def),{},{minSize:{value:t,message:F.toString(n)}}))}},{key:"max",value:function(t,n){return new e(G(G({},this._def),{},{maxSize:{value:t,message:F.toString(n)}}))}},{key:"size",value:function(t,e){return this.min(t,e).max(t,e)}},{key:"nonempty",value:function(t){return this.min(1,t)}}])}();Ut.create=function(t,e){return new Ut(G({valueType:t,minSize:null,maxSize:null,typeName:ae.ZodSet},et(e)))};var Dt=function(t){function e(){var t;return d(this,e),(t=b(this,e,arguments)).validate=t.implement,t}return v(e,rt),y(e,[{key:"_parse",value:function(t){var e=this._processInputParams(t).ctx;if(e.parsedType!==N.function)return W(e,{code:Z.invalid_type,expected:N.function,received:e.parsedType}),Y;function n(t,n){return X({data:t,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,R(),Q].filter((function(t){return!!t})),issueData:{code:Z.invalid_arguments,argumentsError:n}})}function r(t,n){return X({data:t,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,R(),Q].filter((function(t){return!!t})),issueData:{code:Z.invalid_return_type,returnTypeError:n}})}var o={errorMap:e.common.contextualErrorMap},i=e.data;if(this._def.returns instanceof Ht){var a=this;return M(p(l().mark((function t(){var e,c,u,s,f,p,h,d=arguments;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=d.length,c=new Array(e),u=0;u1&&void 0!==arguments[1]?arguments[1]:this._def;return e.create(t,G(G({},this._def),n))}},{key:"exclude",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return e.create(this.options.filter((function(e){return!t.includes(e)})),G(G({},this._def),n))}}])}();U=new WeakMap,Mt.create=Pt;var Vt=function(t){function e(){var t;return d(this,e),t=b(this,e,arguments),D.set(t,void 0),t}return v(e,rt),y(e,[{key:"_parse",value:function(t){var e=a.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==N.string&&n.parsedType!==N.number){var r=a.objectValues(e);return W(n,{expected:a.joinValues(r),received:n.parsedType,code:Z.invalid_type}),Y}if(q(this,D,"f")||K(this,D,new Set(a.getValidEnumValues(this._def.values)),"f"),!q(this,D,"f").has(t.data)){var o=a.objectValues(e);return W(n,{received:n.data,code:Z.invalid_enum_value,options:o}),Y}return M(t.data)}},{key:"enum",get:function(){return this._def.values}}])}();D=new WeakMap,Vt.create=function(t,e){return new Vt(G({values:t,typeName:ae.ZodNativeEnum},et(e)))};var Ht=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"unwrap",value:function(){return this._def.type}},{key:"_parse",value:function(t){var e=this,n=this._processInputParams(t).ctx;if(n.parsedType!==N.promise&&!1===n.common.async)return W(n,{code:Z.invalid_type,expected:N.promise,received:n.parsedType}),Y;var r=n.parsedType===N.promise?n.data:Promise.resolve(n.data);return M(r.then((function(t){return e._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})})))}}])}();Ht.create=function(t,e){return new Ht(G({type:t,typeName:ae.ZodPromise},et(e)))};var Jt=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"innerType",value:function(){return this._def.schema}},{key:"sourceType",value:function(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}},{key:"_parse",value:function(t){var e=this,n=this._processInputParams(t),r=n.status,o=n.ctx,i=this._def.effect||null,c={addIssue:function(t){W(o,t),t.fatal?r.abort():r.dirty()},get path(){return o.path}};if(c.addIssue=c.addIssue.bind(c),"preprocess"===i.type){var u=i.transform(o.data,c);if(o.common.async)return Promise.resolve(u).then(function(){var t=p(l().mark((function t(n){var i;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("aborted"!==r.value){t.next=2;break}return t.abrupt("return",Y);case 2:return t.next=4,e._def.schema._parseAsync({data:n,path:o.path,parent:o});case 4:if("aborted"!==(i=t.sent).status){t.next=7;break}return t.abrupt("return",Y);case 7:if("dirty"!==i.status){t.next=9;break}return t.abrupt("return",P(i.value));case 9:if("dirty"!==r.value){t.next=11;break}return t.abrupt("return",P(i.value));case 11:return t.abrupt("return",i);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());if("aborted"===r.value)return Y;var s=this._def.schema._parseSync({data:u,path:o.path,parent:o});return"aborted"===s.status?Y:"dirty"===s.status||"dirty"===r.value?P(s.value):s}if("refinement"===i.type){var f=function(t){var e=i.refinement(t,c);if(o.common.async)return Promise.resolve(e);if(e instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(!1===o.common.async){var h=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return"aborted"===h.status?Y:("dirty"===h.status&&r.dirty(),f(h.value),{status:r.value,value:h.value})}return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((function(t){return"aborted"===t.status?Y:("dirty"===t.status&&r.dirty(),f(t.value).then((function(){return{status:r.value,value:t.value}})))}))}if("transform"===i.type){if(!1===o.common.async){var d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!J(d))return d;var g=i.transform(d.value,c);if(g instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:g}}return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((function(t){return J(t)?Promise.resolve(i.transform(t.value,c)).then((function(t){return{status:r.value,value:t}})):t}))}a.assertNever(i)}}])}();Jt.create=function(t,e,n){return new Jt(G({schema:t,typeName:ae.ZodEffects,effect:e},et(n)))},Jt.createWithPreprocess=function(t,e,n){return new Jt(G({schema:e,effect:{type:"preprocess",transform:t},typeName:ae.ZodEffects},et(n)))};var zt=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){return this._getType(t)===N.undefined?M(void 0):this._def.innerType._parse(t)}},{key:"unwrap",value:function(){return this._def.innerType}}])}();zt.create=function(t,e){return new zt(G({innerType:t,typeName:ae.ZodOptional},et(e)))};var qt=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){return this._getType(t)===N.null?M(null):this._def.innerType._parse(t)}},{key:"unwrap",value:function(){return this._def.innerType}}])}();qt.create=function(t,e){return new qt(G({innerType:t,typeName:ae.ZodNullable},et(e)))};var Kt=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){var e=this._processInputParams(t).ctx,n=e.data;return e.parsedType===N.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:e.path,parent:e})}},{key:"removeDefault",value:function(){return this._def.innerType}}])}();Kt.create=function(t,e){return new Kt(G({innerType:t,typeName:ae.ZodDefault,defaultValue:"function"==typeof e.default?e.default:function(){return e.default}},et(e)))};var $t=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){var e=this,n=this._processInputParams(t).ctx,r=G(G({},n),{},{common:G(G({},n.common),{},{issues:[]})}),o=this._def.innerType._parse({data:r.data,path:r.path,parent:G({},r)});return z(o)?o.then((function(t){return{status:"valid",value:"valid"===t.status?t.value:e._def.catchValue({get error(){return new _(r.common.issues)},input:r.data})}})):{status:"valid",value:"valid"===o.status?o.value:this._def.catchValue({get error(){return new _(r.common.issues)},input:r.data})}}},{key:"removeCatch",value:function(){return this._def.innerType}}])}();$t.create=function(t,e){return new $t(G({innerType:t,typeName:ae.ZodCatch,catchValue:"function"==typeof e.catch?e.catch:function(){return e.catch}},et(e)))};var te=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){if(this._getType(t)!==N.nan){var e=this._getOrReturnCtx(t);return W(e,{code:Z.invalid_type,expected:N.nan,received:e.parsedType}),Y}return{status:"valid",value:t.data}}}])}();te.create=function(t){return new te(G({typeName:ae.ZodNaN},et(t)))};var ee=Symbol("zod_brand"),ne=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){var e=this._processInputParams(t).ctx,n=e.data;return this._def.type._parse({data:n,path:e.path,parent:e})}},{key:"unwrap",value:function(){return this._def.type}}])}(),re=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){var e=this,n=this._processInputParams(t),r=n.status,o=n.ctx;if(o.common.async){var i=function(){var t=p(l().mark((function t(){var n;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e._def.in._parseAsync({data:o.data,path:o.path,parent:o});case 2:if("aborted"!==(n=t.sent).status){t.next=5;break}return t.abrupt("return",Y);case 5:if("dirty"!==n.status){t.next=10;break}return r.dirty(),t.abrupt("return",P(n.value));case 10:return t.abrupt("return",e._def.out._parseAsync({data:n.value,path:o.path,parent:o}));case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i()}var a=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return"aborted"===a.status?Y:"dirty"===a.status?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:o.path,parent:o})}}],[{key:"create",value:function(t,n){return new e({in:t,out:n,typeName:ae.ZodPipeline})}}])}(),oe=function(t){function e(){return d(this,e),b(this,e,arguments)}return v(e,rt),y(e,[{key:"_parse",value:function(t){var e=this._def.innerType._parse(t),n=function(t){return J(t)&&(t.value=Object.freeze(t.value)),t};return z(e)?e.then((function(t){return n(t)})):n(e)}},{key:"unwrap",value:function(){return this._def.innerType}}])}();function ie(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return t?Et.create().superRefine((function(r,o){var i,a;if(!t(r)){var c="function"==typeof e?e(r):"string"==typeof e?{message:e}:e,u=null===(a=null!==(i=c.fatal)&&void 0!==i?i:n)||void 0===a||a,s="string"==typeof c?{message:c}:c;o.addIssue(G(G({code:"custom"},s),{},{fatal:u}))}})):Et.create()}oe.create=function(t,e){return new oe(G({innerType:t,typeName:ae.ZodReadonly},et(e)))};var ae,ce={object:St.lazycreate};!function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"}(ae||(ae={}));var ue=vt.create,se=mt.create,le=te.create,fe=It.create,pe=xt.create,he=wt.create,de=Ct.create,ge=At.create,ye=Gt.create,be=Et.create,ve=Ot.create,me=kt.create,Ie=Lt.create,xe=Bt.create,we=St.create,Ce=St.strictCreate,Ae=Zt.create,Ge=Qt.create,Ee=Rt.create,Oe=Xt.create,ke=Wt.create,Le=Ft.create,Be=Ut.create,Ne=Dt.create,Se=Tt.create,Ze=Yt.create,_e=Mt.create,Qe=Vt.create,je=Ht.create,Re=Jt.create,Xe=zt.create,We=qt.create,Fe=Jt.createWithPreprocess,Ue=re.create,De={string:function(t){return vt.create(G(G({},t),{},{coerce:!0}))},number:function(t){return mt.create(G(G({},t),{},{coerce:!0}))},boolean:function(t){return xt.create(G(G({},t),{},{coerce:!0}))},bigint:function(t){return It.create(G(G({},t),{},{coerce:!0}))},date:function(t){return wt.create(G(G({},t),{},{coerce:!0}))}},Te=Y,Ye=Object.freeze({__proto__:null,defaultErrorMap:Q,setErrorMap:function(t){j=t},getErrorMap:R,makeIssue:X,EMPTY_PATH:[],addIssueToContext:W,ParseStatus:T,INVALID:Y,DIRTY:P,OK:M,isAborted:V,isDirty:H,isValid:J,isAsync:z,get util(){return a},get objectUtil(){return c},ZodParsedType:N,getParsedType:S,ZodType:rt,datetimeRegex:bt,ZodString:vt,ZodNumber:mt,ZodBigInt:It,ZodBoolean:xt,ZodDate:wt,ZodSymbol:Ct,ZodUndefined:At,ZodNull:Gt,ZodAny:Et,ZodUnknown:Ot,ZodNever:kt,ZodVoid:Lt,ZodArray:Bt,ZodObject:St,ZodUnion:Zt,ZodDiscriminatedUnion:Qt,ZodIntersection:Rt,ZodTuple:Xt,ZodRecord:Wt,ZodMap:Ft,ZodSet:Ut,ZodFunction:Dt,ZodLazy:Tt,ZodLiteral:Yt,ZodEnum:Mt,ZodNativeEnum:Vt,ZodPromise:Ht,ZodEffects:Jt,ZodTransformer:Jt,ZodOptional:zt,ZodNullable:qt,ZodDefault:Kt,ZodCatch:$t,ZodNaN:te,BRAND:ee,ZodBranded:ne,ZodPipeline:re,ZodReadonly:oe,custom:ie,Schema:rt,ZodSchema:rt,late:ce,get ZodFirstPartyTypeKind(){return ae},coerce:De,any:be,array:xe,bigint:fe,boolean:pe,date:he,discriminatedUnion:Ge,effect:Re,enum:_e,function:Ne,instanceof:function(t){return ie((function(e){return e instanceof t}),arguments.length>1&&void 0!==arguments[1]?arguments[1]:{message:"Input not instance of ".concat(t.name)})},intersection:Ee,lazy:Se,literal:Ze,map:Le,nan:le,nativeEnum:Qe,never:me,null:ye,nullable:We,number:se,object:we,oboolean:function(){return pe().optional()},onumber:function(){return se().optional()},optional:Xe,ostring:function(){return ue().optional()},pipeline:Ue,preprocess:Fe,promise:je,record:ke,set:Be,strictObject:Ce,string:ue,symbol:de,transformer:Re,tuple:Oe,undefined:ge,union:Ae,unknown:ve,void:Ie,NEVER:Te,ZodIssueCode:Z,quotelessJson:function(t){return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},ZodError:_});function Pe(){Pe=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),c=new L(r||[]);return o(a,"_invoke",{value:G(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="executing",d="completed",g={};function y(){}function b(){}function v(){}var m={};s(m,a,(function(){return this}));var I=Object.getPrototypeOf,x=I&&I(I(B([])));x&&x!==n&&r.call(x,a)&&(m=x);var w=v.prototype=y.prototype=Object.create(m);function C(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==ze(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function G(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=E(c,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?d:"suspendedYield",s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=d,r.method="throw",r.arg=s.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ve(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return rn[t[e+0]]+rn[t[e+1]]+rn[t[e+2]]+rn[t[e+3]]+"-"+rn[t[e+4]]+rn[t[e+5]]+"-"+rn[t[e+6]]+rn[t[e+7]]+"-"+rn[t[e+8]]+rn[t[e+9]]+"-"+rn[t[e+10]]+rn[t[e+11]]+rn[t[e+12]]+rn[t[e+13]]+rn[t[e+14]]+rn[t[e+15]]}(r)}var un="klarna_initialize_messenger_handshake",sn="klarna_initialize_messenger_handshake_complete",ln=/(\.klarna\.com|\.klarna\.net|^x\.klarnacdn\.net)$/,fn=we({messageId:ue(),method:ue(),data:ve()}),pn=we({messageId:ue(),method:ue(),origin:ue(),reject:ve().or(ge()),resolve:ve().or(ge())}),hn=function(){function t(e){var n=e.source,r=e.target;Me(this,t),$e(this,"callbacks"),$e(this,"handshakeComplete",!1),$e(this,"source"),$e(this,"sourcePort"),$e(this,"target"),$e(this,"targetPort"),this.callbacks=new Map,this.source=n,this.target=r;var o=new MessageChannel,i=o.port1,a=o.port2;this.sourcePort=i,this.targetPort=a,this.sourcePort.onmessage=this.onMessageFromTarget.bind(this)}return He(t,[{key:"onMessageFromTarget",value:function(t){if(t.data!==sn){var e=pn.safeParse(t.data);if(e.success){var n=this.callbacks.get(e.data.messageId);if(n){var r=e.data,o=r.reject,i=r.resolve,a=r.method;void 0!==o?n.reject(o):void 0!==i?n.resolve(i):console.error("No resolution available for method: ".concat(a))}else console.error("Callback not available for method: ".concat(e.data.method))}else console.error("Invalid data schema received from target")}else this.handshakeComplete=!0}},{key:"waitForHandshake",value:function(){var t=this;return new Promise((function(e,n){var r=setTimeout((function(){n(new Error("Handshake timeout"))}),1e4),o=setInterval((function(){t.handshakeComplete&&(clearTimeout(r),clearInterval(o),e(!0))}),100)}))}},{key:"postMessageToTarget",value:function(t){return tn(this,arguments,(function(t){var e=this,n=t.method,r=t.data;return Pe().mark((function t(){var o,i;return Pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=cn(),i={messageId:o,method:n,data:r},e.sourcePort.postMessage(i),t.abrupt("return",new Promise((function(t,n){e.callbacks.set(o,{resolve:t,reject:n})})));case 4:case"end":return t.stop()}}),t)}))()}))}},{key:"initiateHandshake",value:function(){return tn(this,null,Pe().mark((function e(){var n;return Pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.isIframe(this.target)?null==(n=this.target.contentWindow)||n.postMessage({type:un},"*",[this.targetPort]):this.target.postMessage({type:un},"*",[this.targetPort]),e.next=3,this.waitForHandshake();case 3:case"end":return e.stop()}}),e,this)})))}},{key:"destroy",value:function(){this.sourcePort.close(),this.targetPort.close()}}],[{key:"isIframe",value:function(t){try{return!!t.contentWindow}catch(t){return!1}}}])}(),dn=function(){return He((function t(){Me(this,t),$e(this,"handlers"),$e(this,"port"),$e(this,"sourceOrigin"),$e(this,"handshakeComplete"),this.handlers=new Map,this.handshakeComplete=!1}),[{key:"waitForHandshake",value:function(){var t=this;return new Promise((function(e){var n=setInterval((function(){t.handshakeComplete&&(clearInterval(n),e(!0))}),100)}))}},{key:"sendMessageToSource",value:function(t){return tn(this,null,Pe().mark((function e(){return Pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.handshakeComplete){e.next=3;break}return e.next=3,this.waitForHandshake();case 3:this.port.postMessage(t);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"onMessageFromSource",value:function(t){return tn(this,null,Pe().mark((function e(){var n,r,o,i,a,c;return Pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=fn.parse(t.data),r=n.messageId,o=n.method,i=n.data,a={messageId:r,method:o,origin:this.sourceOrigin,reject:void 0,resolve:void 0},c=this.handlers.get(o)){e.next=7;break}return a.reject="Unhandled method: ".concat(o,", add appropriate handler."),this.sendMessageToSource(a),e.abrupt("return");case 7:return e.prev=7,e.next=10,c({data:i,config:{sourceOrigin:this.sourceOrigin}});case 10:a.resolve=e.sent,e.next=16;break;case 13:e.prev=13,e.t0=e.catch(7),a.reject=e.t0;case 16:this.sendMessageToSource(a);case 17:case"end":return e.stop()}}),e,this,[[7,13]])})))}},{key:"registerHandler",value:function(t,e){this.handlers.set(t,e)}},{key:"initiateHandshakeListener",value:function(t){var e=this,n=t.validateOrigin,r=void 0===n||n,o=t.removeListenerAfterHandshake,i=void 0===o||o;window.addEventListener("message",(function t(n){var o;n.data.type===un&&(null==(o=n.ports[0])?void 0:o.postMessage)&&(!r||["development","test"].includes("production")||ln.test(new URL(n.origin).hostname))&&(e.port=n.ports[0],e.port.postMessage(sn),e.port.onmessage=e.onMessageFromSource.bind(e),e.sourceOrigin=n.origin,e.handshakeComplete=!0,i&&window.removeEventListener("message",t))}))}}])}(),gn=function(t){return t.PAYMENT_BUTTON="klarna-payment-button",t.IDENTITY_BUTTON="klarna-identity-button",t.PLACEMENT="klarna-placement",t}({}),yn=function(t){return t.IDENTITY="identity",t.PAYMENT="payment",t}({}),bn=function(t){return t.DEFAULT="default",t.LIGHT="light",t.DARK="dark",t.OUTLINED="outlined",t}({}),vn=function(t){return t.DEFAULT="default",t.PILL="pill",t.RECT="rect",t}({}),mn=function(t){return t.CHECKOUT="checkout",t.CONTINUE="continue",t.CONNECT="connect",t.DONATE="donate",t.SIGNIN="signin",t.SIGNUP="signup",t.SUBSCRIBE="subscribe",t.PAY="pay",t}({}),In=function(t){return t.CHECKOUT="checkout",t.CUSTOM_TYPE_0="custom-type0",t.CUSTOM_TYPE_1="custom-type1",t.CUSTOM_TYPE_0_INLINE="custom-type0-inline",t.CUSTOM_TYPE_2_INLINE="custom-type2-inline",t.CUSTOM_TYPE_3_INLINE="custom-type3-inline",t.CUSTOM_TYPE_1_335_AUTO="custom-type1-335-auto",t.CUSTOM_TYPE_3_335_AUTO="custom-type3-335-auto",t.TOP_STRIP_PROMOTION_AUTO_SIZE="top-strip-promotion-auto-size",t.TOP_STRIP_PROMOTION_STANDARD="top-strip-promotion-standard",t.TOP_STRIP_PROMOTION_BADGE="top-strip-promotion-badge",t.CREDIT_PROMOTION_SMALL="credit-promotion-small",t.CREDIT_PROMOTION_STANDARD="credit-promotion-standard",t.CREDIT_PROMOTION_INLINE="credit-promotion-inline",t.CREDIT_PROMOTION_AUTO_SIZE="credit-promotion-auto-size",t.CREDIT_PROMOTION_BADGE="credit-promotion-badge",t.SIDEBAR_PROMOTION_AUTO_SIZE="sidebar-promotion-auto-size",t.FOOTER_PROMOTION_AUTO_SIZE="footer-promotion-auto-size",t.INFO_PAGE="info-page",t.HOMEPAGE_PROMOTION_TALL="homepage-promotion-tall",t.HOMEPAGE_PROMOTION_WIDE="homepage-promotion-wide",t.HOMEPAGE_PROMOTION_BOX="homepage-promotion-box",t.PRODUCT="product",t.HEADER="header",t.CART="cart",t}({}),xn={production:"https://js.klarna.com",playground:"https://js.playground.klarna.com",staging:"https://x.nonprod.us1.js.klarna.net",development:"https://x.nonprod.us1.js.klarna.net"},wn=function(t){return t.IFRAME="iframe",t.WINDOW="window",t.REDIRECT="redirect",t.SDK="sdk",t}({}),Cn=function(t){return t.TECHNICAL_ERROR="TECHNICAL_ERROR",t.ACCESS_ERROR="ACCESS_ERROR",t.RESOURCE_ERROR="RESOURCE_ERROR",t.INPUT_ERROR="INPUT_ERROR",t}({}),An=function(t){return t.UNAUTHORIZED="UNAUTHORIZED",t.RATE_LIMITED="RATE_LIMITED",t.NOT_FOUND="NOT_FOUND",t.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",t.RESOURCE_CONFLICT="RESOURCE_CONFLICT",t.OPERATION_FORBIDDEN="OPERATION_FORBIDDEN",t.RATE_LIMITED_CLIENT="RATE_LIMITED_CLIENT",t.VALIDATION_ERROR="VALIDATION_ERROR",t.INVALID_CONTENT_TYPE="INVALID_CONTENT_TYPE",t.INTERNAL_ERROR="INTERNAL_ERROR",t.TEMPORARY_UNAVAILABLE="TEMPORARY_UNAVAILABLE",t}({}),Gn=function(t){return t.TO_DOOR="TO_DOOR",t.TO_CURB="TO_CURB",t.TO_MAILBOX="TO_MAILBOX",t.PICKUP_BOX="PICKUP_BOX",t.PICKUP_POINT="PICKUP_POINT",t.PICKUP_STORE="PICKUP_STORE",t.PICKUP_WAREHOUSE="PICKUP_WAREHOUSE",t.DIGITAL_EMAIL="DIGITAL_EMAIL",t.DIGITAL_DOWNLOAD="DIGITAL_DOWNLOAD",t.DIGITAL_OTHER="DIGITAL_OTHER",t.PHYSICAL_OTHER="PHYSICAL_OTHER",t}({}),En=function(t){return t.SIGNATURE_REQUIRED="SIGNATURE_REQUIRED",t.IDENTIFICATION_REQUIRED="IDENTIFICATION_REQUIRED",t.CONTACTLESS_DELIVERY="CONTACTLESS_DELIVERY",t.LEAVE_AT_DOOR="LEAVE_AT_DOOR",t.LEAVE_AT_CURB="LEAVE_AT_CURB",t.LEAVE_WITH_NEIGHBOUR="LEAVE_WITH_NEIGHBOUR",t.EXPRESS="EXPRESS",t.TRACKED="TRACKED",t.UNTRACKED="UNTRACKED",t}({}),On=function(t){return t.POSTAL_CODE_NOT_SUPPORTED="POSTAL_CODE_NOT_SUPPORTED",t.CITY_NOT_SUPPORTED="CITY_NOT_SUPPORTED",t.REGION_NOT_SUPPORTED="REGION_NOT_SUPPORTED",t.COUNTRY_NOT_SUPPORTED="COUNTRY_NOT_SUPPORTED",t.ADDRESS_NOT_SUPPORTED="ADDRESS_NOT_SUPPORTED",t}({}),kn=function(t){return t.ABORT_PAYMENT_REQUEST_CALLED="abort_payment_request_called",t.ABORT_PAYMENT_REQUEST_COMPLETED="abort_payment_request_completed",t.INITIATE_CALLED="initiate_called",t.INITIATE_INTEGRATOR_HANDLED_INTERACTION_TRIGGERED="initiate_integrator_handled_interaction_triggered",t.INITIATE_INTEGRATOR_CLOSED_INTERACTION="initiate_integrator_closed_interaction",t.INITIATE_INTERACTION_MODE_TRIGGERED="inititate_interaction_mode_triggered",t.INITIATE_COMPLETED="initiate_completed",t.FETCH_CALLED="fetch_called",t.FETCH_COMPLETED="fetch_completed",t.CAN_MAKE_PAYMENT_CALLED="can_make_payment_called",t.CAN_MAKE_PAYMENT_COMPLETED="can_make_payment_completed",t.CANCEL_CALLED="cancel_called",t.CANCEL_COMPLETED="cancel_completed",t.PREPARE_CALLED="prepare_called",t.PREPARE_COMPLETED="prepare_completed",t.REQUEST_CALLED="request_called",t.REQUEST_COMPLETED="request_completed",t.SUBMIT_CALLED="submit_called",t.SUBMIT_COMPLETED="submit_completed",t.UPDATE_CALLED="update_called",t.UPDATE_COMPLETED="update_completed",t.MAKE_PAYMENT_REQUEST_CALLED="make_payment_request_called",t.MAKE_PAYMENT_REQUEST_COMPLETED="make_payment_request_completed",t.UPDATE_PAYMENT_REQUEST_CALLED="update_payment_request_called",t.UPDATE_PAYMENT_REQUEST_COMPLETED="update_payment_request_completed",t.FLOW_END_GENERIC_ERROR_RENDERED="flow_end_generic_error_rendered",t.FLOW_END_FALLBACK_CLOSED_UI_RENDERED="flow_end_fallback_closed_ui_rendered",t.FLOW_END_APP_RENDERED="flow_end_app_rendered",t}({}),Ln=function(t){return t.CREATED="CREATED",t.SUBMITTED="SUBMITTED",t.IN_PROGRESS="IN_PROGRESS",t.PREPARED="PREPARED",t.PENDING_CONFIRMATION="PENDING_CONFIRMATION",t.AUTHORIZED="AUTHORIZED",t.EXPIRED="EXPIRED",t.CANCELED="CANCELED",t}({}),Bn=function(t){return t[t.CHECKOUT=mn.CHECKOUT]="CHECKOUT",t[t.CONTINUE=mn.CONTINUE]="CONTINUE",t[t.DONATE=mn.DONATE]="DONATE",t[t.PAY=mn.PAY]="PAY",t[t.SUBSCRIBE=mn.SUBSCRIBE]="SUBSCRIBE",t}({}),Nn=function(t){return t.DISABLED="disabled",t.LOADING="loading",t}({}),Sn=function(t){return t.UPDATE="update",t.SHIPPINGADDRESSCHANGE="shippingaddresschange",t.SHIPPINGOPTIONSELECT="shippingoptionselect",t}({}),Zn=[200,400,800,1600,3200,6400],_n=function(t){return t.AUD="AUD",t.EUR="EUR",t.CAD="CAD",t.CZK="CZK",t.DKK="DKK",t.HUF="HUF",t.MXN="MXN",t.NZD="NZD",t.NOK="NOK",t.PLN="PLN",t.RON="RON",t.SEK="SEK",t.CHF="CHF",t.GBP="GBP",t.USD="USD",t}({}),Qn=function(t){return t.AT="AT",t.AU="AU",t.BE="BE",t.CA="CA",t.CH="CH",t.CZ="CZ",t.DE="DE",t.DK="DK",t.ES="ES",t.FI="FI",t.FR="FR",t.GB="GB",t.GR="GR",t.HU="HU",t.IE="IE",t.IT="IT",t.MX="MX",t.NL="NL",t.NO="NO",t.NZ="NZ",t.PL="PL",t.PT="PT",t.RO="RO",t.SE="SE",t.US="US",t}({});function jn(t){return jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jn(t)}function Rn(t){var e="function"==typeof Map?new Map:void 0;return Rn=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Xn())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Wn(o,n.prototype),o}(t,arguments,Fn(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Wn(n,t)},Rn(t)}function Xn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xn=function(){return!!t})()}function Wn(t,e){return Wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wn(t,e)}function Fn(t){return Fn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fn(t)}var Un,Dn=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Fn(e),function(t,e){if(e&&("object"==jn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Xn()?Reflect.construct(e,n||[],Fn(t).constructor):e.apply(t,n))}(this,e)).message="".concat(t.status," ").concat(t.statusText),n.status=t.status,n.statusText=t.statusText,n.response=t.response,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wn(t,e)}(e,Rn(Error)),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}();function Tn(t){return Tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tn(t)}function Yn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pn(t){for(var e=1;e|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,zn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,qn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Kn="?",$n=/^(?:(\w+):)\/\/(?:([\w-]+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function tr(t){return(t&&t.message||"No error message").split("\n").filter((function(t){return!!t}))[0]}function er(t){try{var e=function(t){if(!t.stack)return null;for(var e,n,r=[],o=t.stack.split("\n"),i=0;it.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&void 0!==arguments[1]?arguments[1]:br();!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=fr(this,e,[t])).options=t,n.window=r,n.destroyed=!1,n._state={};var o=n.options||{},i=o.plugins,a=void 0===i?[]:i,c=o.beforeSend,u=void 0===c?function(t){return t}:c,s=o.beforeBreadcrumb,l=void 0===s?function(t){return t}:s,f=o.blacklistUrls,p=void 0===f?[]:f,h=o.ignoreErrors,d=void 0===h?[]:h,g=o.release,y=void 0===g?void 0:g;return n.plugins=a.map((function(t){return new t(n)})),n.beforeSend=u,n.beforeBreadcrumb=l,n.blacklistUrls=p,n.ignoreErrors=d,n.release=y,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gr(t,e)}(e,nr),n=e,(r=[{key:"state",get:function(){return this._state}},{key:"clearState",value:function(){this._state={}}},{key:"setTags",value:function(t){return this.setKeyState("tags",cr({},t)),this}},{key:"setTag",value:function(t,e){return this.extendState({tags:ur({},t,e)}),this}},{key:"setExtra",value:function(t,e){return this.extendState({extra:ur({},t,e)}),this}},{key:"setExtras",value:function(t){return this.setKeyState("extra",cr({},t)),this}},{key:"setUser",value:function(t){return this.setKeyState("user",t?cr({},t):void 0),this}},{key:"clone",value:function(){var t=new e(cr(cr({},this.options),{},{plugins:[]}));return t.extendState(this.state),t}},{key:"withScope",value:function(t){var e=this.clone();t(e),e.destroy(),this.setBreadcrumbs(void 0)}},{key:"addBreadcrumb",value:function(t){var e=this.beforeBreadcrumb(t);e&&this.extendState({breadcrumbs:[cr({timestamp:Date.now()/1e3},e)]})}},{key:"setBreadcrumbs",value:function(t){this.setKeyState("breadcrumbs",t)}},{key:"captureMessage",value:function(t,e){this.send(cr(cr({},this.getRequestBlank()),{},{message:t,level:e}))}},{key:"destroy",value:function(){this.destroyed=!0,this.plugins.forEach((function(t){t.destroy&&t.destroy()}))}},{key:"isIgnoredError",value:function(t){var e=this;return!!this.ignoreErrors.length&&this.getPossibleEventMessages(t).some((function(t){return e.ignoreErrors.some((function(e){return yr(t,e)}))}))}},{key:"extractQueryString",value:function(t){var e=t;if(e){e.startsWith("/")&&(e="http://prefix".concat(e));try{var n=new URL(e).search.slice(1);return n.length?n:void 0}catch(t){return}}}},{key:"getRequestBlank",value:function(){var t=this.window.location.toString();return cr(cr({request:{url:t,query_string:this.extractQueryString(t),headers:{"User-Agent":this.window.navigator.userAgent}}},hr(dr(e.prototype),"getRequestBlank",this).call(this)),{},{sdk:{name:"micro-sentry.javascript.browser",version:"0.0.0"}},this.state)}},{key:"send",value:function(t){if(!(this.destroyed||this.isDeniedUrl(t)||this.isIgnoredError(t))){var n=this.beforeSend(cr({release:this.release},t));n&&(hr(dr(e.prototype),"send",this).call(this,n),this.setBreadcrumbs(void 0))}}},{key:"getPossibleEventMessages",value:function(t){if(t.message)return[t.message];if(t.exception)try{var e=t.exception.values&&t.exception.values[0]||{},n=e.type,r=void 0===n?"":n,o=e.value,i=void 0===o?"":o;return["".concat(i),"".concat(r,": ").concat(i)]}catch(t){return[]}return[]}},{key:"isDeniedUrl",value:function(t){if(!this.blacklistUrls.length)return!1;var e=this.getEventFilterUrl(t);return!!e&&this.blacklistUrls.some((function(t){return yr(e,t)}))}},{key:"getEventFilterUrl",value:function(t){try{if(t.exception){var e=t.exception.values&&t.exception.values[0].stacktrace&&t.exception.values[0].stacktrace.frames;return e&&e[e.length-1].filename||null}return null}catch(t){return null}}},{key:"extendState",value:function(t){var e=this;this._state=Object.keys(t).reduce((function(n,r){var o=e._state[r],i=Array.isArray(o)?o:null,a=t[r],c=Array.isArray(a)?a:null;return cr(cr({},n),{},ur({},r,i||c?[].concat(or(i||[]),or(c||[])):cr(cr({},"string"!=typeof o?o:{}),"string"!=typeof a?a:{})))}),this._state)}},{key:"setKeyState",value:function(t,e){this._state[t]=e}}])&&sr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(),mr=function(t){return t.SENTRY_NOT_CONFIGURED="sentry_not_configured",t}({}),Ir=function(t){return t.websdk="websdk",t.osm="osm-client-script",t.identitySdk="sign-in-with-klarna",t}({});const xr={create:function(t,e){(new t.Image).src=e}},wr={create:function(t,e,n){t.navigator.sendBeacon(e,JSON.stringify(n))}};var Cr=0,Ar=0,Gr=1,Er=2,Or=3,kr=4,Lr=5,Br=6;function Nr(t){return Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nr(t)}var Sr=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Er;a1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e)}};return{configure:function(e){var r=e.options,o=e.data,i=void 0===o?{}:o,a=e.instanceId,c=void 0===a?void 0:a;n=i,Wr[t]||(Wr[t]=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if("object"!==(void 0===t?"undefined":Zr(t))||!t)throw new TypeError("expected configuration object");var n=t.baseUrl,r=void 0===n?"https://eu.klarnaevt.com":n,o=t.client,i=t.clientVersion,a=t.sessionId,c=t.commonData,u=void 0===c?{}:c,s=t.instanceId,l=void 0===s?Math.floor(9e3*Math.random())+1e3:s,f=t.logLevel||Cr;if("string"!=typeof o)throw new TypeError("expected `client` in the configuration object");if("string"!=typeof i)throw new TypeError("expected `clientVersion` in the configuration object");if("string"!=typeof a)throw new TypeError("expected `sessionId` in the configuration object");if("number"!=typeof f||fBr)throw new TypeError("invalid `logLevel` ("+f+")");function p(t){return Object.keys(t).sort().map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")}function h(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments[2];if(!(f>(arguments.length>3&&void 0!==arguments[3]?arguments[3]:Cr))){if(!t)throw new TypeError("expected `name` as first parameter");var s=function(t,e){return""+r+_r+o+"/"+i+"/"+t+"?"+p(e)}(t,n=Sr({},u,n,{iid:l,sid:a,timestamp:n.timestamp||(new Date).getTime()}));try{wr.create(e,s,c)}catch(t){c&&(s+="&"+p(c)),xr.create(e,s)}}}return{event:h,trace:function(t,e,n){h(t,e,n,Ar)},debug:function(t,e,n){h(t,e,n,Gr)},info:function(t,e,n){h(t,e,n,Er)},warn:function(t,e,n){h(t,e,n,Or)},error:function(t,e,n){h(t,e,n,kr)},fatal:function(t,e,n){h(t,e,n,Lr)},setLogLevel:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Cr;if("number"!=typeof t||tBr)throw new TypeError("invalid `logLevel` ("+t+")");f=t},getConfig:function(){return{baseUrl:r,client:o,clientVersion:i,sessionId:a,instanceId:l,logLevel:f}}}}(Ur(Rr(Rr({},r),{},{instanceId:c}))))},event:r,trace:o(r,Ar),debug:o(r,Gr),info:o(r,Er),warn:o(r,Or),error:o(r,kr),fatal:o(r,Lr),setLogLevel:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ALL";try{var r=n.toUpperCase();e=r in u?u[r]:Cr,Wr[t]&&Wr[t].setLogLevel(e)}catch(t){}},removeInstance:function(){Wr[t]&&delete Wr[t]}}}var Ur=function(t){var e=t.client,n=void 0===e?"sdk":e,r=t.clientVersion,o=void 0===r?"":r,i=t.sessionId,a=void 0===i?"":i,c=t.instanceId,u=t.baseUrl;return{client:n,clientVersion:o,environment:"production",sessionId:a,instanceId:c,baseUrl:void 0===u?"":u}},Dr=[],Tr=function(t){var e,n=!1;return null===(e=t.exception)||void 0===e||null===(e=e.values)||void 0===e||e.forEach((function(t){var e=t.value;Dr.forEach((function(t){e.includes(t)&&(n=!0)}))})),n?null:t},Yr=function(t){return t.sessionStorageNotSupported="sessionStorage-not-supported",t.localStorageNotSupported="localStorage-not-supported",t.dynamicImportFailed="dynamic-import-failed",t.multipleCustomElementsWithSameTagName="multiple-custom-elements-same-tag-name",t.unexpectedTokenMethodParamsList="unexpected-token-method-params-list",t.missingColonAfterPropertyId="missing-colon-after-property-id",t.unexpectedTokenEqual="unexpected-token-equal",t.expectedExpressionGotEqual="expected-expression-got-equal",t.performanceNotDefined="performance-is-not-defined",t.undefinedIsNotAnObjectRenderOptions="undefined-is-not-an-object-render-options",t.renderOptionsIsUndefined="render-options-is-undefined",t.nullIsNotAnObjectParentNodeInsertBefore="null-is-not-an-object-parent-node-insert-before",t.failedToFetchOSMAPI="failed-to-fetch-osm-api",t.cannotReadPropertiesOfNull="cannot-read-properties-of-null",t.failedToExecuteInvokeOnCreateHTMLCallback="failed-to-execute-invoke-on-create-html-callback",t.performanceMarkIsNotAFunction="performance-mark-is-not-a-function",t.backendBridgeInitFailed="backend-bridge-init-failed",t.globalThisIsNotDefined="globalThisIsNotDefined",t.identityNaClientIdsNotFound="identity-na-client-ids-not-found",t.chunkLoadErrorObjectNotExtensible="chunk-load-error-object-not-extensible",t}(Yr||{}),Pr=["https://s3.int.klarna.net","https://js.klarna.com","https://x.klarnacdn.net","https://x.nonprod.us1.js.klarna.net","https://osm.klarnaservices.com","https://eu-assets.playground.klarnaservices.com","https://na-assets.playground.klarnaservices.com","https://ap-assets.playground.klarnaservices.com"],Mr=function(t){return Pr.some((function(e){return t.startsWith(e)}))},Vr={INIT:5,MERCHANT_WARN:5},Hr=function(t){return 100*Math.random()t.length)&&(e=t.length);for(var n=0,r=Array(e);n2&&void 0!==arguments[2]?arguments[2]:Ir.websdk);try{n.event("error",{message:e,name_1:t})}catch(t){}}(mr.SENTRY_NOT_CONFIGURED,"Sentry client not initialized"),$r)},eo=function(t){return Kr||(Kr=function(t){return new vr({dsn:"https://6fdc8e6e634d4a998b6f0dbfd7b025e1@o24547.ingest.sentry.io/4505471301713920",release:t.version,environment:t.environment,beforeSend:function(t){var e;null===(e=t.exception)||void 0===e||null===(e=e.values)||void 0===e||e.forEach((function(e){var n=e.value;t.fingerprint=function(t){var e,n,r,o,i,a,c,u,s,l,f,p,h,d,g,y,b;switch(t){case"Storage type: sessionStorage not supported":return[Yr.sessionStorageNotSupported];case"Storage type: localStorage not supported":return[Yr.localStorageNotSupported];case"Cannot define multiple custom elements with the same tag name":return[Yr.multipleCustomElementsWithSameTagName];case"Unexpected token ';'. Expected an opening '(' before a method's parameter list.":return[Yr.unexpectedTokenMethodParamsList];case null===(e=t.match(/Failed to fetch dynamically imported module/))||void 0===e?void 0:e.input:return[Yr.dynamicImportFailed];case null===(n=t.match("missing : after property id"))||void 0===n?void 0:n.input:return[Yr.missingColonAfterPropertyId];case null===(r=t.match("Unexpected token '='"))||void 0===r?void 0:r.input:return[Yr.unexpectedTokenEqual];case null===(o=t.match("expected expression, got '='"))||void 0===o?void 0:o.input:return[Yr.expectedExpressionGotEqual];case null===(i=t.match(/error loading dynamically imported module/))||void 0===i?void 0:i.input:return[Yr.dynamicImportFailed];case null===(a=t.match(/performance is not defined/))||void 0===a?void 0:a.input:return[Yr.performanceNotDefined];case null===(c=t.match(/performance?.mark is not a function/))||void 0===c?void 0:c.input:return[Yr.performanceMarkIsNotAFunction];case null===(u=t.match(/undefined is not an object (evaluating 'this.renderOptions.renderBefore')/))||void 0===u?void 0:u.input:return[Yr.undefinedIsNotAnObjectRenderOptions];case null===(s=t.match(/this.renderOptions is undefined/))||void 0===s?void 0:s.input:return[Yr.renderOptionsIsUndefined];case null===(l=t.match(/Cannot read properties of null (reading 'insertBefore')/))||void 0===l?void 0:l.input:return[Yr.cannotReadPropertiesOfNull];case null===(f=t.match(/null is not an object (evaluating 'this._$AA.parentNode.insertBefore')/))||void 0===f?void 0:f.input:return[Yr.nullIsNotAnObjectParentNodeInsertBefore];case null===(p=t.match(/Failed to execute 'invoke' on 'CreateHTMLCallback': The provided callback is no longer runnable./))||void 0===p?void 0:p.input:return[Yr.failedToExecuteInvokeOnCreateHTMLCallback];case null===(h=t.match("Failed to fetch: GET https://js.klarna.com/na/cma/"))||void 0===h?void 0:h.input:return[Yr.failedToFetchOSMAPI];case null===(d=t.match("BackendBridge: init failed"))||void 0===d?void 0:d.input:return[Yr.backendBridgeInitFailed];case null===(g=t.match("globalThis is not defined"))||void 0===g?void 0:g.input:return[Yr.globalThisIsNotDefined];case null===(y=t.match("Identity naClientIds list not found"))||void 0===y?void 0:y.input:return[Yr.identityNaClientIdsNotFound];case null===(b=t.match("Cannot add property timelineEnd, object is not extensible"))||void 0===b?void 0:b.input:return[Yr.chunkLoadErrorObjectNotExtensible]}}(n)}));var n,r,o=function(t){var e,n=!0;return null===(e=t.exception)||void 0===e||null===(e=e.values)||void 0===e||e.forEach((function(t){var e,r=t.stacktrace;null==r||null===(e=r.frames)||void 0===e||e.forEach((function(t){var e=t.filename;n=!Mr(e)}))})),n?null:t}(t);return o?(n=zr,r=Tr,function(t){return n(r(t))})(o):null},blacklistUrls:[/pagead\/js/i,/graph\.facebook\.com/i,/connect\.facebook\.net\/en_US\/all\.js/i,/extensions\//i,/^chrome:\/\//i,/metrics\.itunes\.apple\.com\.edgesuite\.net\//i]})}(t)),t.tags&&Object.entries(t.tags).forEach((function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(e,n)||function(t,e){if(t){if("string"==typeof t)return qr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qr(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],i=r[1];i&&Kr.setTag(o,i.toString())})),Kr},no=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o1&&void 0!==arguments[1]?arguments[1]:0;return Ao[t[e+0]]+Ao[t[e+1]]+Ao[t[e+2]]+Ao[t[e+3]]+"-"+Ao[t[e+4]]+Ao[t[e+5]]+"-"+Ao[t[e+6]]+Ao[t[e+7]]+"-"+Ao[t[e+8]]+Ao[t[e+9]]+"-"+Ao[t[e+10]]+Ao[t[e+11]]+Ao[t[e+12]]+Ao[t[e+13]]+Ao[t[e+14]]+Ao[t[e+15]]}(r)};function Oo(t){return Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oo(t)}function ko(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Lo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Oo(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Oo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Oo(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Bo,No=function(t){var e=function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:_o).includes(t.toLowerCase())},Po={africa:"eu",america:"na",antarctica:"na",arctic:"na",asia:"oc",atlantic:"na",australia:"oc",europe:"eu",indian:"oc",pacific:"na"},Mo=function(){var t=Intl.DateTimeFormat().resolvedOptions().timeZone;if(t){var e=t.split("/")[0].toLowerCase();if(e in Po)return Po[e]}return mo("Provided region is not supported - defaulting region to ".concat("eu")),"eu"},Vo={eu:"en-GB",na:"en-US",oc:"en-AU"},Ho=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.locale,r=void 0===n?"":n,o=e.win,i=void 0===o?window:o,a=e.allowFallback,c=void 0===a||a;r&&(r=r.replace("_","-"));var u=r.split("-");if(r=u.length>1?"".concat(u[0].toLowerCase(),"-").concat(u[1].toUpperCase()):"",Yo(r))return r;if(c){var s,l=null===(t=i.navigator)||void 0===t?void 0:t.language;if((s=l)&&_o.filter((function(t){return t.startsWith(s.toLowerCase())})).length>0)return l;var f=Mo();return Vo[f]}},Jo={at:"eu",au:"oc",be:"eu",ca:"na",ch:"eu",cz:"eu",de:"eu",dk:"eu",es:"eu",fi:"eu",fr:"eu",gb:"eu",gr:"eu",ie:"eu",it:"eu",mx:"na",nl:"eu",no:"eu",nz:"oc",pl:"eu",pt:"eu",ro:"eu",se:"eu",sk:"eu",us:"na",hu:"eu"},zo=function(t){if(t&&(t=t.replace("_","-")),t&&Yo(t)){var e=t.split("-")[1].toLowerCase();if(e in Jo)return Jo[e]}var n=Mo();return mo("Provided locale is not supported - defaulting region to ".concat(n)),n},qo=function(t){var e=t.paymentRequestId,n=t.currency,r=t.locale;if(e&&e.split(":").length>=3){var o=e.split(":")[2].substring(0,2);return"us"===o?"na":"ap"===o?"oc":o}return n?function(t){return"USD"===t?"na":"eu"}(n):zo(r)},Ko=function(t){var e=t.environment,n=t.locale,r=t.currency,o=Ho({locale:n}),i=qo({currency:r,locale:o});return"https://".concat(i,"playground"===e?".playground.klarnaevt.com":".klarnaevt.com")},$o=function(t){var e=t.config,n=t.trackerClient,r=t.extraTrackingData,o=t.locale,i=e.version,a=e.environment,c=e.sessionId,u=Fr(n),s=No({clientId:null==r?void 0:r.clientId,accountId:null==r?void 0:r.accountId,additionalIdentifier:null==r?void 0:r.additionalIdentifier,sdk:"websdk",aId:null==r?void 0:r.aId});return u.configure({options:{client:n,clientVersion:i,sessionId:c,baseUrl:Ko({environment:a,locale:o})},data:s}),u};function ti(t){return ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ti(t)}function ei(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);n=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function da(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function ga(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){da(i,r,o,a,c,"next",t)}function c(t){da(i,r,o,a,c,"throw",t)}a(void 0)}))}}function ya(t,e){for(var n=0;n1&&void 0!==r[1]?r[1]:"",t.abrupt("return",new Promise((function(t,r){e&&""!==e||r(new Error("BackendBridge: baseUrl missing"));try{var o="".concat(e,"backend_bridge_iframe.html"),i=document.querySelector("#".concat(va).concat(n));i&&t({target:i,src:o});var a=document.createElement("iframe");a.src=o,a.id="".concat(va).concat(n),a.style.cssText="display:none!important",document.body.appendChild(a),a.onload=function(){return t({target:a,src:o})}}catch(t){r(t)}})));case 2:case"end":return t.stop()}}),t)}))),function(t){return o.apply(this,arguments)})},{key:"configure",value:(r=ga(ha().mark((function t(e,n){return ha().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.config=e,this.tracker=n;case 2:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"init",value:(n=ga(ha().mark((function t(){var e,n;return ha().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config){t.next=2;break}throw new $i(Cn.TECHNICAL_ERROR,An.INTERNAL_ERROR,"BackendBridge: config missing");case 2:return this.status="initialized",this.tracker.event("backend_bridge_init",fa({},this.config)),t.next=6,this.createTarget(this.config.baseUrl,this.config.clientInstanceName);case 6:return e=t.sent,n=e.target,this.messenger=new hn({source:window,target:n}),t.next=11,this.messenger.initiateHandshake();case 11:return t.next=13,this.call({method:"setupApiCredentials",data:this.config});case 13:this.status="initialized";case 14:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"call",value:(e=ga(ha().mark((function t(e){var n;return ha().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("initializing"!==this.status){t.next=3;break}return t.next=3,this.waitForInitialization();case 3:if("uninitialized"!==this.status){t.next=6;break}return t.next=6,this.init();case 6:if(!1!==(n=ua[e.method].data.safeParse(e.data)).success){t.next=9;break}throw new $i(Cn.TECHNICAL_ERROR,An.INTERNAL_ERROR,"Invalid request",n.error);case 9:return t.abrupt("return",this.messenger.postMessageToTarget({method:e.method,data:n.data}).then((function(t){var n=ua[e.method].response.safeParse(t);if(!1===n.success)throw new $i(Cn.TECHNICAL_ERROR,An.INTERNAL_ERROR,"Invalid response",n.error);return n.data})).catch((function(t){throw Object.prototype.hasOwnProperty.call(t,"status")&&Object.prototype.hasOwnProperty.call(t,"statusText")&&Object.prototype.hasOwnProperty.call(t,"response")?new Dn(t):new $i(Cn.TECHNICAL_ERROR,t,t)})));case 10:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new t),this.instance}}]);var e,n,r,o}(),Ia=ma.getInstance(),xa=o(5890),wa=o(562);function Ca(t){return Ca="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ca(t)}function Aa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ga(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:window;if(null==e||!e.sessionStorage)throw new Error("client does not support ".concat(Qa.sessionStorage));var n=function(){return JSON.parse(e.sessionStorage.getItem(t)||"{}")},r={get:function(t){var e=n();return(null==e?void 0:e[t])||null},set:function(r,o){var i=n();return null===o?delete i[r]:i[r]=o,e.sessionStorage.setItem(t,JSON.stringify(i))},remove:function(t){return r.set(t,null)},flush:function(){return e.sessionStorage.removeItem(t)}};return r}(e)}catch(t){Za("Storage type: sessionStorage not supported")}},Ra=ja("identity-api"),Xa="klarna-sign-in-code-verifier",Wa="klarna-sign-in-nonce",Fa="klarna-sign-in-state",Ua="klarna-sign-in-session-id",Da="klarna-sign-in-redirect-uris";function Ta(t){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ta(t)}function Ya(t){var e="function"==typeof Map?new Map:void 0;return Ya=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Pa())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Ma(o,n.prototype),o}(t,arguments,Va(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ma(n,t)},Ya(t)}function Pa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Pa=function(){return!!t})()}function Ma(t,e){return Ma=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ma(t,e)}function Va(t){return Va=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Va(t)}var Ha=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Va(e),function(t,e){if(e&&("object"==Ta(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Pa()?Reflect.construct(e,n||[],Va(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ma(t,e)}(e,Ya(Error)),function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}(e)}(),Ja=["errorTitle"];function za(){za=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),c=new L(r||[]);return o(a,"_invoke",{value:G(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="executing",d="completed",g={};function y(){}function b(){}function v(){}var m={};s(m,a,(function(){return this}));var I=Object.getPrototypeOf,x=I&&I(I(B([])));x&&x!==n&&r.call(x,a)&&(m=x);var w=v.prototype=y.prototype=Object.create(m);function C(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==qa(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function G(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=E(c,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?d:"suspendedYield",s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=d,r.method="throw",r.arg=s.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function qa(t){return qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qa(t)}function Ka(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}var $a="Invalid AuthorizationCodeOpenID Response",tc="Could not create Authorization Server",ec=function(){var t,e=(t=za().mark((function t(e){return za().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e instanceof Error)){t.next=2;break}return t.abrupt("return",e);case 2:if("object"!==qa(e)||null===e||!("message"in e)||"string"!=typeof e.message){t.next=4;break}return t.abrupt("return",new Error(e.message));case 4:if(!(e&&"object"===qa(e)&&"json"in e&&"bodyUsed"in e&&"function"==typeof e.json)){t.next=20;break}if(t.prev=5,!e.bodyUsed||!("body"in e)){t.next=8;break}return t.abrupt("return",new Error(Buffer.from(e.body).toString("utf-8")));case 8:return t.t0=Error,t.t1=JSON,t.next=12,e.json();case 12:return t.t2=t.sent,t.t3=t.t1.stringify.call(t.t1,t.t2),t.abrupt("return",new t.t0(t.t3));case 17:return t.prev=17,t.t4=t.catch(5),t.abrupt("return",t.t4);case 20:return t.prev=20,t.abrupt("return",new Error(JSON.stringify(e)));case 24:return t.prev=24,t.t5=t.catch(20),t.abrupt("return",new Error(String(e)));case 27:case"end":return t.stop()}}),t,null,[[5,17],[20,24]])})),function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ka(i,r,o,a,c,"next",t)}function c(t){Ka(i,r,o,a,c,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}(),nc=function(t,e){var n=e.errorTitle,r=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,Ja);ec(t).then((function(t){if(t instanceof Ha)t.message;else{var e=to(),o=Ra.get(Ua);r&&e.setExtras(r),e.setExtra("errorTitle",n),e.setExtra("sessionId",o),e.report(t),Sa.sendEvent({name:"unexpected_error",options:{errorTitle:n,funnelId:o}}),t.message}}))};function rc(t){return rc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rc(t)}function oc(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=e.locale,r=e.params,o=n||Cc(),i=kc[t][o];return r&&i&&(i=Ac(i,r).join("")),i},Bc=o(8091),Nc=o(5542),Sc=(0,Bc.qy)(Oc||(Oc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['\n \n \n \n \n'])));const Zc=Sc;var _c,Qc=(0,Bc.qy)(_c||(_c=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}([' \n \n \n \n \n \n \n \n \n \n'])));const jc=Qc,Rc=Bc.AH`:root{--current-gap: 0px}:host{width:335px;height:48px;display:inline-block}#klarna-identity-button{container-type:inline-size;container-name:identity-button-content;position:relative;height:inherit;width:inherit;min-height:35px;max-height:60px;padding:0;outline:none;border:0;margin:0;background-color:rgba(0,0,0,0)}#klarna-identity-button:focus #klarna-identity-button__outline{position:absolute;inset:-4px;border:2px solid #0d0e0f;border-radius:8px;min-height:inherit;max-height:64px;margin:auto 0}#klarna-identity-button #klarna-identity-button__inner-container{display:inline-block;min-height:inherit;max-height:inherit;min-width:min-content;width:inherit;height:inherit;cursor:pointer;transition:background-color .2s ease;box-sizing:border-box;border-radius:8px}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text{font-family:"-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Arial","sans-serif";font-weight:500;height:inherit;font-size:16px;opacity:1;transition:color .2s ease;text-rendering:optimizeLegibility;white-space:nowrap;max-height:inherit;min-height:inherit;position:relative;display:flex;justify-content:center;align-items:center;--current-gap: 14px;gap:var(--current-gap);margin:0 var(--current-gap) 0 var(--current-gap)}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text.hidden{opacity:0}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text--center{display:flex;justify-content:center;align-items:center}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text--center #logo{margin-right:16px}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #logo{width:24px;height:24px}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{width:inherit;height:inherit}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #badge{width:64px;height:28px;margin-left:6px}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #badge svg{width:inherit;height:inherit}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #copy{flex:1 1 0%;margin-right:calc(var(--current-gap) + 20px)}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #copy--center{flex:0 1 0%}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #copy--right{flex:1 1 0%;margin-left:calc(var(--current-gap) + 20px)}@container identity-button-content (width < 250px){#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text{font-size:12px;--current-gap: 8px}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text--center #logo{margin-right:12px}}@container identity-button-content (width < 195px){#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #copy{font-size:12px;margin-right:0px}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text--center #logo{margin-right:6px}}#klarna-identity-button.theme-outlined #klarna-identity-button__inner-container{color:#0e0e0f;background-color:#fff;border:1px solid #0e0e0f}#klarna-identity-button.theme-outlined #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#0e0e0f}#klarna-identity-button.theme-outlined:hover #klarna-identity-button__inner-container{background-color:#f1f1f1;color:#333536}#klarna-identity-button.theme-outlined:hover #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#333536}#klarna-identity-button.theme-outlined:focus #klarna-identity-button__outline{inset:-5px}#klarna-identity-button.theme-outlined:focus #klarna-identity-button__outline #klarna-identity-button__text #logo svg{fill:#0d0e0f}#klarna-identity-button.theme-outlined:active #klarna-identity-button__inner-container{background-color:#e2e2e2;color:#0d0e0f}#klarna-identity-button.theme-light #klarna-identity-button__inner-container{color:#0e0e0f;background-color:#fff}#klarna-identity-button.theme-light #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#0e0e0f}#klarna-identity-button.theme-light:hover #klarna-identity-button__inner-container{background-color:#f1f1f1;color:#333536}#klarna-identity-button.theme-light:hover #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#333536}#klarna-identity-button.theme-light:focus #klarna-identity-button__outline{inset:-5px}#klarna-identity-button.theme-light:focus #klarna-identity-button__outline #klarna-identity-button__text #logo svg{fill:#0d0e0f}#klarna-identity-button.theme-light:active #klarna-sign-in__inner-container{background-color:#e2e2e2;color:#0d0e0f}#klarna-identity-button.theme-dark #klarna-identity-button__inner-container{color:#fff;background-color:#0e0e0f;border:none}#klarna-identity-button.theme-dark #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#fff}#klarna-identity-button.theme-dark:hover #klarna-identity-button__inner-container{background-color:#333536;color:#f1f1f1}#klarna-identity-button.theme-dark:hover #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#f1f1f1}#klarna-identity-button.theme-dark:active #klarna-identity-button__inner-container{background-color:#0d0e0f;color:#e2e2e2}#klarna-identity-button.theme-dark:active #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#e2e2e2}#klarna-identity-button.shape-rect #klarna-identity-button__inner-container{border-radius:0}#klarna-identity-button.shape-rect:focus #klarna-identity-button__outline{border-radius:0}#klarna-identity-button.shape-pill #klarna-identity-button__inner-container{border-radius:60px}#klarna-identity-button.shape-pill:focus #klarna-identity-button__outline{border-radius:60px}#klarna-identity-button.copy-default-en{min-width:165px}#klarna-identity-button__spinner{width:24px;height:24px;border:2px solid;border-bottom-color:rgba(0,0,0,0);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite;position:absolute;top:calc(50% - 12px);right:calc(50% - 12px);pointer-events:none}.theme-outlined #klarna-identity-button__spinner{border-color:#0e0e0f;border-bottom-color:#fff}.theme-dark #klarna-identity-button__spinner{border-color:#fff;border-bottom-color:#0e0e0f}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}} /*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uLy4uL2tsYXJuYS1pZGVudGl0eS9zcmMva2xhcm5hSWRlbnRpdHlCdXR0b24vc3R5bGUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3QkEsTUFDRSxrQkFBQSxDQUtGLE1BQ0UsV0FBQSxDQUNBLFdBQUEsQ0FDQSxvQkFBQSxDQUlGLHdCQUNFLDBCQUFBLENBQ0Esc0NBQUEsQ0FDQSxpQkFBQSxDQUNBLGNBQUEsQ0FDQSxhQUFBLENBQ0EsZUFBQSxDQUNBLGVBQUEsQ0FDQSxTQUFBLENBQ0EsWUFBQSxDQUNBLFFBQUEsQ0FDQSxRQUFBLENBQ0EsOEJBQUEsQ0FHRSwrREFDRSxpQkFBQSxDQUNBLFVBQUEsQ0FDQSx3QkFBQSxDQUNBLGlCQXBDVyxDQXFDWCxrQkFBQSxDQUNBLGVBQUEsQ0FDQSxhQUFBLENBSUosaUVBQ0Usb0JBQUEsQ0FDQSxrQkFBQSxDQUNBLGtCQUFBLENBQ0EscUJBQUEsQ0FDQSxhQUFBLENBQ0EsY0FBQSxDQUNBLGNBQUEsQ0FDQSxvQ0FBQSxDQUNBLHFCQUFBLENBQ0EsaUJBckRhLENBdURiLCtGQUNFLHlGQUFBLENBRUEsZUFBQSxDQUNBLGNBQUEsQ0FDQSxjQUFBLENBQ0EsU0FBQSxDQUNBLHlCQUFBLENBQ0EsaUNBQUEsQ0FDQSxrQkFBQSxDQUNBLGtCQUFBLENBQ0Esa0JBQUEsQ0FDQSxpQkFBQSxDQUNBLFlBQUEsQ0FDQSxzQkFBQSxDQUNBLGtCQUFBLENBQ0EsbUJBQUEsQ0FDQSxzQkFBQSxDQUNBLGdEQUFBLENBRUEsc0dBQ0UsU0FBQSxDQUdGLHVHQUNFLFlBQUEsQ0FDQSxzQkFBQSxDQUNBLGtCQUFBLENBRUEsNkdBQ0UsaUJBQUEsQ0FJSixxR0FDRSxVQUFBLENBQ0EsV0FBQSxDQUVBLHlHQUNFLGFBQUEsQ0FDQSxjQUFBLENBSUosc0dBQ0UsVUFBQSxDQUNBLFdBQUEsQ0FDQSxlQUFBLENBRUEsMEdBQ0UsYUFBQSxDQUNBLGNBQUEsQ0FJSixxR0FDRSxXQUFBLENBQ0EsNENBQUEsQ0FFQSw2R0FDRSxXQUFBLENBR0YsNEdBQ0UsV0FBQSxDQUNBLDJDQUFBLENBUVYsbURBR00sK0ZBQ0UsY0FBQSxDQUNBLGtCQUFBLENBR0UsNkdBQ0UsaUJBQUEsQ0FBQSxDQVFaLG1EQUlRLHFHQUNFLGNBQUEsQ0FDQSxnQkFBQSxDQUlBLDZHQUNFLGdCQUFBLENBQUEsQ0FVVixnRkFDRSxhQXRMWSxDQXVMWixxQkE3S1ksQ0E4S1osd0JBQUEsQ0FJSSx3SEFDRSxZQTdMTSxDQW9NWixzRkFDRSx3QkExTFEsQ0EyTFIsYUFyTVEsQ0F5TUosOEhBQ0UsWUExTUUsQ0FrTlYsOEVBQ0UsVUFBQSxDQUlJLHNIQUNFLFlBdk5HLENBK05YLHVGQUNFLHdCQXROUyxDQXVOVCxhQWpPUyxDQXVPYiw2RUFDRSxhQTFPWSxDQTJPWixxQkFqT1ksQ0FxT1IscUhBQ0UsWUFoUE0sQ0F1UFosbUZBQ0Usd0JBN09RLENBOE9SLGFBeFBRLENBNFBKLDJIQUNFLFlBN1BFLENBcVFWLDJFQUNFLFVBQUEsQ0FJSSxtSEFDRSxZQTFRRyxDQWtSWCw0RUFDRSx3QkF6UVMsQ0EwUVQsYUFwUlMsQ0EwUmIsNEVBQ0UsVUFuUlksQ0FvUlosd0JBOVJZLENBK1JaLFdBQUEsQ0FJSSxvSEFDRSxTQTFSTSxDQWlTWixrRkFDRSx3QkEzU1EsQ0E0U1IsYUFsU1EsQ0FzU0osMEhBQ0UsWUF2U0UsQ0ErU1YsbUZBQ0Usd0JBelRTLENBMFRULGFBaFRTLENBb1RMLDJIQUNFLFlBclRHLENBK1RiLDRFQUNFLGVBNVRVLENBK1RaLDBFQUNFLGVBaFVVLENBcVVaLDRFQUNFLGtCQXJVVSxDQXdVWiwwRUFDRSxrQkF6VVUsQ0E4VWQsd0NBQ0UsZUFBQSxDQUdGLGlDQUNFLFVBQUEsQ0FDQSxXQUFBLENBQ0EsZ0JBQUEsQ0FDQSxpQ0FBQSxDQUNBLGlCQUFBLENBQ0Esb0JBQUEsQ0FDQSxxQkFBQSxDQUNBLHFDQUFBLENBQ0EsaUJBQUEsQ0FDQSxvQkFBQSxDQUNBLHNCQUFBLENBQ0EsbUJBQUEsQ0FFQSxpREFDRSxvQkFsWFksQ0FtWFosd0JBeldZLENBMldkLDZDQUNFLGlCQTVXWSxDQTZXWiwyQkF2WFksQ0EwWGQsb0JBQ0UsR0FDRSxzQkFBQSxDQUVGLEtBQ0Usd0JBQUEsQ0FBQSIsInNvdXJjZXNDb250ZW50IjpbIi8vIFZhcmlhYmxlcyBmb3IgZWFzZSBvZiBjaGFuZ2VcblxuLy8gQ29sb3JzXG5cbi8vIEJsYWNrXG4kcmVndWxhcl9ibGFjazogIzBlMGUwZjtcbiRob3Zlcl9ibGFjazogIzMzMzUzNjtcbiRhY3RpdmVfYmxhY2s6ICMwZDBlMGY7XG5cbi8vIFBpbmtcbiRyZWd1bGFyX3Bpbms6ICNmZmE4Y2Q7XG4kaG92ZXJfcGluazogI2YwYTViNztcbiRhY3RpdmVfcGluazogI2ZmYThjZDtcblxuLy8gV2hpdGVcbiRyZWd1bGFyX3doaXRlOiAjZmZmZmZmO1xuJGhvdmVyX3doaXRlOiAjZjFmMWYxO1xuJGFjdGl2ZV93aGl0ZTogI2UyZTJlMjtcblxuLy8gU2hhcGVcbiRyYWRpdXNfZGVmYXVsdDogOHB4O1xuJHJhZGl1c19yZWN0OiAwO1xuJHJhZGl1c19waWxsOiA2MHB4O1xuXG46cm9vdCB7XG4gIC0tY3VycmVudC1nYXA6IDBweDtcbn1cblxuLy8gSGVyZSB3ZSBzZXQgdGhlIGtsYXJuYS1pZGVudGl0eS1idXR0b24gY29udGFpbmVyIHRvIGhhdmUgaXRzIGRlZmF1bHQgaGVpZ2h0IGFuZCB3aWR0aC5cbi8vIE1lcmNoYW50cyBjYW4gb3ZlcndyaXRlIHRob3NlIHN0eWxlcyBieSBkZWZpbmluZyBhIG1vcmUgc3BlY2lmaWMgc2VsZWN0b3IsIGUuZy4gYSBjbGFzc1xuOmhvc3Qge1xuICB3aWR0aDogMzM1cHg7XG4gIGhlaWdodDogNDhweDtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xufVxuXG4vLyBEZWZhdWx0IEJ1dHRvblxuI2tsYXJuYS1pZGVudGl0eS1idXR0b24ge1xuICBjb250YWluZXItdHlwZTogaW5saW5lLXNpemU7XG4gIGNvbnRhaW5lci1uYW1lOiBpZGVudGl0eS1idXR0b24tY29udGVudDtcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xuICBoZWlnaHQ6IGluaGVyaXQ7XG4gIHdpZHRoOiBpbmhlcml0O1xuICBtaW4taGVpZ2h0OiAzNXB4O1xuICBtYXgtaGVpZ2h0OiA2MHB4O1xuICBwYWRkaW5nOiAwO1xuICBvdXRsaW5lOiBub25lO1xuICBib3JkZXI6IDA7XG4gIG1hcmdpbjogMDtcbiAgYmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7XG5cbiAgJjpmb2N1cyB7XG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX291dGxpbmUge1xuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgaW5zZXQ6IC00cHg7XG4gICAgICBib3JkZXI6IDJweCBzb2xpZCAkYWN0aXZlX2JsYWNrO1xuICAgICAgYm9yZGVyLXJhZGl1czogJHJhZGl1c19kZWZhdWx0O1xuICAgICAgbWluLWhlaWdodDogaW5oZXJpdDtcbiAgICAgIG1heC1oZWlnaHQ6IDY0cHg7XG4gICAgICBtYXJnaW46IGF1dG8gMDtcbiAgICB9XG4gIH1cblxuICAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9faW5uZXItY29udGFpbmVyIHtcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gICAgbWluLWhlaWdodDogaW5oZXJpdDtcbiAgICBtYXgtaGVpZ2h0OiBpbmhlcml0O1xuICAgIG1pbi13aWR0aDogbWluLWNvbnRlbnQ7XG4gICAgd2lkdGg6IGluaGVyaXQ7XG4gICAgaGVpZ2h0OiBpbmhlcml0O1xuICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICB0cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLWNvbG9yIDAuMnMgZWFzZTtcbiAgICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuICAgIGJvcmRlci1yYWRpdXM6ICRyYWRpdXNfZGVmYXVsdDtcblxuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgIGZvbnQtZmFtaWx5OiAnLWFwcGxlLXN5c3RlbScsICdCbGlua01hY1N5c3RlbUZvbnQnLCAnU2Vnb2UgVUknLCAnUm9ib3RvJywgJ0FyaWFsJyxcbiAgICAgICAgJ3NhbnMtc2VyaWYnO1xuICAgICAgZm9udC13ZWlnaHQ6IDUwMDtcbiAgICAgIGhlaWdodDogaW5oZXJpdDtcbiAgICAgIGZvbnQtc2l6ZTogMTZweDtcbiAgICAgIG9wYWNpdHk6IDE7XG4gICAgICB0cmFuc2l0aW9uOiBjb2xvciAwLjJzIGVhc2U7XG4gICAgICB0ZXh0LXJlbmRlcmluZzogb3B0aW1pemVMZWdpYmlsaXR5O1xuICAgICAgd2hpdGUtc3BhY2U6IG5vd3JhcDtcbiAgICAgIG1heC1oZWlnaHQ6IGluaGVyaXQ7XG4gICAgICBtaW4taGVpZ2h0OiBpbmhlcml0O1xuICAgICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgIC0tY3VycmVudC1nYXA6IDE0cHg7XG4gICAgICBnYXA6IHZhcigtLWN1cnJlbnQtZ2FwKTtcbiAgICAgIG1hcmdpbjogMCB2YXIoLS1jdXJyZW50LWdhcCkgMCB2YXIoLS1jdXJyZW50LWdhcCk7XG5cbiAgICAgICYuaGlkZGVuIHtcbiAgICAgICAgb3BhY2l0eTogMDtcbiAgICAgIH1cblxuICAgICAgJi0tY2VudGVyIHtcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG4gICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5cbiAgICAgICAgI2xvZ28ge1xuICAgICAgICAgIG1hcmdpbi1yaWdodDogMTZweDtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAjbG9nbyB7XG4gICAgICAgIHdpZHRoOiAyNHB4O1xuICAgICAgICBoZWlnaHQ6IDI0cHg7XG5cbiAgICAgICAgc3ZnIHtcbiAgICAgICAgICB3aWR0aDogaW5oZXJpdDtcbiAgICAgICAgICBoZWlnaHQ6IGluaGVyaXQ7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgI2JhZGdlIHtcbiAgICAgICAgd2lkdGg6IDY0cHg7XG4gICAgICAgIGhlaWdodDogMjhweDtcbiAgICAgICAgbWFyZ2luLWxlZnQ6IDZweDtcblxuICAgICAgICBzdmcge1xuICAgICAgICAgIHdpZHRoOiBpbmhlcml0O1xuICAgICAgICAgIGhlaWdodDogaW5oZXJpdDtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAjY29weSB7XG4gICAgICAgIGZsZXg6IDEgMSAwJTtcbiAgICAgICAgbWFyZ2luLXJpZ2h0OiBjYWxjKHZhcigtLWN1cnJlbnQtZ2FwKSArIDIwcHgpO1xuXG4gICAgICAgICYtLWNlbnRlciB7XG4gICAgICAgICAgZmxleDogMCAxIDAlO1xuICAgICAgICB9XG5cbiAgICAgICAgJi0tcmlnaHQge1xuICAgICAgICAgIGZsZXg6IDEgMSAwJTtcbiAgICAgICAgICBtYXJnaW4tbGVmdDogY2FsYyh2YXIoLS1jdXJyZW50LWdhcCkgKyAyMHB4KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxufVxuXG4vLyBCcmVha3BvaW50XG5AY29udGFpbmVyIGlkZW50aXR5LWJ1dHRvbi1jb250ZW50ICh3aWR0aCA8IDI1MHB4KSB7XG4gICNrbGFybmEtaWRlbnRpdHktYnV0dG9uIHtcbiAgICAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9faW5uZXItY29udGFpbmVyIHtcbiAgICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgICAgZm9udC1zaXplOiAxMnB4O1xuICAgICAgICAtLWN1cnJlbnQtZ2FwOiA4cHg7XG5cbiAgICAgICAgJi0tY2VudGVyIHtcbiAgICAgICAgICAjbG9nbyB7XG4gICAgICAgICAgICBtYXJnaW4tcmlnaHQ6IDEycHg7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG59XG5cbkBjb250YWluZXIgaWRlbnRpdHktYnV0dG9uLWNvbnRlbnQgKHdpZHRoIDwgMTk1cHgpIHtcbiAgI2tsYXJuYS1pZGVudGl0eS1idXR0b24ge1xuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19pbm5lci1jb250YWluZXIge1xuICAgICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX3RleHQge1xuICAgICAgICAjY29weSB7XG4gICAgICAgICAgZm9udC1zaXplOiAxMnB4O1xuICAgICAgICAgIG1hcmdpbi1yaWdodDogMHB4O1xuICAgICAgICB9XG5cbiAgICAgICAgJi0tY2VudGVyIHtcbiAgICAgICAgICAjbG9nbyB7XG4gICAgICAgICAgICBtYXJnaW4tcmlnaHQ6IDZweDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cbn1cblxuLy8gVGhlbWVcbiNrbGFybmEtaWRlbnRpdHktYnV0dG9uLnRoZW1lLW91dGxpbmVkIHtcbiAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgY29sb3I6ICRyZWd1bGFyX2JsYWNrO1xuICAgIGJhY2tncm91bmQtY29sb3I6ICRyZWd1bGFyX3doaXRlO1xuICAgIGJvcmRlcjogMXB4IHNvbGlkICRyZWd1bGFyX2JsYWNrO1xuXG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX3RleHQge1xuICAgICAgI2xvZ28ge1xuICAgICAgICBzdmcge1xuICAgICAgICAgIGZpbGw6ICRyZWd1bGFyX2JsYWNrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgJjpob3ZlciB7XG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAkaG92ZXJfd2hpdGU7XG4gICAgICBjb2xvcjogJGhvdmVyX2JsYWNrO1xuXG4gICAgICAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9fdGV4dCB7XG4gICAgICAgICNsb2dvIHtcbiAgICAgICAgICBzdmcge1xuICAgICAgICAgICAgZmlsbDogJGhvdmVyX2JsYWNrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gICY6Zm9jdXMge1xuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19vdXRsaW5lIHtcbiAgICAgIGluc2V0OiAtNXB4O1xuXG4gICAgICAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9fdGV4dCB7XG4gICAgICAgICNsb2dvIHtcbiAgICAgICAgICBzdmcge1xuICAgICAgICAgICAgZmlsbDogJGFjdGl2ZV9ibGFjaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAmOmFjdGl2ZSB7XG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAkYWN0aXZlX3doaXRlO1xuICAgICAgY29sb3I6ICRhY3RpdmVfYmxhY2s7XG4gICAgfVxuICB9XG59XG5cbiNrbGFybmEtaWRlbnRpdHktYnV0dG9uLnRoZW1lLWxpZ2h0IHtcbiAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgY29sb3I6ICRyZWd1bGFyX2JsYWNrO1xuICAgIGJhY2tncm91bmQtY29sb3I6ICRyZWd1bGFyX3doaXRlO1xuXG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX3RleHQge1xuICAgICAgI2xvZ28ge1xuICAgICAgICBzdmcge1xuICAgICAgICAgIGZpbGw6ICRyZWd1bGFyX2JsYWNrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgJjpob3ZlciB7XG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAkaG92ZXJfd2hpdGU7XG4gICAgICBjb2xvcjogJGhvdmVyX2JsYWNrO1xuXG4gICAgICAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9fdGV4dCB7XG4gICAgICAgICNsb2dvIHtcbiAgICAgICAgICBzdmcge1xuICAgICAgICAgICAgZmlsbDogJGhvdmVyX2JsYWNrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gICY6Zm9jdXMge1xuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19vdXRsaW5lIHtcbiAgICAgIGluc2V0OiAtNXB4O1xuXG4gICAgICAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9fdGV4dCB7XG4gICAgICAgICNsb2dvIHtcbiAgICAgICAgICBzdmcge1xuICAgICAgICAgICAgZmlsbDogJGFjdGl2ZV9ibGFjaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAmOmFjdGl2ZSB7XG4gICAgI2tsYXJuYS1zaWduLWluX19pbm5lci1jb250YWluZXIge1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogJGFjdGl2ZV93aGl0ZTtcbiAgICAgIGNvbG9yOiAkYWN0aXZlX2JsYWNrO1xuICAgIH1cbiAgfVxufVxuXG4ja2xhcm5hLWlkZW50aXR5LWJ1dHRvbi50aGVtZS1kYXJrIHtcbiAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgY29sb3I6ICRyZWd1bGFyX3doaXRlO1xuICAgIGJhY2tncm91bmQtY29sb3I6ICRyZWd1bGFyX2JsYWNrO1xuICAgIGJvcmRlcjogbm9uZTtcblxuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgICNsb2dvIHtcbiAgICAgICAgc3ZnIHtcbiAgICAgICAgICBmaWxsOiAkcmVndWxhcl93aGl0ZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gICY6aG92ZXIge1xuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19pbm5lci1jb250YWluZXIge1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogJGhvdmVyX2JsYWNrO1xuICAgICAgY29sb3I6ICRob3Zlcl93aGl0ZTtcblxuICAgICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX3RleHQge1xuICAgICAgICAjbG9nbyB7XG4gICAgICAgICAgc3ZnIHtcbiAgICAgICAgICAgIGZpbGw6ICRob3Zlcl93aGl0ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAmOmFjdGl2ZSB7XG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAkYWN0aXZlX2JsYWNrO1xuICAgICAgY29sb3I6ICRhY3RpdmVfd2hpdGU7XG5cbiAgICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgICAgI2xvZ28ge1xuICAgICAgICAgIHN2ZyB7XG4gICAgICAgICAgICBmaWxsOiAkYWN0aXZlX3doaXRlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxufVxuXG4vLyBTaGFwZVxuI2tsYXJuYS1pZGVudGl0eS1idXR0b24uc2hhcGUtcmVjdCB7XG4gICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19pbm5lci1jb250YWluZXIge1xuICAgIGJvcmRlci1yYWRpdXM6ICRyYWRpdXNfcmVjdDtcbiAgfVxuXG4gICY6Zm9jdXMgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX291dGxpbmUge1xuICAgIGJvcmRlci1yYWRpdXM6ICRyYWRpdXNfcmVjdDtcbiAgfVxufVxuXG4ja2xhcm5hLWlkZW50aXR5LWJ1dHRvbi5zaGFwZS1waWxsIHtcbiAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgYm9yZGVyLXJhZGl1czogJHJhZGl1c19waWxsO1xuICB9XG5cbiAgJjpmb2N1cyAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9fb3V0bGluZSB7XG4gICAgYm9yZGVyLXJhZGl1czogJHJhZGl1c19waWxsO1xuICB9XG59XG5cbi8vIENvcHlcbiNrbGFybmEtaWRlbnRpdHktYnV0dG9uLmNvcHktZGVmYXVsdC1lbiB7XG4gIG1pbi13aWR0aDogMTY1cHg7XG59XG5cbiNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19zcGlubmVyIHtcbiAgd2lkdGg6IDI0cHg7XG4gIGhlaWdodDogMjRweDtcbiAgYm9yZGVyOiAycHggc29saWQ7XG4gIGJvcmRlci1ib3R0b20tY29sb3I6IHRyYW5zcGFyZW50O1xuICBib3JkZXItcmFkaXVzOiA1MCU7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgYW5pbWF0aW9uOiByb3RhdGlvbiAxcyBsaW5lYXIgaW5maW5pdGU7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgdG9wOiBjYWxjKDUwJSAtIDEycHgpO1xuICByaWdodDogY2FsYyg1MCUgLSAxMnB4KTtcbiAgcG9pbnRlci1ldmVudHM6IG5vbmU7XG5cbiAgLnRoZW1lLW91dGxpbmVkICYge1xuICAgIGJvcmRlci1jb2xvcjogJHJlZ3VsYXJfYmxhY2s7XG4gICAgYm9yZGVyLWJvdHRvbS1jb2xvcjogJHJlZ3VsYXJfd2hpdGU7XG4gIH1cbiAgLnRoZW1lLWRhcmsgJiB7XG4gICAgYm9yZGVyLWNvbG9yOiAkcmVndWxhcl93aGl0ZTtcbiAgICBib3JkZXItYm90dG9tLWNvbG9yOiAkcmVndWxhcl9ibGFjaztcbiAgfVxuXG4gIEBrZXlmcmFtZXMgcm90YXRpb24ge1xuICAgIDAlIHtcbiAgICAgIHRyYW5zZm9ybTogcm90YXRlKDBkZWcpO1xuICAgIH1cbiAgICAxMDAlIHtcbiAgICAgIHRyYW5zZm9ybTogcm90YXRlKDM2MGRlZyk7XG4gICAgfVxuICB9XG59XG4iXSwic291cmNlUm9vdCI6IiJ9 */`;var Xc,Wc,Fc,Uc,Dc;function Tc(t){return Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(t)}function Yc(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Pc(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pc(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n',""])),jc,n);case iu.Left:return(0,Bc.qy)(Wc||(Wc=Mc([''," "])),jc,n);default:return(0,Bc.qy)(Fc||(Fc=Mc(['','',""])),n,Zc)}}},{key:"handleClick",value:function(){var t;this.loading||(this.loading=!0,null===(t=this.identityButton)||void 0===t||t.click())}},{key:"validateButtonOptions",value:function(){var t={shape:this.shape,theme:this.theme,logoAlignment:this.logoAlignment,hideOverlay:this.hideOverlay,interactionMode:this.interactionMode,scope:this.scope,redirectUri:this.redirectUri},e=au.safeParse(t).error;e&&mo("Invalid button configuration: ".concat(e.message))}},{key:"connectedCallback",value:function(){Jc(zc(v.prototype),"connectedCallback",this).call(this),this.identityButton=t.registerButton(this),t.on("signin",this.handleEvent("signin")),t.on("error",this.handleEvent("error")),t.on("popupclose",this.handleEvent("popupclose"))}},{key:"disconnectedCallback",value:function(){Jc(zc(v.prototype),"disconnectedCallback",this).call(this),t.unregisterButton(this),this.identityButton=void 0}},{key:"handleEvent",value:function(t){var e=this;return function(){switch(t){case"signin":case"error":case"popupclose":e.loading=!1}}}},{key:"render",value:function(){return this.validateButtonOptions(),(0,Bc.qy)(Uc||(Uc=Mc(["\n \n \n
\n
\n \n ',"\n \n ","\n
\n \n "])),Rc,this.theme===bn.DEFAULT?bn.DARK:this.theme,this.shape,this.handleClick,this.loading?"hidden":"",this.alignLogo(this.logoAlignment),this.loading?(0,Bc.qy)(Dc||(Dc=Mc(['']))):"")}}])}(),L=function(t,e,n,r,o,i){var a,c,u,s,l,f,p,h=Symbol.metadata||Symbol.for("Symbol.metadata"),d=Object.defineProperty,g=Object.create,y=[g(null),g(null)],b=e.length;function v(e,n,r){return function(o,i){n&&(i=o,o=t);for(var a=0;a=0;B-=n?2:1){var N=m(g[B],"A decorator","be",!0),S=n?g[B-1]:void 0,Z={},_={kind:["field","accessor","method","getter","setter","class"][o],name:r,metadata:a,addInitializer:function(t,e){if(t.v)throw new TypeError("attempted to call addInitializer after decoration was finished");m(e,"An initializer","be",!0),i.push(e)}.bind(null,Z)};if(I)c=N.call(S,L,_),Z.v=1,m(c,"class decorators","return")&&(L=c);else if(_.static=s,_.private=l,c=_.access={has:l?p.bind():function(t){return r in t}},C||(c.get=l?A?function(t){return h(t),E.value}:G("get",0,h):function(t){return t[r]}),A||w||(c.set=l?G("set",0,h):function(t,e){t[r]=e}),L=N.call(S,x?{get:E.get,set:E.set}:E[k],_),Z.v=1,x){if("object"==Tc(L)&&L)(c=m(L.get,"accessor.get"))&&(E.get=c),(c=m(L.set,"accessor.set"))&&(E.set=c),(c=m(L.init,"accessor.init"))&&O.unshift(c);else if(void 0!==L)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else m(L,(f?"field":"method")+" decorators","return")&&(f?O.unshift(L):E[k]=L)}return o<2&&u.push(v(O,s,1),v(i,s,0)),f||I||(l?x?u.splice(-1,0,G("get",s),G("set",s)):u.push(A?E[k]:m.call.bind(E[k])):d(t,r,E)),L}function x(t){return d(t,h,{configurable:!0,enumerable:!0,value:a})}return void 0!==i&&(a=i[h]),a=g(null==a?null:a),l=[],f=function(t){t&&l.push(v(t))},p=function(e,r){for(var o=0;o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Au(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Gu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function Gu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=this.maxSize&&(this._cache=this.cache,this.cache=new Map)}}])}(),qu=function(t){function e(t){var n,r;return Qu(this,e),(r=Lu(this,e,[null!=t?t:"operation not supported"])).name=r.constructor.name,null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,r,r.constructor),r}return Bu(e,Nu(Error)),Ru(e)}(),Ku=function(t){function e(t,n){var r,o;return Qu(this,e),(o=Lu(this,e,[t,n])).name=o.constructor.name,null===(r=Error.captureStackTrace)||void 0===r||r.call(Error,o,o.constructor),o}return Bu(e,Nu(Error)),Ru(e)}(),$u=new zu(100);function ts(t){return t instanceof CryptoKey}function es(t){return ts(t)&&"private"===t.type}function ns(t){try{var e=t.headers.get("dpop-nonce");e&&$u.set(new URL(t.url).origin,e)}catch(t){}return t}function rs(t){return null!==t&&"object"===ku(t)&&!Array.isArray(t)}function os(t){Wu(t,Headers)&&(t=Object.fromEntries(t.entries()));var e=new Headers(t);if(mu&&!e.has("user-agent")&&e.set("user-agent",mu),e.has("authorization"))throw new TypeError('"options.headers" must not include the "authorization" header name');if(e.has("dpop"))throw new TypeError('"options.headers" must not include the "dpop" header name');return e}function is(t){if("function"==typeof t&&(t=t()),!(t instanceof AbortSignal))throw new TypeError('"options.signal" must return or be an instance of AbortSignal');return t}function as(){return cs.apply(this,arguments)}function cs(){return(cs=Ou(Cu().mark((function t(e,n){var r,o;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof URL){t.next=2;break}throw new TypeError('"issuerIdentifier" must be an instance of URL');case 2:if("https:"===e.protocol||"http:"===e.protocol){t.next=4;break}throw new TypeError('"issuer.protocol" must be "https:" or "http:"');case 4:r=new URL(e.href),t.t0=null==n?void 0:n.algorithm,t.next=void 0===t.t0||"oidc"===t.t0?8:"oauth2"===t.t0?10:12;break;case 8:return r.pathname="".concat(r.pathname,"/.well-known/openid-configuration").replace("//","/"),t.abrupt("break",13);case 10:return"/"===r.pathname?r.pathname=".well-known/oauth-authorization-server":r.pathname=".well-known/oauth-authorization-server/".concat(r.pathname).replace("//","/"),t.abrupt("break",13);case 12:throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');case 13:return(o=os(null==n?void 0:n.headers)).set("accept","application/json"),t.abrupt("return",((null==n?void 0:n[Du])||fetch)(r.href,{headers:Object.fromEntries(o.entries()),method:"GET",redirect:"manual",signal:null!=n&&n.signal?is(n.signal):null}).then(ns));case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function us(t){return"string"==typeof t&&0!==t.length}function ss(t,e){return ls.apply(this,arguments)}function ls(){return(ls=Ou(Cu().mark((function t(e,n){var r;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof URL){t.next=2;break}throw new TypeError('"expectedIssuer" must be an instance of URL');case 2:if(Wu(n,Response)){t.next=4;break}throw new TypeError('"response" must be an instance of Response');case 4:if(200===n.status){t.next=6;break}throw new Ku('"response" is not a conform Authorization Server Metadata response');case 6:return al(n),t.prev=7,t.next=10,n.json();case 10:r=t.sent,t.next=16;break;case 13:throw t.prev=13,t.t0=t.catch(7),new Ku('failed to parse "response" body as JSON',{cause:t.t0});case 16:if(rs(r)){t.next=18;break}throw new Ku('"response" body must be a top level object');case 18:if(us(r.issuer)){t.next=20;break}throw new Ku('"response" body "issuer" property must be a non-empty string');case 20:if(new URL(r.issuer).href===e.href){t.next=22;break}throw new Ku('"response" body "issuer" does not match "expectedIssuer"');case 22:return t.abrupt("return",r);case 23:case"end":return t.stop()}}),t,null,[[7,13]])})))).apply(this,arguments)}function fs(){return Hu(crypto.getRandomValues(new Uint8Array(32)))}function ps(t){return hs.apply(this,arguments)}function hs(){return(hs=Ou(Cu().mark((function t(e){return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(us(e)){t.next=2;break}throw new TypeError('"codeVerifier" must be a non-empty string');case 2:return t.t0=Hu,t.next=5,crypto.subtle.digest("SHA-256",Mu(e));case 5:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ds(t){if(t instanceof CryptoKey)return{key:t};if(!((null==t?void 0:t.key)instanceof CryptoKey))return{};if(void 0!==t.kid&&!us(t.kid))throw new TypeError('"kid" must be a non-empty string');return{key:t.key,kid:t.kid}}function gs(t){return encodeURIComponent(t).replace(/%20/g,"+")}function ys(t){switch(t.algorithm.name){case"RSA-PSS":return function(t){switch(t.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new qu("unsupported RsaHashedKeyAlgorithm hash name")}}(t);case"RSASSA-PKCS1-v1_5":return function(t){switch(t.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new qu("unsupported RsaHashedKeyAlgorithm hash name")}}(t);case"ECDSA":return function(t){switch(t.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new qu("unsupported EcKeyAlgorithm namedCurve")}}(t);case"Ed25519":case"Ed448":return"EdDSA";default:throw new qu("unsupported CryptoKey algorithm name")}}function bs(t){var e=null==t?void 0:t[Fu];return"number"==typeof e&&Number.isFinite(e)?e:0}function vs(t){var e=null==t?void 0:t[Uu];return"number"==typeof e&&Number.isFinite(e)&&-1!==Math.sign(e)?e:30}function ms(){return Math.floor(Date.now()/1e3)}function Is(t,e){var n=ms()+bs(e);return{jti:fs(),aud:[t.issuer,t.token_endpoint],exp:n+60,iat:n,nbf:n,iss:e.client_id,sub:e.client_id}}function xs(t,e,n,r){return ws.apply(this,arguments)}function ws(){return(ws=Ou(Cu().mark((function t(e,n,r,o){return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Bs({alg:ys(r),kid:o},Is(e,n),r));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Cs(t){if("object"!==ku(t)||null===t)throw new TypeError('"as" must be an object');if(!us(t.issuer))throw new TypeError('"as.issuer" property must be a non-empty string');return!0}function As(t){if("object"!==ku(t)||null===t)throw new TypeError('"client" must be an object');if(!us(t.client_id))throw new TypeError('"client.client_id" property must be a non-empty string');return!0}function Gs(t){if(!us(t))throw new TypeError('"client.client_secret" property must be a non-empty string');return t}function Es(t,e){if(void 0!==e)throw new TypeError('"options.clientPrivateKey" property must not be provided when '.concat(t," client authentication method is used."))}function Os(t,e){if(void 0!==e)throw new TypeError('"client.client_secret" property must not be provided when '.concat(t," client authentication method is used."))}function ks(t,e,n,r,o){return Ls.apply(this,arguments)}function Ls(){return(Ls=Ou(Cu().mark((function t(e,n,r,o,i){var a,c,u;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.delete("client_secret"),r.delete("client_assertion_type"),r.delete("client_assertion"),t.t0=n.token_endpoint_auth_method,t.next=void 0===t.t0||"client_secret_basic"===t.t0?6:"client_secret_post"===t.t0?9:"private_key_jwt"===t.t0?13:"tls_client_auth"===t.t0||"self_signed_tls_client_auth"===t.t0||"none"===t.t0?27:31;break;case 6:return Es("client_secret_basic",i),o.set("authorization",(s=n.client_id,l=Gs(n.client_secret),void 0,void 0,void 0,f=gs(s),p=gs(l),h=btoa("".concat(f,":").concat(p)),"Basic ".concat(h))),t.abrupt("break",32);case 9:return Es("client_secret_post",i),r.set("client_id",n.client_id),r.set("client_secret",Gs(n.client_secret)),t.abrupt("break",32);case 13:if(Os("private_key_jwt",n.client_secret),void 0!==i){t.next=16;break}throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');case 16:if(a=ds(i),c=a.key,u=a.kid,es(c)){t.next=19;break}throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');case 19:return r.set("client_id",n.client_id),r.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),t.t1=r,t.next=24,xs(e,n,c,u);case 24:return t.t2=t.sent,t.t1.set.call(t.t1,"client_assertion",t.t2),t.abrupt("break",32);case 27:return Os(n.token_endpoint_auth_method,n.client_secret),Es(n.token_endpoint_auth_method,i),r.set("client_id",n.client_id),t.abrupt("break",32);case 31:throw new qu("unsupported client token_endpoint_auth_method");case 32:case"end":return t.stop()}var s,l,f,p,h}),t)})))).apply(this,arguments)}function Bs(t,e,n){return Ns.apply(this,arguments)}function Ns(){return Ns=Ou(Cu().mark((function t(e,n,r){var o,i;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.usages.includes("sign")){t.next=2;break}throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');case 2:return o="".concat(Hu(Mu(JSON.stringify(e))),".").concat(Hu(Mu(JSON.stringify(n)))),t.t0=Hu,t.next=6,crypto.subtle.sign(fl(r),r,Mu(o));case 6:return t.t1=t.sent,i=(0,t.t0)(t.t1),t.abrupt("return","".concat(o,".").concat(i));case 9:case"end":return t.stop()}}),t)}))),Ns.apply(this,arguments)}function Ss(t,e,n,r,o,i){return Zs.apply(this,arguments)}function Zs(){return Zs=Ou(Cu().mark((function t(e,n,r,o,i,a){var c,u,s,l,f,p;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=n.privateKey,u=n.publicKey,s=n.nonce,l=void 0===s?$u.get(r.origin):s,es(c)){t.next=3;break}throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');case 3:if(ts(h=u)&&"public"===h.type){t.next=5;break}throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');case 5:if(void 0===l||us(l)){t.next=7;break}throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');case 7:if(u.extractable){t.next=9;break}throw new TypeError('"DPoP.publicKey.extractable" must be true');case 9:return f=ms()+i,t.t0=Bs,t.t1=ys(c),t.next=14,js(u);case 14:if(t.t2=t.sent,t.t3={alg:t.t1,typ:"dpop+jwt",jwk:t.t2},t.t4=f,t.t5=fs(),t.t6=o,t.t7=l,t.t8="".concat(r.origin).concat(r.pathname),!a){t.next=29;break}return t.t10=Hu,t.next=25,crypto.subtle.digest("SHA-256",Mu(a));case 25:t.t11=t.sent,t.t9=(0,t.t10)(t.t11),t.next=30;break;case 29:t.t9=void 0;case 30:return t.t12=t.t9,t.t13={iat:t.t4,jti:t.t5,htm:t.t6,nonce:t.t7,htu:t.t8,ath:t.t12},t.t14=c,t.next=35,(0,t.t0)(t.t3,t.t13,t.t14);case 35:p=t.sent,e.set("dpop",p);case 37:case"end":return t.stop()}var h}),t)}))),Zs.apply(this,arguments)}function _s(t){return Qs.apply(this,arguments)}function Qs(){return Qs=Ou(Cu().mark((function t(e){var n,r,o,i,a,c,u,s;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,crypto.subtle.exportKey("jwk",e);case 2:return n=t.sent,r=n.kty,o=n.e,i=n.n,a=n.x,c=n.y,u=n.crv,s={kty:r,e:o,n:i,x:a,y:c,crv:u},Ju.set(e,s),t.abrupt("return",s);case 12:case"end":return t.stop()}}),t)}))),Qs.apply(this,arguments)}function js(t){return Rs.apply(this,arguments)}function Rs(){return(Rs=Ou(Cu().mark((function t(e){return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ju||(Ju=new WeakMap),t.abrupt("return",Ju.get(e)||_s(e));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Xs(t,e,n){if("string"!=typeof t){if(null!=n&&n[Tu])throw new TypeError('"as.mtls_endpoint_aliases.'.concat(e,'" must be a string'));throw new TypeError('"as.'.concat(e,'" must be a string'))}return new URL(t)}function Ws(t,e,n){return null!=n&&n[Tu]&&t.mtls_endpoint_aliases&&e in t.mtls_endpoint_aliases?Xs(t.mtls_endpoint_aliases[e],e,n):Xs(t[e],e)}function Fs(t){var e=t;return"object"===ku(e)&&!Array.isArray(e)&&null!==e&&void 0!==e.error}function Us(t,e,n,r,o,i,a){return Ds.apply(this,arguments)}function Ds(){return(Ds=Ou(Cu().mark((function t(e,n,r,o,i,a,c){return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ks(e,n,i,a,null==c?void 0:c.clientPrivateKey);case 2:return a.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t.abrupt("return",((null==c?void 0:c[Du])||fetch)(o.href,{body:i,headers:Object.fromEntries(a.entries()),method:r,redirect:"manual",signal:null!=c&&c.signal?is(c.signal):null}).then(ns));case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ts(t,e,n,r,o){return Ys.apply(this,arguments)}function Ys(){return(Ys=Ou(Cu().mark((function t(e,n,r,o,i){var a,c;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=Ws(e,"token_endpoint",i),o.set("grant_type",r),(c=os(null==i?void 0:i.headers)).set("accept","application/json"),void 0===(null==i?void 0:i.DPoP)){t.next=7;break}return t.next=7,Ss(c,i.DPoP,a,"POST",bs(n));case 7:return t.abrupt("return",Us(e,n,"POST",a,o,c,i));case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}Symbol();var Ps=new WeakMap;function Ms(t){if(t.id_token){var e=Ps.get(t);if(!e)throw new TypeError('"ref" was already garbage collected or did not resolve from the proper sources');return e}}function Vs(t,e,n){return Hs.apply(this,arguments)}function Hs(){return Hs=Ou(Cu().mark((function t(e,n,r){var o,i,a,c,u,s,l=arguments;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=l.length>3&&void 0!==l[3]&&l[3],i=l.length>4&&void 0!==l[4]&&l[4],Cs(e),As(n),Wu(r,Response)){t.next=6;break}throw new TypeError('"response" must be an instance of Response');case 6:if(200===r.status){t.next=12;break}return t.next=9,cl(r);case 9:if(!(a=t.sent)){t.next=11;break}return t.abrupt("return",a);case 11:throw new Ku('"response" is not a conform Token Endpoint response');case 12:return al(r),t.prev=13,t.next=16,r.json();case 16:c=t.sent,t.next=22;break;case 19:throw t.prev=19,t.t0=t.catch(13),new Ku('failed to parse "response" body as JSON',{cause:t.t0});case 22:if(rs(c)){t.next=24;break}throw new Ku('"response" body must be a top level object');case 24:if(us(c.access_token)){t.next=26;break}throw new Ku('"response" body "access_token" property must be a non-empty string');case 26:if(us(c.token_type)){t.next=28;break}throw new Ku('"response" body "token_type" property must be a non-empty string');case 28:if(c.token_type=c.token_type.toLowerCase(),"dpop"===c.token_type||"bearer"===c.token_type){t.next=31;break}throw new qu("unsupported `token_type` value");case 31:if(void 0===c.expires_in||!("number"!=typeof c.expires_in||c.expires_in<=0)){t.next=33;break}throw new Ku('"response" body "expires_in" property must be a positive number');case 33:if(i||void 0===c.refresh_token||us(c.refresh_token)){t.next=35;break}throw new Ku('"response" body "refresh_token" property must be a non-empty string');case 35:if(void 0===c.scope||"string"==typeof c.scope){t.next=37;break}throw new Ku('"response" body "scope" property must be a string');case 37:if(o){t.next=50;break}if(void 0===c.id_token||us(c.id_token)){t.next=40;break}throw new Ku('"response" body "id_token" property must be a non-empty string');case 40:if(!c.id_token){t.next=50;break}return t.next=43,hl(c.id_token,gl.bind(void 0,n.id_token_signed_response_alg,e.id_token_signing_alg_values_supported),pl,bs(n),vs(n)).then(el.bind(void 0,["aud","exp","iat","iss","sub"])).then(zs.bind(void 0,e.issuer)).then(Js.bind(void 0,n.client_id));case 43:if(u=t.sent,s=u.claims,!Array.isArray(s.aud)||1===s.aud.length||s.azp===n.client_id){t.next=47;break}throw new Ku('unexpected ID Token "azp" (authorized party) claim value');case 47:if(void 0===s.auth_time||Number.isFinite(s.auth_time)&&1===Math.sign(s.auth_time)){t.next=49;break}throw new Ku('ID Token "auth_time" (authentication time) must be a positive number');case 49:Ps.set(c,s);case 50:return t.abrupt("return",c);case 51:case"end":return t.stop()}}),t,null,[[13,19]])}))),Hs.apply(this,arguments)}function Js(t,e){if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t))throw new Ku('unexpected JWT "aud" (audience) claim value')}else if(e.claims.aud!==t)throw new Ku('unexpected JWT "aud" (audience) claim value');return e}function zs(t,e){if(e.claims.iss!==t)throw new Ku('unexpected JWT "iss" (issuer) claim value');return e}var qs=new WeakSet;function Ks(t,e,n,r,o,i){return $s.apply(this,arguments)}function $s(){return($s=Ou(Cu().mark((function t(e,n,r,o,i,a){var c,u;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Cs(e),As(n),qs.has(r)){t.next=4;break}throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');case 4:if(us(o)){t.next=6;break}throw new TypeError('"redirectUri" must be a non-empty string');case 6:if(us(i)){t.next=8;break}throw new TypeError('"codeVerifier" must be a non-empty string');case 8:if(c=yl(r,"code")){t.next=11;break}throw new Ku('no authorization code in "callbackParameters"');case 11:return(u=new URLSearchParams(null==a?void 0:a.additionalParameters)).set("redirect_uri",o),u.set("code_verifier",i),u.set("code",c),t.abrupt("return",Ts(e,n,"authorization_code",u,a));case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var tl={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation"};function el(t,e){var n,r=Au(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(void 0===e.claims[o])throw new Ku('JWT "'.concat(o,'" (').concat(tl[o],") claim missing"))}}catch(t){r.e(t)}finally{r.f()}return e}var nl=Symbol(),rl=Symbol();function ol(t,e,n,r,o){return il.apply(this,arguments)}function il(){return(il=Ou(Cu().mark((function t(e,n,r,o,i){var a,c,u,s,l,f;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Vs(e,n,r);case 2:if(!Fs(u=t.sent)){t.next=5;break}return t.abrupt("return",u);case 5:if(us(u.id_token)){t.next=7;break}throw new Ku('"response" body "id_token" property must be a non-empty string');case 7:if(null!==(a=i)&&void 0!==a||(i=null!==(c=n.default_max_age)&&void 0!==c?c:rl),s=Ms(u),!n.require_auth_time&&i===rl||void 0!==s.auth_time){t.next=11;break}throw new Ku('ID Token "auth_time" (authentication time) claim missing');case 11:if(i===rl){t.next=18;break}if(!("number"!=typeof i||i<0)){t.next=14;break}throw new TypeError('"maxAge" must be a non-negative number');case 14:if(l=ms()+bs(n),f=vs(n),!(s.auth_time+i399&&e.status<500)){t.next=16;break}return al(e),t.prev=2,t.next=5,e.json();case 5:if(!rs(n=t.sent)||"string"!=typeof n.error||!n.error.length){t.next=12;break}return void 0!==n.error_description&&"string"!=typeof n.error_description&&delete n.error_description,void 0!==n.error_uri&&"string"!=typeof n.error_uri&&delete n.error_uri,void 0!==n.algs&&"string"!=typeof n.algs&&delete n.algs,void 0!==n.scope&&"string"!=typeof n.scope&&delete n.scope,t.abrupt("return",n);case 12:t.next=16;break;case 14:t.prev=14,t.t0=t.catch(2);case 16:return t.abrupt("return",void 0);case 17:case"end":return t.stop()}}),t,null,[[2,14]])})))).apply(this,arguments)}function sl(t){if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new Ku("".concat(t.name," modulusLength must be at least 2048 bits"))}function ll(t){switch(t){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new qu}}function fl(t){switch(t.algorithm.name){case"ECDSA":return{name:t.algorithm.name,hash:ll(t.algorithm.namedCurve)};case"RSA-PSS":switch(sl(t.algorithm),t.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:t.algorithm.name,saltLength:parseInt(t.algorithm.hash.name.slice(-3),10)>>3};default:throw new qu}case"RSASSA-PKCS1-v1_5":return sl(t.algorithm),t.algorithm.name;case"Ed448":case"Ed25519":return t.algorithm.name}throw new qu}var pl=Symbol();function hl(t,e,n,r,o){return dl.apply(this,arguments)}function dl(){return dl=Ou(Cu().mark((function t(e,n,r,o,i){var a,c,u,s,l,f,p,h,d,g,y;return Cu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=e.split("."),c=a[0],u=a[1],s=a[2],5!==(l=a.length)){t.next=3;break}throw new qu("JWE structure JWTs are not supported");case 3:if(3===l){t.next=5;break}throw new Ku("Invalid JWT");case 5:t.prev=5,f=JSON.parse(Mu(Hu(c))),t.next=12;break;case 9:throw t.prev=9,t.t0=t.catch(5),new Ku("failed to parse JWT Header body as base64url encoded JSON",{cause:t.t0});case 12:if(rs(f)){t.next=14;break}throw new Ku("JWT Header must be a top level object");case 14:if(n(f),void 0===f.crit){t.next=17;break}throw new Ku('unexpected JWT "crit" header parameter');case 17:if(p=Hu(s),r===pl){t.next=28;break}return t.next=21,r(f);case 21:return h=t.sent,d="".concat(c,".").concat(u),t.next=25,crypto.subtle.verify(fl(h),h,p,Mu(d));case 25:if(t.sent){t.next=28;break}throw new Ku("JWT signature verification failed");case 28:t.prev=28,g=JSON.parse(Mu(Hu(u))),t.next=35;break;case 32:throw t.prev=32,t.t1=t.catch(28),new Ku("failed to parse JWT Payload body as base64url encoded JSON",{cause:t.t1});case 35:if(rs(g)){t.next=37;break}throw new Ku("JWT Payload must be a top level object");case 37:if(y=ms()+o,void 0===g.exp){t.next=43;break}if("number"==typeof g.exp){t.next=41;break}throw new Ku('unexpected JWT "exp" (expiration time) claim type');case 41:if(!(g.exp<=y-i)){t.next=43;break}throw new Ku('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');case 43:if(void 0===g.iat){t.next=46;break}if("number"==typeof g.iat){t.next=46;break}throw new Ku('unexpected JWT "iat" (issued at) claim type');case 46:if(void 0===g.iss){t.next=49;break}if("string"==typeof g.iss){t.next=49;break}throw new Ku('unexpected JWT "iss" (issuer) claim type');case 49:if(void 0===g.nbf){t.next=54;break}if("number"==typeof g.nbf){t.next=52;break}throw new Ku('unexpected JWT "nbf" (not before) claim type');case 52:if(!(g.nbf>y+i)){t.next=54;break}throw new Ku('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');case 54:if(void 0===g.aud){t.next=57;break}if("string"==typeof g.aud||Array.isArray(g.aud)){t.next=57;break}throw new Ku('unexpected JWT "aud" (audience) claim type');case 57:return t.abrupt("return",{header:f,claims:g,signature:p,key:h});case 58:case"end":return t.stop()}}),t,null,[[5,9],[28,32]])}))),dl.apply(this,arguments)}function gl(t,e,n){if(void 0===t){if(Array.isArray(e)){if(!e.includes(n.alg))throw new Ku('unexpected JWT "alg" header parameter')}else if("RS256"!==n.alg)throw new Ku('unexpected JWT "alg" header parameter')}else if(n.alg!==t)throw new Ku('unexpected JWT "alg" header parameter')}function yl(t,e){var n=t.getAll(e),r=n[0];if(n.length>1)throw new Ku('"'.concat(e,'" parameter must be provided only once'));return r}var bl=Symbol(),vl=Symbol();function ml(t,e,n,r){if(Cs(t),As(e),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');if(yl(n,"response"))throw new Ku('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');var o=yl(n,"iss"),i=yl(n,"state");if(!o&&t.authorization_response_iss_parameter_supported)throw new Ku('response parameter "iss" (issuer) missing');if(o&&o!==t.issuer)throw new Ku('unexpected "iss" (issuer) response parameter value');switch(r){case void 0:case vl:if(void 0!==i)throw new Ku('unexpected "state" response parameter encountered');break;case bl:break;default:if(!us(r))throw new Ku('"expectedState" must be a non-empty string');if(void 0===i)throw new Ku('response parameter "state" missing');if(i!==r)throw new Ku('unexpected "state" response parameter value')}var a=yl(n,"error");if(a)return{error:a,error_description:yl(n,"error_description"),error_uri:yl(n,"error_uri")};var c,u=yl(n,"id_token"),s=yl(n,"token");if(void 0!==u||void 0!==s)throw new qu("implicit and hybrid flows are not supported");return c=new URLSearchParams(n),qs.add(c),c}var Il={retries:3,minTimeout:100,maxTimeout:200,maxRetryTime:1e3};function xl(t){return xl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xl(t)}function wl(t){var e="function"==typeof Map?new Map:void 0;return wl=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Cl())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Al(o,n.prototype),o}(t,arguments,Gl(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Al(n,t)},wl(t)}function Cl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Cl=function(){return!!t})()}function Al(t,e){return Al=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Al(t,e)}function Gl(t){return Gl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gl(t)}var El=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Gl(e),function(t,e){if(e&&("object"==xl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Cl()?Reflect.construct(e,n||[],Gl(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Al(t,e)}(e,wl(Error)),function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}(e)}();function Ol(t){return Ol="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ol(t)}function kl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ll(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Nl(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function Sl(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Nl(i,r,o,a,c,"next",t)}function c(t){Nl(i,r,o,a,c,"throw",t)}a(void 0)}))}}function Zl(t,e){for(var n=0;n=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Yl(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function Pl(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Yl(i,r,o,a,c,"next",t)}function c(t){Yl(i,r,o,a,c,"throw",t)}a(void 0)}))}}var Ml=function(){var t=Pl(Tl().mark((function t(e){var n,r,o;return Tl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,wu()(Pl(Tl().mark((function t(){return Tl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",as(new URL(e.oidc.idpUrl)));case 1:case"end":return t.stop()}}),t)}))),Fl(Fl({},Il),{},{onRetry:function(t,e){nc(t,{errorTitle:"Discovery request failed!",attempt:e})}}));case 2:return r=t.sent,t.next=5,ss(new URL(e.oidc.issuerUrl),r);case 5:if(o=t.sent,!0===(null===(n=o.code_challenge_methods_supported)||void 0===n?void 0:n.includes("S256"))){t.next=8;break}throw new Error("Code challenge method not supported");case 8:return t.abrupt("return",o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Vl=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return function(t,e,n){return n&&Xl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,0,[{key:"setEnvironment",value:function(e){t.environment=e}},{key:"setRegion",value:function(e){t.region=e}},{key:"getInstance",value:(e=Pl(Tl().mark((function e(){var n,r;return Tl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.authorizationServer){e.next=6;break}return n=su(t.region,t.environment),e.next=4,Ml(n);case 4:r=e.sent,t.authorizationServer=new jl(r,n);case 6:return e.abrupt("return",t.authorizationServer);case 7:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})}]);var e}();function Hl(t){return Hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hl(t)}function Jl(){Jl=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),c=new L(r||[]);return o(a,"_invoke",{value:G(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="executing",d="completed",g={};function y(){}function b(){}function v(){}var m={};s(m,a,(function(){return this}));var I=Object.getPrototypeOf,x=I&&I(I(B([])));x&&x!==n&&r.call(x,a)&&(m=x);var w=v.prototype=y.prototype=Object.create(m);function C(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==Hl(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function G(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=E(c,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?d:"suspendedYield",s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=d,r.method="throw",r.arg=s.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function zl(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function ql(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(n.keys());try{for(o.s();!(e=o.n()).done;){var i=e.value;if(r.get(i)!==n.get(i))return!1}}catch(t){o.e(t)}finally{o.f()}return!0},tf=function(){var t,e=(t=Jl().mark((function t(e){var n,r,o,i,a;return Jl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.clientId,r=e.pkceFlow,o=e.redirectUri,t.prev=1,o&&$l(new URL(o))){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,Vl.getInstance();case 6:return i=t.sent,t.next=9,i.verifyLogin({urlWithLoginParams:new URL(window.location.href),isOnPageFlow:!1,redirectUri:o,clientId:n,pkceFlow:r});case 9:return a=t.sent,t.abrupt("return",a);case 13:t.prev=13,t.t0=t.catch(1),nc(t.t0,{errorTitle:"verifyLogin failed for redirect flow."});case 16:case"end":return t.stop()}}),t,null,[[1,13]])})),function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){zl(i,r,o,a,c,"next",t)}function c(t){zl(i,r,o,a,c,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}(),ef=function(t,e){return!t||!t.includes(e)},nf=o(6178),rf=o.n(nf);function of(t){return of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},of(t)}function af(t,e){for(var n=0;n %s] sending message:","color: #16a085",this.origin,t)}},{key:"bindToMessage",value:function(e,n){this._listener=function(){e.apply(n,arguments)};var r=this.getTarget();sf(r)||lf(r)?r.onmessage=this._listener:t.addListener("message",this._listener)}},{key:"unbind",value:function(){if(this._listener){var e=this.getTarget();sf(e)||lf(e)?e.onmessage=null:t.removeListener("message",this._listener),this._listener=null}}}],[{key:"addListener",value:function(t,e){window.removeEventListener?window.addEventListener("message",e,!1):window.attachEvent("on"+t,e,!1)}},{key:"removeListener",value:function(t,e){window.removeEventListener?window.removeEventListener("message",e):window.detachEvent("on"+t,e)}}])}(),sf=function(t){return"MessagePort"in window&&t instanceof window.MessagePort},lf=function(t){return"BroadcastChannel"in window&&t instanceof window.BroadcastChannel};function ff(t){return ff="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ff(t)}function pf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function hf(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!n.target)throw new Error("Property `options.target` is required.");"[object Object]"===Object.prototype.toString.call(n.debug)?(this.debug=!!n.debug.logs,this.logErrors=!!n.debug.errors):(this.debug=!!n.debug,this.logErrors=this.debug),this.posten=t.createPosten(hf(hf({},n),{},{debug:this.debug})),this.posten.onMessage=function(){e.posten&&e.posten.hasTarget()&&e.onMessage.apply(e,arguments)},this.messageHandlers={},this.queue=n.queue||[],this.sourceID=n.sourceID||"NO NAME",this.targetIsReady=n.targetIsReady,this.shouldBuffer=!this.targetIsReady,this.autoSyncOnStart=null!=n.autoSyncOnStart?n.autoSyncOnStart:!this.targetIsReady,this.addMessageHandler("@@messenger/ready",this.onReadyMessage.bind(this)),this.addMessageHandler("@@messenger/SYN",this.onSyncMessage.bind(this)),this.addMessageHandler("@@messenger/SYN-ACK",this.onAcknowledgeSyncMessage.bind(this)),this.addMessageHandler("@@messenger/ACK",this.onAcknowledgeMessage.bind(this)),this.addMessageHandler("@@messenger/transferPort",this.onTransferPort.bind(this)),this.startTargetExistenceCheckPolling(n.targetExistenceCheckInterval),this.targetIsReady?this.ready():this.autoSyncOnStart&&this.sync()}return function(t,e,n){return e&&gf(t.prototype,e),n&&gf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"log",value:function(){if(this.debug){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:100;this.existenceCheckPoller=setInterval((function(){t.shouldBuffer||t.hasTarget()||(t.log("Target no longer exists. Start buffering."),t.shouldBuffer=!0)}),e)}},{key:"sync",value:function(){this.hasTarget()&&(this.posten.send({action:"@@messenger/SYN"}),this.log("SYN"))}},{key:"acknowledgeSync",value:function(){this.hasTarget()&&(this.posten.send({action:"@@messenger/SYN-ACK"}),this.log("SYN-ACK"))}},{key:"acknowledge",value:function(){this.hasTarget()&&(this.posten.send({action:"@@messenger/ACK"}),this.log("ACK"))}},{key:"addMessageHandler",value:function(t,e){var n=this;return this.messageHandlers[t]=e,function(){delete n.messageHandlers[t]}}},{key:"transferPort",value:function(t){this.log("Transfer port:",t),this.send({action:"@@messenger/transferPort",port:t})}},{key:"getPort",value:function(){var t=this;return this.port?Promise.resolve(this.port):new Promise((function(e){t.resolvePortPromise=e}))}},{key:"send",value:function(t){!this.shouldBuffer&&this.hasTarget()?this.posten.send(hf(hf({},t),{},{__sourceID:this.sourceID})):(this.log("Buffering message:",t),this.queue.push(t))}},{key:"ready",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).fromPostMessage,e=void 0!==t&&t;this.hasTarget()&&(this.log("Ready to receive messages."),this.shouldBuffer=!1,e||this.send({action:"@@messenger/ready"}),this.flush(this.queue,this.send))}},{key:"flush",value:function(){for(this.log("Flushing buffer:",[].concat(this.queue));this.queue.length>0;)this.send(this.queue.shift())}},{key:"pause",value:function(){this.shouldBuffer=!0}},{key:"destroy",value:function(){clearInterval(this.existenceCheckPoller),this.posten&&this.posten.unbind(),delete this.posten}},{key:"onMessage",value:function(t,e,n){if(t)this.logError(t);else{var r=this.messageHandlers[e.action];"function"==typeof r&&r(e,n)}}},{key:"onReadyMessage",value:function(){this.ready({fromPostMessage:!0})}},{key:"onSyncMessage",value:function(){this.acknowledgeSync()}},{key:"onAcknowledgeSyncMessage",value:function(){this.ready({fromPostMessage:!0}),this.acknowledge()}},{key:"onAcknowledgeMessage",value:function(){this.ready({fromPostMessage:!0})}},{key:"onTransferPort",value:function(t,e){var n=e.ports[0];this.log("Received port:",n),!this.port&&this.resolvePortPromise&&this.resolvePortPromise(n),this.port=n}}],[{key:"createPosten",value:function(e){var n=e.src,r=void 0===n?window:n,o=e.target,i=e.origin,a=void 0===i?"*":i,c=e.debug,u=e.sourceID,s=e.disableMessageSourceCheck,l={src:r,origin:a,console:rf(),debug:c,sourceID:u,disableMessageSourceCheck:s};return o.url&&(l.origin=t.getOriginFromURL(o.url)),o.window?l.target=o.window:o.frame&&(l.frame=o.frame),new uf(l)}},{key:"getOriginFromURL",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").match(/^[a-z]+:\/\/[a-z0-9A-Z\.:\-]+/);if(t)return t[0]}}])}();function vf(t){return vf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vf(t)}function mf(){mf=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),c=new L(r||[]);return o(a,"_invoke",{value:G(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="executing",d="completed",g={};function y(){}function b(){}function v(){}var m={};s(m,a,(function(){return this}));var I=Object.getPrototypeOf,x=I&&I(I(B([])));x&&x!==n&&r.call(x,a)&&(m=x);var w=v.prototype=y.prototype=Object.create(m);function C(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==vf(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function G(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=E(c,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?d:"suspendedYield",s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=d,r.method="throw",r.arg=s.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function If(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function xf(t,e){for(var n=0;n\n\n \n \n \n \n \n Klarna\n \n