
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="721a1ae8-0c8c-5dbf-81fc-b70c5c322f34")}catch(e){}}();
(()=>{"use strict";var e={9386:(e,t,n)=>{var r=n(6357),i=n(215),o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(i(e)+" is not a function")}},5292:(e,t,n)=>{var r=n(6653),i=n(215),o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(i(e)+" is not a constructor")}},2834:(e,t,n)=>{var r=n(6357),i=String,o=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw new o("Can't set "+i(e)+" as a prototype")}},5845:(e,t,n)=>{var r=n(3683),i=n(2104),o=n(8449).f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&o(s,a,{configurable:!0,value:i(null)}),e.exports=function(e){s[a][e]=!0}},7157:(e,t,n)=>{var r=n(4775).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},2135:(e,t,n)=>{var r=n(5161),i=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new i("Incorrect invocation")}},151:(e,t,n)=>{var r=n(1634),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(i(e)+" is not an object")}},2372:(e,t,n)=>{var r=n(4543);e.exports=r((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},3371:(e,t,n)=>{var r=n(2077).forEach,i=n(4486)("forEach");e.exports=i?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},2753:(e,t,n)=>{var r=n(853),i=n(7418),o=n(5526),a=function(e){return function(t,n,a){var s,c=r(t),l=o(c),u=i(a,l);if(e&&n!=n){for(;l>u;)if((s=c[u++])!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},2077:(e,t,n)=>{var r=n(1232),i=n(1008),o=n(191),a=n(581),s=n(5526),c=n(797),l=i([].push),u=function(e){var t=1===e,n=2===e,i=3===e,u=4===e,d=6===e,h=7===e,p=5===e||d;return function(f,m,g,v){for(var y,E,b=a(f),_=o(b),C=r(m,g),S=s(_),I=0,w=v||c,O=t?w(f,S):n||h?w(f,0):void 0;S>I;I++)if((p||I in _)&&(E=C(y=_[I],I,b),e))if(t)O[I]=E;else if(E)switch(e){case 3:return!0;case 5:return y;case 6:return I;case 2:l(O,y)}else switch(e){case 4:return!1;case 7:l(O,y)}return d?-1:i||u?u:O}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},4486:(e,t,n)=>{var r=n(4543);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},7262:(e,t,n)=>{var r=n(9386),i=n(581),o=n(191),a=n(5526),s=TypeError,c=function(e){return function(t,n,c,l){r(n);var u=i(t),d=o(u),h=a(u),p=e?h-1:0,f=e?-1:1;if(c<2)for(;;){if(p in d){l=d[p],p+=f;break}if(p+=f,e?p<0:h<=p)throw new s("Reduce of empty array with no initial value")}for(;e?p>=0:h>p;p+=f)p in d&&(l=n(l,d[p],p,u));return l}};e.exports={left:c(!1),right:c(!0)}},231:(e,t,n)=>{var r=n(7418),i=n(5526),o=n(9904),a=Array,s=Math.max;e.exports=function(e,t,n){for(var c=i(e),l=r(t,c),u=r(void 0===n?c:n,c),d=a(s(u-l,0)),h=0;l<u;l++,h++)o(d,h,e[l]);return d.length=h,d}},9929:(e,t,n)=>{var r=n(6872),i=n(6653),o=n(1634),a=n(3683)("species"),s=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(i(t)&&(t===s||r(t.prototype))||o(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?s:t}},797:(e,t,n)=>{var r=n(9929);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},668:(e,t,n)=>{var r=n(3683)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},e(o)}catch(e){}return n}},6032:(e,t,n)=>{var r=n(1008),i=r({}.toString),o=r("".slice);e.exports=function(e){return o(i(e),8,-1)}},7611:(e,t,n)=>{var r=n(3644),i=n(6357),o=n(6032),a=n(3683)("toStringTag"),s=Object,c="Arguments"===o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?n:c?o(t):"Object"===(r=o(t))&&i(t.callee)?"Arguments":r}},8137:(e,t,n)=>{var r=n(1008),i=n(6519),o=n(8907).getWeakData,a=n(2135),s=n(151),c=n(3445),l=n(1634),u=n(3308),d=n(2077),h=n(5889),p=n(4317),f=p.set,m=p.getterFor,g=d.find,v=d.findIndex,y=r([].splice),E=0,b=function(e){return e.frozen||(e.frozen=new _)},_=function(){this.entries=[]},C=function(e,t){return g(e.entries,(function(e){return e[0]===t}))};_.prototype={get:function(e){var t=C(this,e);if(t)return t[1]},has:function(e){return!!C(this,e)},set:function(e,t){var n=C(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=v(this.entries,(function(t){return t[0]===e}));return~t&&y(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,n,r){var d=e((function(e,i){a(e,p),f(e,{type:t,id:E++,frozen:void 0}),c(i)||u(i,e[r],{that:e,AS_ENTRIES:n})})),p=d.prototype,g=m(t),v=function(e,t,n){var r=g(e),i=o(s(t),!0);return!0===i?b(r).set(t,n):i[r.id]=n,e};return i(p,{delete:function(e){var t=g(this);if(!l(e))return!1;var n=o(e);return!0===n?b(t).delete(e):n&&h(n,t.id)&&delete n[t.id]},has:function(e){var t=g(this);if(!l(e))return!1;var n=o(e);return!0===n?b(t).has(e):n&&h(n,t.id)}}),i(p,n?{get:function(e){var t=g(this);if(l(e)){var n=o(e);return!0===n?b(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return v(this,e,t)}}:{add:function(e){return v(this,e,!0)}}),d}}},196:(e,t,n)=>{var r=n(6566),i=n(4523),o=n(1008),a=n(4396),s=n(9704),c=n(8907),l=n(3308),u=n(2135),d=n(6357),h=n(3445),p=n(1634),f=n(4543),m=n(668),g=n(6143),v=n(3103);e.exports=function(e,t,n){var y=-1!==e.indexOf("Map"),E=-1!==e.indexOf("Weak"),b=y?"set":"add",_=i[e],C=_&&_.prototype,S=_,I={},w=function(e){var t=o(C[e]);s(C,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(E&&!p(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return E&&!p(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(E&&!p(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(a(e,!d(_)||!(E||C.forEach&&!f((function(){(new _).entries().next()})))))S=n.getConstructor(t,e,y,b),c.enable();else if(a(e,!0)){var O=new S,A=O[b](E?{}:-0,1)!==O,T=f((function(){O.has(1)})),P=m((function(e){new _(e)})),N=!E&&f((function(){for(var e=new _,t=5;t--;)e[b](t,t);return!e.has(-0)}));P||((S=t((function(e,t){u(e,C);var n=v(new _,e,S);return h(t)||l(t,n[b],{that:n,AS_ENTRIES:y}),n}))).prototype=C,C.constructor=S),(T||N)&&(w("delete"),w("has"),y&&w("get")),(N||A)&&w(b),E&&C.clear&&delete C.clear}return I[e]=S,r({global:!0,constructor:!0,forced:S!==_},I),g(S,e),E||n.setStrong(S,e,y),S}},812:(e,t,n)=>{var r=n(5889),i=n(7527),o=n(9763),a=n(8449);e.exports=function(e,t,n){for(var s=i(t),c=a.f,l=o.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},6412:(e,t,n)=>{var r=n(3683)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},99:(e,t,n)=>{var r=n(4543);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},5025:e=>{e.exports=function(e,t){return{value:e,done:t}}},6587:(e,t,n)=>{var r=n(5180),i=n(8449),o=n(6372);e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},6372:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},9904:(e,t,n)=>{var r=n(9833),i=n(8449),o=n(6372);e.exports=function(e,t,n){var a=r(t);a in e?i.f(e,a,o(0,n)):e[a]=n}},3642:(e,t,n)=>{var r=n(27),i=n(8449);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),i.f(e,t,n)}},9704:(e,t,n)=>{var r=n(6357),i=n(8449),o=n(27),a=n(2969);e.exports=function(e,t,n,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:t;if(r(n)&&o(n,l,s),s.global)c?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},6519:(e,t,n)=>{var r=n(9704);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},2969:(e,t,n)=>{var r=n(4523),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},5180:(e,t,n)=>{var r=n(4543);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2155:e=>{var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},2679:(e,t,n)=>{var r=n(4523),i=n(1634),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},792:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},832:(e,t,n)=>{var r=n(2679)("span").classList,i=r&&r.constructor&&r.constructor.prototype;e.exports=i===Object.prototype?void 0:i},2224:(e,t,n)=>{var r=n(4523),i=n(6032);e.exports="process"===i(r.process)},4848:e=>{e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},2844:(e,t,n)=>{var r,i,o=n(4523),a=n(4848),s=o.process,c=o.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(i=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},8471:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6566:(e,t,n)=>{var r=n(4523),i=n(9763).f,o=n(6587),a=n(9704),s=n(2969),c=n(812),l=n(4396);e.exports=function(e,t){var n,u,d,h,p,f=e.target,m=e.global,g=e.stat;if(n=m?r:g?r[f]||s(f,{}):(r[f]||{}).prototype)for(u in t){if(h=t[u],d=e.dontCallGetSet?(p=i(n,u))&&p.value:n[u],!l(m?u:f+(g?".":"#")+u,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;c(h,d)}(e.sham||d&&d.sham)&&o(h,"sham",!0),a(n,u,h,e)}}},4543:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},1644:(e,t,n)=>{n(3831);var r=n(1316),i=n(9704),o=n(8779),a=n(4543),s=n(3683),c=n(6587),l=s("species"),u=RegExp.prototype;e.exports=function(e,t,n,d){var h=s(e),p=!a((function(){var t={};return t[h]=function(){return 7},7!==""[e](t)})),f=p&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[l]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return t=!0,null},n[h](""),!t}));if(!p||!f||n){var m=r(/./[h]),g=t(h,""[e],(function(e,t,n,i,a){var s=r(e),c=t.exec;return c===o||c===u.exec?p&&!a?{done:!0,value:m(t,n,i)}:{done:!0,value:s(n,t,i)}:{done:!1}}));i(String.prototype,e,g[0]),i(u,h,g[1])}d&&c(u[h],"sham",!0)}},5240:(e,t,n)=>{var r=n(4543);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},1881:(e,t,n)=>{var r=n(9944),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},1232:(e,t,n)=>{var r=n(1316),i=n(9386),o=n(9944),a=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},9944:(e,t,n)=>{var r=n(4543);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},2957:(e,t,n)=>{var r=n(9944),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},94:(e,t,n)=>{var r=n(5180),i=n(5889),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},2946:(e,t,n)=>{var r=n(1008),i=n(9386);e.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},1316:(e,t,n)=>{var r=n(6032),i=n(1008);e.exports=function(e){if("Function"===r(e))return i(e)}},1008:(e,t,n)=>{var r=n(9944),i=Function.prototype,o=i.call,a=r&&i.bind.bind(o,o);e.exports=r?a:function(e){return function(){return o.apply(e,arguments)}}},7735:(e,t,n)=>{var r=n(4523),i=n(6357);e.exports=function(e,t){return arguments.length<2?(n=r[e],i(n)?n:void 0):r[e]&&r[e][t];var n}},787:(e,t,n)=>{var r=n(7611),i=n(6046),o=n(3445),a=n(7869),s=n(3683)("iterator");e.exports=function(e){if(!o(e))return i(e,s)||i(e,"@@iterator")||a[r(e)]}},6417:(e,t,n)=>{var r=n(2957),i=n(9386),o=n(151),a=n(215),s=n(787),c=TypeError;e.exports=function(e,t){var n=arguments.length<2?s(e):t;if(i(n))return o(r(n,e));throw new c(a(e)+" is not iterable")}},6046:(e,t,n)=>{var r=n(9386),i=n(3445);e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},9070:(e,t,n)=>{var r=n(1008),i=n(581),o=Math.floor,a=r("".charAt),s=r("".replace),c=r("".slice),l=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,d,h){var p=n+e.length,f=r.length,m=u;return void 0!==d&&(d=i(d),m=l),s(h,m,(function(i,s){var l;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return c(t,0,n);case"'":return c(t,p);case"<":l=d[c(s,1,-1)];break;default:var u=+s;if(0===u)return i;if(u>f){var h=o(u/10);return 0===h?i:h<=f?void 0===r[h-1]?a(s,1):r[h-1]+a(s,1):i}l=r[u-1]}return void 0===l?"":l}))}},4523:function(e,t,n){var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||this||Function("return this")()},5889:(e,t,n)=>{var r=n(1008),i=n(581),o=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},5525:e=>{e.exports={}},2093:(e,t,n)=>{var r=n(7735);e.exports=r("document","documentElement")},9053:(e,t,n)=>{var r=n(5180),i=n(4543),o=n(2679);e.exports=!r&&!i((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},191:(e,t,n)=>{var r=n(1008),i=n(4543),o=n(6032),a=Object,s=r("".split);e.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?s(e,""):a(e)}:a},3103:(e,t,n)=>{var r=n(6357),i=n(1634),o=n(7943);e.exports=function(e,t,n){var a,s;return o&&r(a=t.constructor)&&a!==n&&i(s=a.prototype)&&s!==n.prototype&&o(e,s),e}},6842:(e,t,n)=>{var r=n(1008),i=n(6357),o=n(3965),a=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},8907:(e,t,n)=>{var r=n(6566),i=n(1008),o=n(5525),a=n(1634),s=n(5889),c=n(8449).f,l=n(9712),u=n(3834),d=n(3452),h=n(6048),p=n(5240),f=!1,m=h("meta"),g=0,v=function(e){c(e,m,{value:{objectID:"O"+g++,weakData:{}}})},y=e.exports={enable:function(){y.enable=function(){},f=!0;var e=l.f,t=i([].splice),n={};n[m]=1,e(n).length&&(l.f=function(n){for(var r=e(n),i=0,o=r.length;i<o;i++)if(r[i]===m){t(r,i,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:u.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,m)){if(!d(e))return"F";if(!t)return"E";v(e)}return e[m].objectID},getWeakData:function(e,t){if(!s(e,m)){if(!d(e))return!0;if(!t)return!1;v(e)}return e[m].weakData},onFreeze:function(e){return p&&f&&d(e)&&!s(e,m)&&v(e),e}};o[m]=!0},4317:(e,t,n)=>{var r,i,o,a=n(158),s=n(4523),c=n(1634),l=n(6587),u=n(5889),d=n(3965),h=n(9847),p=n(5525),f="Object already initialized",m=s.TypeError,g=s.WeakMap;if(a||d.state){var v=d.state||(d.state=new g);v.get=v.get,v.has=v.has,v.set=v.set,r=function(e,t){if(v.has(e))throw new m(f);return t.facade=e,v.set(e,t),t},i=function(e){return v.get(e)||{}},o=function(e){return v.has(e)}}else{var y=h("state");p[y]=!0,r=function(e,t){if(u(e,y))throw new m(f);return t.facade=e,l(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},o=function(e){return u(e,y)}}e.exports={set:r,get:i,has:o,enforce:function(e){return o(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=i(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return n}}}},5745:(e,t,n)=>{var r=n(3683),i=n(7869),o=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},6872:(e,t,n)=>{var r=n(6032);e.exports=Array.isArray||function(e){return"Array"===r(e)}},6357:(e,t,n)=>{var r=n(2155),i=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},6653:(e,t,n)=>{var r=n(1008),i=n(4543),o=n(6357),a=n(7611),s=n(7735),c=n(6842),l=function(){},u=[],d=s("Reflect","construct"),h=/^\s*(?:class|function)\b/,p=r(h.exec),f=!h.test(l),m=function(e){if(!o(e))return!1;try{return d(l,u,e),!0}catch(e){return!1}},g=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!p(h,c(e))}catch(e){return!0}};g.sham=!0,e.exports=!d||i((function(){var e;return m(m.call)||!m(Object)||!m((function(){e=!0}))||e}))?g:m},4396:(e,t,n)=>{var r=n(4543),i=n(6357),o=/#|\.prototype\./,a=function(e,t){var n=c[s(e)];return n===u||n!==l&&(i(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},3445:e=>{e.exports=function(e){return null==e}},1634:(e,t,n)=>{var r=n(6357),i=n(2155),o=i.all;e.exports=i.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===o}:function(e){return"object"==typeof e?null!==e:r(e)}},7051:e=>{e.exports=!1},2388:(e,t,n)=>{var r=n(1634),i=n(6032),o=n(3683)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"===i(e))}},2357:(e,t,n)=>{var r=n(7735),i=n(6357),o=n(5161),a=n(2496),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&o(t.prototype,s(e))}},3308:(e,t,n)=>{var r=n(1232),i=n(2957),o=n(151),a=n(215),s=n(5745),c=n(5526),l=n(5161),u=n(6417),d=n(787),h=n(2675),p=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,n){var g,v,y,E,b,_,C,S=n&&n.that,I=!(!n||!n.AS_ENTRIES),w=!(!n||!n.IS_RECORD),O=!(!n||!n.IS_ITERATOR),A=!(!n||!n.INTERRUPTED),T=r(t,S),P=function(e){return g&&h(g,"normal",e),new f(!0,e)},N=function(e){return I?(o(e),A?T(e[0],e[1],P):T(e[0],e[1])):A?T(e,P):T(e)};if(w)g=e.iterator;else if(O)g=e;else{if(!(v=d(e)))throw new p(a(e)+" is not iterable");if(s(v)){for(y=0,E=c(e);E>y;y++)if((b=N(e[y]))&&l(m,b))return b;return new f(!1)}g=u(e,v)}for(_=w?e.next:g.next;!(C=i(_,g)).done;){try{b=N(C.value)}catch(e){h(g,"throw",e)}if("object"==typeof b&&b&&l(m,b))return b}return new f(!1)}},2675:(e,t,n)=>{var r=n(2957),i=n(151),o=n(6046);e.exports=function(e,t,n){var a,s;i(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw n;if(s)throw a;return i(a),n}},714:(e,t,n)=>{var r=n(793).IteratorPrototype,i=n(2104),o=n(6372),a=n(6143),s=n(7869),c=function(){return this};e.exports=function(e,t,n,l){var u=t+" Iterator";return e.prototype=i(r,{next:o(+!l,n)}),a(e,u,!1,!0),s[u]=c,e}},3952:(e,t,n)=>{var r=n(6566),i=n(2957),o=n(7051),a=n(94),s=n(6357),c=n(714),l=n(7763),u=n(7943),d=n(6143),h=n(6587),p=n(9704),f=n(3683),m=n(7869),g=n(793),v=a.PROPER,y=a.CONFIGURABLE,E=g.IteratorPrototype,b=g.BUGGY_SAFARI_ITERATORS,_=f("iterator"),C="keys",S="values",I="entries",w=function(){return this};e.exports=function(e,t,n,a,f,g,O){c(n,t,a);var A,T,P,N=function(e){if(e===f&&k)return k;if(!b&&e&&e in L)return L[e];switch(e){case C:case S:case I:return function(){return new n(this,e)}}return function(){return new n(this)}},D=t+" Iterator",R=!1,L=e.prototype,x=L[_]||L["@@iterator"]||f&&L[f],k=!b&&x||N(f),M="Array"===t&&L.entries||x;if(M&&(A=l(M.call(new e)))!==Object.prototype&&A.next&&(o||l(A)===E||(u?u(A,E):s(A[_])||p(A,_,w)),d(A,D,!0,!0),o&&(m[D]=w)),v&&f===S&&x&&x.name!==S&&(!o&&y?h(L,"name",S):(R=!0,k=function(){return i(x,this)})),f)if(T={values:N(S),keys:g?k:N(C),entries:N(I)},O)for(P in T)(b||R||!(P in L))&&p(L,P,T[P]);else r({target:t,proto:!0,forced:b||R},T);return o&&!O||L[_]===k||p(L,_,k,{name:f}),m[t]=k,T}},793:(e,t,n)=>{var r,i,o,a=n(4543),s=n(6357),c=n(1634),l=n(2104),u=n(7763),d=n(9704),h=n(3683),p=n(7051),f=h("iterator"),m=!1;[].keys&&("next"in(o=[].keys())?(i=u(u(o)))!==Object.prototype&&(r=i):m=!0),!c(r)||a((function(){var e={};return r[f].call(e)!==e}))?r={}:p&&(r=l(r)),s(r[f])||d(r,f,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:m}},7869:e=>{e.exports={}},5526:(e,t,n)=>{var r=n(5966);e.exports=function(e){return r(e.length)}},27:(e,t,n)=>{var r=n(1008),i=n(4543),o=n(6357),a=n(5889),s=n(5180),c=n(94).CONFIGURABLE,l=n(6842),u=n(4317),d=u.enforce,h=u.get,p=String,f=Object.defineProperty,m=r("".slice),g=r("".replace),v=r([].join),y=s&&!i((function(){return 8!==f((function(){}),"length",{value:8}).length})),E=String(String).split("String"),b=e.exports=function(e,t,n){"Symbol("===m(p(t),0,7)&&(t="["+g(p(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(s?f(e,"name",{value:t,configurable:!0}):e.name=t),y&&n&&a(n,"arity")&&e.length!==n.arity&&f(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return a(r,"source")||(r.source=v(E,"string"==typeof t?t:"")),e};Function.prototype.toString=b((function(){return o(this)&&h(this).source||l(this)}),"toString")},4469:e=>{var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},495:(e,t,n)=>{var r=n(2388),i=TypeError;e.exports=function(e){if(r(e))throw new i("The method doesn't accept regular expressions");return e}},3280:(e,t,n)=>{var r=n(4523),i=n(4543),o=n(1008),a=n(2255),s=n(8906).trim,c=n(8908),l=o("".charAt),u=r.parseFloat,d=r.Symbol,h=d&&d.iterator,p=1/u(c+"-0")!=-1/0||h&&!i((function(){u(Object(h))}));e.exports=p?function(e){var t=s(a(e)),n=u(t);return 0===n&&"-"===l(t,0)?-0:n}:u},3957:(e,t,n)=>{var r=n(5180),i=n(1008),o=n(2957),a=n(4543),s=n(2528),c=n(2981),l=n(5),u=n(581),d=n(191),h=Object.assign,p=Object.defineProperty,f=i([].concat);e.exports=!h||a((function(){if(r&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol("assign detection"),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!==h({},e)[n]||s(h({},t)).join("")!==i}))?function(e,t){for(var n=u(e),i=arguments.length,a=1,h=c.f,p=l.f;i>a;)for(var m,g=d(arguments[a++]),v=h?f(s(g),h(g)):s(g),y=v.length,E=0;y>E;)m=v[E++],r&&!o(p,g,m)||(n[m]=g[m]);return n}:h},2104:(e,t,n)=>{var r,i=n(151),o=n(8337),a=n(8471),s=n(5525),c=n(2093),l=n(2679),u=n(9847),d="prototype",h="script",p=u("IE_PROTO"),f=function(){},m=function(e){return"<"+h+">"+e+"</"+h+">"},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;v="undefined"!=typeof document?document.domain&&r?g(r):(t=l("iframe"),n="java"+h+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):g(r);for(var i=a.length;i--;)delete v[d][a[i]];return v()};s[p]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(f[d]=i(e),n=new f,f[d]=null,n[p]=e):n=v(),void 0===t?n:o.f(n,t)}},8337:(e,t,n)=>{var r=n(5180),i=n(7310),o=n(8449),a=n(151),s=n(853),c=n(2528);t.f=r&&!i?Object.defineProperties:function(e,t){a(e);for(var n,r=s(t),i=c(t),l=i.length,u=0;l>u;)o.f(e,n=i[u++],r[n]);return e}},8449:(e,t,n)=>{var r=n(5180),i=n(9053),o=n(7310),a=n(151),s=n(9833),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",h="configurable",p="writable";t.f=r?o?function(e,t,n){if(a(e),t=s(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&p in n&&!n[p]){var r=u(e,t);r&&r[p]&&(e[t]=n.value,n={configurable:h in n?n[h]:r[h],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(a(e),t=s(t),a(n),i)try{return l(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},9763:(e,t,n)=>{var r=n(5180),i=n(2957),o=n(5),a=n(6372),s=n(853),c=n(9833),l=n(5889),u=n(9053),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return a(!i(o.f,e,t),e[t])}},3834:(e,t,n)=>{var r=n(6032),i=n(853),o=n(9712).f,a=n(231),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===r(e)?function(e){try{return o(e)}catch(e){return a(s)}}(e):o(i(e))}},9712:(e,t,n)=>{var r=n(1156),i=n(8471).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},2981:(e,t)=>{t.f=Object.getOwnPropertySymbols},7763:(e,t,n)=>{var r=n(5889),i=n(6357),o=n(581),a=n(9847),s=n(99),c=a("IE_PROTO"),l=Object,u=l.prototype;e.exports=s?l.getPrototypeOf:function(e){var t=o(e);if(r(t,c))return t[c];var n=t.constructor;return i(n)&&t instanceof n?n.prototype:t instanceof l?u:null}},3452:(e,t,n)=>{var r=n(4543),i=n(1634),o=n(6032),a=n(2372),s=Object.isExtensible,c=r((function(){s(1)}));e.exports=c||a?function(e){return!!i(e)&&(!a||"ArrayBuffer"!==o(e))&&(!s||s(e))}:s},5161:(e,t,n)=>{var r=n(1008);e.exports=r({}.isPrototypeOf)},1156:(e,t,n)=>{var r=n(1008),i=n(5889),o=n(853),a=n(2753).indexOf,s=n(5525),c=r([].push);e.exports=function(e,t){var n,r=o(e),l=0,u=[];for(n in r)!i(s,n)&&i(r,n)&&c(u,n);for(;t.length>l;)i(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},2528:(e,t,n)=>{var r=n(1156),i=n(8471);e.exports=Object.keys||function(e){return r(e,i)}},5:(e,t)=>{var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},7943:(e,t,n)=>{var r=n(2946),i=n(151),o=n(2834);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return i(n),o(r),t?e(n,r):n.__proto__=r,n}}():void 0)},5221:(e,t,n)=>{var r=n(5180),i=n(4543),o=n(1008),a=n(7763),s=n(2528),c=n(853),l=o(n(5).f),u=o([].push),d=r&&i((function(){var e=Object.create(null);return e[2]=2,!l(e,2)})),h=function(e){return function(t){for(var n,i=c(t),o=s(i),h=d&&null===a(i),p=o.length,f=0,m=[];p>f;)n=o[f++],r&&!(h?n in i:l(i,n))||u(m,e?[n,i[n]]:i[n]);return m}};e.exports={entries:h(!0),values:h(!1)}},5774:(e,t,n)=>{var r=n(2957),i=n(6357),o=n(1634),a=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&i(n=e.toString)&&!o(s=r(n,e)))return s;if(i(n=e.valueOf)&&!o(s=r(n,e)))return s;if("string"!==t&&i(n=e.toString)&&!o(s=r(n,e)))return s;throw new a("Can't convert object to primitive value")}},7527:(e,t,n)=>{var r=n(7735),i=n(1008),o=n(9712),a=n(2981),s=n(151),c=i([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(s(e)),n=a.f;return n?c(t,n(e)):t}},4192:(e,t,n)=>{var r=n(8449).f;e.exports=function(e,t,n){n in e||r(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}},6010:(e,t,n)=>{var r=n(2957),i=n(151),o=n(6357),a=n(6032),s=n(8779),c=TypeError;e.exports=function(e,t){var n=e.exec;if(o(n)){var l=r(n,e,t);return null!==l&&i(l),l}if("RegExp"===a(e))return r(s,e,t);throw new c("RegExp#exec called on incompatible receiver")}},8779:(e,t,n)=>{var r,i,o=n(2957),a=n(1008),s=n(2255),c=n(4315),l=n(9933),u=n(9441),d=n(2104),h=n(4317).get,p=n(3027),f=n(8702),m=u("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,v=g,y=a("".charAt),E=a("".indexOf),b=a("".replace),_=a("".slice),C=(i=/b*/g,o(g,r=/a/,"a"),o(g,i,"a"),0!==r.lastIndex||0!==i.lastIndex),S=l.BROKEN_CARET,I=void 0!==/()??/.exec("")[1];(C||I||S||p||f)&&(v=function(e){var t,n,r,i,a,l,u,p=this,f=h(p),w=s(e),O=f.raw;if(O)return O.lastIndex=p.lastIndex,t=o(v,O,w),p.lastIndex=O.lastIndex,t;var A=f.groups,T=S&&p.sticky,P=o(c,p),N=p.source,D=0,R=w;if(T&&(P=b(P,"y",""),-1===E(P,"g")&&(P+="g"),R=_(w,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(w,p.lastIndex-1))&&(N="(?: "+N+")",R=" "+R,D++),n=new RegExp("^(?:"+N+")",P)),I&&(n=new RegExp("^"+N+"$(?!\\s)",P)),C&&(r=p.lastIndex),i=o(g,T?n:p,R),T?i?(i.input=_(i.input,D),i[0]=_(i[0],D),i.index=p.lastIndex,p.lastIndex+=i[0].length):p.lastIndex=0:C&&i&&(p.lastIndex=p.global?i.index+i[0].length:r),I&&i&&i.length>1&&o(m,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&A)for(i.groups=l=d(null),a=0;a<A.length;a++)l[(u=A[a])[0]]=i[u[1]];return i}),e.exports=v},4315:(e,t,n)=>{var r=n(151);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},1274:(e,t,n)=>{var r=n(2957),i=n(5889),o=n(5161),a=n(4315),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||i(e,"flags")||!o(s,e)?t:r(a,e)}},9933:(e,t,n)=>{var r=n(4543),i=n(4523).RegExp,o=r((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=o||r((function(){return!i("a","y").sticky})),s=o||r((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},3027:(e,t,n)=>{var r=n(4543),i=n(4523).RegExp;e.exports=r((function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},8702:(e,t,n)=>{var r=n(4543),i=n(4523).RegExp;e.exports=r((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},9286:(e,t,n)=>{var r=n(3445),i=TypeError;e.exports=function(e){if(r(e))throw new i("Can't call method on "+e);return e}},9089:(e,t,n)=>{var r=n(7735),i=n(3642),o=n(3683),a=n(5180),s=o("species");e.exports=function(e){var t=r(e);a&&t&&!t[s]&&i(t,s,{configurable:!0,get:function(){return this}})}},6143:(e,t,n)=>{var r=n(8449).f,i=n(5889),o=n(3683)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!i(e,o)&&r(e,o,{configurable:!0,value:t})}},9847:(e,t,n)=>{var r=n(9441),i=n(6048),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},3965:(e,t,n)=>{var r=n(4523),i=n(2969),o="__core-js_shared__",a=r[o]||i(o,{});e.exports=a},9441:(e,t,n)=>{var r=n(7051),i=n(3965);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.33.0",mode:r?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"})},8581:(e,t,n)=>{var r=n(151),i=n(5292),o=n(3445),a=n(3683)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||o(n=r(s)[a])?t:i(n)}},4775:(e,t,n)=>{var r=n(1008),i=n(4827),o=n(2255),a=n(9286),s=r("".charAt),c=r("".charCodeAt),l=r("".slice),u=function(e){return function(t,n){var r,u,d=o(a(t)),h=i(n),p=d.length;return h<0||h>=p?e?"":void 0:(r=c(d,h))<55296||r>56319||h+1===p||(u=c(d,h+1))<56320||u>57343?e?s(d,h):r:e?l(d,h,h+2):u-56320+(r-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},4567:(e,t,n)=>{var r=n(4848);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(r)},613:(e,t,n)=>{var r=n(1008),i=n(5966),o=n(2255),a=n(4458),s=n(9286),c=r(a),l=r("".slice),u=Math.ceil,d=function(e){return function(t,n,r){var a,d,h=o(s(t)),p=i(n),f=h.length,m=void 0===r?" ":o(r);return p<=f||""===m?h:((d=c(m,u((a=p-f)/m.length))).length>a&&(d=l(d,0,a)),e?h+d:d+h)}};e.exports={start:d(!1),end:d(!0)}},4458:(e,t,n)=>{var r=n(4827),i=n(2255),o=n(9286),a=RangeError;e.exports=function(e){var t=i(o(this)),n="",s=r(e);if(s<0||s===1/0)throw new a("Wrong number of repetitions");for(;s>0;(s>>>=1)&&(t+=t))1&s&&(n+=t);return n}},82:(e,t,n)=>{var r=n(94).PROPER,i=n(4543),o=n(8908);e.exports=function(e){return i((function(){return!!o[e]()||"​᠎"!=="​᠎"[e]()||r&&o[e].name!==e}))}},8906:(e,t,n)=>{var r=n(1008),i=n(9286),o=n(2255),a=n(8908),s=r("".replace),c=RegExp("^["+a+"]+"),l=RegExp("(^|[^"+a+"])["+a+"]+$"),u=function(e){return function(t){var n=o(i(t));return 1&e&&(n=s(n,c,"")),2&e&&(n=s(n,l,"$1")),n}};e.exports={start:u(1),end:u(2),trim:u(3)}},4687:(e,t,n)=>{var r=n(2844),i=n(4543),o=n(4523).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},3048:(e,t,n)=>{var r=n(1008);e.exports=r(1..valueOf)},7418:(e,t,n)=>{var r=n(4827),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},853:(e,t,n)=>{var r=n(191),i=n(9286);e.exports=function(e){return r(i(e))}},4827:(e,t,n)=>{var r=n(4469);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},5966:(e,t,n)=>{var r=n(4827),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},581:(e,t,n)=>{var r=n(9286),i=Object;e.exports=function(e){return i(r(e))}},9113:(e,t,n)=>{var r=n(2957),i=n(1634),o=n(2357),a=n(6046),s=n(5774),c=n(3683),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!i(n)||o(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},9833:(e,t,n)=>{var r=n(9113),i=n(2357);e.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}},3644:(e,t,n)=>{var r={};r[n(3683)("toStringTag")]="z",e.exports="[object z]"===String(r)},2255:(e,t,n)=>{var r=n(7611),i=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},215:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6048:(e,t,n)=>{var r=n(1008),i=0,o=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,36)}},2496:(e,t,n)=>{var r=n(4687);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7310:(e,t,n)=>{var r=n(5180),i=n(4543);e.exports=r&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},158:(e,t,n)=>{var r=n(4523),i=n(6357),o=r.WeakMap;e.exports=i(o)&&/native code/.test(String(o))},3683:(e,t,n)=>{var r=n(4523),i=n(9441),o=n(5889),a=n(6048),s=n(4687),c=n(2496),l=r.Symbol,u=i("wks"),d=c?l.for||l:l&&l.withoutSetter||a;e.exports=function(e){return o(u,e)||(u[e]=s&&o(l,e)?l[e]:d("Symbol."+e)),u[e]}},8908:e=>{e.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},935:(e,t,n)=>{var r=n(6566),i=n(2753).includes,o=n(4543),a=n(5845);r({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},6656:(e,t,n)=>{var r=n(853),i=n(5845),o=n(7869),a=n(4317),s=n(8449).f,c=n(3952),l=n(5025),u=n(7051),d=n(5180),h="Array Iterator",p=a.set,f=a.getterFor(h);e.exports=c(Array,"Array",(function(e,t){p(this,{type:h,target:r(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,n=e.kind,r=e.index++;if(!t||r>=t.length)return e.target=void 0,l(void 0,!0);switch(n){case"keys":return l(r,!1);case"values":return l(t[r],!1)}return l([r,t[r]],!1)}),"values");var m=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!u&&d&&"values"!==m.name)try{s(m,"name",{value:"values"})}catch(e){}},6104:(e,t,n)=>{var r=n(6566),i=n(7262).left,o=n(4486),a=n(2844);r({target:"Array",proto:!0,forced:!n(2224)&&a>79&&a<83||!o("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},7156:(e,t,n)=>{var r=n(6566),i=n(3280);r({target:"Number",stat:!0,forced:Number.parseFloat!==i},{parseFloat:i})},6460:(e,t,n)=>{var r=n(6566),i=n(1008),o=n(4827),a=n(3048),s=n(4458),c=n(4543),l=RangeError,u=String,d=Math.floor,h=i(s),p=i("".slice),f=i(1..toFixed),m=function(e,t,n){return 0===t?n:t%2==1?m(e,t-1,n*e):m(e*e,t/2,n)},g=function(e,t,n){for(var r=-1,i=n;++r<6;)i+=t*e[r],e[r]=i%1e7,i=d(i/1e7)},v=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=d(r/t),r=r%t*1e7},y=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var r=u(e[t]);n=""===n?r:n+h("0",7-r.length)+r}return n};r({target:"Number",proto:!0,forced:c((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!c((function(){f({})}))},{toFixed:function(e){var t,n,r,i,s=a(this),c=o(e),d=[0,0,0,0,0,0],f="",E="0";if(c<0||c>20)throw new l("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return u(s);if(s<0&&(f="-",s=-s),s>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(s*m(2,69,1))-69)<0?s*m(2,-t,1):s/m(2,t,1),n*=4503599627370496,(t=52-t)>0){for(g(d,0,n),r=c;r>=7;)g(d,1e7,0),r-=7;for(g(d,m(10,r,1),0),r=t-1;r>=23;)v(d,1<<23),r-=23;v(d,1<<r),g(d,1,1),v(d,2),E=y(d)}else g(d,0,n),g(d,1<<-t,0),E=y(d)+h("0",c);return c>0?f+((i=E.length)<=c?"0."+h("0",c-i)+E:p(E,0,i-c)+"."+p(E,i-c)):f+E}})},2221:(e,t,n)=>{var r=n(6566),i=n(3957);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},8370:(e,t,n)=>{var r=n(6566),i=n(5221).entries;r({target:"Object",stat:!0},{entries:function(e){return i(e)}})},3249:(e,t,n)=>{var r=n(6566),i=n(3308),o=n(9904);r({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,(function(e,n){o(t,e,n)}),{AS_ENTRIES:!0}),t}})},9170:(e,t,n)=>{var r=n(6566),i=n(5221).values;r({target:"Object",stat:!0},{values:function(e){return i(e)}})},1152:(e,t,n)=>{var r=n(5180),i=n(4523),o=n(1008),a=n(4396),s=n(3103),c=n(6587),l=n(9712).f,u=n(5161),d=n(2388),h=n(2255),p=n(1274),f=n(9933),m=n(4192),g=n(9704),v=n(4543),y=n(5889),E=n(4317).enforce,b=n(9089),_=n(3683),C=n(3027),S=n(8702),I=_("match"),w=i.RegExp,O=w.prototype,A=i.SyntaxError,T=o(O.exec),P=o("".charAt),N=o("".replace),D=o("".indexOf),R=o("".slice),L=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,x=/a/g,k=/a/g,M=new w(x)!==x,j=f.MISSED_STICKY,U=f.UNSUPPORTED_Y;if(a("RegExp",r&&(!M||j||C||S||v((function(){return k[I]=!1,w(x)!==x||w(k)===k||"/a/i"!==String(w(x,"i"))}))))){for(var B=function(e,t){var n,r,i,o,a,l,f=u(O,this),m=d(e),g=void 0===t,v=[],b=e;if(!f&&m&&g&&e.constructor===B)return e;if((m||u(O,e))&&(e=e.source,g&&(t=p(b))),e=void 0===e?"":h(e),t=void 0===t?"":h(t),b=e,C&&"dotAll"in x&&(r=!!t&&D(t,"s")>-1)&&(t=N(t,/s/g,"")),n=t,j&&"sticky"in x&&(i=!!t&&D(t,"y")>-1)&&U&&(t=N(t,/y/g,"")),S&&(o=function(e){for(var t,n=e.length,r=0,i="",o=[],a={},s=!1,c=!1,l=0,u="";r<=n;r++){if("\\"===(t=P(e,r)))t+=P(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:T(L,R(e,r+1))&&(r+=2,c=!0),i+=t,l++;continue;case">"===t&&c:if(""===u||y(a,u))throw new A("Invalid capture group name");a[u]=!0,o[o.length]=[u,l],c=!1,u="";continue}c?u+=t:i+=t}return[i,o]}(e),e=o[0],v=o[1]),a=s(w(e,t),f?this:O,B),(r||i||v.length)&&(l=E(a),r&&(l.dotAll=!0,l.raw=B(function(e){for(var t,n=e.length,r=0,i="",o=!1;r<=n;r++)"\\"!==(t=P(e,r))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),i+=t):i+="[\\s\\S]":i+=t+P(e,++r);return i}(e),n)),i&&(l.sticky=!0),v.length&&(l.groups=v)),e!==b)try{c(a,"source",""===b?"(?:)":b)}catch(e){}return a},q=l(w),H=0;q.length>H;)m(B,w,q[H++]);O.constructor=B,B.prototype=O,g(i,"RegExp",B,{constructor:!0})}b("RegExp")},3831:(e,t,n)=>{var r=n(6566),i=n(8779);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},4237:(e,t,n)=>{var r=n(94).PROPER,i=n(9704),o=n(151),a=n(2255),s=n(4543),c=n(1274),l="toString",u=RegExp.prototype[l],d=s((function(){return"/a/b"!==u.call({source:"a",flags:"b"})})),h=r&&u.name!==l;(d||h)&&i(RegExp.prototype,l,(function(){var e=o(this);return"/"+a(e.source)+"/"+a(c(e))}),{unsafe:!0})},1257:(e,t,n)=>{var r,i=n(6566),o=n(1316),a=n(9763).f,s=n(5966),c=n(2255),l=n(495),u=n(9286),d=n(6412),h=n(7051),p=o("".endsWith),f=o("".slice),m=Math.min,g=d("endsWith");i({target:"String",proto:!0,forced:!(!h&&!g&&(r=a(String.prototype,"endsWith"),r&&!r.writable)||g)},{endsWith:function(e){var t=c(u(this));l(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,i=void 0===n?r:m(s(n),r),o=c(e);return p?p(t,o,i):f(t,i-o.length,i)===o}})},8291:(e,t,n)=>{var r=n(6566),i=n(1008),o=n(495),a=n(9286),s=n(2255),c=n(6412),l=i("".indexOf);r({target:"String",proto:!0,forced:!c("includes")},{includes:function(e){return!!~l(s(a(this)),s(o(e)),arguments.length>1?arguments[1]:void 0)}})},9964:(e,t,n)=>{var r=n(6566),i=n(613).start;r({target:"String",proto:!0,forced:n(4567)},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},8304:(e,t,n)=>{var r=n(1881),i=n(2957),o=n(1008),a=n(1644),s=n(4543),c=n(151),l=n(6357),u=n(3445),d=n(4827),h=n(5966),p=n(2255),f=n(9286),m=n(7157),g=n(6046),v=n(9070),y=n(6010),E=n(3683)("replace"),b=Math.max,_=Math.min,C=o([].concat),S=o([].push),I=o("".indexOf),w=o("".slice),O="$0"==="a".replace(/./,"$0"),A=!!/./[E]&&""===/./[E]("a","$0");a("replace",(function(e,t,n){var o=A?"$":"$0";return[function(e,n){var r=f(this),o=u(e)?void 0:g(e,E);return o?i(o,e,r,n):i(t,p(r),e,n)},function(e,i){var a=c(this),s=p(e);if("string"==typeof i&&-1===I(i,o)&&-1===I(i,"$<")){var u=n(t,a,s,i);if(u.done)return u.value}var f=l(i);f||(i=p(i));var g,E=a.global;E&&(g=a.unicode,a.lastIndex=0);for(var O,A=[];null!==(O=y(a,s))&&(S(A,O),E);)""===p(O[0])&&(a.lastIndex=m(s,h(a.lastIndex),g));for(var T,P="",N=0,D=0;D<A.length;D++){for(var R,L=p((O=A[D])[0]),x=b(_(d(O.index),s.length),0),k=[],M=1;M<O.length;M++)S(k,void 0===(T=O[M])?T:String(T));var j=O.groups;if(f){var U=C([L],k,x,s);void 0!==j&&S(U,j),R=p(r(i,void 0,U))}else R=v(L,s,x,k,j,i);x>=N&&(P+=w(s,N,x)+R,N=x+L.length)}return P+w(s,N)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!O||A)},488:(e,t,n)=>{var r=n(1881),i=n(2957),o=n(1008),a=n(1644),s=n(151),c=n(3445),l=n(2388),u=n(9286),d=n(8581),h=n(7157),p=n(5966),f=n(2255),m=n(6046),g=n(231),v=n(6010),y=n(8779),E=n(9933),b=n(4543),_=E.UNSUPPORTED_Y,C=4294967295,S=Math.min,I=[].push,w=o(/./.exec),O=o(I),A=o("".slice);a("split",(function(e,t,n){var o;return o="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var o=f(u(this)),a=void 0===n?C:n>>>0;if(0===a)return[];if(void 0===e)return[o];if(!l(e))return i(t,o,e,a);for(var s,c,d,h=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),m=0,v=new RegExp(e.source,p+"g");(s=i(y,v,o))&&!((c=v.lastIndex)>m&&(O(h,A(o,m,s.index)),s.length>1&&s.index<o.length&&r(I,h,g(s,1)),d=s[0].length,m=c,h.length>=a));)v.lastIndex===s.index&&v.lastIndex++;return m===o.length?!d&&w(v,"")||O(h,""):O(h,A(o,m)),h.length>a?g(h,0,a):h}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:i(t,this,e,n)}:t,[function(t,n){var r=u(this),a=c(t)?void 0:m(t,e);return a?i(a,t,r,n):i(o,f(r),t,n)},function(e,r){var i=s(this),a=f(e),c=n(o,i,a,r,o!==t);if(c.done)return c.value;var l=d(i,RegExp),u=i.unicode,m=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(_?"g":"y"),g=new l(_?"^(?:"+i.source+")":i,m),y=void 0===r?C:r>>>0;if(0===y)return[];if(0===a.length)return null===v(g,a)?[a]:[];for(var E=0,b=0,I=[];b<a.length;){g.lastIndex=_?0:b;var w,T=v(g,_?A(a,b):a);if(null===T||(w=S(p(g.lastIndex+(_?b:0)),a.length))===E)b=h(a,b,u);else{if(O(I,A(a,E,b)),I.length===y)return I;for(var P=1;P<=T.length-1;P++)if(O(I,T[P]),I.length===y)return I;b=E=w}}return O(I,A(a,E)),I}]}),!!b((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),_)},7680:(e,t,n)=>{var r,i=n(6566),o=n(1316),a=n(9763).f,s=n(5966),c=n(2255),l=n(495),u=n(9286),d=n(6412),h=n(7051),p=o("".startsWith),f=o("".slice),m=Math.min,g=d("startsWith");i({target:"String",proto:!0,forced:!(!h&&!g&&(r=a(String.prototype,"startsWith"),r&&!r.writable)||g)},{startsWith:function(e){var t=c(u(this));l(e);var n=s(m(arguments.length>1?arguments[1]:void 0,t.length)),r=c(e);return p?p(t,r,n):f(t,n,n+r.length)===r}})},9098:(e,t,n)=>{var r=n(6566),i=n(8906).trim;r({target:"String",proto:!0,forced:n(82)("trim")},{trim:function(){return i(this)}})},9399:(e,t,n)=>{var r=n(6566),i=n(5180),o=n(4523),a=n(1008),s=n(5889),c=n(6357),l=n(5161),u=n(2255),d=n(3642),h=n(812),p=o.Symbol,f=p&&p.prototype;if(i&&c(p)&&(!("description"in f)||void 0!==p().description)){var m={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:u(arguments[0]),t=l(f,this)?new p(e):void 0===e?p():p(e);return""===e&&(m[t]=!0),t};h(g,p),g.prototype=f,f.constructor=g;var v="Symbol(description detection)"===String(p("description detection")),y=a(f.valueOf),E=a(f.toString),b=/^Symbol\((.*)\)[^)]+$/,_=a("".replace),C=a("".slice);d(f,"description",{configurable:!0,get:function(){var e=y(this);if(s(m,e))return"";var t=E(e),n=v?C(t,7,-1):_(t,b,"$1");return""===n?void 0:n}}),r({global:!0,constructor:!0,forced:!0},{Symbol:g})}},7250:(e,t,n)=>{var r,i=n(5240),o=n(4523),a=n(1008),s=n(6519),c=n(8907),l=n(196),u=n(8137),d=n(1634),h=n(4317).enforce,p=n(4543),f=n(158),m=Object,g=Array.isArray,v=m.isExtensible,y=m.isFrozen,E=m.isSealed,b=m.freeze,_=m.seal,C={},S={},I=!o.ActiveXObject&&"ActiveXObject"in o,w=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},O=l("WeakMap",w,u),A=O.prototype,T=a(A.set);if(f)if(I){r=u.getConstructor(w,"WeakMap",!0),c.enable();var P=a(A.delete),N=a(A.has),D=a(A.get);s(A,{delete:function(e){if(d(e)&&!v(e)){var t=h(this);return t.frozen||(t.frozen=new r),P(this,e)||t.frozen.delete(e)}return P(this,e)},has:function(e){if(d(e)&&!v(e)){var t=h(this);return t.frozen||(t.frozen=new r),N(this,e)||t.frozen.has(e)}return N(this,e)},get:function(e){if(d(e)&&!v(e)){var t=h(this);return t.frozen||(t.frozen=new r),N(this,e)?D(this,e):t.frozen.get(e)}return D(this,e)},set:function(e,t){if(d(e)&&!v(e)){var n=h(this);n.frozen||(n.frozen=new r),N(this,e)?T(this,e,t):n.frozen.set(e,t)}else T(this,e,t);return this}})}else i&&p((function(){var e=b([]);return T(new O,e,1),!y(e)}))&&s(A,{set:function(e,t){var n;return g(e)&&(y(e)?n=C:E(e)&&(n=S)),T(this,e,t),n===C&&b(e),n===S&&_(e),this}})},5372:(e,t,n)=>{n(7250)},2892:(e,t,n)=>{var r=n(4523),i=n(792),o=n(832),a=n(3371),s=n(6587),c=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var l in i)i[l]&&c(r[l]&&r[l].prototype);c(o)},5993:(e,t,n)=>{var r=n(4523),i=n(792),o=n(832),a=n(6656),s=n(6587),c=n(3683),l=c("iterator"),u=c("toStringTag"),d=a.values,h=function(e,t){if(e){if(e[l]!==d)try{s(e,l,d)}catch(t){e[l]=d}if(e[u]||s(e,u,t),i[t])for(var n in a)if(e[n]!==a[n])try{s(e,n,a[n])}catch(t){e[n]=a[n]}}};for(var p in i)h(r[p]&&r[p].prototype,p);h(o,"DOMTokenList")}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(9399),n(6656),n(2221),n(3831),n(4237),n(5993),n(935),n(8291),n(2892);var r=/android/i;function i(){var e=window.navigator.userAgent;return!!e&&Boolean((e.includes("Safari")&&(e.includes("iPhone")||e.includes("iPad"))&&!e.includes("Trident")||e.includes("AppleWebKit")&&!(e.includes("Android")||e.includes("Linux")||e.includes("Trident"))&&(e.includes("Mobile")||e.includes("iPhone")||e.includes("iPad"))&&!e.includes("Macintosh")&&!e.includes("Windows"))&&!(e.includes("Chrome")||e.includes("CriOS")||e.includes("Edg")))}function o(){var e=window.navigator.userAgent;return!!e&&Boolean((e.includes("Safari")||e.includes("AppleWebKit"))&&(e.includes("Macintosh")||e.includes("Windows"))&&!e.includes("iPhone")&&!e.includes("iPad")&&!e.includes("Chrome")&&!e.includes("Edg")&&!e.includes("Firefox"))}var a={get documentBody(){return window.document.body},get documentReferrer(){return window.document.referrer},get documentVisibilityState(){return document.visibilityState},getQueryParams:function(e,t){var n=new URL(e),r={};return t.forEach((e=>{var t=n.searchParams.get(e);null!==t&&(r[e]=t)})),r},isAndroid:function(){return r.test(window.navigator.userAgent)},isDesktopSafari:o,isMobileSafari:i,isSafari:function(){return i()||o()},get isSecureContext(){return window.isSecureContext},isSupported:function(){return void 0!==window.postMessage&&void 0!==window.fetch&&void 0!==document.createElement("a").classList},get isTopLevelWindow(){return window.parent===window},get supportsCryptoDigest(){var e;return void 0!==(null===(e=crypto.subtle)||void 0===e?void 0:e.digest)},get supportsDocumentVisibilityState(){return void 0!==document.visibilityState},get supportsPerformanceEntries(){return"performance"in window&&"function"==typeof window.performance.getEntriesByType},get supportsSendBeacon(){return"function"==typeof window.navigator.sendBeacon},get windowInnerHeight(){return window.innerHeight},get windowInnerWidth(){return window.innerWidth},get windowLocation(){return window.location},get windowNavigationBeacon(){return(e,t)=>window.navigator.sendBeacon(e,t)},get windowNavigatorLanguages(){var e=window.navigator,t=e.language,n=e.languages;return Array.isArray(n)?t&&t!==n[0]?[t,...n]:n:t?[t]:["en-US"]},get windowParentLocation(){return window.parent.location},get windowPerformance(){return window.performance}};const s="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function c(e){return e&&e.Math==Math?e:void 0}const l="object"==typeof globalThis&&c(globalThis)||"object"==typeof window&&c(window)||"object"==typeof self&&c(self)||"object"==typeof n.g&&c(n.g)||function(){return this}()||{};function u(){return l}function d(e,t,n){const r=n||l,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}const h=["debug","info","warn","error","log","assert","trace"],p={};function f(e){if(!("console"in l))return e();const t=l.console,n={},r=Object.keys(p);r.forEach((e=>{const r=p[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}const m=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return s?h.forEach((n=>{t[n]=(...t)=>{e&&f((()=>{l.console[n](`Sentry Logger [${n}]:`,...t)}))}})):h.forEach((e=>{t[e]=()=>{}})),t}(),g="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,v=Object.prototype.toString;function y(e){switch(v.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return T(e,Error)}}function E(e,t){return v.call(e)===`[object ${t}]`}function b(e){return E(e,"ErrorEvent")}function _(e){return E(e,"DOMError")}function C(e){return E(e,"String")}function S(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function I(e){return null===e||S(e)||"object"!=typeof e&&"function"!=typeof e}function w(e){return E(e,"Object")}function O(e){return"undefined"!=typeof Event&&T(e,Event)}function A(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function T(e,t){try{return e instanceof t}catch(e){return!1}}function P(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}var N;function D(e){return new L((t=>{t(e)}))}function R(e){return new L(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(N||(N={}));class L{constructor(e){L.prototype.__init.call(this),L.prototype.__init2.call(this),L.prototype.__init3.call(this),L.prototype.__init4.call(this),this._state=N.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new L(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new L(((t,n)=>{let r,i;return this.then((t=>{i=!1,r=t,e&&e()}),(t=>{i=!0,r=t,e&&e()})).then((()=>{i?n(r):t(r)}))}))}__init(){this._resolve=e=>{this._setResult(N.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(N.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===N.PENDING&&(A(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===N.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===N.RESOLVED&&e[1](this._value),this._state===N.REJECTED&&e[2](this._value),e[0]=!0)}))}}}function x(){return d("globalEventProcessors",(()=>[]))}function k(e){x().push(e)}function M(e,t,n,r=0){return new L(((i,o)=>{const a=e[r];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},n);g&&a.id&&null===s&&m.log(`Event processor "${a.id}" dropped event`),A(s)?s.then((t=>M(e,t,n,r+1).then(i))).then(null,o):M(e,s,n,r+1).then(i).then(null,o)}}))}const j=u();function U(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,i=[];let o=0,a=0;const s=" > ",c=s.length;let l;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&o++<r&&(l=B(n,u),!("html"===l||o>1&&a+i.length*c+l.length>=d));)i.push(l),a+=l.length,n=n.parentNode;return i.reverse().join(s)}catch(e){return"<unknown>"}}function B(e,t){const n=e,r=[];let i,o,a,s,c;if(!n||!n.tagName)return"";if(j.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const l=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(l&&l.length)l.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&C(i))for(o=i.split(/\s+/),c=0;c<o.length;c++)r.push(`.${o[c]}`);const u=["aria-label","type","name","title","alt"];for(c=0;c<u.length;c++)a=u[c],s=n.getAttribute(a),s&&r.push(`[${a}="${s}"]`);return r.join("")}function q(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function H(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{P(r)?n.push("[VueViewModel]"):n.push(String(r))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function F(e,t=[],n=!1){return t.some((t=>function(e,t,n=!1){return!!C(e)&&(E(t,"RegExp")?t.test(e):!!C(t)&&(n?e===t:e.includes(t)))}(e,t,n)))}function V(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);"function"==typeof i&&z(i,r),e[t]=i}function G(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(n){s&&m.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function z(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,G(e,"__sentry_original__",t)}catch(e){}}function $(e){return e.__sentry_original__}function Y(e){if(y(e))return{message:e.message,name:e.name,stack:e.stack,...K(e)};if(O(e)){const t={type:e.type,target:W(e.target),currentTarget:W(e.currentTarget),...K(e)};return"undefined"!=typeof CustomEvent&&T(e,CustomEvent)&&(t.detail=e.detail),t}return e}function W(e){try{return"undefined"!=typeof Element&&T(e,Element)?U(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}}function K(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function X(e){return J(e,new Map)}function J(e,t){if(function(e){if(!w(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(e){return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const n of Object.keys(e))void 0!==e[n]&&(r[n]=J(e[n],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach((e=>{r.push(J(e,t))})),r}return e}function Z(){const e=l,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(e){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function Q(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function ee(e){const{message:t,event_id:n}=e;if(t)return t;const r=Q(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function te(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=n||"Error")}function ne(e,t){const n=Q(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r&&r.data,...t.data};n.mechanism.data=e}}function re(e){if(e&&e.__sentry_captured__)return!0;try{G(e,"__sentry_captured__",!0)}catch(e){}return!1}function ie(){return Date.now()/1e3}const oe=function(){const{performance:e}=l;if(!e||!e.now)return ie;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();let ae;(()=>{const{performance:e}=l;if(!e||!e.now)return void(ae="none");const t=36e5,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=i<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;o||s<t?i<=s?(ae="timeOrigin",e.timeOrigin):ae="navigationStart":ae="dateNow"})();const se="production";function ce(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||oe(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Z()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}const le=/\(error: (.*)\)/,ue=/captureMessage|captureException/;const de="<anonymous>";function he(e){try{return e&&"function"==typeof e&&e.name||de}catch(e){return de}}function pe(e,t=100,n=1/0){try{return me("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function fe(e,t=3,n=102400){const r=pe(e,t);return i=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(i))>n?fe(e,t-1,n):r;var i}function me(e,t,r=1/0,i=1/0,o=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[a,s]=o;if(null==t||["number","boolean","string"].includes(typeof t)&&("number"!=typeof(c=t)||c==c))return t;var c;const l=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(void 0!==n.g&&t===n.g)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(P(t))return"[VueViewModel]";if(function(e){return w(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t))return"[SyntheticEvent]";if("number"==typeof t&&t!=t)return"[NaN]";if("function"==typeof t)return`[Function: ${he(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;const u="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===u)return l.replace("object ","");if(a(t))return"[Circular ~]";const d=t;if(d&&"function"==typeof d.toJSON)try{return me("",d.toJSON(),u-1,i,o)}catch(e){}const h=Array.isArray(t)?[]:{};let p=0;const f=Y(t);for(const e in f){if(!Object.prototype.hasOwnProperty.call(f,e))continue;if(p>=i){h[e]="[MaxProperties ~]";break}const t=f[e];h[e]=me(e,t,u-1,i,o),p++}return s(t),h}function ge(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:o,status:a,tags:s,origin:c}=ve(e);return X({data:r,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:n,origin:c})}function ve(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}const ye=new WeakMap;const Ee=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function be(e,t){return Be().captureEvent(e,t)}function _e(e,t){Be().addBreadcrumb(e,t)}function Ce(){return Be().getClient()}function Se(){return Be().getScope()}function Ie(e){return e.transaction}function we(e,t,n){const r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=n&&n.getUser()||{},a=X({environment:r.environment||se,release:r.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function Oe(e){const t=Ce();if(!t)return{};const n=we(ve(e).trace_id||"",t,Se()),r=Ie(e);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:o,source:a}=r.metadata;null!=o&&(n.sample_rate=`${o}`);const s=ve(r);return a&&"url"!==a&&(n.transaction=s.description),n.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return Boolean(1&t)}(r)),t.emit&&t.emit("createDsc",n),n}function Ae(e,t){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:o}=t;!function(e,t){const{extra:n,tags:r,user:i,contexts:o,level:a,transactionName:s}=t,c=X(n);c&&Object.keys(c).length&&(e.extra={...c,...e.extra});const l=X(r);l&&Object.keys(l).length&&(e.tags={...l,...e.tags});const u=X(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=X(o);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),a&&(e.level=a),s&&(e.transaction=s)}(e,t),r&&function(e,t){e.contexts={trace:ge(t),...e.contexts};const n=Ie(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:Oe(t),...e.sdkProcessingMetadata};const r=ve(n).description;r&&(e.tags={transaction:r,...e.tags})}}(e,r),function(e,t){var n;e.fingerprint=e.fingerprint?(n=e.fingerprint,Array.isArray(n)?n:[n]):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,i),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,o)}function Te(e,t){const{extra:n,tags:r,user:i,contexts:o,level:a,sdkProcessingMetadata:s,breadcrumbs:c,fingerprint:l,eventProcessors:u,attachments:d,propagationContext:h,transactionName:p,span:f}=t;Pe(e,"extra",n),Pe(e,"tags",r),Pe(e,"user",i),Pe(e,"contexts",o),Pe(e,"sdkProcessingMetadata",s),a&&(e.level=a),p&&(e.transactionName=p),f&&(e.span=f),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...h}}function Pe(e,t,n){if(n&&Object.keys(n).length){e[t]={...e[t]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}}let Ne;class De{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Re()}static clone(e){return e?e.clone():new De}clone(){const e=new De;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&ce(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e;if(t instanceof De){const e=t.getScopeData();this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&Object.keys(e.user).length&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint.length&&(this._fingerprint=e.fingerprint),t.getRequestSession()&&(this._requestSession=t.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if(w(t)){const t=e;this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Re(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:ie(),...e},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:r,_extra:i,_user:o,_level:a,_fingerprint:s,_eventProcessors:c,_propagationContext:l,_sdkProcessingMetadata:u,_transactionName:d,_span:h}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:r,extra:i,user:o,level:a,fingerprint:s||[],eventProcessors:c,propagationContext:l,sdkProcessingMetadata:u,transactionName:d,span:h}}applyToEvent(e,t={},n=[]){return Ae(e,this.getScopeData()),M([...n,...x(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:Z();if(!this._client)return m.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:Z();if(!this._client)return m.warn("No client configured on scope - will not capture message!"),r;const i=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Z();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(m.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function Re(){return{traceId:Z(),spanId:Z().substring(16)}}const Le="7.120.4",xe=parseFloat(Le),ke=100;class Me{constructor(e,t,n,r=xe){let i,o;this._version=r,t?i=t:(i=new De,i.setClient(e)),n?o=n:(o=new De,o.setClient(e)),this._stack=[{scope:i}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1||!this.getStack().pop())}withScope(e){const t=this.pushScope();let n;try{n=e(t)}catch(e){throw this.popScope(),e}return A(n)?n.then((e=>(this.popScope(),e)),(e=>{throw this.popScope(),e})):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:Z(),r=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:r,...t,event_id:n}),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:Z(),i=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Z();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=ke}=r.getOptions&&r.getOptions()||{};if(o<=0)return;const a={timestamp:ie(),...e},s=i?f((()=>i(a,t))):a;null!==s&&(r.emit&&r.emit("beforeAddBreadcrumb",s,t),n.addBreadcrumb(s,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=Ue(this);try{e(this)}finally{Ue(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return g&&m.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);return g&&!n&&(this.getClient()?m.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):m.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),ce(e,t)}(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=se}=n&&n.getOptions()||{},{userAgent:o}=l.navigator||{},a=function(e){const t=oe(),n={sid:Z(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return X({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&ce(n,e),n}({release:r,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&ce(s,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_callExtensionMethod(e,...t){const n=je().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);g&&m.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function je(){return l.__SENTRY__=l.__SENTRY__||{extensions:{},hub:void 0},l}function Ue(e){const t=je(),n=qe(t);return He(t,e),n}function Be(){const e=je();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=je()){return t=e,!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)&&!qe(e).isOlderThan(xe)||He(e,new Me),qe(e);var t}(e)}function qe(e){return d("hub",(()=>new Me),e)}function He(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}const Fe=[];function Ve(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function Ge(e,t,n){if(n[t.name])g&&m.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===Fe.indexOf(t.name)&&(t.setupOnce(k,Be),Fe.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),e.on&&"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,r)=>n(t,r,e)))}if(e.addEventProcessor&&"function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=(t,r)=>n(t,r,e);r.id=t.name,e.addEventProcessor(r)}g&&m.log(`Integration installed: ${t.name}`)}}function ze(e,t){const n=function(...e){return t(...e)};return n.id=e,n}const $e=l;let Ye=0;function We(){return Ye>0}function Ke(e,t={},n){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if($(e))return e}catch(t){return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const i=r.map((e=>Ke(e,t)));return e.apply(this,i)}catch(e){throw Ye++,setTimeout((()=>{Ye--})),function(...e){const t=Be();if(2===e.length){const[n,r]=e;return n?t.withScope((()=>(t.getStackTop().scope=n,r(n)))):t.withScope(r)}t.withScope(e[0])}((n=>{var i;n.addEventProcessor((e=>(t.mechanism&&(te(e,void 0,void 0),ne(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),i=e,Be().captureException(i,function(e){if(e)return function(e){return e instanceof De||"function"==typeof e}(e)||function(e){return Object.keys(e).some((e=>Ee.includes(e)))}(e)?{captureContext:e}:e}(undefined))})),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(e){}z(r,e),G(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(e){}return r}const Xe=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Je="TryCatch",Ze=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:Je,setupOnce(){t.setTimeout&&V($e,"setTimeout",Qe),t.setInterval&&V($e,"setInterval",Qe),t.requestAnimationFrame&&V($e,"requestAnimationFrame",et),t.XMLHttpRequest&&"XMLHttpRequest"in $e&&V(XMLHttpRequest.prototype,"send",tt);const e=t.eventTarget;e&&(Array.isArray(e)?e:Xe).forEach(nt)}}};function Qe(e){return function(...t){const n=t[0];return t[0]=Ke(n,{mechanism:{data:{function:he(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function et(e){return function(t){return e.apply(this,[Ke(t,{mechanism:{data:{function:"requestAnimationFrame",handler:he(e)},handled:!1,type:"instrument"}})])}}function tt(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&V(n,e,(function(t){const n={mechanism:{data:{function:e,handler:he(t)},handled:!1,type:"instrument"}},r=$(t);return r&&(n.mechanism.data.handler=he(r)),Ke(t,n)}))})),e.apply(this,t)}}function nt(e){const t=$e,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(V(n,"addEventListener",(function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Ke(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:he(r),target:e},handled:!1,type:"instrument"}}))}catch(e){}return t.apply(this,[n,Ke(r,{mechanism:{data:{function:"addEventListener",handler:he(r),target:e},handled:!1,type:"instrument"}}),i])}})),V(n,"removeEventListener",(function(e){return function(t,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch(e){}return e.call(this,t,i,r)}})))}ze(Je,Ze);const rt=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],it=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],ot="InboundFilters",at=(e={})=>({name:ot,setupOnce(){},processEvent(t,n,r){const i=r.getOptions(),o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:rt],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:it],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,i);return function(e,t){return t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e)?(g&&m.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${ee(e)}`),!0):function(e,t){return!(e.type||!t||!t.length)&&function(e){const t=[];let n;e.message&&t.push(e.message);try{n=e.exception.values[e.exception.values.length-1]}catch(e){}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),g&&0===t.length&&m.error(`Could not extract message for event ${ee(e)}`),t}(e).some((e=>F(e,t)))}(e,t.ignoreErrors)?(g&&m.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${ee(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&F(n,t)}(e,t.ignoreTransactions)?(g&&m.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${ee(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const n=st(e);return!!n&&F(n,t)}(e,t.denyUrls)?(g&&m.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${ee(e)}.\nUrl: ${st(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const n=st(e);return!n||F(n,t)}(e,t.allowUrls)&&(g&&m.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${ee(e)}.\nUrl: ${st(e)}`),!0)}(t,o)?null:t}});function st(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return g&&m.error(`Cannot extract url for event ${ee(e)}`),null}}let ct;ze(ot,at);const lt="FunctionToString",ut=new WeakMap,dt=()=>({name:lt,setupOnce(){ct=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=$(this),n=ut.has(Ce())&&void 0!==t?t:this;return ct.apply(n,e)}}catch(e){}},setup(e){ut.set(e,!0)}}),ht=(ze(lt,dt),{}),pt={};function ft(e,t){ht[e]=ht[e]||[],ht[e].push(t)}function mt(e,t){pt[e]||(t(),pt[e]=!0)}function gt(e,t){const n=e&&ht[e];if(n)for(const r of n)try{r(t)}catch(t){s&&m.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${he(r)}\nError:`,t)}}function vt(){"console"in l&&h.forEach((function(e){e in l.console&&V(l.console,e,(function(t){return p[e]=t,function(...t){gt("console",{args:t,level:e});const n=p[e];n&&n.apply(l.console,t)}}))}))}const yt=l;let Et,bt,_t;function Ct(){if(!yt.document)return;const e=gt.bind(null,"dom"),t=St(e,!0);yt.document.addEventListener("click",t,!1),yt.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=yt[t]&&yt[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(V(n,"addEventListener",(function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,o=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},a=o[n]=o[n]||{refCount:0};if(!a.handler){const r=St(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch(e){}return t.call(this,n,r,i)}})),V(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},o=i[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}function St(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch(e){return null}}(n);if(function(e,t){return"keypress"===e&&(!t||!t.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;G(n,"_sentryCaptured",!0),r&&!r._sentryId&&G(r,"_sentryId",Z());const i="keypress"===n.type?"input":n.type;(function(e){if(e.type!==bt)return!1;try{if(!e.target||e.target._sentryId!==_t)return!1}catch(e){}return!0})(n)||(e({event:n,name:i,global:t}),bt=n.type,_t=r?r._sentryId:void 0),clearTimeout(Et),Et=yt.setTimeout((()=>{_t=void 0,bt=void 0}),1e3)}}const It=l,wt="__sentry_xhr_v3__";function Ot(){if(!It.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;V(e,"open",(function(e){return function(...t){const n=Date.now(),r=C(t[0])?t[0].toUpperCase():void 0,i=function(e){if(C(e))return e;try{return e.toString()}catch(e){}}(t[1]);if(!r||!i)return e.apply(this,t);this[wt]={method:r,url:i,request_headers:{}},"POST"===r&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[wt];if(e&&4===this.readyState){try{e.status_code=this.status}catch(e){}gt("xhr",{args:[r,i],endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?V(this,"onreadystatechange",(function(e){return function(...t){return o(),e.apply(this,t)}})):this.addEventListener("readystatechange",o),V(this,"setRequestHeader",(function(e){return function(...t){const[n,r]=t,i=this[wt];return i&&C(n)&&C(r)&&(i.request_headers[n.toLowerCase()]=r),e.apply(this,t)}})),e.apply(this,t)}})),V(e,"send",(function(e){return function(...t){const n=this[wt];return n?(void 0!==t[0]&&(n.body=t[0]),gt("xhr",{args:[n.method,n.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)):e.apply(this,t)}}))}const At=u();function Tt(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Pt(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in At))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}())return!1;if(Tt(At.fetch))return!0;let e=!1;const t=At.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=Tt(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){s&&m.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&V(l,"fetch",(function(e){return function(...t){const{method:n,url:r}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:Dt(t),method:Nt(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Dt(t),method:Nt(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return gt("fetch",{...i}),e.apply(l,t).then((e=>(gt("fetch",{...i,endTimestamp:Date.now(),response:e}),e)),(e=>{throw gt("fetch",{...i,endTimestamp:Date.now(),error:e}),e}))}}))}function Nt(e,t){return!!e&&"object"==typeof e&&!!e[t]}function Dt(e){return"string"==typeof e?e:e?Nt(e,"url")?e.url:e.toString?e.toString():"":""}const Rt=u(),Lt=l;let xt;function kt(){if(!function(){const e=Rt.chrome,t=e&&e.app&&e.app.runtime,n="history"in Rt&&!!Rt.history.pushState&&!!Rt.history.replaceState;return!t&&n}())return;const e=Lt.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=xt,t=String(n);xt=t,gt("history",{from:e,to:t})}return e.apply(this,t)}}Lt.onpopstate=function(...t){const n=Lt.location.href,r=xt;if(xt=n,gt("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(e){}},V(Lt.history,"pushState",t),V(Lt.history,"replaceState",t)}const Mt=["fatal","error","warning","log","info","debug"];function jt(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const Ut="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Bt="Breadcrumbs",qt=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Bt,setupOnce(){},setup(e){var n;t.console&&function(e){const t="console";ft(t,e),mt(t,vt)}(function(e){return function(t){if(Ce()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:(r=t.level,"warn"===r?"warning":Mt.includes(r)?r:"log"),message:H(t.args," ")};var r;if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${H(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}_e(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(Ce()!==e)return;let r,i,o="object"==typeof t?t.serializeAttribute:void 0,a="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;a&&a>1024&&(Ut&&m.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=1024),"string"==typeof o&&(o=[o]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=U(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!j.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}(t)}catch(e){r="<unknown>"}if(0===r.length)return;const s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),_e(s,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),ft("dom",n),mt("dom",Ct)),t.xhr&&function(e){ft("xhr",e),mt("xhr",Ot)}(function(e){return function(t){if(Ce()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[wt];if(!n||!r||!i)return;const{method:o,url:a,status_code:s,body:c}=i;_e({category:"xhr",data:{method:o,url:a,status_code:s},type:"http"},{xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r})}}(e)),t.fetch&&function(e){const t="fetch";ft(t,e),mt(t,Pt)}(function(e){return function(t){if(Ce()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error)_e({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:n,endTimestamp:r});else{const e=t.response;_e({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:n,endTimestamp:r})}}}(e)),t.history&&function(e){const t="history";ft(t,e),mt(t,kt)}(function(e){return function(t){if(Ce()!==e)return;let n=t.from,r=t.to;const i=jt($e.location.href);let o=n?jt(n):void 0;const a=jt(r);o&&o.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),_e({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){Ce()===e&&_e({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:ee(t)},{event:t})}}(e))}}};ze(Bt,qt);const Ht="Dedupe",Ft=()=>{let e;return{name:Ht,setupOnce(){},processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!Gt(e,t)&&!!Vt(e,t))))}(e,t)||!!function(e,t){const n=zt(t),r=zt(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!Gt(e,t)&&!!Vt(e,t)))}(e,t))}(t,e))return Ut&&m.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return e=t}}};function Vt(e,t){let n=$t(e),r=$t(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Gt(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function zt(e){return e.exception&&e.exception.values&&e.exception.values[0]}function $t(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}}ze(Ht,Ft);let Yt=null;function Wt(){Yt=l.onerror,l.onerror=function(e,t,n,r,i){return gt("error",{column:r,error:i,line:n,msg:e,url:t}),!(!Yt||Yt.__SENTRY_LOADER__)&&Yt.apply(this,arguments)},l.onerror.__SENTRY_INSTRUMENTED__=!0}let Kt=null;function Xt(){Kt=l.onunhandledrejection,l.onunhandledrejection=function(e){return gt("unhandledrejection",e),!(Kt&&!Kt.__SENTRY_LOADER__)||Kt.apply(this,arguments)},l.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Jt(e,t){const n=Qt(e,t),r={type:t&&t.name,value:tn(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Zt(e,t){return{exception:{values:[Jt(e,t)]}}}function Qt(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(en.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(e){}return[]}const en=/Minified React error #\d+;/i;function tn(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function nn(e,t,n,r,i){let o;if(b(t)&&t.error)return Zt(e,t.error);if(_(t)||E(t,"DOMException")){const i=t;if("stack"in t)o=Zt(e,t);else{const t=i.name||(_(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=rn(e,a,n,r),te(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return y(t)?Zt(e,t):w(t)||O(t)?(o=function(e,t,n,r){const i=Ce(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:O(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:on(t,{isUnhandledRejection:r})}]},extra:{__serialized__:fe(t,o)}};if(n){const t=Qt(e,n);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,n,i),ne(o,{synthetic:!0}),o):(o=rn(e,t,n,r),te(o,`${t}`,void 0),ne(o,{synthetic:!0}),o)}function rn(e,t,n,r){const i={};if(r&&n){const r=Qt(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}if(S(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function on(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(Y(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return q(n[0],t);for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:q(r,t)}return""}(e),r=t?"promise rejection":"exception";return b(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:O(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}const an="GlobalHandlers",sn=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:an,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(){const t="error";ft(t,(t=>{const{stackParser:n,attachStacktrace:r}=un();if(Ce()!==e||We())return;const{msg:i,url:o,line:a,column:s,error:c}=t,l=void 0===c&&C(i)?function(e,t,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=b(e)?e.message:e,a="Error";const s=o.match(i);s&&(a=s[1],o=s[2]);return cn({exception:{values:[{type:a,value:o}]}},t,n,r)}(i,o,a,s):cn(nn(n,c||i,void 0,r,!1),o,a,s);l.level="error",be(l,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})),mt(t,Wt)}()}(e),ln("onerror")),t.onunhandledrejection&&(function(e){!function(){const t="unhandledrejection";ft(t,(t=>{const{stackParser:n,attachStacktrace:r}=un();if(Ce()!==e||We())return;const i=function(e){if(I(e))return e;const t=e;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(e){}return e}(t),o=I(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:nn(n,i,void 0,r,!0);o.level="error",be(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})),mt(t,Xt)}()}(e),ln("onunhandledrejection"))}}};function cn(e,t,n,r){const i=e.exception=e.exception||{},o=i.values=i.values||[],a=o[0]=o[0]||{},s=a.stacktrace=a.stacktrace||{},c=s.frames=s.frames||[],l=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=C(t)&&t.length>0?t:function(){try{return j.document.location.href}catch(e){return""}}();return 0===c.length&&c.push({colno:l,filename:d,function:"?",in_app:!0,lineno:u}),e}function ln(e){Ut&&m.log(`Global Handler attached: ${e}`)}function un(){const e=Ce();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}ze(an,sn);const dn="HttpContext",hn=()=>({name:dn,setupOnce(){},preprocessEvent(e){if(!$e.navigator&&!$e.location&&!$e.document)return;const t=e.request&&e.request.url||$e.location&&$e.location.href,{referrer:n}=$e.document||{},{userAgent:r}=$e.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:i};e.request=o}});function pn(e,t,n=250,r,i,o,a){if(!(o.exception&&o.exception.values&&a&&T(a.originalException,Error)))return;const s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;var c,l;s&&(o.exception.values=(c=fn(e,t,i,a.originalException,r,o.exception.values,s,0),l=n,c.map((e=>(e.value&&(e.value=q(e.value,l)),e)))))}function fn(e,t,n,r,i,o,a,s){if(o.length>=n+1)return o;let c=[...o];if(T(r[i],Error)){mn(a,s);const o=e(t,r[i]),l=c.length;gn(o,i,l,s),c=fn(e,t,n,r[i],i,[o,...c],o,l)}return Array.isArray(r.errors)&&r.errors.forEach(((r,o)=>{if(T(r,Error)){mn(a,s);const l=e(t,r),u=c.length;gn(l,`errors[${o}]`,u,s),c=fn(e,t,n,r,i,[l,...c],l,u)}})),c}function mn(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function gn(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}ze(dn,hn);const vn="LinkedErrors",yn=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:vn,setupOnce(){},preprocessEvent(e,r,i){const o=i.getOptions();pn(Jt,o.stackParser,o.maxValueLength,n,t,e,r)}}};ze(vn,yn);const En=[at(),dt(),Ze(),qt(),sn(),yn(),Ft(),hn()];const bn="?";function _n(e,t,n,r){const i={filename:e,function:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}const Cn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Sn=/\((\S*)(?::(\d+))(?::(\d+))\)/,In=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,On=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,An=function(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,n=0)=>{const r=[],i=e.split("\n");for(let e=n;e<i.length;e++){const n=i[e];if(n.length>1024)continue;const o=le.test(n)?n.replace(le,"$1"):n;if(!o.match(/\S*Error: /)){for(const e of t){const t=e(o);if(t){r.push(t);break}}if(r.length>=50)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),ue.test(t[t.length-1].function||"")&&(t.pop(),ue.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,50).map((e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"})))}(r)}}([30,e=>{const t=Cn.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=Sn.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=Tn(t[1]||bn,t[2]);return _n(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,e=>{const t=In.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=wn.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||bn;return[n,e]=Tn(n,e),_n(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,e=>{const t=On.exec(e);return t?_n(t[2],t[1]||bn,+t[3],t[4]?+t[4]:void 0):void 0}]),Tn=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:bn,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};class Pn extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}const Nn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Dn(e,t=!1){const{host:n,path:r,pass:i,port:o,projectId:a,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r?`${r}/`:r}${a}`}function Rn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Ln(e,t=[]){return[e,t]}function xn(e,t){const[n,r]=e;return[n,[...r,t]]}function kn(e,t){const n=e[1];for(const e of n)if(t(e,e[0].type))return!0;return!1}function Mn(e,t){return(t||new TextEncoder).encode(e)}function jn(e,t){const[n,r]=e;let i=JSON.stringify(n);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[Mn(i,t),e]:i.push("string"==typeof e?Mn(e,t):e)}for(const e of r){const[t,n]=e;if(o(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)o(n);else{let e;try{e=JSON.stringify(n)}catch(t){e=JSON.stringify(pe(n))}o(e)}}return"string"==typeof i?i:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(i)}function Un(e,t){const n="string"==typeof e.data?Mn(e.data,t):e.data;return[X({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const Bn={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function qn(e){return Bn[e]}function Hn(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Fn(e,t,n=function(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return R(new Pn("Not adding Promise because buffer limit was reached."));const i=r();return-1===t.indexOf(i)&&t.push(i),i.then((()=>n(i))).then(null,(()=>n(i).then(null,(()=>{})))),i},drain:function(e){return new L(((n,r)=>{let i=t.length;if(!i)return n(!0);const o=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{D(e).then((()=>{--i||(clearTimeout(o),n(!0))}),r)}))}))}}}(e.bufferSize||30)){let r={};function i(i){const o=[];if(kn(i,((t,n)=>{const i=qn(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,i)){const r=Vn(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else o.push(t)})),0===o.length)return D();const a=Ln(i[0],o),s=t=>{kn(a,((n,r)=>{const i=Vn(n,r);e.recordDroppedEvent(t,qn(r),i)}))};return n.add((()=>t({body:jn(a,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&g&&m.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=Date.now()){const i={...e},o=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(o)for(const e of o.trim().split(",")){const[t,n,,,o]=e.split(":",5),a=parseInt(t,10),s=1e3*(isNaN(a)?60:a);if(n)for(const e of n.split(";"))"metric_bucket"===e&&o&&!o.split(";").includes("custom")||(i[e]=r+s);else i.all=r+s}else a?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(i.all=r+6e4);return i}(r,e),e)),(e=>{throw s("network_error"),e})))).then((e=>e),(e=>{if(e instanceof Pn)return g&&m.error("Skipped sending event because buffer is full."),s("queue_overflow"),D();throw e}))}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>n.drain(e)}}function Vn(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}let Gn;function zn(e,t=function(){if(Gn)return Gn;if(Tt($e.fetch))return Gn=$e.fetch.bind($e);const e=$e.document;let t=$e.fetch;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){Ut&&m.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Gn=t.bind($e)}()){let n=0,r=0;return Fn(e,(function(i){const o=i.body.length;n+=o,r++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,a).then((e=>(n-=o,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(e){return Gn=void 0,n-=o,r--,R(e)}}))}function $n(e,t={}){const n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){return n={sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}},Object.keys(n).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`)).join("&");var n}(e,r)}`}const Yn="Not capturing exception because it's already been captured.";class Wn{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=Nn.exec(e);if(!t)return void f((()=>{console.error(`Invalid Sentry Dsn: ${e}`)}));const[n,r,i="",o,a="",s]=t.slice(1);let c="",l=s;const u=l.split("/");if(u.length>1&&(c=u.slice(0,-1).join("/"),l=u.pop()),l){const e=l.match(/^\d+/);e&&(l=e[0])}return Rn({host:o,pass:i,path:c,projectId:l,port:a,protocol:n,publicKey:r})}(e):Rn(e);if(t&&function(e){if(!s)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(m.error(`Invalid Sentry Dsn: ${t} missing`),!0)))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(m.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(m.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(m.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):g&&m.warn("No DSN provided, client will not send events."),this._dsn){const t=$n(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(re(e))return void(g&&m.log(Yn));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{r=e}))),r}captureMessage(e,t,n,r){let i=n&&n.event_id;const o=S(e)?e:String(e),a=I(e)?this.eventFromMessage(o,t,n):this.eventFromException(e,n);return this._process(a.then((e=>this._captureEvent(e,n,r))).then((e=>{i=e}))),i}captureEvent(e,t,n){if(t&&t.originalException&&re(t.originalException))return void(g&&m.log(Yn));let r=t&&t.event_id;const i=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,i||n).then((e=>{r=e}))),r}captureSession(e){"string"!=typeof e.release?g&&m.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),ce(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e))))):D(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return g&&m.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];Ge(this,e,this._integrations),t||Ve(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const i=Hn(n),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const a=function(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Dn(r)},...i&&{trace:X({...i})}}}(e,i,r,t);return delete e.sdkProcessingMetadata,Ln(a,[[{type:o},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=xn(n,Un(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((t=>this.emit("afterSendEvent",e,t)),null)}sendSession(e){const t=function(e,t,n,r){const i=Hn(n);return Ln({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:Dn(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const r="number"==typeof n?n:1,i=`${e}:${t}`;g&&m.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}captureAggregateMetrics(e){g&&m.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=function(e,t,n,r){const i={sent_at:(new Date).toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&t&&(i.dsn=Dn(t));const o=function(e){const t=function(e){let t="";for(const n of e){const e=Object.entries(n.tags),r=e.length>0?`|#${e.map((([e,t])=>`${e}:${t}`)).join(",")}`:"";t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${r}|T${n.timestamp}\n`}return t}(e);return[{type:"statsd",length:t.length},t]}(e);return Ln(i,[o])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach((e=>e(...t)))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach((t=>{t&&Ge(e,t,n)})),n}(this,e),Ve(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let n=!1,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&n)&&(ce(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new L((t=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r=function(){return Be().getIsolationScope()}()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),function(e,t,n,r,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||Z(),timestamp:t.timestamp||ie()},u=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:se),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=q(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=q(a.value,o));const s=e.request;s&&s.url&&(s.url=q(s.url,o))}(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,u),void 0===t.type&&function(e,t){const n=l._sentryDebugIds;if(!n)return;let r;const i=ye.get(t);i?r=i:(r=new Map,ye.set(t,r));const o=Object.keys(n).reduce(((e,i)=>{let o;const a=r.get(i);a?o=a:(o=t(i),r.set(i,o));for(let t=o.length-1;t>=0;t--){const r=o[t];if(r.filename){e[r.filename]=n[i];break}}return e}),{});try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.filename&&(e.debug_id=o[e.filename])}))}))}catch(e){}}(c,e.stackParser);const d=function(e,t){if(!t)return e;const n=e?e.clone():new De;return n.update(t),n}(r,n.captureContext);n.mechanism&&ne(c,n.mechanism);const h=i&&i.getEventProcessors?i.getEventProcessors():[],p=(Ne||(Ne=new De),Ne).getScopeData();o&&Te(p,o.getScopeData()),d&&Te(p,d.getScopeData());const f=[...n.attachments||[],...p.attachments];return f.length&&(n.attachments=f),Ae(c,p),M([...h,...x(),...p.eventProcessors],c,n).then((e=>(e&&function(e){const t={};try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))}))}catch(e){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach((e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})}))}(e),"number"==typeof a&&a>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:pe(e.data,t,n)}})))},...e.user&&{user:pe(e.user,t,n)},...e.contexts&&{contexts:pe(e.contexts,t,n)},...e.extra&&{extra:pe(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=pe(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map((e=>{const r=ve(e).data;return r&&(e.data=pe(r,t,n)),e}))),r}(e,a,s):e)))}(i,e,t,n,this,r).then((e=>{if(null===e)return e;const t={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if((!e.contexts||!e.contexts.trace)&&t){const{traceId:r,spanId:i,parentSpanId:o,dsc:a}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:o},...e.contexts};const s=a||we(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata}}return e}))}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if(g){const t=e;"log"===t.logLevel?m.log(t.message):m.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r,o=Xn(e),a=Kn(e),s=e.type||"error",c=`before send for type \`${s}\``;if(a&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),R(new Pn(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const l="replay_event"===s?"replay":s,u=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,u).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",l,e),new Pn("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const i=function(e,t,n){const{beforeSend:r,beforeSendTransaction:i}=e;if(Kn(t)&&r)return r(t,n);if(Xn(t)&&i){if(t.spans){const e=t.spans.length;t.sdkProcessingMetadata={...t.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return i(t,n)}return t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(A(e))return e.then((e=>{if(!w(e)&&null!==e)throw new Pn(n);return e}),(e=>{throw new Pn(`${t} rejected with ${e}`)}));if(!w(e)&&null!==e)throw new Pn(n);return e}(i,c)})).then((r=>{if(null===r){if(this.recordDroppedEvent("before_send",l,e),o){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw new Pn(`${c} returned \`null\`, will not send event.`,"log")}const i=n&&n.getSession();if(!o&&i&&this._updateSessionFromEvent(i,r),o){const e=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const a=r.transaction_info;if(o&&a&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...a,source:e}}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof Pn)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Pn(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,(e=>{g&&m.error("Error while sending event:",e)}));g&&m.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}}))}}function Kn(e){return void 0===e.type}function Xn(e){return"transaction"===e.type}class Jn extends Wn{constructor(e){!function(e,t,n=[t],r="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map((e=>({name:`${r}:@sentry/${e}`,version:Le}))),version:Le}),e._metadata=i}(e,"browser",["browser"],$e.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&$e.document&&$e.document.addEventListener("visibilitychange",(()=>{"hidden"===$e.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){const i=nn(e,t,n&&n.syntheticException||void 0,r);return ne(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),D(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const o=rn(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),D(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(Ut&&m.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:Dn(r)}},o=function(e){return[{type:"user_report"},e]}(e);return Ln(i,[o])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(Ut&&m.log("No outcomes to send"));if(!this._dsn)return void(Ut&&m.log("No dsn provided, will not send outcomes"));Ut&&m.log("Sending outcomes:",e);const t=(n=e,Ln((r=this._options.tunnel&&Dn(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:ie(),discarded_events:n}]]));var n,r;this._sendEnvelope(t)}}const Zn=Ze().name;class Qn{constructor(e){this.debug=e.debug??!1;const t={debug:this.debug,dist:`${e.release.split("@")[1]}-${e.environment}`,dsn:e.dsn,environment:e.environment,integrations:[...[...En].filter((e=>e.name!==Zn&&"Breadcrumbs"!==e.name)),sn({onerror:e.useGlobalHandlers??!1,onunhandledrejection:e.useGlobalHandlers??!1})],release:e.release,stackParser:An,transport:e.transport??zn};e.beforeSend&&(t.beforeSend=e.beforeSend),this.client=new Jn(t),!0===e.useGlobalHandlers?(function(e){const t=Be().getStackTop();t.client=e,t.scope.setClient(e)}(this.client),this.scope=Se(),this.scope.clear()):this.scope=new De,e.initialScope&&this.scope.update(e.initialScope),this.scope.setClient(this.client),this.client.init()}setCustomTags(e){Object.entries(e).forEach((([e,t])=>{this.scope.setTag(e,t)}))}setUser(e){this.scope.setUser({id:e})}captureException(e,t){this.debug&&console.error("[Sentry exception]",e,t),this.scope.captureException(e,t)}addBreadcrumb(e){this.debug&&console.log("[Sentry Breadcrumb]",e),this.scope.addBreadcrumb(e)}}async function er(e,t,n=new Error("Promise timeout exceeded")){let r=-1;const i=new Promise(((e,i)=>{r=window.setTimeout((()=>{i(n)}),t)})),o=await Promise.race([i,e()]);return window.clearTimeout(r),o}const tr=(e,t)=>Math.min(200*Math.pow(2,e-1)+Math.floor(1e3*Math.random()),t);class nr extends Error{constructor(e,t,n){super(`Request timeout exceeded (attempts=${e}; duration=${t}ms; url=${n})`),this.name="HttpRequestTimeoutError",Object.setPrototypeOf(this,nr.prototype)}}class rr extends Error{constructor(e,t,n){super(`Invalid JSON received (status=${t}; url=${e})`),this.originalErrorMessage=n,this.name="HttpRequestInvalidJsonError",Object.setPrototypeOf(this,rr.prototype)}}class ir extends Error{constructor(e,t,n){super(`Network error during request (attempts=${e}; duration=${t}ms; url=${n})`),this.name="HttpRequestNetworkError",Object.setPrototypeOf(this,ir.prototype)}}function or(e,t){return{body:e,status:t.status,statusText:t.statusText}}function ar(e){const t=new Headers([["Accept","application/json"],["Content-Type","application/json; charset=utf-8"]]);for(const n in e){const r=e[n];void 0!==r&&t.set(n,r)}return t}async function sr(e,t,n=1,r=Date.now()){const i=Date.now()-r,{body:o,headers:a={},credentials:s="include",mode:c="cors",timeoutMs:l=1e4,maxAttempts:u=3,maxBackoffMs:d=32e3}=t;let h=null;void 0!==window.AbortController&&null!==window.AbortController&&(h=new window.AbortController);const p={...t,body:null!=o?JSON.stringify(o):null,credentials:s,headers:ar(a),mode:c,signal:h?h.signal:null};try{const t=await er(window.fetch.bind(null,e,p),l,new nr(n,i,e));return await async function(e,t){let n={};const r=e.status;if(!(r<500))return or(n,e);{let i;try{return 204!==r&&(n=await e.json()),or(n,e)}catch(n){if(n instanceof Error){const r=n.toString();try{i=await e.text(),i=`${i} ${r}`}catch{i=r}throw new rr(t,e.status,i)}throw new rr(t,e.status,JSON.stringify(n))}}}(t,e)}catch(o){if(o instanceof nr)h?.abort();else{if(o instanceof rr)throw o;if(n===u)throw new ir(n,i,e)}if(n===u)throw o;const a=tr(n,d);return new Promise((i=>{setTimeout((()=>{i(sr(e,t,n+1,r))}),a)}))}}const cr=function(e,t){return sr(e,{...t,method:"POST"})};var lr=null!=="production"?"production":"development",ur="local",dr={get ANALYTICS_CLIENT_VERSION(){},get API_PROTOCOL(){return"https://"},get API_PUBLIC_HOST(){switch(lr){case"production":return"squareup.com";case"sandbox":return"squareupsandbox.com";default:return"squareupstaging.com"}},get API_URL(){return"".concat(this.API_PROTOCOL).concat(this.PCI_CONNECT_API_HOST)},get ASSET_BASE_URL(){return function(e){switch(e){case"production":return"https://web.squarecdn.com";case"sandbox":return"https://sandbox.web.squarecdn.com";case"development":return"https://localhost:1779";default:return"https://staging.web.squarecdn.com"}}(lr)},get ASSET_URL(){return this.VERSION===ur?this.ASSET_BASE_URL:"".concat(this.ASSET_BASE_URL,"/").concat(this.VERSION)},get ASYNC_TRANSACTION_NONCE_ENDPOINT(){return"".concat(this.API_URL,"/v2/async-transaction-nonce")},get BANK_NONCE_ENDPOINT(){return"".concat(this.API_URL,"/v2/bank-nonce")},get BITCOIN_STYLES(){return"".concat(this.ASSET_URL,"/bitcoin.css")},get CARD_NONCE_ENDPOINT(){return"".concat(this.API_URL,"/v2/card-nonce")},get CONNECT_API_URL(){return"https://connect.".concat(this.API_PUBLIC_HOST)},get CREATE_OAUTH_PLAID_LINK_SESSION_ENDPOINT(){return"".concat(this.API_URL,"/digital-wallets/plaid/oauth-link-session")},get ENABLE_ERROR_LOGGING(){return"development"!==lr},GET_ASYNC_NONCE_STATUS_ENDPOINT(e){return"".concat(this.API_URL,"/v2/async-transaction-nonce/").concat(e,"/status")},get GET_PRODUCT_INFORMATION_ENDPOINT(){return"".concat(this.API_URL,"/v2/tokenization/product-information")},get GIFT_CARD_IFRAME(){return"".concat(this.ASSET_URL,"/gift-card-element-iframe.html")},get GOOGLE_PAY_GENERATE_TOKEN_ENDPOINT(){return"".concat(this.API_URL,"/digital-wallets/google-pay/token")},get HYDRATION_ENDPOINT(){return"".concat(this.API_URL,"/payments/hydrate")},get IFRAME_SRC(){return"".concat(this.ASSET_URL,"/main-iframe.html")},get INITIALIZE_THREE_DS_METHOD_ENDPOINT(){return"".concat(this.API_URL,"/v2/analytics/three-ds-method")},get INSTANT_WALLET_NONCE_ENDPOINT(){return"".concat(this.API_URL,"/v2/instant-wallet-nonce")},get METRICS_URL(){return"".concat(this.API_URL,"/payments/mtx")},get METRICS_V2_URL(){return"".concat(this.API_URL,"/payments/mtx/v2")},get PCI_CONNECT_API_HOST(){return"pci-connect.".concat(this.API_PUBLIC_HOST)},get QR_CODE_GENERATOR_SCRIPT(){return"".concat(this.ASSET_URL,"/qr-code-generator.js")},get SENTRY_DSN(){switch(lr){case"test":case"development":return"https://acacaeaccacacacabcaacdacdacadaca@sentry.io/000001";default:return"https://565ee38bb5ff45dabc25ab6d7b8bebe3@o160250.ingest.sentry.io/3478832"}},get SINGLE_CARD_IFRAME(){return"".concat(this.ASSET_URL,"/single-card-element-iframe.html")},get SINGLE_CARD_WRAPPER_STYLES(){return"".concat(this.ASSET_URL,"/card-wrapper.css")},THREE_DS_AUTHENTICATE_ENDPOINT(e){return"".concat(this.VERIFICATION_ENDPOINT,"/").concat(e,"/three-ds-authentication")},get VERIFICATION_ENDPOINT(){return"".concat(this.API_URL,"/v2/analytics/verifications")},VERIFICATION_UPDATE_ENDPOINT(e){return"".concat(this.VERIFICATION_ENDPOINT,"/").concat(e)},get VERSION(){return null!=="1.83.14"?"1.83.14":ur},env:lr,staticAsset(e){return"".concat(this.ASSET_URL,"/static-assets/").concat(e)}};class hr extends Error{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Unknown Error",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e;t.length>0&&(n=function(e,t){return"".concat(e,"\n  ").concat(t.map((e=>{switch(!0){case"message"in e:return e.message;case"detail"in e:return e.detail;default:return"[Unspecified Error]"}})).join("\n  "))}(e,t)),super(n),this.errors=t,this.name="SqError",Object.setPrototypeOf(this,hr.prototype)}fromSerializedError(e){this.name=e.name,this.message=e.message,e.errors&&Object.assign(this,{errors:e.errors})}}n(9170);var pr,fr,mr,gr,vr,yr,Er,br,_r,Cr,Sr,Ir,wr,Or,Ar,Tr=Object.freeze({SHIPPING_CONTACT_CHANGED:"shippingcontactchanged",SHIPPING_OPTION_CHANGED:"shippingoptionchanged"}),Pr=Object.freeze({AFTERPAY_SHIPPING_ADDRESS_CHANGED:"afterpay_shippingaddresschanged",AFTERPAY_SHIPPING_OPTION_CHANGED:"afterpay_shippingoptionchanged"}),Nr=Object.freeze({ACH:"ACH",AFTERPAY_CLEARPAY:"AfterpayClearpay",APPLE_PAY:"Apple Pay",CARD:"Card",CASH_APP_PAY:"Cash App Pay",GIFT_CARD:"Gift Card",GOOGLE_PAY:"Google Pay"}),Dr="Cancel",Rr="Error",Lr="Invalid",xr="OK";class kr extends hr{constructor(){super("Tokenization has failed. `accountHolderName` is a required option when calling ach.tokenize()"),this.name="PlaidMissingNameError",Object.setPrototypeOf(this,kr.prototype)}}class Mr extends hr{constructor(){super("You cannot call `tokenize` when using an `onTokenize` callback"),this.name="AfterpayOnTokenizeListenerError",Object.setPrototypeOf(this,Mr.prototype)}}class jr extends hr{constructor(e,t){super("This instance of ".concat(e," is missing the ").concat(t," listener.")),this.name="PaymentMethodMissingListener",Object.setPrototypeOf(this,jr.prototype)}}class Ur extends hr{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super("The payment request used for Afterpay/Clearpay caused a failure",e),this.errors=e,this.name="AfterpayRequestError",Object.setPrototypeOf(this,Ur.prototype)}}class Br extends hr{constructor(){super("The amount is outside of the merchant's Afterpay payment limits."),this.name="AfterpayAmountOutsideLimitsError",Object.setPrototypeOf(this,Br.prototype)}}class qr extends hr{constructor(){super("The currency provided is not supported for use with Afterpay/Clearpay"),this.name="AfterpayUnsupportedCurrencyError",Object.setPrototypeOf(this,qr.prototype)}}class Hr extends hr{constructor(){super("Afterpay/Clearpay is not enabled for this merchant."),this.name="AfterpayMerchantError",Object.setPrototypeOf(this,Hr.prototype)}}class Fr extends hr{constructor(e){super(e),this.name="AfterpayInvalidPaymentRequestError",Object.setPrototypeOf(this,Fr.prototype)}}class Vr extends hr{constructor(e){super("An issue occurred while verifying the buyer",[e]),this.name="VerifyBuyerError",Object.setPrototypeOf(this,Vr.prototype)}toJSON(){return{errors:this.errors.map((e=>{var t={};return["name","message","type","code","token"].forEach((function(n){n in e&&(t[n]=e[n])})),t})),name:this.name}}}function Gr(e){return"type"in e&&"message"in e}function zr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$r(e,t):void 0}}(e,t)||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 $r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}class Yr extends hr{constructor(e){var t=e instanceof HTMLElement?e.nodeName:e;super("The element ".concat(t," was not found")),this.name="ElementNotFoundError",Object.setPrototypeOf(this,Yr.prototype)}}class Wr extends hr{constructor(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((e=>{var t=zr(e,2),n=t[0],r=t[1];return'expected property: "'.concat(n,'" of type "').concat(r,'"')})).concat(e);super("Please ensure you call payments.paymentRequest (https://developer.squareup.com/reference/sdks/web/payments#Payments.paymentRequest) with the appropriate options.\n".concat(t.join("\n"))),this.name="InvalidPaymentRequestError",Object.setPrototypeOf(this,Wr.prototype)}}class Kr extends hr{constructor(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((e=>{var t=zr(e,2),n=t[0],r=t[1];return'expected property: "'.concat(n,'" of type "').concat(r,'"')})).join("\n");super("\n".concat(e)),this.name="InvalidPaymentRequestUpdateError",Object.setPrototypeOf(this,Kr.prototype)}}class Xr extends hr{constructor(e,t){super("The callback provided to the event listener ".concat(e," threw an error with message: ").concat(t)),this.name="InvalidEventListenerCallbackError",Object.setPrototypeOf(this,Xr.prototype)}}class Jr extends hr{constructor(e){super(e),this.name="InvalidOptionError",Object.setPrototypeOf(this,Jr.prototype)}}!function(e){e.FOCUS_CLASS_ADDED="focusClassAdded",e.FOCUS_CLASS_REMOVED="focusClassRemoved",e.ERROR_CLASS_ADDED="errorClassAdded",e.ERROR_CLASS_REMOVED="errorClassRemoved",e.CARD_BRAND_CHANGED="cardBrandChanged",e.POSTAL_CODE_CHANGED="postalCodeChanged",e.ESCAPE="escape",e.SUBMIT="submit"}(pr||(pr={})),function(e){e.CARD_NUMBER="cardNumber",e.CVV="cvv",e.EXPIRATION_DATE="expirationDate",e.POSTAL_CODE="postalCode"}(fr||(fr={})),function(e){e.CARD_INPUT="input",e.CARD_INPUT_FOCUS="input.is-focus",e.CARD_INPUT_PLACEHOLDER="input::placeholder",e.CARD_INPUT_FOCUS_PLACEHOLDER="input.is-focus::placeholder",e.CARD_INPUT_ERROR="input.is-error",e.CARD_INPUT_ERROR_PLACEHOLDER="input.is-error::placeholder",e.CARD_COMPONENT=".input-container",e.CARD_COMPONENT_FOCUS=".input-container.is-focus",e.CARD_COMPONENT_ERROR=".input-container.is-error",e.CARD_INPUT_HELPER_TEXT=".message-text",e.CARD_INPUT_HELPER_ICON=".message-icon",e.CARD_INPUT_ERROR_TEXT=".message-text.is-error",e.CARD_INPUT_ERROR_ICON=".message-icon.is-error"}(mr||(mr={})),function(e){e.GIFT_CARD_NUMBER="giftCardNumber"}(gr||(gr={})),function(e){e.FOCUS_CLASS_ADDED="focusClassAdded",e.FOCUS_CLASS_REMOVED="focusClassRemoved",e.ERROR_CLASS_ADDED="errorClassAdded",e.ERROR_CLASS_REMOVED="errorClassRemoved",e.CARD_BRAND_CHANGED="cardBrandChanged",e.ESCAPE="escape",e.SUBMIT="submit"}(vr||(vr={})),function(e){e.UNKNOWN="Unknown"}(yr||(yr={})),function(e){e.GIFT="Gift"}(Er||(Er={}));class Zr extends hr{constructor(e){super("".concat(e," is not a valid field name. Valid field names are ").concat([...Object.values(fr),...Object.values(gr)].join(", "))),this.name="InvalidFieldNameError",Object.setPrototypeOf(this,Zr.prototype)}}class Qr extends hr{constructor(e){super("Configuration property '".concat(e,"' is invalid")),this.name="InvalidConfigurationPropertyError",Object.setPrototypeOf(this,Qr.prototype)}}class ei extends hr{constructor(e,t,n){super("Configuration property '".concat(e,"' has an invalid value '").concat(t,"'.").concat(void 0!==n?" ".concat(n,"."):"")),this.name="InvalidConfigurationValueError",Object.setPrototypeOf(this,ei.prototype)}}function ti(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ni(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ni(e,t):void 0}}(e,t)||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 ni(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}class ri extends hr{constructor(e){var t=e.map((e=>{var t=ti(e,2),n=t[0],r=t[1];return'expected property: "'.concat(n,'" of type "').concat(r,'"')})).join("\n");super("\n".concat(t)),this.name="InvalidCashAppPayV1OptionsFieldTypes",Object.setPrototypeOf(this,ri.prototype)}}class ii extends hr{constructor(e){var t=e.map((e=>{var t=ti(e,2),n=t[0],r=t[1];return'accepted property: "'.concat(n,'" values are "').concat(r,'"')})).join("\n");super("\n".concat(t)),this.name="InvalidCashAppPayV1OptionsFieldValues",Object.setPrototypeOf(this,ii.prototype)}}class oi extends hr{constructor(e){super(e),this.name="CashAppPayInvalidPaymentRequestError",Object.setPrototypeOf(this,oi.prototype)}}class ai extends hr{constructor(){super("A redirect url is always required for requests. This must also be a secure link."),this.name="CashAppPayMissingRedirectUrlError",Object.setPrototypeOf(this,ai.prototype)}}class si extends hr{constructor(){super("Non function passed as shouldTokenize checker"),this.name="CashAppPayInvalidShouldTokenizeError",Object.setPrototypeOf(this,si.prototype)}}class ci extends hr{constructor(e,t){super("amount '".concat(e,"' in ").concat(t," is not expressed in a valid format")),this.name="InvalidCurrencyFormatError",Object.setPrototypeOf(this,ci.prototype)}}class li extends hr{constructor(){super("Web Payments SDK does not support this browser"),this.name="BrowserNotSupportedError",Object.setPrototypeOf(this,li.prototype)}}class ui extends hr{constructor(){super("Web Payments SDK can only be embedded on sites that use HTTPS and have a secure context"),this.name="WebSdkEmbedError",Object.setPrototypeOf(this,ui.prototype)}}class di extends hr{constructor(e,t){var n=null!=t?t:null==e?void 0:e.field;super("Method unsupported: ".concat(null==e?void 0:e.message).concat(void 0!==n?" (field=".concat(n,")"):"")),this.name="PaymentMethodUnsupportedError",Object.setPrototypeOf(this,di.prototype)}}class hi extends hr{constructor(e){super("This instance of ".concat(e," has already been attached to the page.")),this.name="PaymentMethodAlreadyAttachedError",Object.setPrototypeOf(this,hi.prototype)}}class pi extends hr{constructor(e){super("".concat(e," has not been attached to the page. It must be attached before you can call this method.")),this.name="PaymentMethodNotAttachedError",Object.setPrototypeOf(this,pi.prototype)}}class fi extends hr{constructor(e){super("This instance of ".concat(e," has already been destroyed.")),this.name="PaymentMethodAlreadyDestroyedError",Object.setPrototypeOf(this,fi.prototype)}}class mi extends hr{constructor(e,t){var n=e instanceof HTMLElement?e.nodeName:e;super("The value ".concat(n," is not a valid element type or selector. Only valid elements or selectors referring to ").concat([...t].join(", ")," elements are allowed.")),this.name="InvalidElementTypeError",Object.setPrototypeOf(this,mi.prototype)}}class gi extends hr{constructor(e,t){super("An element with one of the following conflicting IDs was found on the page: ".concat(t,". You must change those elements' ID before you can use ").concat(e)),this.name="InvalidElementPresentError",Object.setPrototypeOf(this,gi.prototype)}}class vi extends hr{constructor(e){super("Invalid style property '".concat(e,"'.")),this.name="InvalidInputStylePropertyError",Object.setPrototypeOf(this,vi.prototype)}}class yi extends hr{constructor(e,t){super("Invalid style value '".concat(t,"' for property '").concat(e,"'.")),this.name="InvalidInputStyleValueError",Object.setPrototypeOf(this,yi.prototype)}}class Ei extends hr{constructor(e){super("Invalid style selector '".concat(e,"'.")),this.name="InvalidInputStyleSelectorError",Object.setPrototypeOf(this,Ei.prototype)}}class bi extends hr{constructor(e){super("One or more style selectors and/or CSS properties are invalid",e),this.errors=e,this.name="InvalidStylesError",Object.setPrototypeOf(this,bi.prototype)}}class _i extends hr{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super("Tokenization has failed",e),this.errors=e,this.name="TokenizationError",Object.setPrototypeOf(this,_i.prototype)}}class Ci extends hr{constructor(e){var t="An unexpected error occurred";e&&(t+=" while ".concat(e)),super("".concat(t,".")),this.name="UnexpectedError",Object.setPrototypeOf(this,Ci.prototype)}}!function(e){e.ON_TOKENIZATION="ontokenization",e.CLOSE_OAUTH="CLOSE_OAUTH",e.ERROR="ERROR",e.EXIT="EXIT",e.FAIL_OAUTH="FAIL_OAUTH",e.HANDOFF="HANDOFF",e.MATCHED_SELECT_INSTITUTION="MATCHED_SELECT_INSTITUTION",e.MATCHED_SELECT_VERIFY_METHOD="MATCHED_SELECT_VERIFY_METHOD",e.OPEN="OPEN",e.OPEN_MY_PLAID="OPEN_MY_PLAID",e.OPEN_OAUTH="OPEN_OAUTH",e.SEARCH_INSTITUTION="SEARCH_INSTITUTION",e.SELECT_BRAND="SELECT_BRAND",e.SELECT_INSTITUTION="SELECT_INSTITUTION",e.SUBMIT_CREDENTIALS="SUBMIT_CREDENTIALS",e.SUBMIT_MFA="SUBMIT_MFA",e.TRANSITION_VIEW="TRANSITION_VIEW"}(br||(br={})),function(e){e.BLACK="black",e.MINT="mint",e.GREEN="green"}(_r||(_r={})),function(e){e.CheckoutWithAfterpay="checkout_with_afterpay",e.BuyNowWithAfterpay="buy_now_with_afterpay",e.PlaceOrderWithAfterpay="place_order_with_afterpay"}(Cr||(Cr={})),function(e){e.REVIEW_MY_ORDER="review_my_order",e.BUY_NOW="buy_now"}(Sr||(Sr={})),function(e){e.BLACK_ON_MINT="black-on-mint",e.BLACK_ON_WHITE="black-on-white",e.MINT_ON_BLACK="mint-on-black",e.WHITE_ON_BLACK="white-on-black"}(Ir||(Ir={})),function(e){e.XS="xs",e.SM="sm",e.MD="md",e.LG="lg"}(wr||(wr={})),function(e){e.CIRCLED_INFO_ICON="circled-info-icon",e.CIRCLED_QUESTION_ICON="circled-question-icon",e.LEARN_MORE_TEXT="learn-more-text",e.MORE_INFO_TEXT="more-info-text",e.NONE="none"}(Or||(Or={})),function(e){e.MINT="mint",e.WHITE="white"}(Ar||(Ar={}));var Si,Ii,wi,Oi,Ai,Ti,Pi,Ni,Di,Ri,Li,xi,ki=["CLASSIC","TIMELINE","COLLAPSIBLE","MODAL"],Mi=["borderColor","borderRadius","borderWidth"],ji=["borderColor","borderWidth"],Ui=["color"],Bi=["color"];!function(e){e.UNKNOWN="OTHER_BRAND",e.AMERICAN_EXPRESS="AMERICAN_EXPRESS",e.DINERS_CLUB="DISCOVER_DINERS",e.DISCOVER="DISCOVER",e.JCB="JCB",e.MASTERCARD="MASTERCARD",e.UNION_PAY="CHINA_UNIONPAY",e.VISA="VISA"}(Si||(Si={})),function(e){e.UNKNOWN_CARD_TYPE="UNKNOWN_CARD_TYPE",e.CREDIT="CREDIT",e.DEBIT="DEBIT"}(Ii||(Ii={})),function(e){e.UNKNOWN_PAYMENT_TYPE="UNKNOWN_PREPAID_TYPE",e.NOT_PREPAID="NOT_PREPAID",e.PREPAID="PREPAID"}(wi||(wi={})),function(e){e.ROUND="round",e.SEMIROUND="semiround"}(Oi||(Oi={})),function(e){e.MEDIUM="medium",e.SMALL="small"}(Ai||(Ai={})),function(e){e.DARK="dark",e.LIGHT="light"}(Ti||(Ti={})),function(e){e.FULL="full",e.STATIC="static"}(Pi||(Pi={})),function(e){e.ONTOKENIZATION="ontokenization",e.CUSTOMER_INTERACTION="customerInteraction",e.CUSTOMER_DISMISSED="customerDismissed"}(Ni||(Ni={})),function(e){e.DEFAULT="default",e.BLACK="black",e.WHITE="white"}(Di||(Di={})),function(e){e.STATIC="static",e.FILL="fill"}(Ri||(Ri={})),function(e){e.LONG="long",e.SHORT="short"}(Li||(Li={})),function(e){e.PAYMENT_METHOD_DESTROYED="PAYMENT_METHOD_DESTROYED",e.SHIPPING_ADDRESS_UNSERVICEABLE="SHIPPING_ADDRESS_UNSERVICEABLE",e.SHIPPING_ADDRESS_INVALID="SHIPPING_ADDRESS_INVALID"}(xi||(xi={}));class qi{constructor(e,t){this.type=e,this.detail=t,this.type=e,this.detail=t}}class Hi extends hr{constructor(){super("The Payment 'applicationId' option is not in the correct format."),this.name="InvalidApplicationIdError",Object.setPrototypeOf(this,Hi.prototype)}}class Fi extends hr{constructor(e,t){super("Web Payments SDK was initialized with an application ID created in ".concat(e," however you are currently using ").concat(t,".")),this.name="ApplicationIdEnvironmentMismatchError ",Object.setPrototypeOf(this,Fi.prototype)}}class Vi extends hr{constructor(){super("The Payment 'locationId' option is not in the correct format."),this.name="InvalidLocationIdError",Object.setPrototypeOf(this,Vi.prototype)}}var Gi={message:"An internal error has occurred. Unable to complete the request.",type:"INTERNAL_SERVER_ERROR"},zi={message:"The requested resource was not found.",type:"NOT_FOUND"},$i={message:"The endpoint is currently unavailable.",type:"SERVICE_UNAVAILABLE"},Yi={message:"Too many requests in progress.",type:"TOO_MANY_REQUESTS"},Wi={message:"Request not authorized.",type:"UNAUTHORIZED"},Ki={message:"An unknown error has occurred",type:"UNKNOWN"};class Xi extends hr{constructor(e){super(e),this.name="InternalError",Object.setPrototypeOf(this,Xi.prototype)}}class Ji extends hr{constructor(e){super(e),this.name="AlreadyCapturedError",Object.setPrototypeOf(this,Ji.prototype)}}class Zi extends hr{constructor(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=function(e){switch(e){case 401:return Wi;case 404:return zi;case 429:return Yi;case 500:return Gi;case 503:return $i;default:return Ki}}(t);super("".concat(i.message," (message=").concat(n,"; url=").concat(e,")"),r),this.name="InternalHttpError",Object.setPrototypeOf(this,Zi.prototype)}}class Qi extends hr{constructor(e,t){super("".concat(e," (payment_method=").concat(t,")")),this.name="InternalPaymentMethodError",Object.setPrototypeOf(this,Qi.prototype)}}class eo extends hr{constructor(e){super(e),this.name="InvalidIframeError",Object.setPrototypeOf(this,eo.prototype)}}class to extends hr{constructor(e){super("Received error event from iframe"),this.event=e,this.name="IframeErrorEventError",Object.setPrototypeOf(this,to.prototype)}}class no extends hr{constructor(e,t,n){super("Request timeout exceeded (attempts=".concat(e,"; duration=").concat(t,"ms; url=").concat(n,")")),this.name="InternalTimeoutError",Object.setPrototypeOf(this,no.prototype)}}function ro(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return io(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?io(e,t):void 0}}(e,t)||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 io(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n(7156),n(6460),n(8370),n(1152),n(1257),n(8304),n(7680);var oo=new RegExp(/^[\w.-]+$/i),ao=new RegExp(/sq0at/i);function so(e){return dr.env===e}function co(){return so("production")}var lo=/^_/g,uo=/(?!^)([A-Z])/g,ho=/[\s_]+(?=[A-Za-z])/g;function po(e){return"JPY"===e.toUpperCase()?0:2}function fo(e,t){var n=ro(e,3),r=(n[0],n[1]),i=n[2],o=void 0===i?"":i;if(0===t)return Number(r);var a="0".repeat(t-o.length);return Number(r+o+a)}function mo(e,t){var n=po(t);return(e/Math.pow(10,n)).toFixed(n)}var go={buildUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.entries(t).map((e=>{var t=ro(e,2),n=t[0],r=t[1];return"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(r))})).join("&");return encodeURI(e)+(n.length>0?"?".concat(n):"")},convertLocaleToUnderscore:function(e){return e.replace(/-/,"_")},cssProperty:function(e){return e.replace(lo,"-").replace(uo," $1").replace(ho,"-").toLowerCase()},decimalPlaces:po,delay:function(e){return new Promise((t=>{setTimeout(t,e)}))},enumValues:function(e){return Object.values(e)},formatCSSKeyValuePair:function(e,t){return"".concat(e,": ").concat(t,";")},isInstanceOf:function(e,t){return t.some((function(t){return e instanceof t}))},isNonBlankString:function(e){return void 0!==e&&""!==e},isProduction:co,isStaging:function(){return so("staging")},isValidUrl:function(e){try{return new URL(e),!0}catch(e){return!1}},moneyAmountToInternationalizedCurrency:function(e,t,n){var r=po(t),i=e/Math.pow(10,r);return new Intl.NumberFormat(n,{currency:t,style:"currency"}).format(i)},moneyAmountToPaymentRequestAmount:mo,paymentRequestAmountToMoneyAmount:function(e,t){var n=po(t),r="^(-?[0-9]+)";n>0&&(r="".concat(r,"(?:\\.([0-9]{1,").concat(n,"})[0-9]*)?")),r="".concat(r,"$");var i=new RegExp(r).exec(e);if(!i)throw new ci(e,t);return fo(i,n)},requestId:function(){return Date.now()+Number.parseFloat(Math.random().toFixed(8))},sanitizePaymentRequestAmount:function(e,t){var n=po(t),r="^(-?[0-9]+)(?:\\.([0-9]{0,".concat(n,"})[0-9]*)?$"),i=new RegExp(r).exec(e);return i?mo(fo(i,n),t):e}},vo={message:"An unknown error has occurred",type:"UNKNOWN"},yo={message:"An error occurred while verifying the buyer",type:"VERIFICATION_ERROR"},Eo={UNKNOWN:vo};new Set(["EXPIRED_PLAID_SESSION","INVALID_SELECTED_PLAID_BANK_ACCOUNT_ID","DATABASE_INSIGHTS_VERIFICATION_FAILURE"]);class bo extends hr{constructor(e){super("Internal Validation Error",e),this.errors=e,this.name="InternalValidationError",Object.setPrototypeOf(this,bo.prototype)}}function _o(e,t){return{field:e,message:"".concat(e," is required and must be a(n) ").concat(t,"."),type:"VALIDATION_ERROR"}}function Co(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function So(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Co(Object(n),!0).forEach((function(t){Io(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Co(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Io(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wo={AlreadyCapturedError:Ji,HttpRequestInvalidJsonError:rr,HttpRequestNetworkError:ir,HttpRequestTimeoutError:nr,InternalError:Xi,InternalHttpError:Zi,InternalPaymentMethodError:Qi,InternalTimeoutError:no,InternalValidationError:bo,InvalidIframeError:eo},Oo={AfterpayAmountOutsideLimitsError:Br,AfterpayMerchantError:Hr,AfterpayRequestError:Ur,AfterpayUnsupportedCurrencyError:qr,BrowserNotSupportedError:li,ElementNotFoundError:Yr,InvalidCurrencyFormatError:ci,InvalidElementTypeError:mi,InvalidEventListenerCallbackError:Xr,InvalidOptionError:Jr,InvalidPaymentRequestError:Wr,InvalidPaymentRequestUpdateError:Kr,PaymentMethodUnsupportedError:di,PlaidMissingNameError:kr,TokenizationError:_i,UnexpectedError:Ci,VerifyBuyerError:Vr,WebSdkEmbedError:ui},Ao=So(So(So({},Oo),wo),{},{AfterpayInvalidPaymentRequestError:Fr,AfterpayOnTokenizeListenerError:Mr,InvalidApplicationIdError:Hi,InvalidInputStylePropertyError:vi,InvalidInputStyleValueError:yi,InvalidStylesError:bi,PaymentMethodAlreadyAttachedError:hi,PaymentMethodAlreadyDestroyedError:fi,PaymentMethodMissingListener:jr,PaymentMethodNotAttachedError:pi,SqError:hr});function To(e){return e instanceof Error?e:new Error(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4;if("string"==typeof e)return e.length>t?"".concat(e.slice(0,t),"...[truncated]"):e;if(void 0===e)return"undefined";try{var n=JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t));return n&&n.length>t?"".concat(n.slice(0,t),"...[truncated]"):n}catch(e){return"[Error]"}}(e))}function Po(e){return To(e).message}var No,Do=function(e){var t,n=new(null!==(t=Ao[e.name])&&void 0!==t?t:hr);return n.fromSerializedError(e),n},Ro=function(e){return{_isSerializedError:!0,errors:e.errors,message:e.message,name:e.name}};class Lo{constructor(e){var t={beforeSend:(e,t)=>{var n;return dr.ENABLE_ERROR_LOGGING?e:(console.error(e.exception),null!==(n=e.exception)&&void 0!==n&&n.values&&e.exception.values.forEach((e=>{console.error(e)})),null)},dsn:dr.SENTRY_DSN,environment:dr.env,release:"web-payments-sdk@".concat(dr.VERSION),transport:e.transport,useGlobalHandlers:e.useGlobalHandlers};this.browserErrorLogger=new Qn(t),this.browserErrorLogger.setCustomTags({applicationId:e.applicationId,applicationUrl:e.applicationUrl,source:e.source,version:dr.VERSION})}setCustomTags(e){this.browserErrorLogger.setCustomTags(e)}setUser(e){this.browserErrorLogger.setUser(e)}addBreadcrumb(e){this.browserErrorLogger.addBreadcrumb(e)}captureException(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};go.isInstanceOf(e,[ir,nr])||e instanceof Error&&"AnalyticsError"===e.name||(e instanceof rr&&this.browserErrorLogger.addBreadcrumb({category:"invalid json error message",message:e.originalErrorMessage}),this.browserErrorLogger.captureException(To(e),{captureContext:{tags:t}}))}}function xo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ko=["en","ja","fr","es"],Mo=["en-US","en-IE","en-CA","en-GB","en-AU","ja-JP","fr-FR","fr-CA","es-ES","es-US"];function jo(e){return Mo.includes(e)}var Uo={"en-AU":{paymentMethods:{cards:{errors:{cardNumberError:"Enter a valid card number.",cvvError:"Enter a valid security code.",expirationDateError:"Enter a valid expiration date.",multipleErrors:"Fix the highlighted errors.",postalCodeErrors:{CA:"Enter a valid postal code.",GB:"Enter a valid postcode.",US:"Enter a valid ZIP code."}},formTitle:"Secure credit card form",helperText:{cardNumber:"Enter your card number",cvv:"Enter the security code",expirationDate:"Enter the expiration date",postalCodes:{CA:"Enter the postal code",GB:"Enter the postcode",US:"Enter the ZIP code"}},inputFieldTitles:{cardNumber:"Credit card number",cvv:"CVV",expirationDate:"Expiration date",postalCodes:{CA:"Postal Code",GB:"Postcode",US:"ZIP Code"}},placeholderText:{cardNumber:"Card number",cvv:"CVV",expirationDate:"MM/YY",postalCodes:{CA:"Postal Code",GB:"Postcode",US:"ZIP"}},cardIcon:{brandNames:{JCB:"JCB",americanExpress:"American Express",discover:"Discover",discoverDiners:"Diners Club",masterCard:"Mastercard",squareGiftCardV2:"Square gift card",unionPay:"UnionPay",unknown:"Unknown card",visa:"Visa"}}},giftCards:{errors:{giftCardNumberError:"Enter a valid gift card number."},formTitle:"Secure gift card form",helperText:{giftCardNumber:"Enter your gift card number"},inputFieldTitles:{giftCardNumber:"Gift card number"},placeholderText:{giftCardNumber:"Gift card"}},afterpay:{checkoutWidget:{today:"Today",weeks:"weeks",title:"Your 4 interest-free payments"}},wallets:{callbackErrors:{contactError:"There was an error processing your selected shipping contact. Please try again.",optionsError:"There was an error processing your selected shipping option. Please try again."}},clickToPay:{modal:{headerTitle:"Credit or Debit card",cardNetworksAlt:"Mastercard, Visa",cancelAriaLabel:"Cancel",continueButton:"Continue"}},bitcoin:{buttonText:"Continue with Bitcoin",modalTitle:"Scan to Pay",lightningPayButtonText:"Open Lightning wallet",lightningPayButtonAriaLabel:"Open Lightning wallet",qrCodeAltText:"Bitcoin Lightning payment QR code",closeButtonAriaLabel:"Close"}}},"en-CA":{paymentMethods:{cards:{errors:{cardNumberError:"Enter a valid card number.",cvvError:"Enter a valid security code.",expirationDateError:"Enter a valid expiration date.",multipleErrors:"Fix the highlighted errors.",postalCodeErrors:{CA:"Enter a valid postal code.",GB:"Enter a valid postcode.",US:"Enter a valid zip code."}},formTitle:"Secure Credit Card Form",helperText:{cardNumber:"Enter your card number",cvv:"Enter the security code",expirationDate:"Enter the expiration date",postalCodes:{CA:"Enter the postal code",GB:"Enter the postcode",US:"Enter the ZIP code"}},inputFieldTitles:{cardNumber:"Credit card number",cvv:"CVV",expirationDate:"Expiration date",postalCodes:{CA:"Postal Code",GB:"Postcode",US:"ZIP Code"}},placeholderText:{cardNumber:"Card number",cvv:"CVV",expirationDate:"MM/YY",postalCodes:{CA:"Postal Code",GB:"Postcode",US:"ZIP"}},cardIcon:{brandNames:{JCB:"JCB",americanExpress:"American Express",discover:"Discover",discoverDiners:"Diners Club",masterCard:"Mastercard",squareGiftCardV2:"Square gift card",unionPay:"UnionPay",unknown:"Unknown card",visa:"Visa"}}},giftCards:{errors:{giftCardNumberError:"Enter a valid gift card number."},formTitle:"Secure Gift Card Form",helperText:{giftCardNumber:"Enter your gift card number"},inputFieldTitles:{giftCardNumber:"Gift card number"},placeholderText:{giftCardNumber:"Gift card"}},afterpay:{checkoutWidget:{today:"Today",weeks:"weeks",title:"Your 4 interest-free payments"}},wallets:{callbackErrors:{contactError:"There was an error processing your selected shipping contact. Please try again.",optionsError:"There was an error processing your selected shipping option. Please try again."}},clickToPay:{modal:{headerTitle:"Credit or Debit Card",cardNetworksAlt:"Mastercard, Visa",cancelAriaLabel:"Cancel",continueButton:"Continue"}},bitcoin:{buttonText:"Continue with bitcoin",modalTitle:"Scan to pay",lightningPayButtonText:"Open Lightning wallet",lightningPayButtonAriaLabel:"Open Lightning wallet",qrCodeAltText:"Bitcoin Lightning Payment QR Code",closeButtonAriaLabel:"Close"}}},"en-GB":{paymentMethods:{cards:{errors:{cardNumberError:"Enter a valid card number.",cvvError:"Enter a valid security code.",expirationDateError:"Enter a valid expiration date.",multipleErrors:"Fix the highlighted errors.",postalCodeErrors:{CA:"Enter a valid postal code.",GB:"Enter a valid postcode.",US:"Enter a valid ZIP code."}},formTitle:"Secure card form",helperText:{cardNumber:"Enter your card number",cvv:"Enter the security code",expirationDate:"Enter the expiration date",postalCodes:{CA:"Enter the postal code",GB:"Enter the postcode",US:"Enter the zip code"}},inputFieldTitles:{cardNumber:"Credit card number",cvv:"CVV",expirationDate:"Expiration date",postalCodes:{CA:"Postal Code",GB:"Postcode",US:"ZIP Code"}},placeholderText:{cardNumber:"Card number",cvv:"CVV",expirationDate:"MM/YY",postalCodes:{CA:"Postal Code",GB:"Postcode",US:"ZIP"}},cardIcon:{brandNames:{JCB:"JCB",americanExpress:"American Express",discover:"Discover",discoverDiners:"Diners Club",masterCard:"Mastercard",squareGiftCardV2:"Square Gift Card",unionPay:"UnionPay",unknown:"Unknown card",visa:"Visa"}}},giftCards:{errors:{giftCardNumberError:"Enter a valid gift card number."},formTitle:"Secure gift card form",helperText:{giftCardNumber:"Enter your gift card number"},inputFieldTitles:{giftCardNumber:"Gift card number"},placeholderText:{giftCardNumber:"Gift card"}},afterpay:{checkoutWidget:{today:"Today",weeks:"weeks",title:"Your 4 interest-free payments"}},wallets:{callbackErrors:{contactError:"There was an error processing your selected delivery contact. Please try again.",optionsError:"There was an error processing your selected delivery option. Please try again."}},clickToPay:{modal:{headerTitle:"Credit or debit card",cardNetworksAlt:"Mastercard, Visa",cancelAriaLabel:"Cancel",continueButton:"Continue"}},bitcoin:{buttonText:"Continue with bitcoin",modalTitle:"Scan to pay",lightningPayButtonText:"Open Lightning wallet",lightningPayButtonAriaLabel:"Open Lightning wallet",qrCodeAltText:"Bitcoin Lightning payment QR code",closeButtonAriaLabel:"Close"}}},"en-IE":{paymentMethods:{cards:{errors:{cardNumberError:"Enter a valid card number.",cvvError:"Enter a valid security code.",expirationDateError:"Enter a valid expiry date.",multipleErrors:"Fix the highlighted errors.",postalCodeErrors:{CA:"Enter a valid postal code.",GB:"Enter a valid postcode.",US:"Enter a valid zip code."}},formTitle:"Secure card form",helperText:{cardNumber:"Enter your card number",cvv:"Enter the security code",expirationDate:"Enter the expiry date",postalCodes:{CA:"Enter the postal code",GB:"Enter the postcode",US:"Enter the ZIP code"}},inputFieldTitles:{cardNumber:"Credit card number",cvv:"CVV",expirationDate:"Expiration date",postalCodes:{CA:"Postal Code",GB:"Postcode",US:"ZIP Code"}},placeholderText:{cardNumber:"Card number",cvv:"CVV",expirationDate:"MM/YY",postalCodes:{CA:"Postal Code",GB:"Postcode",US:"ZIP"}},cardIcon:{brandNames:{JCB:"JCB",americanExpress:"American Express",discover:"Discover",discoverDiners:"Diners Club",masterCard:"Mastercard",squareGiftCardV2:"Square Gift Card",unionPay:"UnionPay",unknown:"Unknown card",visa:"Visa"}}},giftCards:{errors:{giftCardNumberError:"Enter a valid gift card number."},formTitle:"Secure gift card form",helperText:{giftCardNumber:"Enter your gift card number"},inputFieldTitles:{giftCardNumber:"Gift card number"},placeholderText:{giftCardNumber:"Gift card"}},afterpay:{checkoutWidget:{today:"Today",weeks:"weeks",title:"Your 4 interest-free payments"}},wallets:{callbackErrors:{contactError:"There was an error processing your selected delivery contact. Please try again.",optionsError:"There was an error processing your selected delivery option. Please try again."}},clickToPay:{modal:{headerTitle:"Credit or Debit Card",cardNetworksAlt:"Mastercard, Visa",cancelAriaLabel:"Cancel",continueButton:"Continue"}},bitcoin:{buttonText:"Continue with bitcoin",modalTitle:"Scan to Pay",lightningPayButtonText:"Open Lightning wallet",lightningPayButtonAriaLabel:"Open Lightning wallet",qrCodeAltText:"Bitcoin Lightning payment QR code",closeButtonAriaLabel:"Close"}}},"en-US":{paymentMethods:{cards:{errors:{cardNumberError:"Enter a valid card number.",cvvError:"Enter a valid security code.",expirationDateError:"Enter a valid expiration date.",multipleErrors:"Fix the highlighted errors.",postalCodeErrors:{CA:"Enter a valid postal code.",GB:"Enter a valid postcode.",US:"Enter a valid zip code."}},formTitle:"Secure Credit Card Form",helperText:{cardNumber:"Enter your card number",cvv:"Enter the security code",expirationDate:"Enter the expiration date",postalCodes:{CA:"Enter the postal code",GB:"Enter the postcode",US:"Enter the zip code"}},cardIcon:{brandNames:{visa:"Visa",masterCard:"Mastercard",americanExpress:"American Express",discover:"Discover",discoverDiners:"Diners Club",JCB:"JCB",unionPay:"UnionPay",squareGiftCardV2:"Square gift card",unknown:"Unknown card"}},inputFieldTitles:{cardNumber:"Credit card number",cvv:"CVV",expirationDate:"Expiration date",postalCodes:{CA:"Postal Code",GB:"Postcode",US:"ZIP Code"}},placeholderText:{cardNumber:"Card number",cvv:"CVV",expirationDate:"MM/YY",postalCodes:{CA:"Postal Code",GB:"Postcode",US:"ZIP"}}},giftCards:{errors:{giftCardNumberError:"Enter a valid gift card number."},formTitle:"Secure Gift Card Form",helperText:{giftCardNumber:"Enter your gift card number"},inputFieldTitles:{giftCardNumber:"Gift card number"},placeholderText:{giftCardNumber:"Gift card"}},afterpay:{checkoutWidget:{today:"Today",weeks:"weeks",title:"Your 4 interest-free payments"}},wallets:{callbackErrors:{contactError:"There was an error processing your selected shipping contact. Please try again.",optionsError:"There was an error processing your selected shipping option. Please try again."}},clickToPay:{modal:{headerTitle:"Credit or Debit Card",cardNetworksAlt:"Mastercard, Visa",cancelAriaLabel:"Cancel",continueButton:"Continue"}},bitcoin:{buttonText:"Continue with bitcoin",modalTitle:"Scan to pay",lightningPayButtonText:"Open Lightning wallet",lightningPayButtonAriaLabel:"Open Lightning wallet",qrCodeAltText:"Bitcoin Lightning Payment QR Code",closeButtonAriaLabel:"Close"}}},"es-ES":{paymentMethods:{afterpay:{checkoutWidget:{title:"Tus 4 pagos sin intereses",today:"Hoy",weeks:"semanas"}},cards:{errors:{cardNumberError:"Introduce un número de tarjeta válido.",cvvError:"Introduce un código de seguridad válido.",expirationDateError:"Introduce una fecha de caducidad válida.",multipleErrors:"Corrige los errores resaltados.",postalCodeErrors:{CA:"Introduce un código postal válido.",GB:"Introduce un código postal válido.",US:"Introduce un código postal válido."}},formTitle:"Formulario seguro para tarjetas de crédito",helperText:{cardNumber:"Introduce tu número de tarjeta",cvv:"Introduce el código de seguridad",expirationDate:"Introduce la fecha de caducidad",postalCodes:{CA:"Introduce el código postal",GB:"Introduce el código postal",US:"Introduce el código postal"}},inputFieldTitles:{cardNumber:"Número de la tarjeta de crédito",cvv:"Código CVV",expirationDate:"Fecha de vencimiento",postalCodes:{CA:"Código postal",GB:"Código postal",US:"Código postal"}},placeholderText:{cardNumber:"Número de tarjeta",cvv:"Código CVV",expirationDate:"MM/AA",postalCodes:{CA:"Código postal",GB:"Código postal",US:"C.P."}},cardIcon:{brandNames:{JCB:"JCB",americanExpress:"American Express",discover:"Discover",discoverDiners:"Diners Club",masterCard:"Mastercard",squareGiftCardV2:"Tarjeta regalo de Square",unionPay:"UnionPay",unknown:"Tarjeta desconocida",visa:"Visa"}}},giftCards:{errors:{giftCardNumberError:"Introduce un número de tarjeta de regalo válido."},formTitle:"Formulario seguro para tarjetas regalo",helperText:{giftCardNumber:"Introduce el número de tu tarjeta de regalo"},inputFieldTitles:{giftCardNumber:"Número de la tarjeta regalo"},placeholderText:{giftCardNumber:"Tarjeta de regalo"}},wallets:{callbackErrors:{contactError:"Se ha producido un error al procesar el contacto de envío que has seleccionado. Inténtalo de nuevo.",optionsError:"Se ha producido un error al procesar la opción de envío que has seleccionado. Inténtalo de nuevo."}},clickToPay:{modal:{headerTitle:"Tarjeta de crédito o débito",cardNetworksAlt:"Mastercard o Visa",cancelAriaLabel:"Cancelar",continueButton:"Continuar"}},bitcoin:{buttonText:"Continuar con bitcoines",modalTitle:"Escanear para pagar",lightningPayButtonText:"Abrir la billetera Lightning",lightningPayButtonAriaLabel:"Abrir la billetera Lightning",qrCodeAltText:"Código QR de pago con bitcóin y Lightning",closeButtonAriaLabel:"Cerrar"}}},"es-US":{paymentMethods:{afterpay:{checkoutWidget:{title:"Tus pagos de 4 cuotas sin interés",today:"Hoy",weeks:"semanas"}},cards:{errors:{cardNumberError:"Introduce un número de tarjeta válido.",cvvError:"Ingresa un código de seguridad válido.",expirationDateError:"Ingresar una fecha de vencimiento válida.",multipleErrors:"Arregla los errores resaltados.",postalCodeErrors:{CA:"Introduce un código postal válido.",GB:"Introduce un código postal válido.",US:"Introduce un código zip válido."}},formTitle:"Formulario seguro para tarjetas de crédito",helperText:{cardNumber:"Ingresa el número de la tarjeta",cvv:"Ingresa el código de seguridad",expirationDate:"Ingresa la fecha de vencimiento",postalCodes:{CA:"Ingresa el código postal",GB:"Ingresa el código postal",US:"Ingresar el código ZIP"}},inputFieldTitles:{cardNumber:"Número de la tarjeta de crédito",cvv:"CVV",expirationDate:"Fecha de vencimiento",postalCodes:{CA:"Código postal",GB:"Código postal",US:"Código ZIP"}},placeholderText:{cardNumber:"Número de tarjeta",cvv:"CVV",expirationDate:"MM/AA",postalCodes:{CA:"Código postal",GB:"Código postal",US:"ZIP"}},cardIcon:{brandNames:{JCB:"JCB",americanExpress:"American Express",discover:"Descubre",discoverDiners:"Diners Club",masterCard:"Mastercard",squareGiftCardV2:"Tarjeta de regalo Square",unionPay:"UnionPay",unknown:"Tarjeta desconocida",visa:"Visa"}}},giftCards:{errors:{giftCardNumberError:"Ingresa un número válido de tarjeta de regalo."},formTitle:"Formulario seguro para tarjetas de regalo",helperText:{giftCardNumber:"Ingresar el número de la tarjeta de regalo"},inputFieldTitles:{giftCardNumber:"Número de la tarjeta de regalo"},placeholderText:{giftCardNumber:"Tarjeta de regalo"}},wallets:{callbackErrors:{contactError:"Ocurrió un error al procesar el contacto de envío seleccionado. Vuelve a intentarlo.",optionsError:"Ocurrió un error al procesar la opción de envío seleccionada. Vuelve a intentarlo."}},clickToPay:{modal:{headerTitle:"Tarjeta de crédito o débito",cardNetworksAlt:"Mastercard, Visa",cancelAriaLabel:"Cancelar",continueButton:"Continuar"}},bitcoin:{buttonText:"Continuar con bitcoins",modalTitle:"Escanear para pagar",lightningPayButtonText:"Abrir cartera Lightning",lightningPayButtonAriaLabel:"Abrir cartera Lightning",qrCodeAltText:"Código QR del pago Lightning con bitcoin",closeButtonAriaLabel:"Cerrar"}}},"fr-CA":{paymentMethods:{cards:{errors:{cardNumberError:"Saisissez un numéro de carte valide.",cvvError:"Veuillez saisir un code de sécurité valide.",expirationDateError:"Veuillez saisir une date d’expiration valide.",multipleErrors:"Corrigez les erreurs mises en évidence.",postalCodeErrors:{CA:"Saisissez un code postal valide.",GB:"Saisissez un code postal valide.",US:"Saisissez un code postal valide."}},formTitle:"Formulaire de carte de crédit sécurisé",helperText:{cardNumber:"Saisir votre numéro de carte",cvv:"Saisir le code de sécurité",expirationDate:"Saisir la date d’expiration",postalCodes:{CA:"Saisir le code postal",GB:"Saisir le code postal",US:"Saisir le code postal"}},inputFieldTitles:{cardNumber:"Numéro de carte bancaire",cvv:"CVV",expirationDate:"Date d’expiration",postalCodes:{CA:"Code postal",GB:"Code postal",US:"Code postal"}},placeholderText:{cardNumber:"Numéro de la carte",cvv:"CVV",expirationDate:"MM/AA",postalCodes:{CA:"Code postal",GB:"Code postal",US:"Code postal"}},cardIcon:{brandNames:{JCB:"JCB",americanExpress:"American Express",discover:"Discover",discoverDiners:"Diners Club",masterCard:"Mastercard",squareGiftCardV2:"Carte cadeau Square",unionPay:"UnionPay",unknown:"Carte inconnue",visa:"Visa"}}},giftCards:{errors:{giftCardNumberError:"Saisissez un numéro de carte cadeau valide."},formTitle:"Formulaire de carte cadeau sécurisé",helperText:{giftCardNumber:"Saisir le numéro de votre carte cadeau"},inputFieldTitles:{giftCardNumber:"Numéro de carte cadeau"},placeholderText:{giftCardNumber:"Carte cadeau"}},afterpay:{checkoutWidget:{title:"Vos quatre paiements sans intérêts",today:"Aujourd’hui",weeks:"semaines"}},wallets:{callbackErrors:{contactError:"Une erreur s‘est produite lors du traitement du contact de livraison sélectionné. Veuillez réessayer.",optionsError:"Une erreur s‘est produite lors du traitement de l‘option d‘expédition sélectionnée. Veuillez réessayer."}},clickToPay:{modal:{headerTitle:"Carte de crédit ou débit",cardNetworksAlt:"Mastercard, Visa",cancelAriaLabel:"Annuler",continueButton:"Continuer"}},bitcoin:{buttonText:"Continuer avec bitcoin",modalTitle:"Lisez le code pour payer",lightningPayButtonText:"Ouvrir le portefeuille Lightning",lightningPayButtonAriaLabel:"Ouvrir le portefeuille Lightning",qrCodeAltText:"Code QR de paiement avec Bitcoin Lightning",closeButtonAriaLabel:"Fermer"}}},"fr-FR":{paymentMethods:{afterpay:{checkoutWidget:{title:"Vos quatre paiements sans intérêts",today:"Aujourd’hui",weeks:"semaines"}},cards:{errors:{cardNumberError:"Saisissez un numéro de carte valide",cvvError:"Veuillez saisir un code de sécurité valide.",expirationDateError:"Saisir une date d’expiration valide",multipleErrors:"Corrigez les erreurs mises en évidence.",postalCodeErrors:{CA:"Saisissez un code postal valide",GB:"Saisissez un code postal valide",US:"Saisissez un code ZIP valide"}},formTitle:"Formulaire de carte bancaire sécurisé",helperText:{cardNumber:"Saisir votre numéro de carte",cvv:"Saisir le code de sécurité",expirationDate:"Saisir la date d’expiration",postalCodes:{CA:"Saisir un code postal",GB:"Saisir un code postal",US:"Saisir un code ZIP"}},inputFieldTitles:{cardNumber:"Numéro de carte bancaire",cvv:"CVV",expirationDate:"Date d’expiration",postalCodes:{CA:"Code postal",GB:"Code postal",US:"Code postal"}},placeholderText:{cardNumber:"Numéro de carte",expirationDate:"MM/AA",cvv:"CVV",postalCodes:{CA:"Code postal",GB:"Code postal",US:"Code ZIP"}},cardIcon:{brandNames:{JCB:"JCB",americanExpress:"American Express",discover:"Discover",discoverDiners:"Diners Club",masterCard:"Mastercard",squareGiftCardV2:"Carte cadeau Square",unionPay:"UnionPay",unknown:"Carte inconnue",visa:"Visa"}}},giftCards:{errors:{giftCardNumberError:"Saisir un numéro de carte cadeau valide"},formTitle:"Formulaire de carte cadeau sécurisé",helperText:{giftCardNumber:"Saisir le numéro de votre carte cadeau"},inputFieldTitles:{giftCardNumber:"Numéro de carte cadeau"},placeholderText:{giftCardNumber:"Carte cadeau"}},wallets:{callbackErrors:{contactError:"Une erreur s‘est produite lors du traitement du contact de livraison sélectionné. Veuillez réessayer.",optionsError:"Une erreur s‘est produite lors du traitement de l‘option d‘expédition sélectionnée. Veuillez réessayer."}},clickToPay:{modal:{headerTitle:"Carte bancaire",cardNetworksAlt:"Mastercard, Visa",cancelAriaLabel:"Annuler",continueButton:"Continuer"}},bitcoin:{buttonText:"Continuer avec les bitcoins",modalTitle:"Scanner pour payer",lightningPayButtonText:"Ouvrir le portefeuille Lightning",lightningPayButtonAriaLabel:"Ouvrir le portefeuille Lightning",qrCodeAltText:"Code QR de paiement avec Bitcoin Lightning",closeButtonAriaLabel:"Fermer"}}},"ja-JP":{paymentMethods:{afterpay:{checkoutWidget:{title:"無利息の4回払い",today:"今日",weeks:"週間"}},cards:{errors:{cardNumberError:"正しいカード番号を入力してください。",cvvError:"有効なセキュリティコードを入力してください。",expirationDateError:"正しい有効期限を入力してください。",multipleErrors:"強調表示されたエラーを修正してください。",postalCodeErrors:{CA:"正しい郵便番号を入力してください。",GB:"有効な郵便番号を入力してください。",US:"正しいZIPコードを入力してください。"}},formTitle:"セキュアクレジットカードフォーム",helperText:{cardNumber:"カード番号を入力してください",cvv:"セキュリティコードを入力してください",expirationDate:"有効期限を入力してください",postalCodes:{CA:"郵便番号を入力してください",GB:"郵便番号を入力してください",US:"ZIPコードを入力してください"}},inputFieldTitles:{cardNumber:"クレジットカード番号",cvv:"CVV",expirationDate:"有効期限",postalCodes:{CA:"郵便番号",GB:"郵便番号",US:"ZIPコード"}},placeholderText:{cardNumber:"カード番号",cvv:"CVV",expirationDate:"MM/YY",postalCodes:{CA:"郵便番号",GB:"郵便番号",US:"ZIP"}},cardIcon:{brandNames:{JCB:"JCB",americanExpress:"American Express",discover:"Discover",discoverDiners:"Diners Club",masterCard:"Mastercard",squareGiftCardV2:"Square ギフトカード",unionPay:"UnionPay",unknown:"不明なカード",visa:"Visa"}}},giftCards:{errors:{giftCardNumberError:"有効なギフトカード番号を入力してください。"},formTitle:"セキュアギフトカードフォーム",helperText:{giftCardNumber:"ギフトカード番号を入力してください"},inputFieldTitles:{giftCardNumber:"ギフトカード番号"},placeholderText:{giftCardNumber:"ギフトカード"}},wallets:{callbackErrors:{contactError:"選択された配送住所を処理する際にエラーが発生しました。もう一度やり直してください。",optionsError:"選択された配送方法を処理する際にエラーが発生しました。もう一度やり直してください。"}},clickToPay:{modal:{headerTitle:"クレジットカードまたはデビットカード",cardNetworksAlt:"Mastercard、Visa",cancelAriaLabel:"キャンセル",continueButton:"続行"}},bitcoin:{buttonText:"ビットコインで続行",modalTitle:"セルフ会計",lightningPayButtonText:"ライトニング対応ウォレットを開く",lightningPayButtonAriaLabel:"ライトニング対応ウォレットを開く",qrCodeAltText:"ライトニング対応ビットコイン決済QRコード",closeButtonAriaLabel:"閉じる"}}}},Bo={en:"en-US",es:"es-ES",fr:"fr-FR",ja:"ja-JP"};class qo{constructor(e){this.currentLocale="en-US",this.setLocale(e)}setLocale(e){var t,n,r=(t=e.split("-"),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,n)||function(e,t){if(e){if("string"==typeof e)return xo(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xo(e,t):void 0}}(t,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.")}()),i=r[0],o=r[1],a=this.currentLocale;return jo(e)?(this.currentLocale=e,{newLocale:this.currentLocale,previousLocale:a}):function(e){return ko.includes(e)}(i)?(this.currentLocale=Bo[i],{message:"Locale ".concat(e," is not supported. Language ").concat(i," is supported, but region ").concat(o," is not. Falling back to ").concat(this.currentLocale,"."),newLocale:this.currentLocale,previousLocale:a}):{message:"Locale ".concat(e," is not supported. Language ").concat(i," and region ").concat(o," are both unsupported."),newLocale:this.currentLocale,previousLocale:a}}getCurrentLocale(){return this.currentLocale}getLocaleString(){return Uo[this.currentLocale]}}function Ho(e){return"[object Object]"===Object.prototype.toString.call(e)}function Fo(e){return"object"==typeof e&&null!==e}function Vo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Go="INVALID_VALUE",zo="SANITIZED",$o=new Set(["countryCode","currencyCode","requestBillingContact","requestShippingContact","lineItems","total","shippingOptions","shippingContact"]),Yo=new Set(["error","shippingErrors","lineItems","total","shippingOptions","taxLineItems","shippingLineItems","discounts"]),Wo=new Set([...Yo.values(),"eventName"]),Ko=new Set(["accountHolderName","amount","bankAccountId","currency","total"]),Xo=new Set([...Ko.values(),"intent","cadence","startDate"]),Jo=new Set(["amount","currencyCode","total","billingContact"]),Zo=new Set([...Jo.values(),"intent","customerInitiated","sellerKeyedIn"]),Qo=new Set(["includeInputLabels","postalCode","style"]),ea=new Set(["includeInputLabels","style"]),ta=new Set(["lineItems","total","shippingOptions","shippingContact"]),na=new Set(["buttonColor","buttonSizeMode","buttonType"]),ra=new Set(["shape","size","values","theme","width"]),ia=ba(br),oa=ba(pr),aa=ba(vr),sa=ba(Tr),ca=ba(fr),la=ba(gr),ua=ba(Di),da=ba(Ri),ha=ba(Li),pa=ba(Ai),fa=ba(Oi),ma=ba(Ti),ga=ba(Pi),va=new Set(["shippingOption"]),ya=new Set([...va.values(),"error"]),Ea=new Set(["checkoutWidgetLaunch","locale","selectorOrElement"]);function ba(e){return new Set(Object.values(e))}function _a(e){return JSON.stringify({value:e})}function Ca(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Ho(e)){var a={};return Object.entries(e).forEach((e=>{var n,s,c=(s=2,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(n,s)||function(e,t){if(e){if("string"==typeof e)return Vo(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vo(e,t):void 0}}(n,s)||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.")}()),l=c[0],u=c[1];if(t.has(l)){var d=u;r.has(l)?d=zo:l in i&&(d=i[l].has(u)?u:Go),a[l]=d}else o&&(a[l]=zo)})),JSON.stringify(a)}return"invalid non-struct type: ".concat("object"!=typeof(n=e)?typeof n:Array.isArray(n)?"array":null===n?"null":Object.prototype.toString.call(n))}var Sa=function(e,t,n){switch(e){case"TOKENIZE_CONFIGURED":return function(e,t){switch(e){case"ACH":return function(e){return Ca(e,Xo,Ko)}(t);case"Card":return function(e){var t=e.verificationDetails,n=void 0===t?{}:t,r=e.cofToken,i=Ca(n,Zo,Jo,void 0,!0),o={verificationDetails:JSON.parse(i)};return void 0!==r&&(o.cofToken=function(e){return"string"==typeof e&&e.startsWith("ccof:")?zo:Go}(r)),JSON.stringify(o)}(t)}return Go}(t,n);case"CONFIGURED":case"CONFIG_UPDATED":return function(e,t){switch(e){case"Card":case"Gift Card":return function(e,t){return Ca(t,"Card"===e?Qo:ea)}(e,t);case"Google Pay":return function(e){return Ca(e,na,void 0,{buttonColor:ua,buttonSizeMode:da,buttonType:ha})}(t);case"Payment Request":return function(e){return Ca(e,$o,ta)}(t);case Nr.CASH_APP_PAY:return function(e){return Ca(e,ra,void 0,{shape:fa,size:pa,theme:ma,values:ma,width:ga})}(t)}return Go}(t,n);case"FOCUSED":return _a(function(e,t){if("string"!=typeof t)return Go;switch(e){case"Card":if(ca.has(t))return t;break;case"Gift Card":if(la.has(t))return t}return Go}(t,n));case"SET_LOCALE":return _a(function(e){return"string"!=typeof e?Go:jo(e)?e:Go}(n));case"EVENT_LISTENER_ADDED":return _a(function(e,t){if("string"!=typeof t)return Go;switch(e){case"ACH":if(ia.has(t))return t;break;case"Card":if(oa.has(t))return t;break;case"Gift Card":if(aa.has(t))return t;break;case"Payment Request":if(sa.has(t))return t}return Go}(t,n));case"EVENT_LISTENER_ON_COMPLETE_RESPONSE":return function(e,t){return"Payment Request"===e?function(e){return Ca(e,Wo,Yo,{eventName:sa})}(t):Go}(t,n);case"SHIPPING_OPTION_UPDATE_RECEIVED":return Ca(n,ya,va,void 0,!0);case"AFTERPAY_CHECKOUT_WIDGET_CONFIGURED":return Ca(n,Ea);default:return""}};function Ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wa(e,t){return void 0!==e.document.body&&null!==e.document.createNodeIterator(e.document.body,NodeFilter.SHOW_ELEMENT,{acceptNode:t}).nextNode()}function Oa(e,t){return Boolean(e.querySelector(t))}n(3249);var Aa=function(e){var t,n=void 0!==e.angular,r=Oa(e.document,"[ng-version]")||void 0!==e.getAllAngularRootElements||void 0!==e.getAngularVersion,i=void 0!==e.bootstrap,o=void 0!==e.Ember,a=void 0!==e.jQuery,s=Oa(e.document,'form[action*="paypal.com"]'),c=function(e){return wa(e,(function(e){return"__k"in e||"_component"in e||"__c"in e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}))}(e),l=function(e){var t=Oa(e.document,"*[data-reactroot]");if(t)return t;return wa(e,(function(e){return"_reactRootContainer"in e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}))}(e),u=function(e){var t=void 0!==e.__NUXT__||void 0!==e.$nuxt,n=void 0!==e.__VUE__;if(n||t)return n||t;return wa(e,(function(e){return"__vue__"in e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}))}(e),d={angular:r,angularJS:n,bootstrap:i,ember:o,jquery:a,nextJS:void 0!==(null===(t=e.__NEXT_DATA__)||void 0===t?void 0:t.buildId),paypalBuyNow:s,preact:c,react:l,vue:u};return Object.fromEntries(Object.entries(d).filter((e=>{var t,n,r=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,n)||function(e,t){if(e){if("string"==typeof e)return Ia(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ia(e,t):void 0}}(t,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.")}());return r[0],r[1]})))},Ta=new Set(["AFTERPAY_CHECKOUT_WIDGET_CONFIGURED","CLEAR","CONFIG_UPDATED","CONFIGURED","DESTROYED","DETACHED","EVENT_LISTENER_ADDED","EVENT_LISTENER_ON_COMPLETE_RESPONSE","FOCUSED","RECALCULATED_SIZE","SET_LOCALE","SET_ERROR","SHIPPING_OPTION_UPDATE_RECEIVED","TOKENIZE_CONFIGURED"]),Pa=new Set(["PAYMENTS_REUSE","PAYMENTS_ENV_METADATA","DEVELOPER_ERROR","DEVELOPER_ERROR_PENDING","REQUEST_AFTERPAY_INVALID"]),Na=new Set(["GET_PRODUCT_INFORMATION","LOAD","MAIN_IFRAME","NONCE"]),Da={ATTACH:!0,BUILD:!0,CONFIGURE:!0,EXTERNAL_SESSION:!0,INITIALIZATION:!1,PROOF_OF_WORK:!1,TOKENIZE:!1};function Ra(e){return e in Da}var La=/[$()*+.?[\\\]^{|}]/g,xa=new RegExp(La.source),ka=function(e){return xa.test(e)?e.replace(La,"\\$&"):e},Ma={CARD_NONCE_ENDPOINT:new RegExp(ka(dr.CARD_NONCE_ENDPOINT)),GET_PRODUCT_INFORMATION_ENDPOINT:new RegExp(ka(dr.GET_PRODUCT_INFORMATION_ENDPOINT)),LIBRARY_RESOURCE:new RegExp("".concat(ka(dr.ASSET_BASE_URL),"/([\\w\\d.-]*/)?square\\.js")),MAIN_IFRAME_RESOURCE:new RegExp("".concat(ka(dr.ASSET_URL),"/main-iframe"))};function ja(e,t){if(!a.supportsPerformanceEntries)return null;var n=a.windowPerformance,r=function(e,t,n){var r=e.filter((e=>e.initiatorType===t&&n.test(e.name)));return r[r.length-1]}([...n.getEntriesByType("resource"),...n.getEntriesByType("navigation")],e,t);return r?Math.round(function(e){return e.duration>0?e.duration:Math.max(Math.trunc(e.responseEnd-e.startTime),0)}(r)):null}var Ua=function(e){switch(e){case"GET_PRODUCT_INFORMATION":return ja("fetch",Ma.GET_PRODUCT_INFORMATION_ENDPOINT);case"MAIN_IFRAME":return ja("navigation",Ma.MAIN_IFRAME_RESOURCE);case"LOAD":return ja("script",Ma.LIBRARY_RESOURCE);case"NONCE":return ja("fetch",Ma.CARD_NONCE_ENDPOINT);default:return null}};function Ba(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(n),!0).forEach((function(t){Ha(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ba(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ha(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Va=dr.METRICS_URL,Ga=dr.METRICS_V2_URL;function za(e){return t=e.event,Ta.has(t);var t}function $a(e){return t=e.event,Pa.has(t);var t}function Ya(e){return!za(e)&&!$a(e)}class Wa{constructor(e,t){this.manualTelemetryStarts=new Map,this.logVisibilityEvent=()=>{var e={event:"visible"===a.documentVisibilityState?"VISIBILITY:VISIBLE":"VISIBILITY:HIDDEN",eventSource:"WebSDK"},t=this.getMetricsLoggerBody(e,this.session.instanceId,this.session.sessionId,this.session.paymentMethodTrackingId);this.metricsBuffer.push(t)},this.flushAllMetrics=()=>{"hidden"===a.documentVisibilityState&&(this.buildAndSendBeacon(),clearInterval(this.currentInterval),this.currentInterval=void 0)},this.sdkVersion=dr.VERSION,this.jsFramework="",this.applicationData=t,this.metricsBuffer=[],this.errorLogger=e,this.disableBeacon=!1}setAvt(e){this.avt=e}setFeatureFlagValues(e){this.featureFlagValues=e}logEvent(e,t,n,r){try{var i=this.getMetricsLoggerBody(e,t,n,r);if(this.session=i.session,this.disableBeacon||!a.supportsSendBeacon||!a.supportsDocumentVisibilityState)return void cr(Va,{body:i}).catch((e=>{this.errorLogger.captureException(e)}));this.metricsBuffer.push(i),"NONCE:OK"!==e.event&&"DESTROYED"!==e.event||this.buildAndSendBeacon(),void 0===this.currentInterval&&(document.addEventListener("visibilitychange",this.logVisibilityEvent),document.addEventListener("visibilitychange",this.flushAllMetrics),this.currentInterval=window.setInterval((()=>{this.buildAndSendBeacon()}),1e3))}catch(e){this.errorLogger.captureException(e)}}clearEventListener(){document.removeEventListener("visibilitychange",this.logVisibilityEvent),document.removeEventListener("visibilitychange",this.flushAllMetrics)}getJSFrameworkValue(){return 0===this.jsFramework.length&&(this.jsFramework=JSON.stringify(Aa(window))),this.jsFramework}eventDuration(e,t){var n,r,i,o=(r=e.event.split(":"),i=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(r,i)||function(e,t){if(e){if("string"==typeof e)return Fa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fa(e,t):void 0}}(r,i)||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.")}()),a=o[0],s=o[1];if(Ra(a)){var c;if(Ra(n=a)&&!Da[n]?c=a:void 0!==t&&(c="".concat(a,":").concat(t)),void 0===c)return null;if("START"===s){var l=Date.now();return this.manualTelemetryStarts.set(c,l),null}if("OK"===s||"ERROR"===s||"CANCEL"===s){var u=this.manualTelemetryStarts.get(c);return void 0===u?null:(this.manualTelemetryStarts.delete(c),Date.now()-u)}}return"START"!==s&&function(e){return Na.has(e)}(a)?Ua(a):null}buildAndSendBeacon(){if(0!==this.metricsBuffer.length){try{var e=new Blob([JSON.stringify({metrics:this.metricsBuffer})],{type:"text/plain;charset=UTF-8"});window.navigator.sendBeacon(Ga,e)}catch(e){(function(e){return e instanceof Error&&"TypeError"===e.name&&(e.message.includes("Not implemented")||e.message.includes("Illegal invocation"))})(e)||this.errorLogger.captureException(e),this.disableBeacon=!0,void 0!==this.currentInterval&&(clearInterval(this.currentInterval),this.currentInterval=void 0),cr(Ga,{body:{metrics:this.metricsBuffer}}).catch((e=>{this.errorLogger.captureException(e)}))}this.metricsBuffer=[]}}metricsSession(e,t,n){var r=qa(qa({},this.applicationData),{},{instanceId:e,sessionId:t});return void 0!==n&&(r.paymentMethodTrackingId=n),r}getMetricsLoggerBody(e,t,n,r){var i=function(){if(a.isTopLevelWindow)return{origin:a.windowLocation.origin,pathname:a.windowLocation.pathname};var e=a.documentReferrer;return e&&0!==e.length?(null!=No||(No=document.createElement("a")),No.href=e,{origin:No.origin,pathname:""}):{origin:"",pathname:""}}(),o={innerHeight:a.windowInnerHeight,innerWidth:a.windowInnerWidth,isSecureContext:a.isSecureContext,language:a.windowNavigatorLanguages[0]},s=this.eventDuration(e,r),c=e.event,l=e.eventSource,u=this.sdkVersion,d=this.metricsSession(t,n,r),h={appLocation:i,avt:this.avt,browserData:o,event:c,eventSource:l,paymentMethodTrackingId:r,sdkVersion:u,session:d};return za(e)&&void 0!==e.eventConfigurationValues&&(h.eventConfigurationValues=Sa(e.event,l,e.eventConfigurationValues)),$a(e)?h.internalConfigurationValues=e.errorMessage:Ya(e)&&void 0!==this.featureFlagValues&&(h.internalConfigurationValues=JSON.stringify(this.featureFlagValues)),null!==s&&s>0&&(h.duration=s),Ya(e)&&void 0!==e.sloStatus&&(h.sloStatus=e.sloStatus),"INITIALIZATION:OK"===c&&(h.jsFramework=this.getJSFrameworkValue()),h}}n(5372);class Ka{constructor(e,t){this.errorLogger=e,this.messenger=t}}function Xa(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}var Ja="LOCALE_CHANGED_EVENT";class Za extends Ka{constructor(e,t,n,r,i,o,a,s,c){super(e,t),this.session=r,this.localeStrings=o,this.paymentMethodSupportDetail=i,this.metricsHandler=n,this.eventTarget=a,this.featureFlagValues=s,this.analyticsBackend=c}addLocaleChangedListener(e){this.eventTarget.addEventListener(Ja,e)}removeLocaleChangedListener(e){this.eventTarget.removeEventListener(Ja,e)}getSession(){return this.session.serialize()}getFeatureFlagValues(){return this.featureFlagValues}getLocaleString(){return this.localeStrings.getLocaleString()}setLocale(e){var t=this.localeStrings.setLocale(e);if(t.previousLocale===t.newLocale)return t;var n=this.localeStrings.getCurrentLocale();return this.session.setLocale(n),this.eventTarget.dispatchEvent(Ja,n),this.messenger.sendOneWayMessage("UPDATE_SESSION",{session:this.session.serialize()}),t}updateSession(e){var t,n=this;return(t=function*(){n.session.setSessionId(e),n.errorLogger.setCustomTags({sessionId:e}),yield n.messenger.sendOneWayMessage("UPDATE_SESSION",{session:n.session.serialize()})},function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(e){Xa(o,r,i,a,s,"next",e)}function s(e){Xa(o,r,i,a,s,"throw",e)}a(void 0)}))})()}setPaymentMethodTrackingId(e){this.metricsHandler.setPaymentMethodTrackingId(e)}getPaymentMethodTrackingId(){return this.metricsHandler.getPaymentMethodTrackingId()}}var Qa={attach:[Yr,mi,ei,vi,Ei,yi,bi,hi,fi,di,ri,ii,si],attachMessaging:[Yr,mi,fi],build:[Qr,ei,gi,Jr,Wr,di,Fr,Ur,oi,ai,ci],configure:[Yr,Qr,ei,vi,Ei,yi,Jr,bi,pi,fi],tokenize:[Jr,fi,pi,di,_i,Mr]};function es(e){return Qa[e]}var ts={APPLE_PAY_BROWSER_NOT_SUPPORTED:{message:"Apple Pay is only available on Safari.",type:"BROWSER_NOT_SUPPORTED"},APPLE_PAY_CONSISTENT_DOMAIN_REQUIRED:{message:"Apple Pay should be hosted on the same domain as its top-level frame.",type:"CONSISTENT_DOMAIN_REQUIRED"},APPLE_PAY_DEVICE_NOT_SUPPORTED:{message:"Device does not support Apple Pay.\nSee: https://developer.squareup.com/docs/web-payments/apple-pay#prerequisites-and-assumptions",type:"DEVICE_NOT_SUPPORTED"},APPLE_PAY_NOT_REGISTERED:{message:"No active card available in the Apple Wallet or domain not registered.",type:"NOT_REGISTERED"},APPLE_PAY_REQUIRES_SECURE_CONTEXT:{message:"Apple Pay requires a fully secure HTTPS context.\nSee: https://developer.squareup.com/docs/web-payments/apple-pay#prerequisites-and-assumptions",type:"IFRAME_NOT_ALLOWED"},GOOGLE_PAY_BROWSER_NOT_SUPPORTED:{message:"Browser does not support Google Pay. \nSee: https://developer.squareup.com/docs/web-payments/google-pay#prerequisites-and-assumptions",type:"BROWSER_NOT_SUPPORTED"},GOOGLE_PAY_REQUIRES_HTTPS:{message:"Google Pay requires HTTPS. \nSee: https://developer.squareup.com/docs/web-payments/google-pay#prerequisites-and-assumptions",type:"BROWSER_NOT_SUPPORTED"},INVALID_CONFIG:{message:"Configuration is invalid.",type:"INVALID_CONFIG"},MISC_THIRD_PARTY_IFRAME_NOT_ALLOWED:{message:"Third-party iframes are not allowed to request payments unless explicitly allowed via Permissions-Policy Configuration.\n    Please configure the relevant permissions policy (via the Permissions-Policy header or <iframe allow...> ) to allow 'payment' in order to enable this functionality.\n    See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy/payment",type:"IFRAME_NOT_ALLOWED"},UNABLE_TO_LOAD:{message:"Temporarily unable to register the payment method.",type:"UNABLE_TO_LOAD"},UNKNOWN:{message:"An unknown error has occurred.",type:"UNKNOWN"}},ns=["COUNTRY_NOT_SUPPORTED","APPLICATION_DISABLED","MISSING_LOCATION_ID","UNVERIFIED_DOMAIN","NOT_ONBOARDED","US_AND_UK_MERCHANT_ONLY","US_MERCHANT_ONLY","INTERNAL_ERROR","DOMAIN_NOT_REGISTERED"],rs={APPLICATION_DISABLED:{message:"Wallet is disabled for your application.",type:"APPLICATION_DISABLED"},COUNTRY_NOT_SUPPORTED:{message:"Wallet is not available in this merchant country.",type:"COUNTRY_NOT_SUPPORTED"},DOMAIN_NOT_REGISTERED:{message:"Your website's domain is not registered for use with Apple Pay.\nSee: https://developer.squareup.com/docs/web-payments/apple-pay#production-configuration",type:"DOMAIN_NOT_REGISTERED"},INTERNAL_ERROR:{message:"There was a temporary error determining your website's payment method status",type:"INTERNAL_ERROR"},MISSING_LOCATION_ID:{field:"locationId",message:"Missing locationId in the payment request configuration.\nSee: https://developer.squareup.com/reference/sdks/web/payments/objects/Payments",type:"MISSING_LOCATION_ID"},NOT_ONBOARDED:{message:"Your merchant account has not yet been onboarded for this payment method. Please visit the Seller Dashboard to enable the payment method",type:"NOT_ONBOARDED"},UNVERIFIED_DOMAIN:{message:"Your website's domain is not verified for use with Apple Pay. Please visit the Square Developer Dashboard at https://developer.squareup.com/ to register your domain for use with Apple Pay",type:"UNVERIFIED_DOMAIN"},US_AND_UK_MERCHANT_ONLY:{message:"Wallet is available for US and UK merchants only.",type:"US_AND_UK_MERCHANT_ONLY"},US_MERCHANT_ONLY:{message:"Wallet is available for US merchants only.",type:"US_MERCHANT_ONLY"}};class is extends hr{constructor(e,t,n){var r="".concat(e," was called with a missing or invalid parameter. '").concat(t,"' is required");r+=" and must be a(n) ".concat(n),super("".concat(r,".")),this.name="InvalidFunctionArgumentError",Object.setPrototypeOf(this,is.prototype)}}class os extends hr{constructor(e){super("One or more of the arguments needed are missing or invalid."),this.argumentErrors=e,this.name="InvalidArgumentsError",Object.setPrototypeOf(this,os.prototype)}}class as{constructor(){this.listeners={}}addEventListener(e,t){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(t)}removeEventListener(e,t){if(e in this.listeners)for(var n=this.listeners[e],r=0;r<n.length;r+=1)n[r]===t&&(n.splice(r,1),r-=1)}listenersForType(e){return e in this.listeners?[...this.listeners[e]]:[]}hasEventListener(e){return e in this.listeners&&this.listeners[e].length>0}}class ss{constructor(){this.listenerRegistry=new as}addEventListener(e,t){this.listenerRegistry.addEventListener(e,t)}removeEventListener(e,t){this.listenerRegistry.removeEventListener(e,t)}dispatchEvent(e,t){var n=new qi(e,t),r=this.listenerRegistry.listenersForType(e);for(var i of r)try{i(n)}catch(e){console.error(e)}}hasEventListener(e){return this.listenerRegistry.hasEventListener(e)}}var cs=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).slice(1)}return"".concat(e()+e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())};class ls{constructor(e,t,n,r){this.metricsLogger=e,this.methodType=n,this.session=t,this.paymentMethodTrackingId=r}logDeveloperError(e,t){var n={operation:t,paymentMethod:this.methodType,type:e.name};if("errors"in e){var r=e.errors;Array.isArray(r)&&r.length>0&&"type"in r[0]&&(n.errors=r.map((e=>e.type)))}e instanceof di&&(n.message=e.message.replace("Method unsupported: ","")),this.logValidationEvent("DEVELOPER_ERROR",n)}logValidationEvent(e,t){this.logMetricEvent({errorMessage:JSON.stringify(t),event:e,eventSource:this.methodType})}logConfigurationEvent(e,t){this.logMetricEvent({event:e,eventConfigurationValues:t,eventSource:this.methodType})}logEvent(e,t){this.logMetricEvent({event:e,eventSource:this.methodType,sloStatus:t})}setPaymentMethodTrackingId(e){this.paymentMethodTrackingId=e}getPaymentMethodTrackingId(){return this.paymentMethodTrackingId}logMetricEvent(e){this.metricsLogger.logEvent(e,this.session.instanceId,this.session.sessionId,this.paymentMethodTrackingId)}}function us(e,t,n){return void 0===e?[{code:"missing_property",expected:n,propertyPath:t}]:[]}function ds(e,t,n,r){return n(e)?[]:[{code:"invalid_value",expected:r,propertyPath:t}]}function hs(e,t,n,r){var i=[];i.push((()=>us(e,t,n))),i.push((()=>function(e,t,n){return typeof e===n?[]:[{code:"invalid_type",expected:n,propertyPath:t}]}(e,t,n)));var o=r.legalValues;return void 0!==o&&i.push((()=>function(e,t,n){return(n instanceof Set?n.has(e):n.includes(e))?[]:[{code:"invalid_value",expected:(n instanceof Set?[...n]:n).map((e=>String(e))).join(", "),propertyPath:t}]}(e,t,o))),i}function ps(e){for(var t of e){var n=t();if(n.length>0)return n}return[]}function fs(){return{sanitizeFunction:e=>e,validateFunction:function(e,t){return us(e,t,"any")}}}function ms(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{sanitizeFunction:function(t){return t.map((t=>e.sanitizeFunction(t)))},validateFunction:function(n,r){if(!Array.isArray(n))return[{code:"invalid_type",expected:"array",propertyPath:r}];var i,o,a=[],s=0;for(var c of n.entries()){var l=(o=2,function(e){if(Array.isArray(e))return e}(i=c)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(i,o)||function(e,t){if(e){if("string"==typeof e)return ms(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ms(e,t):void 0}}(i,o)||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.")}()),u=l[0],d=l[1];a.push(...e.validateFunction(d,"".concat(r,"[").concat(u,"]"))),s+=1}var h=t.minLength;return void 0!==h&&s<h&&a.push({code:"invalid_value",expected:"Array must contain ".concat(h," or more items"),propertyPath:r}),a}}}function vs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{sanitizeFunction:e=>e,validateFunction:function(t,n){return ps(hs(t,n,"boolean",e))}}}function ys(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n(9964);var Es,bs=/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;function _s(e){var t,n,r,i,o=function(e){var t,n,r=(t=bs.exec(e).map(Number),n=4,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,n)||function(e,t){if(e){if("string"==typeof e)return ys(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ys(e,t):void 0}}(t,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.")}()),i=(r[0],r[1]),o=r[2],a=r[3];return new Date(i,o-1,a)}(e);return(t=o,n="".concat(t.getFullYear(),"-").concat((t.getMonth()+1).toString().padStart(2,"0"),"-").concat(t.getDate().toString().padStart(2,"0")),r=new Date("".concat(n,"T00:00:00").concat("-08:00")),i=new Date(r.getTime()),i.setDate(i.getDate()+1),{endDate:i,endDateMillis:i.getTime(),startDate:r,startDateMillis:r.getTime()}).endDateMillis}function Cs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{sanitizeFunction:e=>e,validateFunction:function(t,n){var r=hs(t,n,"string",{});return"string"==typeof t&&(r.push((()=>ds(t,n,(e=>bs.test(e)),"Date did not match the YYYY-MM-DD format"))),!0===e.futureDate&&_s(t)<Date.now()&&r.push((()=>[{code:"invalid_value",expected:"Date should be a future date",propertyPath:n}]))),ps(r)}}}function Ss(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{sanitizeFunction:e=>e,validateFunction:function(t,n){return ps(hs(t,n,"number",e))}}}function Is(e,t){function n(t){var n=[];for(var r of e)r.eligible(t)&&n.push(r.schemaOperation);return n}return{isRecordSchema:!0,sanitizeFunction:function(e){var t=n(e).filter((t=>0===t.validateFunction(e,"").length));return t[0].sanitizeFunction(e)},validateFunction:function(e,r){var i=n(e);if(0===i.length){var o=t.code,a=t.expected,s=t.propertyPath;return[{code:o,expected:a,propertyPath:""===r?s:"".concat(s," in ").concat(r)}]}var c=i.map((t=>t.validateFunction(e,r))).filter((e=>e.length>0));return c.length===i.length?c[0]:[]}}}function ws(e){return{sanitizeFunction:function(t){if(null!=t)return e.sanitizeFunction(t)},validateFunction:function(t,n){return null==t?[]:e.validateFunction(t,n)}}}function Os(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function As(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(null==e)return e;if("object"!=typeof e)return e;if(e instanceof Date)return new Date(e);var n=t.get(e);if(void 0!==n)return n;if(Array.isArray(e)){var r=[];for(var i of(t.set(e,r),e))r.push(As(i,t));return r}var o={};return t.set(e,o),Object.entries(e).reduce(((e,n)=>{var r,i,o=(i=2,function(e){if(Array.isArray(e))return e}(r=n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(r,i)||function(e,t){if(e){if("string"==typeof e)return Os(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Os(e,t):void 0}}(r,i)||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.")}()),a=o[0],s=o[1];return e[a]=As(s,t),e}),o)}function Ts(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ps(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ps(e,t):void 0}}(e,t)||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 Ps(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ns(e){return{isRecordSchema:!0,sanitizeFunction:function(t){var n=t;if(void 0===e)return As(t);var r={};return Object.entries(e).forEach((e=>{var t=Ts(e,2),i=t[0],o=t[1].sanitizeFunction(n[i]);void 0!==o&&(r[i]=o)})),r},validateFunction:function(t,n){if(!Fo(t))return[{code:"invalid_type",expected:"object",propertyPath:n}];var r=[];if(void 0!==e){var i=""===n?"":"".concat(n,".");Object.entries(e).forEach((e=>{var n=Ts(e,2),o=n[0],a=n[1],s=t[o];r.push(...a.validateFunction(s,"".concat(i).concat(o)))}))}return r}}}function Ds(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;return{sanitizeFunction:function(e){return t(e)},validateFunction:function(t,n){var r=hs(t,n,"string",e),i=t,o=e.nonBlank,a=e.minLength,s=e.maxLength,c=e.matchRegexp,l=e.formatExample;return!0===o&&r.push((()=>ds(i,n,(e=>""!==e.trim()),"non-blank string"))),void 0!==a&&r.push((()=>ds(i,n,(e=>e.length>=a),"minimum length ".concat(e.minLength)))),void 0!==s&&r.push((()=>ds(i,n,(e=>e.length<=s),"maximum length ".concat(e.maxLength)))),void 0!==c&&r.push((()=>ds(i,n,(e=>c.test(e)),void 0!==l?"string with format ".concat(l):"correctly formatted string"))),ps(r)}}}n(6104),n(9098);class Rs extends Error{constructor(e){super("Unable to sanitize value: ".concat(JSON.stringify(e))),this.name="SanitizationError"}}function Ls(e){var t=new WeakMap;function n(n,r){if(""!==r||"object"!=typeof n||null===n)return e.validateFunction(n,r);var i=t.get(n);if(void 0!==i)return i;var o=e.validateFunction(n,r);return t.set(n,o),o}return{logValidationFailures(e,t,r,i){var o=n(i,arguments.length>4&&void 0!==arguments[4]?arguments[4]:"");o.length>0&&e.logValidationEvent("DEVELOPER_ERROR_PENDING",{error:o.map((e=>"".concat(e.code," ").concat(e.expected," ").concat(e.propertyPath))).join(", "),operation:r,paymentMethod:t})},sanitize:function(t){if(n(t,"").length>0)throw new Rs(t);return e.sanitizeFunction(t)},validate:function(e){var t=n(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"");return{isValid:0===t.length,issues:t}}}}function xs(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function ks(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){xs(o,r,i,a,s,"next",e)}function s(e){xs(o,r,i,a,s,"throw",e)}a(void 0)}))}}!function(e){e[e.DETACHED=0]="DETACHED",e[e.ATTACHED=1]="ATTACHED",e[e.DESTROYED=2]="DESTROYED"}(Es||(Es={}));class Ms{constructor(e){this.status=Es.DETACHED,this.eventTarget=new ss,this.eventBuffer={},this.context=e}get session(){return this.context.getSession()}get messenger(){return this.context.messenger}get metricsHandler(){return this.context.metricsHandler}get errorLogger(){return this.context.errorLogger}addEventListener(e,t){this.eventTarget.addEventListener(e,t),e in this.eventBuffer&&this.eventBuffer[e].length>0&&(this.eventBuffer[e].forEach((t=>{this.eventTarget.dispatchEvent(e,t)})),this.eventBuffer[e]=[])}hasEventListener(e){return this.eventTarget.hasEventListener(e)}removeEventListener(e,t){this.eventTarget.removeEventListener(e,t)}destroy(){return Promise.resolve(!0)}detach(){return Promise.resolve(!0)}dispatchEvent(e,t){this.hasEventListener(e)?this.eventTarget.dispatchEvent(e,t):(e in this.eventBuffer||(this.eventBuffer[e]=[]),this.eventBuffer[e].push(t))}withErrorHandling(e,t){var n=this.methodType,r=this.context;return ks((function*(){var i=function(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toUpperCase()}(t);try{r.metricsHandler.logEvent("".concat(i,":START"));var o=yield e(...arguments);return r.metricsHandler.logEvent("".concat(i,":OK"),"good"),o}catch(e){if(go.isInstanceOf(e,es(t)))throw r.metricsHandler.logEvent("".concat(i,":ERROR"),"good"),r.metricsHandler.logDeveloperError(e,t),e;throw r.metricsHandler.logEvent("".concat(i,":ERROR"),"bad"),["UnexpectedError","UnexpectedAnalyticsClientError"].includes(To(e).name)||r.errorLogger.captureException(e),new Ci("using ".concat(n))}}))}throwIfDestroyed(){if(this.status===Es.DESTROYED)throw new fi(this.methodType)}throwIfDestroyedOrAlreadyAttached(){if(this.throwIfDestroyed(),this.status===Es.ATTACHED)throw new hi(this.methodType)}throwIfDestroyedOrNotAttached(){if(this.throwIfDestroyed(),this.status!==Es.ATTACHED)throw new pi(this.methodType)}}var js={message:"the tokenization request is already in process",type:"TOKENIZATION_IN_PROCESS"};class Us extends Error{constructor(e,t,n){super(`error loading script ${e}: ${t} ${n?n.toString():""}`),this.name="ScriptLoaderError",Object.setPrototypeOf(this,Us.prototype)}}const Bs=new Map;function qs(e){Bs.delete(e),document.getElementById(e)?.remove()}function Hs(e,t){const n=t();if(void 0!==n)return Promise.resolve(n);const r=Bs.get(e.id);if(void 0!==r)return r;const i=document.createElement("script");for(const t in e){const n=e[t];void 0!==n&&i.setAttribute(t,n)}const o=new Promise(((n,r)=>{i.onload=()=>{const i=t();void 0===i?(qs(e.id),r(new Us(e.src,"location returned undefined"))):n(i)},i.onerror=(t,n,i,o,a)=>{qs(e.id),r(new Us(e.src,"Unknown error occurred",a))}}));return Bs.set(e.id,o),document.body.appendChild(i),o}function Fs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vs(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gs(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function zs(){var e;return e=function*(e,t,n){try{var r="square-payments-".concat(e,"-script"),i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fs(Object(n),!0).forEach((function(t){Vs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({id:r},t);return void 0===n?void(yield Hs(i,(()=>null!==document.getElementById(r)||void 0))):yield Hs(i,(()=>{var e,t;return"google.payments"===n?null===(e=window.google)||void 0===e?void 0:e.payments:"Square.utils.QRCodeFactory"===n?null===(t=window.Square.utils)||void 0===t?void 0:t.QRCodeFactory:window[n]}))}catch(e){throw new di(ts.UNABLE_TO_LOAD)}},zs=function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Gs(o,r,i,a,s,"next",e)}function s(e){Gs(o,r,i,a,s,"throw",e)}a(void 0)}))},zs.apply(this,arguments)}var $s={load:function(e,t,n){return zs.apply(this,arguments)}};const Ys=["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"],Ws=["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"];class Ks extends Error{constructor(e){super(e),this.name="InvalidAuthorizationParameter",Object.setPrototypeOf(this,Ks.prototype)}}Error,Error;class Xs extends Error{constructor(e,t){super(`The listener provided for event type ${e} threw an error: ${t}`),this.name="InvalidEventListenerError",Object.setPrototypeOf(this,Xs.prototype)}}class Js{constructor(){this.listeners=new Map,this.eventBuffer=new Map}addEventListener(e,t,n={}){if(!0===n.once){const n=t;t=r=>{this.removeEventListener(e,t),n(r)}}if(n.signal){if(n.signal.aborted)return;n.signal.addEventListener("abort",(()=>{this.removeEventListener(e,t)}))}const r=this.listeners.get(e);void 0===r?this.listeners.set(e,[t]):r.push(t);const i=this.eventBuffer.get(e);i&&(i.forEach((e=>{this.dispatchEvent(e)})),this.eventBuffer.set(e,[]))}removeEventListener(e,t){const n=this.listeners.get(e);if(void 0!==n)for(let e=0;e<n.length;e++)n[e]===t&&(n.splice(e,1),e--)}hasEventListener(e){const t=this.listeners.get(e);return void 0!==t&&t.length>0}dispatchEvent(e){if(this.hasEventListener(e.type)){const t=[...this.listeners.get(e.type)??[]];for(const n of t)try{n(e)}catch(t){throw new Xs(e.type,t.message)}}else{const t=this.eventBuffer.get(e.type);void 0===t?this.eventBuffer.set(e.type,[e]):t.push(e)}}}class Zs{constructor(){this.eventTarget=new Js}addEventListener(e,t){this.eventTarget.addEventListener(e,(e=>{t(e.detail)}))}dispatchEvent(e){this.eventTarget.dispatchEvent(new CustomEvent(e.type,{detail:e}))}}const Qs={get DEV_ENV(){return"development"},get IFRAME_NAME(){return"ach_authz"},get IFRAME_TITLE(){return"Square ACH Authorization"},get PRODUCTION_ENV(){return"production"},get SANDBOX_ENV(){return"sandbox"},get TEST_ENV(){return"test"},getDebitAuthHostname(e){switch(e){case this.PRODUCTION_ENV:return"https://connect.squareup.com";case this.SANDBOX_ENV:return"https://connect.squareupsandbox.com";default:return"https://connect.squareupstaging.com"}},getIframeSrc(e,t){return`${this.getSDKBaseUrlForEnv(e)}${"development"===e?"":`/${t}`}/ach-authz-sdk/enclave.html`},getSDKBaseUrlForEnv(e){switch(e){case"production":return"https://web.squarecdn.com";case"sandbox":return"https://sandbox.web.squarecdn.com";case"development":return"https://localhost:1779";default:return"https://staging.web.squarecdn.com"}}};class ec extends Error{constructor(e){super("Received error event from iframe"),this.event=e,this.name="IframeErrorEventError",Object.setPrototypeOf(this,ec.prototype)}}const tc=function(e,t){const n=document.createElement("iframe");return new Promise(((r,i)=>{n.onerror=e=>{i(new ec(e))},n.onload=()=>{r(n)},n.setAttribute("id","ach-auth-enclave"),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("src",Qs.getIframeSrc(e,t)),n.setAttribute("title",Qs.IFRAME_TITLE),n.style.position="fixed",n.style.inset="0px",n.style.zIndex="2147483647",n.style.borderWidth="0px",n.style.display="block",n.style.overflow="hidden auto",document.body.append(n)}))},nc=function(e){e.parentElement?.removeChild(e)};class rc extends Error{constructor(e,t){super(e),this.severity=t??"error"}}class ic extends rc{constructor(e){super(e),this.name="IframeMessengerImplementationError",Object.setPrototypeOf(this,ic.prototype)}}class oc extends rc{constructor(e){super(e),this.name="IframeMessengerInternalMessageError",Object.setPrototypeOf(this,oc.prototype)}}class ac extends rc{constructor(e,t,n,r){void 0!==n?(super(`Messenger has not received an acknowledgement of message ${e} with id ${t} from iframe id=${n} which ${null===document.getElementById(n)?"does not exist":"exists"}`,r),this.iframeID=n):super(`Messenger has not received an acknowledgement of message ${e} with id ${t}, no iframeID was set`,r),this.type=e,this.id=t,this.name="IframeMessengerTimeoutError",Object.setPrototypeOf(this,ac.prototype)}}const sc="channel:connected",cc="channel:connecting",lc="channel:close",uc="channel:error";class dc{constructor(e){this.receiveMessage=e=>{switch(e.data){case this.messageWithName(cc):this.handleConnecting(e);break;case this.messageWithName(sc):this.handleConnected();break;case this.messageWithName(lc):this.close();break;case this.messageWithName(uc):break;default:this.handleMessage(e)}},this.connected=!1,this.listeners=[],this.messageBuffer=[],this.name=void 0!==e?`:${e}`:""}set onmessage(e){this.listeners.push(e)}close(){this.port&&(this.postMessage(this.messageWithName(lc)),this.port.close(),this.port=void 0,this.connected||window.removeEventListener("message",this.receiveMessage)),this.connected=!1}connect(e){if(this.connected)throw new ic("message channel is already connected");if(e){if(void 0===e.origin)throw new ic("message channel remote.origin must be defined");if(null===e.window)throw new ic("message channel remote.window cannot be null");const t=new MessageChannel;this.setupPort(t.port1),e.window.postMessage(this.messageWithName(cc),e.origin,[t.port2])}else window.addEventListener("message",this.receiveMessage)}setErrorHandler(e){this.errorHandler=e}postMessage(e){this.port&&this.connected?this.port.postMessage(e):this.messageBuffer.push(e)}handleConnecting(e){if(this.connected)throw new ic("message channel should not be connecting because already connected");window.removeEventListener("message",this.receiveMessage),e.ports[0]&&(this.setupPort(e.ports[0]),this.postMessage(this.messageWithName(sc)),this.connectionEstablished())}handleConnected(){if(this.connected)throw new ic("message channel already connected");this.connectionEstablished()}connectionEstablished(){for(this.connected=!0;this.messageBuffer.length>0;)this.postMessage(this.messageBuffer.shift())}handleMessage(e){this.listeners.forEach((t=>{t(e)}))}setupPort(e){this.port=e,this.port.onmessage=this.receiveMessage,this.port.onmessageerror=e=>{this.postMessage(this.messageWithName(uc)),this.errorHandler&&this.errorHandler(new ic("message channel failed to deserialize message"),e)}}messageWithName(e){return e+this.name}}function hc(){return`${Date.now()}${Math.floor(8e3*Math.random())}`}const pc=["ack","ok","error"];function fc(e={}){let t,n;const{errorSerializer:r,payloadSerializer:i}=e,o=new dc(e.name),a=new Map;function s(e,t){const{messageType:n,listener:r}=e,i=a.get(n);if(i){const e=i.get(t);e?e.push(r):i.set(t,[r])}else a.set(n,new Map([[t,[r]]]))}function c(e){const c=function(e){if(!e.mustAcknowledge)return Promise.resolve(void 0);let o;const c=()=>{pc.forEach((t=>{const n=a.get(`${e.type}:${t}`);void 0!==n&&n.delete(o)}))},l=window.setTimeout((()=>{!function(e){const r=new ac(e.type,e.id,n,"warning");t&&t(r,new MessageEvent(e.type,{data:e}))}(e)}),1e4);return new Promise(((t,n)=>{o=hc(),s({listener(){clearTimeout(l),e.mustRespond||(c(),t(void 0))},messageType:`${e.type}:ack`},o),s({listener(e){c();const{payload:n}=e.data;if(void 0===i)t(n);else{const e=i.deserialize(n);t(e)}},messageType:`${e.type}:ok`},o),s({listener(e){c();const{payload:t}=e.data;if(void 0===r)n(t);else{const e=r.deserialize(t);n(e)}},messageType:`${e.type}:error`},o)}))}(e);return e.type&&"undefined"!==e.type||void 0===t||t(new oc("attempting to send a messenger message with an undefined type")),o.postMessage(e),c}function l(e,t,n){return c({id:t.id,mustAcknowledge:!1,mustRespond:!1,payload:n,type:e})}return o.onmessage=function(e){if(void 0===e.data.type||"undefined"===e.data.type)return void(void 0!==t&&t(new oc("Received a messenger message with an undefined type"),e));const n=a.get(e.data.type);if(n)!0===e.data.mustAcknowledge&&function(e){const t=`${e.type}:ack`;c({id:e.id,mustAcknowledge:!1,mustRespond:!1,payload:void 0,type:t})}(e.data),n.forEach((t=>{t.forEach((t=>{t(e)}))}));else{const n=e.data.type;t&&t(new ic(`Listener does not exist for ${n}. Add one to your messenger instance:\n            messenger.onMessage({\n                    listener: (msg) => {},\n                    messageType: '${n}',\n                });\n          `),e)}},Object.freeze({close:function(){o.close()},connect:function(e,t){o.connect(e),n=t},onMessage:function(e,t=hc()){return s(e,t),t},reject:function(e,t){const n=`${e.type}:error`;let i=t;return void 0!==r&&(i=r.serialize(t)),l(n,e,i)},request:function(e,t){let n=t;return void 0!==t&&void 0!==i&&(n=i.serialize(t)),c({id:hc(),mustAcknowledge:!0,mustRespond:!0,payload:n,type:e})},respond:function(e,t){const n=`${e.type}:ok`;let r=t;return void 0!==i&&(r=i.serialize(t)),l(n,e,r)},sendMessage:function(e,t){let n=t;return void 0!==t&&void 0!==i&&(n=i.serialize(t)),c({id:hc(),mustAcknowledge:!0,mustRespond:!1,payload:n,type:e})},sendOneWayMessage:function(e,t){let n=t;return void 0!==t&&void 0!==i&&(n=i.serialize(t)),c({id:hc(),mustAcknowledge:!1,mustRespond:!1,payload:n,type:e})},setErrorHandler:function(e){t=e,o.setErrorHandler(e)}})}const mc=function(){return fc({name:Qs.IFRAME_NAME})},gc=async function(e,t,n){const r=Qs.getSDKBaseUrlForEnv(n);e.connect({origin:r,window:t.contentWindow},t.id),await e.sendMessage("INITIALIZE",{env:n})},vc=/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;function yc(e){const t=function(e){const t=vc.exec(e);if(!t)throw new Ks("Date did not match the YYYY-MM-DD format");const[,n,r,i]=t.map(Number);return new Date(n,r-1,i)}(e);return{day:t.getDate(),month:t.getMonth()+1,weekday:Ys[t.getDay()],year:t.getFullYear()}}const Ec={build(e,t){const n=mc(),r=new Zs;return Promise.resolve(Object.freeze({addEventListener:function(e,t){r.addEventListener(e,t)},captureAuthorization:async function(i){let o;try{const a=function(e){const t={applicationId:e.applicationId,avt:e.avt,featureFlagValues:e.featureFlagValues,idempotencyKey:e.idempotencyKey,locationId:e.locationId};if("CHARGE"===e.intent)return"bankNonce"in e?{...t,bankNonce:e.bankNonce,kind:"ONE_TIME_BANK_NONCE",total:e.total}:{...t,bankAccountId:e.bankAccountId,kind:"ONE_TIME_BANK_ACCOUNT_ID",total:e.total};const n=yc(e.startDate);let r;r="frequency"in e?e.frequency:"WEEKLY"===e.cadence?{weekly:{daysOfWeek:[n.weekday],occurrence:1}}:{monthly:{days:{daysOfMonth:[n.day]}}};const i={...t,bankAccountId:e.bankAccountId,frequency:r,startDate:n};return"variableAmount"in e?{...i,kind:"VARIABLE_RECURRING"}:{...i,...void 0!==e.offCadencePayments&&{offCadencePayments:e.offCadencePayments.map((e=>({paymentOn:yc(e.date),total:e.total})))},kind:"RECURRING",total:e.total}}(i);o=await tc(e,t),await gc(n,o,e);const s=await n.request("CAPTURE_AUTHORIZATION",a);"success"===s.kind?r.dispatchEvent({token:s.token,type:"signed"}):r.dispatchEvent({type:"canceled"})}catch(e){r.dispatchEvent({error:e,type:"error"})}o&&nc(o)}}))}};function bc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bc(Object(n),!0).forEach((function(t){Cc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cc(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sc(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}var Ic={build(e){var t=e.env,n=e.transactionId,r=e.session,i=e.context,o=e.onSigned,a=e.onCanceled,s=e.onError;function c(){var e;return e=function*(e){var c,l=yield Ec.build(t,dr.VERSION);i.metricsHandler.logEvent("ACH_AUTH:START"),l.addEventListener("signed",(function(t){o(t.token,e.intent,..."bankAccountDetails"in e?[e.bankAccountDetails]:[]),i.metricsHandler.logEvent("ACH_AUTH:OK")})),l.addEventListener("canceled",(function(){i.metricsHandler.logEvent("ACH_AUTH:CANCEL"),a()})),l.addEventListener("error",(function(e){var t=e.error;t instanceof Ks?s(new Jr(t.message)):t.message.includes("The provided bank account ID was not found")?s(new _i([{message:t.message,type:"INVALID_BANK_ACCOUNT"}])):(s(new Ci("authorizing the payment")),i.errorLogger.captureException(t)),i.metricsHandler.logEvent("ACH_AUTH:ERROR")})),yield l.captureAuthorization(_c(_c({},e),{},{applicationId:r.applicationId,avt:r.avt,featureFlagValues:(c=i.getFeatureFlagValues(),{ach_architecture_changes:c.ach_architecture_changes,show_square_monochrome:c.show_square_monochrome}),idempotencyKey:n,locationId:r.locationId}))},c=function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Sc(o,r,i,a,s,"next",e)}function s(e){Sc(o,r,i,a,s,"throw",e)}a(void 0)}))},c.apply(this,arguments)}return Object.freeze({run:function(e){return c.apply(this,arguments)}})}};function wc(e,t){var n=e.map((e=>{switch(e.code){case"missing_property":return'Missing property: "'.concat(e.propertyPath,'" for ').concat(t,'. Expected "').concat(e.expected,'"');case"invalid_type":return'Invalid type: "'.concat(e.propertyPath,'" for ').concat(t,'. Expected "').concat(e.expected,'"');default:return'Invalid value: "'.concat(e.propertyPath,'" for ').concat(t,'. Expected "').concat(e.expected,'"')}}));return new Jr(n.join("; "))}function Oc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ac(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ac(Object(n),!0).forEach((function(t){Pc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ac(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pc(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Nc=Ns({intent:ws(Ds({legalValues:["CHARGE","STORE","RECURRING_CHARGE"]}))}),Dc=Is([{eligible:function(e){return Fo(e)&&"bankAccountId"in e},schemaOperation:Ns({bankAccountId:Ds({nonBlank:!0})})},{eligible:function(e){return Fo(e)&&"accountHolderName"in e&&void 0===e.bankAccountId},schemaOperation:Ns({accountHolderName:Ds({nonBlank:!0})})}],{code:"missing_property",expected:"string",propertyPath:"accountHolderName"}),Rc=Ns({accountHolderName:Ds({nonBlank:!0})}),Lc=Ns({amount:Ds({matchRegexp:/^-?[0-9]+(\.[0-9]+)?$/}),currency:Ds({legalValues:["USD"]}),date:Cs({futureDate:!0})}),xc={bankAccountId:Ds({minLength:1}),offCadencePayments:ws(gs(Lc,{minLength:1})),startDate:Cs({futureDate:!0})},kc=Ns(Tc(Tc({},xc),{},{cadence:Ds({legalValues:["WEEKLY","MONTHLY"]})})),Mc=Ns(Tc(Tc({},xc),{},{frequency:Ns({weekly:Ns({daysOfWeek:gs(Ds({legalValues:Ys})),occurrence:ws(Ss())})})})),jc=Ns({daysOfMonth:gs(Ss()),endOfMonth:ws(vs())}),Uc=Ns(Tc(Tc({},xc),{},{frequency:Ns({monthly:Ns({days:jc,occurrence:ws(Ss())})})})),Bc=Ns(Tc(Tc({},xc),{},{frequency:Ns({yearly:Ns({days:jc,months:gs(Ds({legalValues:Ws})),occurrence:ws(Ss())})})})),qc=Is([{eligible:e=>Fo(e)&&"daysOfMonth"in e,schemaOperation:Ns({daysOfMonth:gs(Ss())})},{eligible:e=>Fo(e)&&"endOfMonth"in e,schemaOperation:Ns({endOfMonth:vs()})}],{code:"missing_property",expected:"key value",propertyPath:"daysOfMonth or endOfMonth"}),Hc=Ns(Tc(Tc({},xc),{},{frequency:Ns({monthly:Ns({days:qc,occurrence:ws(Ss())})})})),Fc=Ns(Tc(Tc({},xc),{},{frequency:Ns({yearly:Ns({days:qc,months:gs(Ds({legalValues:Ws})),occurrence:ws(Ss())})})})),Vc=Ns(Tc(Tc({},xc),{},{frequency:Ns({days:Ss()})}));function Gc(e,t){return Fo(e)&&"frequency"in e&&Ho(e.frequency)&&1===Object.keys(e.frequency).length&&t in e.frequency}var zc=Is([{eligible:e=>Fo(e)&&"cadence"in e,schemaOperation:kc},{eligible:e=>Gc(e,"days"),schemaOperation:Vc},{eligible:e=>Gc(e,"weekly"),schemaOperation:Mc},{eligible:e=>Gc(e,"monthly"),schemaOperation:Uc},{eligible:e=>Gc(e,"yearly"),schemaOperation:Bc}],{code:"invalid_value",expected:"exactly one of the keys: days, weekly, monthly, yearly",propertyPath:"frequency"}),$c=Is([{eligible:e=>Fo(e)&&"cadence"in e,schemaOperation:kc},{eligible:e=>Gc(e,"days"),schemaOperation:Vc},{eligible:e=>Gc(e,"weekly"),schemaOperation:Mc},{eligible:e=>Gc(e,"monthly"),schemaOperation:Hc},{eligible:e=>Gc(e,"yearly"),schemaOperation:Fc}],{code:"invalid_value",expected:"exactly one of the keys: days, weekly, monthly, yearly",propertyPath:"frequency"}),Yc=Is([{eligible:e=>Fo(e)&&!("total"in e),schemaOperation:Ns({amount:Ds({nonBlank:!0}),currency:Ds({nonBlank:!0})})},{eligible:e=>Fo(e)&&"total"in e,schemaOperation:Ns({total:Ns({amount:Ss(),currencyCode:Ds({nonBlank:!0})})})}],{code:"missing_property",expected:"string",propertyPath:"amount, currency"});function Wc(e,t,n){if(!Fo(e))throw new Jr("Tokenize options must be an object.");var r,i,o=e;if("intent"in o){var a=Ls(Nc).validate(e);if(!a.isValid){var s=(r=a.issues,i=1,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(r,i)||function(e,t){if(e){if("string"==typeof e)return Oc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oc(e,t):void 0}}(r,i)||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.")}())[0];throw new Jr("Unsupported ".concat(s.propertyPath,". Must be one of: ").concat(s.expected))}!function(e,t){if("CHARGE"===e.intent)Kc(Ls(Dc).validate(e)),Xc(e);else if("STORE"===e.intent)Kc(Ls(Rc).validate(e));else{!0!==e.variableAmount&&Xc(e);var n=Ls($c).validate(e);Ls(zc).logValidationFailures(t,Nr.ACH,"tokenize",e),Kc(n)}}(o,n)}else{if("SUPPORTED"!==t)throw new Jr("Invalid parameter format for ACH tokenize");if(!Ls(Rc).validate(o).isValid)throw new kr}}function Kc(e){if(!e.isValid)throw wc(e.issues,"ACH tokenize")}function Xc(e){Kc(Ls(Yc).validate(e))}function Jc(e){return"total"in e?e.total:{amount:go.paymentRequestAmountToMoneyAmount(e.amount,e.currency),currencyCode:e.currency}}var Zc=function(){var e=document.createElement("div");return e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100vw",e.style.height="100%",e.style.zIndex="3",e.style.backgroundColor="rgba(0, 0, 0, 0.8)",e.style.opacity="0",document.body.appendChild(e),e.style.transition="opacity ".concat("cubic-bezier(0.26, 0.1, 0.48, 1)"," ").concat("0.24s"),setTimeout((function(){e.style.opacity="1"})),new Promise((function(t){setTimeout((function(){t(e)}),240)}))},Qc=function(e){e&&(e.style.transition="opacity ".concat("cubic-bezier(0.52, 0, 0.74, 0)"," ").concat("0.16s"),setTimeout((function(){e.style.opacity="0"})),setTimeout((function(){e.remove()}),160))};function el(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}class tl{constructor(e){this.id=cs(),this.context=e}request(e,t){return this.context.messenger.request(e,{body:t,featureFlagValues:this.context.getFeatureFlagValues(),paymentMethodInstanceId:this.id,paymentMethodTrackingId:this.context.getPaymentMethodTrackingId(),session:this.context.getSession()})}initializeMessageBus(e){var t,n=this,r=function(){var e,r,o=(e=i,r=2,t=function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,r)||function(e,t){if(e){if("string"==typeof e)return el(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?el(e,t):void 0}}(e,r)||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.")}())[0],a=t[1];n.context.messenger.onMessage({listener(e){a(e)},messageType:"".concat(o,":").concat(n.id)})};for(var i of Object.entries(e))r()}}function nl(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}var rl=new Set(["ITEM_ERROR","INSTITUTION_ERROR"]),il=new Set(["en","es"]),ol=["US"];function al(){var e;return null!==(e=a.windowNavigatorLanguages.map((e=>e.split("-")[0])).find((e=>il.has(e))))&&void 0!==e?e:"en"}function sl(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function cl(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){sl(o,r,i,a,s,"next",e)}function s(e){sl(o,r,i,a,s,"throw",e)}a(void 0)}))}}var ll={build(e,t,n){var r=new tl(e),i=function(e,t,n,r){var i;function o(){var a;return a=function*(){var o=yield function(e,t){var n=e.getSession();if(void 0===n.locationId||""===n.locationId)throw new Ci("locationId not defined when creating OAuth Plaid Link Session");var r={createOAuthPlaidLinkSessionRequest:{clientId:n.applicationId,languageCode:al(),locationId:n.locationId,redirectUri:""}};return t.request("CREATE_OAUTH_PLAID_LINK_SESSION",r)}(t,n);return function(n){return new Promise(((o,a)=>{var s=t.errorLogger,c=t.metricsHandler,l="sandbox";function u(e,t,n){var r,i,o,a=new Qi("Plaid error received",Nr.ACH),c={plaid_context:e,plaid_error_code:"error_code"in t?t.error_code:null!==(r=null==n?void 0:n.error_code)&&void 0!==r?r:"",plaid_error_message:"error_message"in t?t.error_message:null!==(i=null==n?void 0:n.error_message)&&void 0!==i?i:"",plaid_error_type:"error_type"in t?t.error_type:null!==(o=null==n?void 0:n.error_type)&&void 0!==o?o:"",plaid_link_session_id:t.link_session_id,plaid_request_id:"request_id"in t?t.request_id:"",plaid_status:"status"in t?t.status:"",plaid_timestamp:"timestamp"in t?t.timestamp:""};return s.captureException(a,c),a}"production"===dr.env&&(l="production"),i=e.create({clientName:"Square, Inc.",countryCodes:ol,env:l,language:al(),onEvent:(e,t)=>{e!==br.ERROR||rl.has(t.error_type)||u("onEvent error",t),r.onEvent(e,t)},onExit:(e,t)=>{e&&(c.logEvent("EXTERNAL_SESSION:ERROR"),rl.has(e.error_type)||u("onExit",t,e)),o({kind:"canceled"})},onSuccess:(e,t)=>{if(0!==t.accounts.length)c.logEvent("EXTERNAL_SESSION:OK"),o({gringottsSessionToken:n.gringottsSessionToken,kind:"success",publicToken:e,selectedBankAccountId:t.accounts[0].id});else{c.logEvent("EXTERNAL_SESSION:ERROR");var r=u("noAccountSelected",t);a(r)}},product:["auth"],token:n.plaidLinkToken}),c.logEvent("EXTERNAL_SESSION:START"),i.open()}))}(o)},o=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=a.apply(e,t);function o(e){nl(i,n,r,o,s,"next",e)}function s(e){nl(i,n,r,o,s,"throw",e)}o(void 0)}))},o.apply(this,arguments)}return{beginFlow:function(){return o.apply(this,arguments)},destroy:function(){i&&(i.exit({force:!0}),i.destroy(),i=void 0)}}}(t,e,r,{onEvent:n});function o(){return o=cl((function*(e){var t=yield i.beginFlow();if("success"===t.kind){var n=yield function(e,t,n,r){return a.apply(this,arguments)}(e.accountHolderName,t.publicToken,t.selectedBankAccountId,t.gringottsSessionToken);return n}return{status:"cancelled"}})),o.apply(this,arguments)}function a(){return(a=cl((function*(t,n,i,o){var a=e.getSession(),s={accountHolderName:t,gringottsSessionToken:o,plaidPublicToken:n,selectedPlaidBankAccountId:i},c={bankNonceRequest:{clientId:a.applicationId,instanceId:a.instanceId,locationId:a.locationId,paymentMethodTrackingId:e.getPaymentMethodTrackingId(),plaidLinkData:s,sessionId:a.sessionId,websdkVersion:dr.VERSION}};try{var l=yield r.request("REQUEST_ACH_BANK_NONCE",c);return e.setPaymentMethodTrackingId(l.paymentMethodTrackingId),{accountDetails:l.accountDetails,bankNonce:l.bankNonce,status:"successful"}}catch(e){throw e instanceof _i?e:new _i([vo])}}))).apply(this,arguments)}return Object.freeze({destroy:function(){i.destroy()},run:function(e){return o.apply(this,arguments)}})}};function ul(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ul(Object(n),!0).forEach((function(t){hl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ul(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hl(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pl(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function fl(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){pl(o,r,i,a,s,"next",e)}function s(e){pl(o,r,i,a,s,"throw",e)}a(void 0)}))}}var ml=Ns({transactionId:Ds({nonBlank:!0})});class gl extends Ms{constructor(e,t,n){super(e),this.methodType=Nr.ACH,this.tokenizeInProgress=!1,this.wasFirstInteractionCalled=!1,this.transactionId=function(e){return Ls(ml).validate(e).isValid?e.transactionId:cs()}(n),this.tokenize=this.withErrorHandling(this.tokenize.bind(this),"tokenize"),this.plaidNonceFlow=ll.build(this.context,t,this.dispatchPlaidEvent.bind(this)),this.achAuthFlow=Ic.build({context:this.context,env:dr.env,onCanceled:this.dispatchCancelResult.bind(this),onError:this.dispatchError.bind(this),onSigned:this.dispatchSuccessfulTokenResult.bind(this),session:this.session,transactionId:this.transactionId})}handleLegacyFlow(e){var t=this;return fl((function*(){t.context.metricsHandler.logEvent("ACH_LEGACY:START");var n=yield t.runPlaidFlow(e.accountHolderName);switch(t.context.metricsHandler.logEvent("ACH_LEGACY:OK"),n.status){case"successful":t.resetFirstInteraction();var r=yl(n.bankNonce,n.accountDetails);return t.dispatchTokenizationEvent(r),r;case"cancelled":var i=vl();return t.dispatchTokenizationEvent(i),i;default:throw new Error("Unexpected tokenize flow status")}}))()}tokenize(e){var t=this;return fl((function*(){try{if(t.throwIfDestroyed(),t.tokenizeInProgress)throw new _i([js]);if(Wc(e,t.context.getFeatureFlagValues().can_use_ach_auth,t.metricsHandler),!t.hasEventListener(br.ON_TOKENIZATION)){var n="Add event listener for '".concat(br.ON_TOKENIZATION,"' before calling tokenize.");console.error("".concat(n," This will result in an error when using the Plaid OAuth flow."))}if(t.tokenizeInProgress=!0,t.handleFirstInteraction(),t.metricsHandler.logConfigurationEvent("TOKENIZE_CONFIGURED",e),!function(e){return"intent"in e}(e))return yield t.handleLegacyFlow(e);switch(t.veil=yield Zc(),e.intent){case"STORE":var r=yield t.runPlaidFlow(e.accountHolderName);"successful"===r.status?t.dispatchSuccessfulTokenResult(r.bankNonce,e.intent,r.accountDetails):t.dispatchTokenizationEvent(vl());break;case"CHARGE":var i=(l=e,Tc(Tc({},Ls(Dc).sanitize(l)),{},{intent:"CHARGE",total:Jc(l)}));if("bankAccountId"in i)yield t.achAuthFlow.run(i);else{var o=yield t.runPlaidFlow(i.accountHolderName);"successful"===o.status?yield t.achAuthFlow.run({bankAccountDetails:o.accountDetails,bankNonce:o.bankNonce,intent:i.intent,total:i.total}):t.dispatchTokenizationEvent(vl())}break;case"RECURRING_CHARGE":var a={bankAccountId:e.bankAccountId,intent:e.intent,startDate:e.startDate};if("variableAmount"in e){"frequency"in e?yield t.achAuthFlow.run(dl(dl({},a),{},{frequency:e.frequency,variableAmount:!0})):"cadence"in e&&(yield t.achAuthFlow.run(dl(dl({},a),{},{cadence:e.cadence,variableAmount:!0})));break}var s=dl(dl({},a),{},{total:Jc(e)},void 0!==e.offCadencePayments&&{offCadencePayments:e.offCadencePayments.map((e=>({date:e.date,total:Jc(e)})))});"cadence"in e?yield t.achAuthFlow.run(dl(dl({},s),{},{cadence:e.cadence})):yield t.achAuthFlow.run(dl(dl({},s),{},{frequency:e.frequency}))}return}catch(e){var c=To(e);throw t.dispatchError(c),c}finally{t.tokenizeInProgress=!1,Qc(t.veil)}var l}))()}runPlaidFlow(e){var t=this;return fl((function*(){return yield t.plaidNonceFlow.run({accountHolderName:e})}))()}destroy(){return this.status=Es.DESTROYED,this.metricsHandler.logConfigurationEvent("DESTROYED"),this.plaidNonceFlow.destroy(),Promise.resolve(!0)}addEventListener(e,t){this.metricsHandler.logConfigurationEvent("EVENT_LISTENER_ADDED",e),super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}resetFirstInteraction(){this.wasFirstInteractionCalled=!1}handleFirstInteraction(){this.wasFirstInteractionCalled||(this.wasFirstInteractionCalled=!0,this.metricsHandler.logEvent("FIRST_INTERACTION:OK"))}dispatchCancelResult(){this.dispatchTokenizationEvent(vl())}dispatchSuccessfulTokenResult(e,t,n){this.resetFirstInteraction();var r=yl(e,n,t);this.dispatchTokenizationEvent(r)}dispatchError(e){this.dispatchEvent(br.ON_TOKENIZATION,{error:e})}dispatchPlaidEvent(e,t){this.dispatchEvent(e,t)}dispatchTokenizationEvent(e){this.dispatchEvent(br.ON_TOKENIZATION,{tokenResult:e})}}function vl(){return{status:Dr}}function yl(e,t,n){var r={method:Nr.ACH};return void 0!==n&&(r.ach={intent:n}),t&&(r.bankAccount=t),{details:r,status:xr,token:e}}var El=new Set(["DIV","SPAN"]),bl=new Set(["DIV","SPAN"]),_l=new Set(["DIV","SPAN","BUTTON"]);function Cl(e,t){var n;if(function(e){return"string"==typeof e}(e)){var r=document.querySelector(e);if(!r)throw new Yr(e);n=r}else{if(!(e instanceof HTMLElement))throw new mi(e,t);if(n=e,!document.contains(n))throw new Yr(n)}if(!t.has(n.nodeName))throw new mi(n,t);return n}function Sl(e){return Cl(e,El)}function Il(e){return Cl(e,_l)}function wl(e){return Cl(e,bl)}var Ol="sq-focus",Al="sq-error",Tl=".".concat(Ol),Pl=".".concat(Al),Nl="sq-apply-monochrome",Dl=function(e,t,n){return new Promise(((r,i)=>{if(function(e){return Boolean(document.getElementById(e))}(t))r();else{var o=document.createElement("link");o.onload=()=>{r()},o.onerror=()=>{i(new Error("Failed to load stylesheet at ".concat(e,". The onerror callback was invoked.")))},o.href=e,o.rel="stylesheet",o.type="text/css",o.id=t,n.appendChild(o)}}))},Rl=["black","green","mint"],Ll=Object.freeze({UPDATE:"update"});function xl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{sanitizeFunction:e=>e,validateFunction:function(n,r){var i=hs(n,r,"string",{}),o=n,a=/^-?[0-9]+$/;if("JPY"!==e&&(a=/^-?[0-9]+(\.([0-9]{1,2}))?$/),i.push((()=>ds(o,r,(e=>a.test(e)),"amount is not expressed in a valid format"))),"requireNonNegativeAmount"in t||"requirePositiveAmount"in t){var s=go.paymentRequestAmountToMoneyAmount(o,e);"requireNonNegativeAmount"in t&&!0===t.requireNonNegativeAmount&&s<0&&i.push((()=>[{code:"invalid_value",expected:"amount should be greater than zero",propertyPath:r}])),"requirePositiveAmount"in t&&!0===t.requirePositiveAmount&&s<=0&&i.push((()=>[{code:"invalid_value",expected:"amount should be non-negative",propertyPath:r}]))}return ps(i)}}}n(488);var kl={AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua And Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Finland",AZ:"Azerbaijan",BA:"Bosnia And Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria (rep.)",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthelemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius, And Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (keeling) Islands",CD:"Congo (dem. Rep.)",CF:"Central African Republic",CG:"Congo (rep.)",CH:"Switzerland",CI:"Cote D'ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CV:"Cape Verde",CW:"Curacao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Rep.",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Rep.",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands (malvinas)",FM:"Micronesia (federated State Of)",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada (west Indies)",GE:"Georgia",GF:"French Guiana",GG:"Channel Islands",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia",GT:"Guatemala",GU:"Guam",GW:"Guinea-bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard And Mcdonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary (rep.)",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle Of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Channel Islands",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts And Nevis",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Lao (people's Dem. Rep.)",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Rep. Moldova",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru Central Pacific",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama (rep.)",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"St. Pierre And Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestinian Territory",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Republic Of Serbia",RU:"Russian Federation",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SE:"Sweden",SG:"Rep. Of Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard And Jan Mayen Islands",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome And Principe",SV:"El Salvador",SX:"Sint Maarten",SZ:"Swaziland",TC:"Turks And Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad And Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania (united Rep.)",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Vatican",VC:"Saint Vincent And The Grenadines (antilles)",VE:"Venezuela",VG:"Virgin Islands (british)",VI:"Virgin Islands (u.s.)",VN:"Viet Nam",VU:"Vanuatu",WF:"Wallis And Futuna Islands",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"};function Ml(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(n),!0).forEach((function(t){Ul(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ul(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Bl=Ns({amount:Ds(),label:Ds()}),ql=Ns({amount:Ds(),id:Ds(),label:Ds()}),Hl=Ns({discounts:ws(gs(Bl)),error:ws(Ds()),lineItems:ws(gs(Bl)),shippingErrors:ws(Ns()),shippingLineItems:ws(gs(Bl)),shippingOptions:ws(gs(ql)),taxLineItems:ws(gs(Bl)),total:ws(Bl)});function Fl(e,t){var n=e.lineItems,r=e.taxLineItems,i=e.discounts,o=e.shippingLineItems,a=!1,s=[],c=n,l=r,u=o,d=$l(i);return void 0===t||void 0===n&&void 0===r&&void 0===o&&void 0===d||(null!=c||(c=t.lineItems),null!=l||(l=t.taxLineItems),null!=d||(d=$l(t.discounts)),null!=u||(u=t.shippingLineItems)),[c,l,d,u].forEach((e=>{void 0!==e&&(a=!0,s.push(...e))})),a?s:void 0}function Vl(e,t,n,r){Ls(Ns({amount:xl(t)})).logValidationFailures(n,"Payment Request",r,e)}var Gl=Ns({countryCode:Ds(),currencyCode:Ds(),total:Ns({amount:Ds(),label:Ds()})});function zl(e){var t=Ls(Gl).validate(e),n=t.isValid,r=t.issues.map((e=>[e.propertyPath,e.expected])),i=[],o=e.countryCode;if(o in kl||i.push("Country code '".concat(o,"' is not a valid ISO country code.")),!n||i.length>0)throw new Wr(r,i)}function $l(e){return void 0===e?e:e.map((e=>jl(jl({},e),{},{amount:"-".concat(e.amount)})))}function Yl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Wl(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wl(e,t):void 0}}(e,t)||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 Wl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Kl="".concat(dr.ASSET_URL,"/afterpay.css"),Xl="sq-afterpay-styles",Jl={production:{marketplace:"https://js.squarecdn.com/square-marketplace.js",messaging:"https://js.afterpay.com/afterpay-1.x.js"},sandbox:{marketplace:"https://js-sandbox.squarecdn.com/square-marketplace.js",messaging:"https://js.afterpay.com/afterpay-1.x.js"},staging:{marketplace:"https://portal.stage.afterpay-beta.com/square-marketplace.js",messaging:"https://js.sandbox.afterpay.com/afterpay-1.x.js"}},Zl=Ns({addressLines:fs(),city:Ds(),countryCode:Ds(),familyName:Ds(),givenName:Ds(),postalCode:Ds(),state:Ds()}),Ql=Ns({amount:Ds(),id:Ds(),label:Ds(),taxLineItems:ws(gs(Bl)),total:Bl}),eu=Is([{eligible:e=>Fo(e)&&"shippingOptions"in e,schemaOperation:Ns({shippingOptions:gs(Ql)})},{eligible:e=>Fo(e)&&"error"in e,schemaOperation:Ns({error:fs()})},{eligible:e=>Fo(e)&&"shippingErrors"in e,schemaOperation:Ns({shippingErrors:fs()})}],{code:"missing_property",expected:"object",propertyPath:"shippingOptions, error, or shippingErrors"}),tu=Is([{eligible:e=>Fo(e)&&"shippingOption"in e,schemaOperation:Ns({shippingOption:Ql})},{eligible:e=>Fo(e)&&"error"in e,schemaOperation:Ns({error:fs()})}],{code:"missing_property",expected:"object",propertyPath:"shippingOption or error"}),nu="#000",ru="#00d533",iu="#b2fce4",ou={black:{[Cr.CheckoutWithAfterpay]:{backgroundColor:nu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Afterpay_Checkout_Button_Black-White.svg"},[Cr.BuyNowWithAfterpay]:{backgroundColor:nu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Afterpay_BuyNow_Button_Black-White.svg"},[Cr.PlaceOrderWithAfterpay]:{backgroundColor:nu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Afterpay_PlaceOrder_Button_Black-White.svg"}},green:{[Cr.CheckoutWithAfterpay]:{backgroundColor:iu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Afterpay_Checkout_Button_Mint-Black.svg"},[Cr.BuyNowWithAfterpay]:{backgroundColor:iu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Afterpay_BuyNow_Button_Mint-Black.svg"},[Cr.PlaceOrderWithAfterpay]:{backgroundColor:iu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Afterpay_PlaceOrder_Button_Mint-Black.svg"}}},au={black:{[Cr.CheckoutWithAfterpay]:{backgroundColor:nu,cdn:"AFTERPAY_CDN",url:"https://static.afterpay.com/en-US/integration/button/checkout-with-afterpay/color-on-black.svg"},[Cr.BuyNowWithAfterpay]:{backgroundColor:nu,cdn:"AFTERPAY_CDN",url:"https://static.afterpay.com/en-US/integration/button/buy-with-afterpay/color-on-black.svg"},[Cr.PlaceOrderWithAfterpay]:{backgroundColor:nu,cdn:"AFTERPAY_CDN",url:"https://static.afterpay.com/en-US/integration/button/place-order-with-afterpay/color-on-black.svg"}},green:{[Cr.CheckoutWithAfterpay]:{backgroundColor:ru,cdn:"AFTERPAY_CDN",url:"https://static.afterpay.com/en-US/integration/button/checkout-with-afterpay/black-on-green.svg"},[Cr.BuyNowWithAfterpay]:{backgroundColor:ru,cdn:"AFTERPAY_CDN",url:"https://static.afterpay.com/en-US/integration/button/buy-with-afterpay/black-on-green.svg"},[Cr.PlaceOrderWithAfterpay]:{backgroundColor:ru,cdn:"AFTERPAY_CDN",url:"https://static.afterpay.com/en-US/integration/button/place-order-with-afterpay/black-on-green.svg"}}},su={black:{[Cr.CheckoutWithAfterpay]:{backgroundColor:nu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Clearpay_Checkout_Button_Black-White.svg"},[Cr.BuyNowWithAfterpay]:{backgroundColor:nu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Clearpay_BuyNow_Button_Black-White.svg"},[Cr.PlaceOrderWithAfterpay]:{backgroundColor:nu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Clearpay_PlaceOrder_Button_Black-White.svg"}},green:{[Cr.CheckoutWithAfterpay]:{backgroundColor:iu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Clearpay_Checkout_Button_Mint-Black.svg"},[Cr.BuyNowWithAfterpay]:{backgroundColor:iu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Clearpay_BuyNow_Button_Mint-Black.svg"},[Cr.PlaceOrderWithAfterpay]:{backgroundColor:iu,cdn:"WEBSDK_CDN",url:"afterpay-buttons/Clearpay_PlaceOrder_Button_Mint-Black.svg"}}},cu={AU:"AFTERPAY",CA:"AFTERPAY",NZ:"AFTERPAY",US:"AFTERPAY_CASHAPP"},lu={AFTERPAY:ou,AFTERPAY_CASHAPP:au,CLEARPAY:su};function uu(e,t){var n=0;return e.forEach((e=>{n+=go.paymentRequestAmountToMoneyAmount(e,t)})),go.moneyAmountToPaymentRequestAmount(n,t)}function du(e,t){return uu(e.map((e=>e.amount)),t)}function hu(e){return e.requestShippingContact&&void 0!==e.lineItems&&e.lineItems.length>0}function pu(e,t){var n,r;return{description:"",id:e.id,name:e.label,orderAmount:{amount:null!==(n=e.total.amount)&&void 0!==n?n:"0.00",currency:t},shippingAmount:{amount:e.amount,currency:t},taxAmount:{amount:du(null!==(r=e.taxLineItems)&&void 0!==r?r:[],t),currency:t}}}var fu={buildAfterpayContact:function(e){return{area1:e.city,countryCode:e.countryCode,line1:e.addressLines[0],line2:e.addressLines[1],name:"".concat(e.givenName," ").concat(e.familyName),phoneNumber:e.phone,postcode:e.postalCode,region:e.state}},buildDiscounts:function(e,t){return e.map((e=>({amount:{amount:e.amount,currency:t},displayName:e.label})))},buildLineItems:function(e,t){return e.map((e=>({imageUrl:e.imageUrl,name:e.label,pageUrl:e.productUrl,price:{amount:e.amount,currency:t},quantity:1,sku:e.id})))},shippingOption:pu,shippingOptions:function(e,t){return e.shippingOptions.map((e=>pu(e,t.currencyCode)))},totalAmount:function(e){if(hu(e)){var t=du(e.lineItems,e.currencyCode);return e.discounts&&(t=uu([t,(n=e.discounts,r=e.currencyCode,"-".concat(du(n,r)))],e.currencyCode)),{amount:t,currency:e.currencyCode}}var n,r;return{amount:uu([e.total.amount],e.currencyCode),currency:e.currencyCode}}},mu=function(e){var t,n,r=[];if([e.address1,e.address2].forEach((e=>{void 0!==e&&r.push(e)})),e.name){var i=Yl(e.name.split(/\s(?=\S+$)/),2);t=i[0],n=i[1]}return{addressLines:r,city:e.suburb,countryCode:e.countryCode,familyName:n,givenName:t,phone:e.phoneNumber,postalCode:e.postcode,state:e.state}},gu=function(e){return{amount:e.shippingAmount.amount,id:e.id,label:e.name}},vu=function(e){return Ls(Zl).validate(e,"shippingContact")};function yu(e){var t=fu.totalAmount(e);if(go.paymentRequestAmountToMoneyAmount(t.amount,t.currency)<=0)throw hu(e)?new Fr("Total line item amount must be greater than zero"):new Fr("Total amount must be greater than zero")}function Eu(e){var t,n=Yl(e.split("-"),2),r=(n[0],n[1]);return null!==(t=cu[r])&&void 0!==t?t:"CLEARPAY"}function bu(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}var _u=[25,50,75,100];function Cu(e){return"CLEARPAY"===Eu(e)?"clearpay-brand.svg":"afterpay-brand.svg"}class Su{constructor(e,t){this.attached=!1,this.req=e,this.context=t,this.locale=this.context.getSession().locale,this.currencyCode=this.req.currencyCode;var n=this.context.getLocaleString().paymentMethods.afterpay.checkoutWidget,r=n.today,i=n.weeks;this.periodText=[r,"2 ".concat(i),"4 ".concat(i),"6 ".concat(i)],e.addEventListener(Ll.UPDATE,(()=>{this.update()}))}attach(e,t){var n,r=this;return(n=function*(){r.element=e;try{yield Dl(Kl,Xl,document.head)}catch(e){throw new Ci("attaching the Afterpay Checkout Widget")}var n=r.buildAmounts().map((e=>go.moneyAmountToInternationalizedCurrency(e,r.currencyCode,r.locale))),i=!1;!0===(null==t?void 0:t.includeBranding)&&(i=!0);var o,a=Cu(r.locale),s='\n      <div class="sq-ap__checkout-widget-container">\n        '.concat(i?'<div class="sq-ap__wordmark">\n                <img id="ap-wordmark-image" src="'.concat(dr.staticAsset(a),'"/>\n              </div>'):"",'\n        <p class="sq-ap__checkout-title">').concat(r.context.getLocaleString().paymentMethods.afterpay.checkoutWidget.title,'</p>\n        <div class="sq-ap__payment-container">\n          ').concat(n.map(((e,t)=>'\n              <div id="ap-payment-container-'.concat(t,'" class="sq-ap__individual-payment">\n                <div class="sq-ap__harvey-ball-container">\n                  ').concat(function(e){var t=12,n=2*Math.PI*6,r=n*_u[e]/100;return'\n      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '.concat(24," ").concat(24,'" class="sq-ap__harvey-ball">\n        <circle\n          r="').concat(t,'"\n          cx="').concat(t,'"\n          cy="').concat(t,'"\n          fill="white"\n        />\n        <circle\n          r="').concat(6,'"\n          cx="').concat(t,'"\n          cy="').concat(t,'"\n          fill="none"\n          stroke="').concat("#B2FCE4",'"\n          stroke-width="').concat(t,'"\n          stroke-dasharray="').concat(r," ").concat(n,'"\n          transform="rotate(-90) translate(-').concat(24,')"\n        />\n        <circle\n          r="').concat(t,'"\n          cx="').concat(t,'"\n          cy="').concat(t,'"\n          fill="none"\n          stroke-width="2"\n          stroke="black"\n       />\n      </svg>\n    ')}(t),'\n                </div>\n                <p id="ap-payment-amount-').concat(t,'" class="sq-ap__amount">').concat(e,'</p>\n                <p class="sq-ap__period">').concat(r.periodText[t],"</p>\n              </div>\n            "))).join(""),"\n        </div>\n      </div>\n    ");r.element.insertAdjacentHTML("afterbegin",s),r.context.getFeatureFlagValues().show_square_monochrome&&(null===(o=r.element.querySelector(".sq-ap__checkout-widget-container"))||void 0===o||o.classList.add(Nl)),r.attached=!0},function(){var e=this,t=arguments;return new Promise((function(r,i){var o=n.apply(e,t);function a(e){bu(o,r,i,a,s,"next",e)}function s(e){bu(o,r,i,a,s,"throw",e)}a(void 0)}))})()}update(){if(this.attached&&this.element){var e=document.getElementById("ap-wordmark-image");if(e){var t=Cu(this.locale);e.src=dr.staticAsset(t)}this.buildAmounts().map((e=>go.moneyAmountToInternationalizedCurrency(e,this.currencyCode,this.locale))).forEach(((e,t)=>{var n,r=null===(n=this.element)||void 0===n?void 0:n.querySelector("#ap-payment-amount-".concat(t));r&&(r.innerHTML=e)}))}}buildAmounts(){var e=go.paymentRequestAmountToMoneyAmount(this.req.total.amount,this.req.currencyCode),t=e/4;switch(e%4){case 0:return Iu(t,0);case 1:return Iu(t,1);case 2:return Iu(t,-2);case 3:return Iu(t,-1);default:return[]}}}function Iu(e,t){var n=Array.from({length:3}).fill(Math.round(e));return n.push(e+t),n}function wu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ou(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wu(Object(n),!0).forEach((function(t){Au(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Au(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tu(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Pu(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Tu(o,r,i,a,s,"next",e)}function s(e){Tu(o,r,i,a,s,"throw",e)}a(void 0)}))}}var Nu=new Set(["en_US","en_CA","fr_CA","en_AU","en_NZ","en_GB","fr_FR","es_ES","it_IT"]),Du=new Set(["AUD","GBP","USD","CAD","EUR"]);class Ru extends Ms{constructor(e,t,n,r,i){if(super(r),this.methodType=Nr.AFTERPAY_CLEARPAY,this.onTokenizeCallbacks=[],this.tokenizationBuffer=[],this.wasFirstInteractionCalled=!1,this.onTokenizeHandlerAdded=!1,this.transferOptions={},this.buyNowOption=!1,this.afterpayLibrary=e,this.afterpayMessagingLibrary=t,this.req=n,this.paymentRequestLockController=i,this.paymentMessenger=new tl(this.context),this.total=this.totalMoney(),void 0===this.session.locationId||""===this.session.locationId)throw new di(ts.INVALID_CONFIG,"locationId");this.locationID=this.session.locationId,this.req.addPaymentMethodUsage("AfterpayClearpay"),yu(this.req),this.req.addEventListener("update",(()=>{delete this.checkoutTokenResponse,this.element&&this.initializeAfterpayPopup(this.element),this.total=this.totalMoney()})),this.attach=this.withErrorHandling(this.attach.bind(this),"attach"),this.tokenize=this.withErrorHandling(this.tokenize.bind(this),"tokenize"),this.attachMessaging=this.withErrorHandling(this.attachMessaging.bind(this),"attachMessaging")}attach(e,t){var n=this;return Pu((function*(){n.throwIfDestroyedOrAlreadyAttached(),n.status=Es.ATTACHED,n.metricsHandler.logConfigurationEvent("CONFIGURED",t);try{var r=Il(e);if(!0!==(null==t?void 0:t.useCustomButton)){var i,o,a=document.createElement("div");r.appendChild(a);var s=a.attachShadow({mode:"open"});yield Dl(Kl,Xl,s);var c=null!==(i=null==t?void 0:t.buttonColor)&&void 0!==i?i:_r.BLACK;c===_r.MINT&&console.warn("The 'mint' option has been deprecated. Please use 'green' instead.");var l=null!==(o=null==t?void 0:t.buttonType)&&void 0!==o?o:Cr.BuyNowWithAfterpay;if(p=c,!Rl.includes(p))throw new ei("buttonColor",c);var u=function(e,t){var n="mint"===e?"green":e;return lu[Eu(t)][n]}(c,n.session.locale);if(!(l in u))throw new ei("buttonType",l);var d=u[l],h=document.createElement("button");h.setAttribute("type","button"),h.setAttribute("class","sq-ap__button"),n.context.getFeatureFlagValues().show_square_monochrome&&h.classList.add(Nl),h.style.backgroundColor=d.backgroundColor,h.style.backgroundImage="AFTERPAY_CDN"===d.cdn?"url(".concat(d.url,")"):"url(".concat(dr.staticAsset(d.url),")"),s.append(h)}n.buyNowOption=(null==t?void 0:t.finalCtaButtonType)===Sr.BUY_NOW,n.initializeAfterpayPopup(r),n.element=r,n.onTokenizeHandlerAdded&&n.element.addEventListener("click",(()=>{n.openPaymentModal()}))}catch(e){throw n.status=Es.DETACHED,e}var p}))()}attachMessaging(e,t){this.throwIfDestroyed(),wl(e);var n={amount:Number(this.req.total.amount),currency:this.req.currencyCode,locale:this.session.locale};return void 0!==(null==t?void 0:t.badgeTheme)&&(n.badgeTheme=t.badgeTheme),void 0!==(null==t?void 0:t.modalLinkStyle)&&(n.modalLinkStyle=t.modalLinkStyle),void 0!==(null==t?void 0:t.modalTheme)&&(n.modalTheme=t.modalTheme),void 0!==(null==t?void 0:t.size)&&(n.size=t.size),this.afterpayMessagingLibrary.createPlacements({attributes:n,targetSelector:e}),Promise.resolve()}attachCheckoutWidget(e,t){var n=this;return Pu((function*(){if(!Du.has(n.req.currencyCode))throw new Fr("Currency is not supported by Afterpay. Valid currencies are: ".concat([...Du].join(", ")));var r=wl(e);if(n.metricsHandler.logConfigurationEvent("AFTERPAY_CHECKOUT_WIDGET_CONFIGURED",{checkoutWidgetLaunch:n.context.getFeatureFlagValues().use_new_afterpay_checkout_widget,locale:n.session.locale,selectorOrElement:e instanceof HTMLElement?"element":"selector"}),n.context.getFeatureFlagValues().use_new_afterpay_checkout_widget){var i=document.createElement("div");if(i.id="sq-ap__payment-schedule-container-".concat(cs()),i.classList.add("sq-ap__payment-schedule-container"),void 0!==(null==t?void 0:t.theme)&&!ki.includes(t.theme))throw new ei("theme",t.theme);try{yield Dl(Kl,Xl,document.head)}catch(e){throw new Ci("attaching the Afterpay Checkout Widget")}return r.appendChild(i),new Promise(((e,r)=>{var o,a,s,c,l=new n.afterpayLibrary.Widgets.PaymentSchedule({amount:fu.totalAmount(n.req),locale:n.session.locale,onError:e=>{n.errorLogger.captureException(e),r(To(e))},onReady:function(){e()},style:{border:null===(o=null==t?void 0:t.border)||void 0===o||o,heading:null===(a=null==t?void 0:t.heading)||void 0===a||a,logo:null===(s=null==t?void 0:t.includeBranding)||void 0===s||s,theme:null!==(c=null==t?void 0:t.theme)&&void 0!==c?c:"CLASSIC"},target:"#".concat(i.id)});n.req.addEventListener(Ll.UPDATE,(()=>{l.update({amount:fu.totalAmount(n.req)})}))}))}return new Su(n.req,n.context).attach(r,t)}))()}displayInformationModal(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=go.convertLocaleToUnderscore(this.session.locale);Nu.has(t)||(t="en_US"),this.afterpayMessagingLibrary.launchModal(Ou(Ou({},e),{},{locale:t}))}onTokenize(e){var t;this.throwIfDestroyed(),this.onTokenizeCallbacks.push(e),1===this.onTokenizeCallbacks.length&&(this.tokenizationBuffer.forEach((e=>{var t=e.result,n=e.error;this.emitTokenizationResult(t,n)})),this.tokenizationBuffer=[]),this.onTokenizeHandlerAdded||void 0===this.element||null===(t=this.element)||void 0===t||t.addEventListener("click",(()=>{this.openPaymentModal()})),this.onTokenizeHandlerAdded=!0}tokenize(){var e=this;return Pu((function*(){if(e.throwIfDestroyedOrNotAttached(),e.onTokenizeHandlerAdded)throw new Mr;var t,n,r=new Promise(((e,r)=>{t=e,n=r}));return e.onTokenizeCallbacks=[function(e,r){void 0===r?void 0!==e?t(e):n(new _i([Eo.UNKNOWN])):n(r)}],yield e.openPaymentModal(),r}))()}destroy(){return this.status===Es.DESTROYED?Promise.resolve(!1):(this.detachElement(Es.DESTROYED,"DESTROYED"),Promise.resolve(!0))}detach(){return this.throwIfDestroyedOrNotAttached(),this.detachElement(Es.DETACHED,"DETACHED"),Promise.resolve(!0)}internalSetCheckoutToken(){var e=this;return Pu((function*(){try{var t=yield e.paymentMessenger.request("REQUEST_AFTERPAY_CHECKOUT_HANDLER",e.buildCheckoutPayload());return e.checkoutTokenResponse=t,e.checkoutTokenResponse.token}catch(t){var n=t;throw go.isInstanceOf(t,[Ur,ci,Wr,Fr])||(e.errorLogger.captureException(t),n=new Ci("tokenizing with Afterpay")),n}}))()}commenceCheckout(e){var t=this;return Pu((function*(){if(t.wasFirstInteractionCalled||(t.wasFirstInteractionCalled=!0,t.metricsHandler.logEvent("FIRST_INTERACTION:OK")),t.metricsHandler.logEvent("EXTERNAL_SESSION:START"),t.paymentRequestLockController.lock(t),void 0!==t.checkoutTokenResponse&&new Date(t.checkoutTokenResponse.expires)>new Date)e.resolve(t.checkoutTokenResponse.token);else try{var n=yield t.internalSetCheckoutToken();e.resolve(n)}catch(n){t.paymentRequestLockController.unlock(t),t.metricsHandler.logEvent("EXTERNAL_SESSION:ERROR");var r=To(n);t.emitTokenizationResult(void 0,r),e.reject(r.message)}}))()}completeCheckout(e){var t=this;return Pu((function*(){try{if(function(e){return"SUCCESS"===e.status&&void 0!==e.orderToken}(e)){var n=yield t.paymentMessenger.request("REQUEST_AFTERPAY_INSTANT_WALLET_TOKEN",t.buildInstantWalletTokenPayload(e.orderToken,t.total));t.metricsHandler.logEvent("EXTERNAL_SESSION:OK");var r={method:Nr.AFTERPAY_CLEARPAY,shipping:{contact:{email:n.afterpayData.email}}};n.billingContact&&(r.billing=n.billingContact),n.shippingContact&&(r.shipping={contact:n.shippingContact}),delete t.checkoutTokenResponse,t.emitTokenizationResult({details:r,status:xr,token:n.token})}else t.metricsHandler.logEvent("EXTERNAL_SESSION:CANCEL"),t.emitTokenizationResult({status:Dr})}catch(e){var i;t.metricsHandler.logEvent("EXTERNAL_SESSION:ERROR"),e instanceof _i?i=e:(t.errorLogger.captureException(e),i=new Ci("tokenizing Afterpay")),t.emitTokenizationResult(void 0,i)}t.paymentRequestLockController.unlock(t)}))()}onShippingOptionChange(e,t){this.metricsHandler.logEvent("SHIPPING_OPTION_CHANGE:OK"),this.req.dispatchEvent(Pr.AFTERPAY_SHIPPING_OPTION_CHANGED,{contactOrOption:gu(e),requireValidation:!0},(e=>{if(void 0===e.error){if(void 0!==e.shippingOption){this.total.amount=go.paymentRequestAmountToMoneyAmount(e.shippingOption.total.amount,this.req.currencyCode);var n=fu.shippingOption(e.shippingOption,this.req.currencyCode);t.resolve(n)}}else t.reject(e.error)}))}onShippingOptionChangeLegacy(e){this.metricsHandler.logEvent("SHIPPING_OPTION_CHANGE:OK"),this.total.amount=go.paymentRequestAmountToMoneyAmount(e.orderAmount.amount,this.req.currencyCode),this.req.dispatchEvent(Pr.AFTERPAY_SHIPPING_OPTION_CHANGED,{contactOrOption:gu(e)},(e=>{}))}onShippingAddressChange(e,t){if(!this.req.hasEventListener(Pr.AFTERPAY_SHIPPING_ADDRESS_CHANGED))return this.emitTokenizationResult(void 0,new jr("PaymentRequest",Pr.AFTERPAY_SHIPPING_ADDRESS_CHANGED)),t.reject("SERVICE_UNAVAILABLE"),void this.afterpayLibrary.close();var n=this.req;this.metricsHandler.logEvent("SHIPPING_ADDRESS_CHANGE:OK"),this.req.dispatchEvent(Pr.AFTERPAY_SHIPPING_ADDRESS_CHANGED,{contactOrOption:mu(e)},(e=>{if(void 0===e.error)if(e.shippingErrors)t.reject("SHIPPING_ADDRESS_UNRECOGNIZED");else{var r=fu.shippingOptions(e,n);t.resolve(r)}else t.reject("SHIPPING_ADDRESS_UNSUPPORTED")}))}emitTokenizationResult(e,t){0===this.onTokenizeCallbacks.length?this.tokenizationBuffer.push({error:t,result:e}):this.onTokenizeCallbacks.forEach((n=>{n(e,t)}))}buildInstantWalletTokenPayload(e,t){return{afterpayData:{afterpayToken:e,buyerAmount:t},clientID:this.session.applicationId,instanceID:this.session.instanceId,locationID:this.locationID,paymentMethodTrackingID:this.context.getPaymentMethodTrackingId(),requestBillingContact:this.req.requestBillingContact,requestShippingContact:this.req.requestShippingContact,sessionID:this.session.sessionId,websdkVersion:dr.VERSION}}buildCheckoutPayload(){var e,t={amount:fu.totalAmount(this.req),applicationID:this.session.applicationId,discounts:[],locationID:this.locationID,popupOriginUrl:this.session.sourceUrl};if(this.req.lineItems&&(t.items=fu.buildLineItems(this.req.lineItems,this.req.currencyCode)),this.req.discounts&&(t.discounts=fu.buildDiscounts(this.req.discounts,this.req.currencyCode)),this.req.requestShippingContact?e=this.req.shippingContact:this.req.pickupContact&&(e=this.req.pickupContact),void 0!==e){var n=vu(e);if(!n.isValid)throw new Wr(n.issues.map((e=>[e.propertyPath,e.expected])));t.shipping=fu.buildAfterpayContact(e)}return t}totalMoney(){return{amount:go.paymentRequestAmountToMoneyAmount(this.req.total.amount,this.req.currencyCode),currency:this.req.currencyCode}}openPaymentModal(){var e=this;return Pu((function*(){e.afterpayLibrary.open();var t=yield new Promise(((t,n)=>{e.commenceCheckout({reject:n,resolve:t})}));e.afterpayLibrary.transfer(Ou({token:t},e.transferOptions))}))()}initializeAfterpayPopup(e){var t=this.commenceCheckout.bind(this),n=this.completeCheckout.bind(this),r=document.createElement("div");r.id="sq-afterpay-dummy-element-".concat(cs()),r.style.visibility="hidden",e.appendChild(r),this.transferOptions={buyNow:this.buyNowOption,shippingOptionRequired:this.req.requestShippingContact},this.req.requestShippingContact||this.req.pickupContact||(this.transferOptions.addressMode="NO_ADDRESS");var i,o,a={addressMode:this.transferOptions.addressMode,countryCode:this.req.countryCode,onCommenceCheckout:(o=Pu((function*(e){yield t(e)})),function(e){return o.apply(this,arguments)}),onComplete:(i=Pu((function*(e){var t=e.data;yield n(t)})),function(e){return i.apply(this,arguments)}),shippingOptionRequired:this.req.requestShippingContact,target:"#".concat(r.id)};this.req.requestShippingContact?(a.onShippingAddressChange=this.onShippingAddressChange.bind(this),this.context.getFeatureFlagValues().can_use_afterpay_on_shipping_options_changed&&this.req.hasEventListener(Pr.AFTERPAY_SHIPPING_OPTION_CHANGED)?a.onShippingOptionChange=this.onShippingOptionChange.bind(this):a.onShippingOptionChange=this.onShippingOptionChangeLegacy.bind(this)):this.req.pickupContact&&(this.transferOptions.pickup=!0),this.afterpayLibrary.initializeForPopup(a),e.removeChild(r)}detachElement(e,t){this.afterpayLibrary.close(),this.element&&(this.element.innerHTML=""),this.element=null,this.tokenizationBuffer=[],this.onTokenizeCallbacks=[],this.status=e,this.metricsHandler.logConfigurationEvent(t)}}var Lu=function(){var e,t,n=(e=dr.env,null!==(t=Jl[e])&&void 0!==t?t:Jl.staging),r=n.messaging,i=n.marketplace;return Promise.all([$s.load("afterpay",{src:i},"AfterPay"),$s.load("afterpay-messaging",{src:r},"Afterpay")])};function xu(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}var ku={message:"Bank is not currently available.",type:"NOT_AVAILABLE"},Mu=class extends Ms{constructor(){super(...arguments),this.methodType="Bank"}initialize(){return(e=function*(){},function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){xu(o,r,i,a,s,"next",e)}function s(e){xu(o,r,i,a,s,"throw",e)}a(void 0)}))})();var e}tokenize(e){return Promise.reject(new di(ku))}};function ju(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Uu(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uu(e,t):void 0}}(e,t)||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 Uu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Bu={ASPECT_RATIO:/^\d+\/\d+$/,HEX:/^#([\dA-Fa-f]{3}|[\dA-Fa-f]{6})$/,NEGATIVE_EM:/^-\d*\.?\d+em$/,NEGATIVE_PERCENT:/^\d*\.?\d+%$/,NEGATIVE_PT:/^-\d*\.?\d+pt$/,NEGATIVE_PX:/^-\d*\.?\d+px$/,POSITIVE_EM:/^\d*\.?\d+em$/,POSITIVE_PERCENT:/^\d*\.?\d+%$/,POSITIVE_PT:/^\d*\.?\d+pt$/,POSITIVE_PX:/^\d*\.?\d+px$/,POSITIVE_RESOLUTION:/^\d*\.?\d+(?:dpi|dpcm|dppx|x)$/,RGB:/^rgb\((\s*\d{1,3},){2}\s*\d{1,3}\)$/,RGBA:/^rgba\((\s*\d{1,3},){3}\s*(1|0*.\d*)\)$/},qu=/\s(?![^(]*\))/,Hu=new Set(["screen","all","print","speech"]),Fu=new Set(["and"]),Vu=new Set(["not","only"]),Gu=new Set(["portrait","landscape"]),zu=new Set(["xx-small","x-small","small","medium","large","x-large","xx-large"]),$u=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),Yu=new Set([100,200,300,400,500,600,700,800,900]),Wu=new Set(["100","200","300","400","500","600","700","800","900","normal","bold","bolder","lighter"]),Ku=new Set(["normal"]),Xu=new Set(["smaller","larger"]),Ju=new Set(["andale mono","arial","arial black","arial narrow","arial rounded mt bold","avant garde","baskerville","big caslon","bodoni mt","book antiqua","brush script mt","calibri","calisto mt","cambria","candara","century gothic","charcoal","comic sans ms","consolas","copperplate","copperplate gothic light","courier","courier new","cursive","didot","fantasy","franklin gothic medium","futura","garamond","geneva","georgia","gill sans","goudy old style","helvetica","helvetica neue","hoefler text","impact","lucida bright","lucida console","lucida grande","lucida sans unicode","lucida sans typewriter","monaco","monospace","optima","palatino","palatino linotype","papyrus","perpetua","rockwell","rockwell extra bold","sans-serif","segoe ui","serif","square market","square sans text","tahoma","times","times new roman","trebuchet ms","verdana"]),Zu=new Set(["none","antialiased","subpixel-antialiased"]),Qu=new Set(["grayscale","auto"]),ed=new Set(["none"]);function td(e){return e.split(/, ?(?![^(]*\))/).every((e=>function(e){if("none"===e)return!0;var t=e.split(/ (?![^(]*\))/),n=0;if("inset"===t[0]&&(t.shift(),n+=1),"inset"===t[t.length-1]){if(n>0)return!1;t.pop()}for(var r=0;r<2;r+=1){var i=t.shift();if(void 0===i||!sd(i))return!1}switch(t.length){case 0:return!0;case 1:return ud(t[0])||ld(t[0]);case 2:return ld(t[0])&&(ud(t[1])||cd(t[1]));case 3:return ld(t[0])&&cd(t[1])&&ud(t[2]);default:return!1}}(e)))}function nd(e){return["border-box","content-box"].includes(e)}function rd(e){return e.split(" ").every((e=>function(e){return 0===Number(e)||Cd(e)||wd(e)}(e)))}function id(e){var t=e.split(" ");return!(0===t.length||t.length>4)&&t.every(od)}function od(e){return 0===Number(e)||Cd(e)||wd(e)}function ad(e){return 0===Number(e)||Cd(e)||wd(e)||Sd(e)||Od(e)}function sd(e){return 0===Number(e)||_d(e)||Id(e)}function cd(e){return 0===Number(e)||_d(e)||Id(e)}function ld(e){return 0===Number(e)||Cd(e)||wd(e)}function ud(e){return function(e){return $u.has(e.toLowerCase())}(e)||function(e){return Bu.HEX.test(e)}(e)||function(e){return Bu.RGB.test(e)}(e)||function(e){return Bu.RGBA.test(e)}(e)}function dd(e){return function(e){return zu.has(e.toLowerCase())}(e)||function(e){return Xu.has(e.toLowerCase())}(e)||Cd(e)||Ad(e)||wd(e)||Td(e)}function hd(e){return null!==e&&e.split(", ").every((e=>{return t=e.toLowerCase().trim().replace(/["']+/g,""),Ju.has(t);var t}))}function pd(e){var t=Number(e);return Number.isNaN(t)?Wu.has(e.toLowerCase()):Yu.has(t)}function fd(e){return"normal"===e||Id(e)||function(e){return Ad(e)||function(e){return Bu.NEGATIVE_PT.test(e)}(e)}(e)||_d(e)}function md(e){var t=Number(e);return!Number.isNaN(t)&&t>=0||Ku.has(e)||wd(e)||Cd(e)||Ad(e)||Td(e)}function gd(e){return Zu.has(e)}function vd(e){return Qu.has(e)}function yd(e){return ed.has(e)}function Ed(e){if(null===e)return!1;var t=e.toString().split(" ");return!(t.length>4)&&t.every((e=>function(e){return Cd(e)||wd(e)||Td(e)||0===Number(e)}(e)))}function bd(e){if(!e.startsWith("(")||!e.endsWith(")"))return!1;var t=ju(e.slice(1,-1).split(/: */),2),n=t[0],r=t[1];switch(n){case"width":case"min-width":case"max-width":case"height":case"min-height":case"max-height":case"device-width":case"min-device-width":case"max-device-width":case"device-height":case"min-device-height":case"max-device-height":return Cd(r)||wd(r)||Td(r);case"resolution":case"min-resolution":case"max-resolution":return function(e){return Bu.POSITIVE_RESOLUTION.test(e)}(r);case"aspect-ratio":case"min-aspect-ratio":case"max-aspect-ratio":case"device-aspect-ratio":case"min-device-aspect-ratio":case"max-device-aspect-ratio":return function(e){return Bu.ASPECT_RATIO.test(e)}(r);case"color":case"color-index":case"monochrome":return void 0===r;case"min-color":case"max-color":case"min-color-index":case"max-color-index":case"min-monochrome":case"max-monochrome":return function(e){return Number(e)>=0}(r);case"orientation":return function(e){return Gu.has(e)}(r);default:return!1}}function _d(e){return Cd(e)||Sd(e)}function Cd(e){return Bu.POSITIVE_PX.test(e)}function Sd(e){return Bu.NEGATIVE_PX.test(e)}function Id(e){return wd(e)||Od(e)}function wd(e){return Bu.POSITIVE_EM.test(e)}function Od(e){return Bu.NEGATIVE_EM.test(e)}function Ad(e){return Bu.POSITIVE_PT.test(e)}function Td(e){return Bu.POSITIVE_PERCENT.test(e)}var Pd=function(e,t){var n=(e=>{switch(e){case"border-color":case"background-color":case"color":case"-webkit-text-fill-color":return ud;case"-webkit-box-shadow":case"box-shadow":return td;case"box-sizing":return nd;case"font-family":return hd;case"font-size":return dd;case"font-weight":return pd;case"letter-spacing":return fd;case"line-height":return md;case"padding":return Ed;case"-webkit-font-smoothing":return gd;case"-moz-osx-font-smoothing":return vd;case"display":return yd;case"border-radius":return rd;case"border-width":return id;case"top":case"bottom":case"left":case"right":return ad;case"width":return function(e){return""!==e};default:return}})(e);return!0===(null==n?void 0:n(t))||function(e){return["unset","inherit","revert","initial"].includes(e)}(t)?t:""},Nd=function(e){return!!(t=e).startsWith("@media")&&t.slice(7,t.length).split(/, */).every((e=>{var t=e.split(qu);if(0===t.length)return!1;var n=0;if(!t[0].startsWith("(")){var r=0;if(Vu.has(t[0])&&(r=1),t.length===r+1)return Hu.has(t[r]);if(!Hu.has(t[r])||!Fu.has(t[r+1]))return!1;n=2+r}if((t.length-n)%2==0)return!1;for(var i of Object.entries(t.slice(n))){var o=ju(i,2),a=o[0],s=o[1];if(!(Number(a)%2==0?bd(s):Fu.has(s)))return!1}return!0}));var t};function Dd(e){return function(t){return Pd(e,t)}}var Rd=ws(Ns({rounded:ws(vs()),style:ws(Ns({backgroundColor:ws(Ds({},Dd("background-color"))),color:ws(Ds({},Dd("color")))}))})),Ld="sq-bitcoin-lightning-modal",xd="sq-bitcoin-lightning-modal-content",kd="sq-bitcoin-qr-container",Md="sq-bitcoin-pay",jd="sq-bitcoin-payment-details";class Ud{constructor(e,t,n){this.isShown=!1,this.modalElement=null,this.closeButtonHandler=null,this.lightningPayButtonHandler=null,this.modalOverlayHandler=null,this.qrCodeFactory=e,this.context=t,this.onClose=n}static updatePaymentDetails(e,t,n){var r=document.getElementById(jd);if(!r)throw new Error("Payment details container not found");var i=r.querySelector("h2");r.innerHTML="",i&&r.appendChild(i);var o=Math.round(e.amountMilliSats/1e3),a=new Intl.NumberFormat(t).format(o),s=null!=n?n:e.currencyExchange,c=go.moneyAmountToInternationalizedCurrency(s.amount,s.currency,t),l=document.createElement("div");l.className="sq-bitcoin-amount";var u=document.createElement("div");u.className="sq-bitcoin-amount-btc",u.textContent="₿".concat(a);var d=document.createElement("div");d.className="sq-bitcoin-amount-usd",d.textContent=c,l.appendChild(u),l.appendChild(d);var h=document.createElement("p");h.className="sq-bitcoin-instruction",h.textContent="Scan with your Bitcoin Lightning wallet";var p=document.createElement("div");p.className="sq-bitcoin-invoice";var f=document.createElement("div");f.className="sq-bitcoin-invoice-label",f.textContent="Lightning invoice";var m=document.createElement("div");m.className="sq-bitcoin-invoice-value-container";var g=document.createElement("div");g.className="sq-bitcoin-invoice-value";var v=/lightning:(.+)/.exec(e.paymentUrl),y=v?v[1]:e.paymentUrl,E=y.length>13?"".concat(y.substring(0,7),"...").concat(y.substring(y.length-6)):y;g.textContent=E.toLowerCase();var b=document.createElement("button");b.className="sq-bitcoin-invoice-copy",b.type="button",b.setAttribute("aria-label","Copy invoice"),b.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n    <path fill-rule="evenodd" clip-rule="evenodd" d="M20 7C20.2652 7 20.5195 7.10544 20.707 7.29297C20.8946 7.4805 21 7.73479 21 8V21C21 21.5523 20.5523 22 20 22H9C8.44772 22 8 21.5523 8 21V8L8.00488 7.89746C8.05622 7.39334 8.48233 7 9 7H20ZM10 20H19V9H10V20Z" fill="#101010"/>\n    <path d="M16 4H5V17H3V3C3 2.73478 3.10543 2.48051 3.29297 2.29297C3.48051 2.10543 3.73478 2 4 2H16V4Z" fill="#101010"/>\n  </svg>',b.onclick=()=>{Ud.copyToClipboard(y.toLowerCase()),Ud.showCopyConfirmation(b)},m.appendChild(g),m.appendChild(b),p.appendChild(f),p.appendChild(m),r.appendChild(l),r.appendChild(h),r.appendChild(p)}static createMobileDuplicates(e){var t=document.getElementById(xd),n=document.getElementById(Md);if(t&&n){for(var r of t.querySelectorAll(".sq-bitcoin-instruction--mobile, .sq-bitcoin-invoice--mobile"))r.remove();var i=t.querySelector(".sq-bitcoin-instruction"),o=t.querySelector(".sq-bitcoin-invoice");if(null==i||i.classList.add("sq-bitcoin-instruction--desktop"),null==o||o.classList.add("sq-bitcoin-invoice--desktop"),i){var a=i.cloneNode(!0);a.classList.remove("sq-bitcoin-instruction--desktop"),a.classList.add("sq-bitcoin-instruction--mobile"),t.insertBefore(a,n)}if(o){var s=o.cloneNode(!0);s.classList.remove("sq-bitcoin-invoice--desktop"),s.classList.add("sq-bitcoin-invoice--mobile"),t.insertBefore(s,n);var c=s.querySelector(".sq-bitcoin-invoice-copy");if(c){var l=/lightning:(.+)/.exec(e.paymentUrl),u=l?l[1]:e.paymentUrl;c.onclick=()=>{Ud.copyToClipboard(u.toLowerCase()),Ud.showCopyConfirmation(c)}}}}}static copyToClipboard(e){var t;return null!==(t=navigator.clipboard)&&void 0!==t&&t.writeText?navigator.clipboard.writeText(e):new Promise(((t,n)=>{var r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.opacity="0",r.setAttribute("readonly",""),document.body.appendChild(r);try{r.select(),r.setSelectionRange(0,e.length);var i=document.execCommand("copy");document.body.removeChild(r),i?t():n(new Error("Copy command failed"))}catch(e){document.body.removeChild(r),n(e instanceof Error?e:new Error("Failed to copy to clipboard"))}}))}static showCopyConfirmation(e){"true"!==e.dataset.copying&&(e.dataset.copying="true",e.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n    <path d="M22.7573 5.65039L10.7573 19.6504C10.5673 19.872 10.2905 20 9.99854 20C9.70678 19.9999 9.42963 19.8719 9.23975 19.6504L3.23975 12.6504L4.75732 11.3496L9.99854 17.4639L21.2397 4.34961L22.7573 5.65039Z" fill="#00B23B"/>\n  </svg>',e.classList.add("sq-bitcoin-invoice-copy--pop"),setTimeout((()=>{e.classList.remove("sq-bitcoin-invoice-copy--pop")}),300),setTimeout((()=>{e.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n    <path fill-rule="evenodd" clip-rule="evenodd" d="M20 7C20.2652 7 20.5195 7.10544 20.707 7.29297C20.8946 7.4805 21 7.73479 21 8V21C21 21.5523 20.5523 22 20 22H9C8.44772 22 8 21.5523 8 21V8L8.00488 7.89746C8.05622 7.39334 8.48233 7 9 7H20ZM10 20H19V9H10V20Z" fill="#101010"/>\n    <path d="M16 4H5V17H3V3C3 2.73478 3.10543 2.48051 3.29297 2.29297C3.48051 2.10543 3.73478 2 4 2H16V4Z" fill="#101010"/>\n  </svg>',delete e.dataset.copying}),2e3))}show(e,t){this.isShown||(this.isShown=!0,this.modalElement||this.createModal(e),this.updateQRCode(e.paymentUrl),Ud.updatePaymentDetails(e,this.context.getSession().locale,t),Ud.createMobileDuplicates(e),this.modalElement&&(this.modalElement.style.display="flex"))}hide(){this.isShown&&(this.isShown=!1,this.modalElement&&(this.modalElement.style.display="none"))}createModal(e){var t=document.getElementById(Ld);t&&t.remove();var n=this.context.getLocaleString().paymentMethods.bitcoin,r=document.createElement("div");r.id=Ld,r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-labelledby","sq-bitcoin-modal-title");var i=document.createElement("div");i.id=xd;var o=document.createElement("button");o.id="sq-bitcoin-modal-close",o.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n    <path d="M19.707 5.70703L13.4141 12L19.707 18.293L18.293 19.707L12 13.4141L5.70703 19.707L4.29297 18.293L10.5859 12L4.29297 5.70703L5.70703 4.29297L12 10.5859L18.293 4.29297L19.707 5.70703Z" fill="#101010"/>\n  </svg>',o.type="button",o.setAttribute("aria-label",n.closeButtonAriaLabel);var a=document.createElement("h2");a.id="sq-bitcoin-modal-title",a.textContent=n.modalTitle;var s=document.createElement("div");s.id=kd;var c=document.createElement("div");c.id=jd,c.appendChild(a);var l=document.createElement("button");l.id=Md,l.type="button",l.innerHTML=n.lightningPayButtonText,l.setAttribute("aria-label",n.lightningPayButtonAriaLabel),i.appendChild(o),i.appendChild(c),i.appendChild(s),i.appendChild(l),r.appendChild(i),document.body.appendChild(r),this.modalElement=r,this.closeButtonHandler=()=>{this.hide(),this.onClose()},o.addEventListener("click",this.closeButtonHandler),this.modalOverlayHandler=e=>{e.target===r&&(this.hide(),this.onClose())},r.addEventListener("click",this.modalOverlayHandler),this.lightningPayButtonHandler=()=>{var t=document.createElement("a");t.href=e.paymentUrl,t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},l.addEventListener("click",this.lightningPayButtonHandler)}updateQRCode(e){var t=document.getElementById(kd);if(!t)throw new Error("QR container not found");t.innerHTML="";var n=this.context.getLocaleString().paymentMethods.bitcoin,r=this.qrCodeFactory(0,"M");r.addData(e),r.make();var i=r.createImgTag(8,4,n.qrCodeAltText),o=document.createElement("div");o.innerHTML=i;var a=o.firstChild,s=document.createElement("div");s.className="sq-bitcoin-qr-wrapper",s.appendChild(a);var c=document.createElement("div");c.className="sq-bitcoin-qr-icon",c.innerHTML='<svg width="13" height="18" viewBox="0 0 13 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n    <path d="M8.0257 7.55728H4.85995L5.47985 4.75085H8.16013C9.25594 4.75085 9.88985 5.25034 9.88985 6.0773C9.88985 7.05716 9.12151 7.55728 8.0257 7.55728ZM6.89166 13.2663H3.5985L4.32479 9.97953H7.00698C8.33342 9.97953 9.14063 10.5364 9.14063 11.536C9.14063 12.5547 8.31431 13.2663 6.89166 13.2663ZM12.9849 5.59692C12.9849 3.76908 11.5941 2.5828 9.68216 2.24004L10.0147 0.658125C10.0854 0.318551 9.82678 0 9.4802 0H7.46569C7.20767 0 6.98532 0.179663 6.9318 0.431955L6.56865 2.13683H3.2602C3.06843 2.13683 2.90215 2.26999 2.86073 2.45729L0.00971339 15.3637C-0.0463514 15.6191 0.147327 15.8612 0.409175 15.8612H3.52141L3.20986 17.3247C3.13851 17.663 3.39462 17.9821 3.73993 17.9847L5.75763 18C6.01756 18.0019 6.2431 17.8203 6.29661 17.5655L6.65403 15.8612H6.96812C10.1976 15.8612 12.2541 14.0927 12.2541 11.8055C12.2541 10.4599 11.524 9.3641 10.39 8.80663C11.8126 8.40335 12.9849 7.26867 12.9849 5.59692Z" fill="white"/>\n  </svg>',s.appendChild(c),t.appendChild(s)}}function Bd(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function qd(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Bd(o,r,i,a,s,"next",e)}function s(e){Bd(o,r,i,a,s,"throw",e)}a(void 0)}))}}class Hd{constructor(e,t){this.isRunning=!1,this.fetchStatus=e,this.onError=t}start(){var e=this;return qd((function*(){e.isRunning||(e.isRunning=!0,yield e.poll())}))()}stop(){this.isRunning=!1,void 0!==this.nextPollTimeoutId&&(clearTimeout(this.nextPollTimeoutId),this.nextPollTimeoutId=void 0)}poll(){var e=this;return qd((function*(){try{if(!(yield e.fetchStatus()))return void e.stop();e.isRunning&&(e.nextPollTimeoutId=setTimeout((()=>{e.poll()}),1e3))}catch(t){e.stop(),e.onError(t)}}))()}}function Fd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vd(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Gd(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Vd(o,r,i,a,s,"next",e)}function s(e){Vd(o,r,i,a,s,"throw",e)}a(void 0)}))}}class zd extends Ms{constructor(e,t){super(e),this.methodType="Bitcoin",this.paymentInProgress=!1,this.wasFirstInteractionCalled=!1,this.modalState="active",this.paymentMethodMessenger=new tl(this.context),this.container=null,this.bitcoinButton=null,this.lightningModal=new Ud(t,e,(()=>{"terminal"!==this.modalState&&(this.modalState="dismissed",this.dispatchEvent("onModalCancelled",void 0))})),this.attach=this.withErrorHandling(this.attach.bind(this),"attach")}attach(e,t){var n=this;return Gd((function*(){n.throwIfDestroyedOrAlreadyAttached(),n.status=Es.ATTACHED;try{var r=function(e){var t,n=Ls(Rd),r=n.validate(e);if(!r.isValid)throw wc(r.issues,"Bitcoin attach");return null!==(t=n.sanitize(e))&&void 0!==t?t:{}}(t),i=r.rounded,o=r.style;if(n.container=Sl(e),yield Dl(dr.BITCOIN_STYLES,"sq-bitcoin-styles",document.head),n.bitcoinButton=document.createElement("button"),n.bitcoinButton.type="button",n.bitcoinButton.classList.add("sq-bitcoin-button"),!1!==i&&n.bitcoinButton.classList.add("sq-bitcoin-button--rounded"),void 0!==o)for(var a of Object.entries(o)){var s=(p=2,function(e){if(Array.isArray(e))return e}(h=a)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(h,p)||function(e,t){if(e){if("string"==typeof e)return Fd(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fd(e,t):void 0}}(h,p)||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.")}()),c=s[0],l=s[1];n.bitcoinButton.style[c]=l}var u=document.createElement("span");u.classList.add("sq-bitcoin-button__content"),u.innerText=n.context.getLocaleString().paymentMethods.bitcoin.buttonText;var d=document.createElement("span");d.classList.add("sq-bitcoin-button__spinner"),d.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n    <path clip-rule="evenodd" fill-rule="evenodd" d="M21.3333 12C21.3333 6.84534 17.1547 2.66667 12 2.66667V0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12H2.66667C2.66667 17.1547 6.84534 21.3333 12 21.3333C17.1547 21.3333 21.3333 17.1547 21.3333 12Z"/>\n  </svg>',n.bitcoinButton.appendChild(u),n.bitcoinButton.appendChild(d),n.container.appendChild(n.bitcoinButton),n.bitcoinButton.addEventListener("click",(()=>{n.handleButtonClick()})),n.metricsHandler.logConfigurationEvent("CONFIGURED",r)}catch(e){throw n.status=Es.DETACHED,e}var h,p;return Promise.resolve()}))()}destroy(){var e;return this.status===Es.DESTROYED?Promise.resolve(!1):(null===(e=this.poller)||void 0===e||e.stop(),this.container&&(this.container.innerHTML=""),this.status=Es.DESTROYED,this.metricsHandler.logConfigurationEvent("DESTROYED"),Promise.resolve(!0))}registerPayment(e,t){var n=this;return Gd((function*(){var r;null===(r=n.poller)||void 0===r||r.stop(),n.modalState="active",n.metricsHandler.logEvent("EXTERNAL_SESSION:START"),n.poller=new Hd(Gd((function*(){var r=yield n.requestBitcoinStatus(e,t),i=r.status,o=r.lightningDetails,a=r.totalAmount;switch(i){case"COMPLETED":return n.metricsHandler.logEvent("EXTERNAL_SESSION:OK"),n.modalState="terminal",n.lightningModal.hide(),n.setButtonLoading(!1),n.dispatchEvent("onPaymentCompletion",{paymentId:t}),!1;case"FAILED":return n.metricsHandler.logEvent("EXTERNAL_SESSION:ERROR"),n.modalState="terminal",n.lightningModal.hide(),n.setButtonLoading(!1),n.dispatchEvent("onPaymentFailure",{paymentId:t}),!1;case"CANCELLED":return n.metricsHandler.logEvent("EXTERNAL_SESSION:CANCEL"),n.modalState="terminal",n.lightningModal.hide(),n.setButtonLoading(!1),n.dispatchEvent("onPaymentCancelled",{paymentId:t}),!1;default:return void 0!==o&&"active"===n.modalState&&(n.lightningModal.show(o,a),n.setButtonLoading(!1)),!0}})),(e=>{n.metricsHandler.logEvent("EXTERNAL_SESSION:ERROR"),n.lightningModal.hide(),n.setButtonLoading(!1),n.dispatchEvent("onError",{error:e})})),yield n.poller.start()}))()}requestBitcoinStatus(e,t){var n=this;return Gd((function*(){var r=n.context.getSession(),i={bitcoinNonce:e,clientId:r.applicationId,instanceId:r.instanceId,locationId:r.locationId,paymentId:t,sessionId:r.sessionId};return n.paymentMethodMessenger.request("REQUEST_BITCOIN_STATUS",i)}))()}setButtonLoading(e){this.bitcoinButton&&(e?(this.bitcoinButton.classList.add("sq-bitcoin-button--loading"),this.bitcoinButton.disabled=!0):(this.bitcoinButton.classList.remove("sq-bitcoin-button--loading"),this.bitcoinButton.disabled=!1))}handleButtonClick(){var e=this;return Gd((function*(){if(!e.paymentInProgress){e.wasFirstInteractionCalled||(e.wasFirstInteractionCalled=!0,e.metricsHandler.logEvent("FIRST_INTERACTION:OK")),e.paymentInProgress=!0,e.setButtonLoading(!0);try{var t={paymentMethodTrackingId:e.context.getPaymentMethodTrackingId()},n=(yield e.paymentMethodMessenger.request("REQUEST_BITCOIN_NONCE",t)).bitcoinNonce;e.dispatchEvent("onPaymentCreationNeeded",{bitcoinNonce:n})}catch(t){e.setButtonLoading(!1),e.dispatchEvent("onError",{error:t})}finally{e.paymentInProgress=!1}}}))()}}function $d(){return($d=Gd((function*(){return yield $s.load("qr-code",{src:dr.QR_CODE_GENERATOR_SCRIPT},"Square.utils.QRCodeFactory")}))).apply(this,arguments)}var Yd={initialize:function(){return $d.apply(this,arguments)}},Wd=["style"];function Kd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Xd(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xd(e,t):void 0}}(e,t)||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 Xd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Jd=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=document.createElement("iframe");return new Promise(((i,o)=>{r.onerror=e=>{o(new to(e))},r.onload=()=>{n||i(r)};var a=e.style,s=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Wd);Object.entries(s).forEach((e=>{var t=Kd(e,2),n=t[0],i=t[1];void 0!==i&&r.setAttribute(n,i)})),void 0!==a&&Object.entries(a).forEach((e=>{var t=Kd(e,2),n=t[0],i=t[1];r.style.setProperty(n,i,"important")})),t?t.appendChild(r):document.body.appendChild(r)}))},Zd=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)};function Qd(e,t,n){switch(e){case fr.CARD_NUMBER:return t.paymentMethods.cards.errors.cardNumberError;case fr.CVV:return t.paymentMethods.cards.errors.cvvError;case fr.EXPIRATION_DATE:return t.paymentMethods.cards.errors.expirationDateError;case fr.POSTAL_CODE:return t.paymentMethods.cards.errors.postalCodeErrors[n];case gr.GIFT_CARD_NUMBER:return t.paymentMethods.giftCards.errors.giftCardNumberError;default:return""}}function eh(e,t,n){switch(e){case fr.CARD_NUMBER:return t.paymentMethods.cards.helperText.cardNumber;case fr.CVV:return t.paymentMethods.cards.helperText.cvv;case fr.EXPIRATION_DATE:return t.paymentMethods.cards.helperText.expirationDate;case fr.POSTAL_CODE:return t.paymentMethods.cards.helperText.postalCodes[n];case gr.GIFT_CARD_NUMBER:return t.paymentMethods.giftCards.helperText.giftCardNumber;default:return""}}class th{constructor(e,t){this.errorList=new Set,this.focusedInput=void 0,this.fieldOrdering=e,this._postalCountry=null!=t?t:"US"}get postalCountry(){return this._postalCountry}setErrorOnField(e){this.errorList.add(e)}removeErrorFromField(e){this.errorList.delete(e)}setFocusOnField(e){this.focusedInput=e}removeFocusFromField(e){this.focusedInput===e&&(this.focusedInput=null)}setPostalCountry(e){this._postalCountry=e}hasFocus(){return null!==this.focusedInput&&void 0!==this.focusedInput}hasError(){return this.errorList.size>0}fieldHelperMessage(e){if(0===this.errorList.size)return{fieldName:this.focusedInput,isError:!1,message:eh(this.focusedInput,e,this.postalCountry)};var t=this.fieldOrdering.find((e=>this.errorList.has(e)));return{fieldName:t,isError:!0,message:Qd(t,e,this.postalCountry)}}}var nh=["top","right","bottom","left"];function rh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ih(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ih(e,t):void 0}}(e,t)||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 ih(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oh(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(n.length>0&&!n.includes(e))throw new vi(e);var i=go.cssProperty(e),o=Pd(i,t);if(0===o.length)throw new yi(e,t);return r&&(o+=" !important"),go.formatCSSKeyValuePair(i,o)}function ah(e,t,n){var r,i=[],o=[],a=new Set(null!==(r=e.excludeProperties)&&void 0!==r?r:[]);for(var s of Object.entries(t)){var c=rh(s,2),l=c[0],u=c[1];if(!a.has(l))try{i.push(oh(l,null!=u?u:"",n))}catch(e){(e instanceof vi||e instanceof yi)&&o.push(e)}}if(o.length>0)throw new bi(o);return Object.fromEntries(e.toSelectors.map((function(e){return[e,i]})))}function sh(e,t,n){var r={},i=[];if(e.forEach((function(e){var o=e.property,a=e.setAsImportant,s=e.toProperty,c=e.toSelectors,l=e.transformPropertyValue,u=t[o];if(go.isNonBlankString(u)){var d=l?l(u):u;try{var h=oh(null!=s?s:o,d,void 0!==s?[...n,s]:n,a);c.forEach((e=>{e in r||(r[e]=[]),r[e].push(h)}))}catch(e){(e instanceof vi||e instanceof yi)&&i.push(e)}}})),i.length>0)throw new bi(i);return r}var ch=function(e,t){var n=t.split(" ");switch(n.length){case 1:return n[0];case 2:switch(e){case"top":case"bottom":return n[0];default:return n[1]}case 3:switch(e){case"top":return n[0];case"bottom":return n[2];default:return n[1]}case 4:switch(e){case"top":return n[0];case"right":return n[1];case"bottom":return n[2];case"left":return n[3];default:return""}default:return""}},lh=function e(t,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=[],s=[...Object.keys(n.selectorMappings),...Object.keys(null!==(i=n.selectorPropertyMappings)&&void 0!==i?i:{})],c=new Set(s),l=new Set(Object.values(r));Object.keys(t).forEach((e=>{l.has(e)||function(e,t){return!t&&Nd(e)}(e,o)||a.push(new Ei(e))}));var u={};function d(e){for(var t of Object.entries(e)){var n=rh(t,2),r=n[0],i=n[1];r in u||(u[r]=[]),u[r].push(...i)}}for(var h of c){var p,f,m,g,v=t[h],y=null!==(p=n.allowedAttributes[h])&&void 0!==p?p:[],E=null!==(f=n.selectorMappings[h])&&void 0!==f?f:[],b=null!==(m=null===(g=n.selectorPropertyMappings)||void 0===g?void 0:g[h])&&void 0!==m?m:[];if(v){try{d(ah(E,v,y))}catch(e){e instanceof bi&&a.push(...e.errors)}try{d(sh(b,v,y))}catch(e){e instanceof bi&&a.push(...e.errors)}}}if(Object.keys(t).filter((e=>!c.has(e)&&Nd(e))).forEach((i=>{try{var o=e(t[i],n,r,!0);u[i]=[o]}catch(e){e instanceof bi&&a.push(...e.errors)}})),a.length>0)throw new bi(a);return function(e){var t=[];for(var n of Object.entries(e)){var r=rh(n,2),i=r[0],o=r[1];o&&o.length>0&&t.push("\n      ".concat(i," { ").concat(o.join(" ")," }\n      "))}return t.join("")}(u)},uh="sq-card-iframe-container",dh="sq-card-wrapper",hh="sq-card-component",ph="sq-card-message",fh="sq-card-message-error",mh="sq-card-message-no-error",gh="sq-visible",vh=".".concat(dh),yh=".".concat(hh),Eh=".".concat(uh),bh="".concat(vh).concat(Tl),_h="".concat(vh).concat(Pl),Ch="".concat(vh," ").concat(yh),Sh="".concat(vh," ").concat(Eh),Ih="".concat(bh," ").concat(Eh),wh="".concat(_h," ").concat(Eh),Oh=".sq-card-message-error::before",Ah=".sq-card-message-no-error::before",Th="".concat(Eh).concat("::before"),Ph=["borderWidth"];function Nh(e){var t=["".concat(e).concat(Pl," ").concat(Th),"".concat(e).concat(Tl," ").concat(Th)];return nh.map((e=>{return{property:"borderWidth",toProperty:e,toSelectors:t,transformPropertyValue:(n=e,function(e){var t=ch(n,e);return t.startsWith("0")?t:"-".concat(t)})};var n}))}function Dh(e,t){return lh(e,function(e){var t="#".concat(e);return{allowedAttributes:{[mr.CARD_COMPONENT]:Mi,[mr.CARD_COMPONENT_FOCUS]:ji,[mr.CARD_COMPONENT_ERROR]:ji,[mr.CARD_INPUT_HELPER_TEXT]:Ui,[mr.CARD_INPUT_HELPER_ICON]:Bi,[mr.CARD_INPUT_ERROR_TEXT]:Ui,[mr.CARD_INPUT_ERROR_ICON]:Bi},selectorMappings:{[mr.CARD_COMPONENT]:{toSelectors:["".concat(t).concat(Sh)]},[mr.CARD_COMPONENT_FOCUS]:{excludeProperties:Ph,toSelectors:["".concat(t).concat(Ih)]},[mr.CARD_COMPONENT_ERROR]:{excludeProperties:Ph,toSelectors:["".concat(t).concat(wh)]},[mr.CARD_INPUT_HELPER_TEXT]:{toSelectors:["".concat(t," ").concat(".sq-card-message-no-error")]},[mr.CARD_INPUT_HELPER_ICON]:{toSelectors:["".concat(t," ").concat(Ah)]},[mr.CARD_INPUT_ERROR_TEXT]:{toSelectors:["".concat(t," ").concat(".sq-card-message-error")]},[mr.CARD_INPUT_ERROR_ICON]:{toSelectors:["".concat(t," ").concat(Oh)]}},selectorPropertyMappings:{[mr.CARD_INPUT]:[{property:"backgroundColor",toSelectors:["".concat(t).concat(Sh)]}],[mr.CARD_COMPONENT]:[{property:"borderRadius",toSelectors:["".concat(t," ").concat(Th),"".concat(t).concat(Ch)]},{property:"borderWidth",toProperty:"width",toSelectors:["".concat(t).concat(Sh)],transformPropertyValue:e=>function(e){var t=["left","right"].map((t=>{var n=ch(t,e);return"0"===n&&(n="0px"),n})).join(" + ");return"calc(100% - (".concat(t,"))")}(e)},...Nh(t)],[mr.CARD_COMPONENT_ERROR]:[{property:"borderColor",toSelectors:["".concat(t).concat(Pl," ").concat(Th)]},{property:"borderWidth",toSelectors:["".concat(t).concat(Pl," ").concat(Th)]}],[mr.CARD_COMPONENT_FOCUS]:[{property:"borderColor",toSelectors:["".concat(t).concat(Tl," ").concat(Th)]},{property:"borderWidth",toSelectors:["".concat(t).concat(Tl," ").concat(Th)]}],[mr.CARD_INPUT_ERROR_ICON]:[{property:"color",toProperty:"backgroundColor",toSelectors:["".concat(t," ").concat(Oh)]}],[mr.CARD_INPUT_HELPER_ICON]:[{property:"color",toProperty:"backgroundColor",toSelectors:["".concat(t," ").concat(Ah)]}]}}}(t),mr)}function Rh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rh(Object(n),!0).forEach((function(t){xh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xh(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kh(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Mh(e,t,n){return jh.apply(this,arguments)}function jh(){var e;return e=function*(e,t,n){try{e.metricsHandler.logEvent("OSA_VERIFICATION:START");var r=function(e){if("STORE"===e.intent)return e;var t,n,r=Lh({},e);return"total"in r?(t=go.moneyAmountToPaymentRequestAmount(r.total.amount,r.total.currencyCode),n=r.total.currencyCode,delete r.total):(t=r.amount,n=r.currencyCode),Lh(Lh({},r),{},{amount:t,currencyCode:n})}(t),i=yield e.analyticsBackend.verifyBuyer(n,r);return e.metricsHandler.logEvent("OSA_VERIFICATION:OK"),i}catch(t){if(e.metricsHandler.logEvent("OSA_VERIFICATION:ERROR"),Gr(t))throw new _i([yo]);throw t}},jh=function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){kh(o,r,i,a,s,"next",e)}function s(e){kh(o,r,i,a,s,"throw",e)}a(void 0)}))},jh.apply(this,arguments)}function Uh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bh(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qh=/^-?[0-9]+(\.[0-9]+)?$/,Hh=Ns({includeInputLabels:ws(vs()),postalCode:ws(Ds()),style:ws(Ns())});function Fh(e){var t=Ls(Hh),n=t.validate(e);if(n.isValid)return t.sanitize(e);throw wc(n.issues,"card() configuration options")}function Vh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vh(Object(n),!0).forEach((function(t){zh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zh(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $h(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Yh(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){$h(o,r,i,a,s,"next",e)}function s(e){$h(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Wh(e,t){return void 0!==t?{status:xr,token:"".concat(e,"#").concat(t)}:{status:xr,token:e}}function Kh(e){return"".concat("single-card-wrapper","-").concat(e)}function Xh(e,t){var n=function(e){return"".concat("sq-single-card-custom-styles","-").concat(e)}(t),r=document.getElementById(n);null===r&&((r=document.createElement("style")).id=n,document.head.appendChild(r)),r.innerHTML=Dh(e,Kh(t))}var Jh=class extends Ms{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e),this.methodType=Nr.CARD,this.updateCardDetailText=()=>{if(this.cardDetail){var e=this.fieldState.fieldHelperMessage(this.context.getLocaleString()),t=e.message,n=e.isError;this.cardDetail.classList.toggle(fh,n),this.cardDetail.classList.toggle(mh,!n),this.cardDetail.textContent!==t&&(this.cardDetail.textContent=t),this.cardDetail.classList.toggle(gh,t.length>0)}},this.onResize=e=>{var t;if(this.iframe&&this.wrapperElement&&this.iframeContainer&&(this.lastResizeWidth=this.iframe.clientWidth,void 0===this.currentResizeTimeout)){var n=e=>{if(this.wrapperElement&&this.iframe&&this.iframeContainer){var t=this.inputLabelsIncluded?62:48;e<=505&&(t=2*t+1),this.iframeContainer.style.height="".concat(Math.round(t),"px"),this.iframe.height="".concat(Math.round(t),"px")}};n(null!==(t=this.lastResizeWidth)&&void 0!==t?t:0),this.currentResizeTimeout=window.setTimeout((()=>{var e;n(null!==(e=this.lastResizeWidth)&&void 0!==e?e:0),this.currentResizeTimeout=void 0}),100)}};var n=Fh(t);this.id=cs(),this.iframeName="".concat("single-card","-").concat(this.id),this.paymentMessenger=new tl(this.context),this.tokenizeInProcess=!1,this.inputLabelsIncluded=!0===n.includeInputLabels,this.initializeMessageBus(),this.fieldState=new th([fr.CARD_NUMBER,fr.EXPIRATION_DATE,fr.CVV,fr.POSTAL_CODE],"US"),this.context.addLocaleChangedListener(this.updateCardDetailText),this.initialOptions=n,this.attach=this.withErrorHandling(this.attach.bind(this),"attach"),this.configure=this.withErrorHandling(this.configure.bind(this),"configure"),this.tokenize=this.withErrorHandling(this.tokenize.bind(this),"tokenize")}configure(){var e=arguments,t=this;return Yh((function*(){var n=e.length>0&&void 0!==e[0]?e[0]:{};t.throwIfDestroyedOrNotAttached();var r=Fh(n);t.metricsHandler.logConfigurationEvent("CONFIG_UPDATED",r),void 0!==r.includeInputLabels&&(t.inputLabelsIncluded=r.includeInputLabels,t.onResize()),void 0!==r.style&&Xh(r.style,t.id),yield t.paymentMessenger.request("configure",{includeInputLabels:t.inputLabelsIncluded,postalCode:r.postalCode,style:r.style,type:t.methodType})}))()}attach(e){var t=this;return Yh((function*(){t.throwIfDestroyedOrAlreadyAttached(),t.status=Es.ATTACHED,t.metricsHandler.logConfigurationEvent("CONFIGURED",t.initialOptions);try{var n=Sl(e);t.attachPromise=t.buildElementOnIframe(n),yield t.attachPromise,t.attachPromise=void 0,t.throwIfDestroyed(),t.element=n,window.addEventListener("resize",t.onResize),t.showCardElement(),t.onResize()}catch(e){throw t.status=Es.DETACHED,e}}))()}detach(){return this.throwIfDestroyed(),this.detachElement(Es.DETACHED,"DETACHED")}destroy(){var e=this;return Yh((function*(){if(e.status===Es.DESTROYED)return!1;var t=yield e.detachElement(Es.DESTROYED,"DESTROYED");return e.context.removeLocaleChangedListener(e.updateCardDetailText),t}))()}focus(e){var t=this;return Yh((function*(){if(t.throwIfDestroyedOrNotAttached(),!Object.values(fr).includes(e))throw new Zr(e);t.metricsHandler.logConfigurationEvent("FOCUSED",e);try{return yield t.paymentMessenger.request("setFocus",{field:e})}catch(e){t.errorLogger.captureException(e)}return!1}))()}clear(){var e=this;return Yh((function*(){e.throwIfDestroyedOrNotAttached(),e.metricsHandler.logConfigurationEvent("CLEAR");try{return yield e.paymentMessenger.request("clear")}catch(t){e.errorLogger.captureException(t)}return!1}))()}addEventListener(e,t){this.throwIfDestroyed(),this.metricsHandler.logConfigurationEvent("EVENT_LISTENER_ADDED",e),super.addEventListener(e,t)}removeEventListener(e,t){this.throwIfDestroyed(),super.removeEventListener(e,t)}tokenize(e,t){var n=this;return Yh((function*(){var r,i,o,a,s=n.context.getFeatureFlagValues().one_shot_authentication_eligibility;try{var c,l,u,d=function(e,t){if(t&&void 0!==e){!function(e){var t=[];if(!Fo(e))throw new bo([_o("verificationDetails","object")]);if("billingContact"in e&&"object"==typeof e.billingContact||t.push(_o("verificationDetails.billingContact","object")),"intent"in e&&"string"==typeof e.intent&&["CHARGE","CHARGE_AND_STORE","STORE"].includes(e.intent)||t.push(_o("verificationDetails.intent","string")),"customerInitiated"in e&&"boolean"==typeof e.customerInitiated||t.push(_o("verificationDetails.customerInitiated","boolean")),"sellerKeyedIn"in e&&"boolean"==typeof e.sellerKeyedIn||t.push(_o("verificationDetails.sellerKeyedIn","boolean")),t.length>0)throw new bo(t)}(e);var n=[];if(function(e){return"STORE"===e.intent}(e)?function(e,t){["amount","currencyCode","total"].forEach((n=>{n in e&&t.push({field:"verificationDetails.".concat(n),message:"The STORE intent does not support the ".concat(n," field."),type:"VALIDATION_ERROR"})}))}(e,n):function(e){return"total"in e}(e)?function(e,t){"object"!=typeof e.total?t.push(_o("verificationDetails.total","object")):"number"!=typeof e.total.amount?t.push(_o("verificationDetails.total.amount","number")):"string"!=typeof e.total.currencyCode&&t.push(_o("verificationDetails.total.currencyCode","string"))}(e,n):function(e,t){"string"!=typeof e.amount?t.push(_o("verificationDetails.amount","string")):qh.test(e.amount)||t.push({field:"verificationDetails.amount",message:"The amount needs to be a valid decimal monetary value.",type:"VALIDATION_ERROR"}),"string"!=typeof e.currencyCode&&t.push(_o("verificationDetails.currencyCode","string"))}(e,n),n.length>0)throw new bo(n);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uh(Object(n),!0).forEach((function(t){Bh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e)}}(e,s),h=function(e){if(void 0!==e){if("string"!=typeof e)throw new bo([_o("cofToken","string")]);return e.trim().length>0?e:void 0}}(t);if(void 0===h&&n.throwIfDestroyedOrNotAttached(),n.tokenizeInProcess)throw new _i([js]);if(n.metricsHandler.logConfigurationEvent("TOKENIZE_CONFIGURED",{cofToken:h,verificationDetails:d}),void 0!==h?(l=h,u=Wh(h)):(n.tokenizeInProcess=!0,c=yield n.paymentMessenger.request("requestCardNonceIfValidForm",{type:n.methodType}),n.tokenizeInProcess=!1,n.context.setPaymentMethodTrackingId(c.paymentMethodTrackingId),i=(r=c).card,o=r.billingContact,a=r.cardNonce,l=(u={details:{billing:o,card:i,method:Nr.CARD},status:xr,token:a}).token),s&&void 0!==d){var p;(function(e,t,n){if(!e)return!1;if(void 0===n)return!1;var r=t.billingContact.postalCode;return(null==r?void 0:r.toLowerCase())!==n.toLowerCase()})(n.context.getFeatureFlagValues().can_override_postal_code,d,null===(p=u.details)||void 0===p||null===(p=p.billing)||void 0===p?void 0:p.postalCode)&&(d.billingContact={postalCode:u.details.billing.postalCode},n.metricsHandler.logEvent("OSA_VERIFICATION:POSTAL_CODE_OVERRIDE"));var f=yield Mh(n.context,d,l);void 0!==h&&(u=Wh(h,f.token))}return u}catch(e){if(e instanceof bo)return{errors:e.errors,status:Lr};throw e}finally{n.tokenizeInProcess=!1}}))()}recalculateSize(){this.throwIfDestroyedOrNotAttached(),this.metricsHandler.logConfigurationEvent("RECALCULATED_SIZE"),this.onResize()}setError(e){var t=this;return Yh((function*(){if(t.throwIfDestroyedOrNotAttached(),!Object.values(fr).includes(e))throw new Zr(e);t.metricsHandler.logConfigurationEvent("SET_ERROR",e);try{return yield t.paymentMessenger.request("setError",{field:e})}catch(e){t.errorLogger.captureException(e)}return!1}))()}buildElementOnIframe(e){var t=this;return Yh((function*(){var n=Dl(dr.SINGLE_CARD_WRAPPER_STYLES,"sq-single-card-styles",document.head);yield t.buildCardElement(e),yield t.paymentMessenger.request("loadCardsForm",{configuration:Gh(Gh({},t.initialOptions),{},{type:t.methodType}),iframeName:t.iframeName}),yield n}))()}addErrorMessage(e){this.fieldState.setErrorOnField(e),this.updateCardDetailText()}removeErrorMessage(e){this.fieldState.removeErrorFromField(e),this.updateCardDetailText()}addFocusMessage(e){this.fieldState.setFocusOnField(e),this.updateCardDetailText()}removeFocusMessage(e){this.fieldState.removeFocusFromField(e),setTimeout((()=>{this.fieldState.hasFocus()||this.updateCardDetailText()}),50)}removeFocusClass(){setTimeout((()=>{var e;this.fieldState.hasFocus()||null===(e=this.wrapperElement)||void 0===e||e.classList.remove(Ol)}),50)}removeErrorClass(){var e;this.fieldState.hasError()||null===(e=this.wrapperElement)||void 0===e||e.classList.remove(Al)}handleInputEvent(e){var t=e.data.payload.body;switch(t.eventType){case pr.ERROR_CLASS_ADDED:var n;this.addErrorMessage(t.field),null===(n=this.wrapperElement)||void 0===n||n.classList.add(Al);break;case pr.ERROR_CLASS_REMOVED:this.removeErrorMessage(t.field),this.removeErrorClass();break;case pr.FOCUS_CLASS_ADDED:var r;this.addFocusMessage(t.field),null===(r=this.wrapperElement)||void 0===r||r.classList.add(Ol);break;case pr.FOCUS_CLASS_REMOVED:this.removeFocusMessage(t.field),this.removeFocusClass()}super.dispatchEvent(t.eventType,t)}handleSetPostalCountry(e){var t=e.data;this.fieldState.setPostalCountry(t.payload.body.postalCountry)}handleBankIdentificationNumberChanged(e){this.processBankIdentificationNumberChange(e).catch((e=>{this.errorLogger.captureException(e)}))}processBankIdentificationNumberChange(e){var t=this;return Yh((function*(){var n=e.data;if(t.context.getFeatureFlagValues().eager_three_ds_method_execution_eligibility){var r=n.payload.body.bankIdentificationNumber,i=yield t.paymentMessenger.request("REQUEST_THREE_DS_METHOD_INITIALIZATION",{applicationId:t.context.getSession().applicationId,bin:r,locationId:t.context.getSession().locationId});"string"==typeof i.three_ds_server_transaction_id&&""!==i.three_ds_server_transaction_id.trim()&&"string"==typeof i.three_ds_method_url&&""!==i.three_ds_method_url.trim()&&"string"==typeof i.three_ds_method_notification_url&&""!==i.three_ds_method_notification_url.trim()&&t.context.analyticsBackend.execute3DSMethod({threeDSServerTransId:i.three_ds_server_transaction_id,threeDsMethodNotificationUrl:i.three_ds_method_notification_url,threeDsMethodUrl:i.three_ds_method_url})}}))()}initializeMessageBus(){var e=this.handleInputEvent.bind(this),t=this.handleSetPostalCountry.bind(this),n={bankIdentificationNumberChanged:this.handleBankIdentificationNumberChanged.bind(this),cardBrandChanged:e,errorClassAdded:e,errorClassRemoved:e,escape:e,focusClassAdded:e,focusClassRemoved:e,postalCodeChanged:e,setPostalCountry:t,submit:e};this.paymentMessenger.initializeMessageBus(n)}buildCardIframe(e){return Jd({frameborder:"0",height:"0px",name:this.iframeName,scrolling:"no",src:dr.SINGLE_CARD_IFRAME,title:this.context.getLocaleString().paymentMethods.cards.formTitle,width:"100%"},e)}hideCardElement(){var e;null===(e=this.wrapperElement)||void 0===e||e.setAttribute("hidden","")}showCardElement(){var e;null===(e=this.wrapperElement)||void 0===e||e.removeAttribute("hidden")}buildCardElement(e){var t=this;return Yh((function*(){var n;t.wrapperElement=document.createElement("div"),t.wrapperElement.id=Kh(t.id),t.wrapperElement.classList.add(dh),t.context.getFeatureFlagValues().show_square_monochrome&&t.wrapperElement.classList.add(Nl),t.hideCardElement(),t.cardDetail=document.createElement("span"),t.cardDetail.classList.add(ph),e.appendChild(t.wrapperElement),t.iframeContainer=document.createElement("div"),t.iframeContainer.classList.add(uh),t.wrapperElement.appendChild(t.iframeContainer),t.iframe=yield t.buildCardIframe(t.iframeContainer),t.iframe.classList.add(hh),t.wrapperElement.appendChild(t.cardDetail),null!==(n=t.initialOptions)&&void 0!==n&&n.style&&Xh(t.initialOptions.style,t.id)}))()}detachElement(e,t){var n=this;return Yh((function*(){var r=n.status;if(n.attachPromise)try{yield n.attachPromise}catch(e){}try{var i=yield n.paymentMessenger.request("destroy");return n.element&&(Zd(n.element),window.removeEventListener("resize",n.onResize)),n.status=e,n.metricsHandler.logConfigurationEvent(t),i}catch(e){throw n.status=r,e}}))()}};class Zh extends hr{constructor(){super("A grant was not returned from CashApp and is required for tokenization"),this.name="CashAppPayGrantIsUndefinedError",Object.setPrototypeOf(this,Zh.prototype)}}var Qh=["CUSTOMER_INTERACTION","CUSTOMER_DISMISSED","CUSTOMER_REQUEST_APPROVED","CUSTOMER_REQUEST_DECLINED","CUSTOMER_REQUEST_FAILED"],ep=ws(Is([{eligible:e=>Fo(e),schemaOperation:Ns({shape:ws(Ds({legalValues:fa})),size:ws(Ds({legalValues:pa})),theme:ws(Ds({legalValues:ma})),values:ws(Ds({legalValues:ma})),width:ws(Ds({legalValues:ga}))})},{eligible:e=>!1===e,schemaOperation:vs({legalValues:[!1]})}],{code:"invalid_value",expected:"options hash or false value",propertyPath:""}));function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function np(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tp(Object(n),!0).forEach((function(t){rp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rp(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ip(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function op(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ip(o,r,i,a,s,"next",e)}function s(e){ip(o,r,i,a,s,"throw",e)}a(void 0)}))}}var ap=new Set(["USD"]),sp="cash_app_pay_v1_element";class cp extends Ms{constructor(e,t,n,r,i){if(super(r),this.methodType=Nr.CASH_APP_PAY,this.wasFirstInteractionCalled=!1,this.isMobile=!1,this.payKit=e,this.req=t,this.req.addPaymentMethodUsage("Cash App Pay"),this.context=r,this.paymentRequestLockController=i,this.paymentMessenger=new tl(this.context),this.tokenizeValidator=function(){return Promise.resolve(!0)},this.clickEventHandler=()=>{this.beginAuthorizationFlow()},!go.isNonBlankString(this.session.locationId))throw new di(ts.INVALID_CONFIG,"locationId");if(!go.isNonBlankString(this.session.cashAppPayMerchantIdentifier))throw new di(ts.INVALID_CONFIG,"merchantId");if(!ap.has(this.req.currencyCode))throw new oi("".concat(this.req.currencyCode," is not supported by CashAppPay. Valid currencies are: ").concat([...ap].join(", ")));if(go.paymentRequestAmountToMoneyAmount(this.req.total.amount,this.req.currencyCode)<1)throw new oi("".concat(this.req.total.amount," is an invalid payment amount. Total amount should be greater than 0"));if(!n.redirectURL)throw new ai;for(var o of(this.cashAppPaymentRequestOptions=n,this.cashAppPayMerchantIdentifier=this.session.cashAppPayMerchantIdentifier,this.cashAppEventHandler={CUSTOMER_DISMISSED:()=>{this.dispatchEvent("customerDismissed",null)},CUSTOMER_INTERACTION:e=>{this.registerExternalEventStart(e)},CUSTOMER_REQUEST_APPROVED:e=>{this.customerRequestApprovedEvent(e)},CUSTOMER_REQUEST_DECLINED:()=>{this.customerRequestDeclinedEvent()},CUSTOMER_REQUEST_FAILED:()=>{this.customerRequestFailedEvent()}},Qh))this.payKit.addEventListener(o,this.cashAppEventHandler[o]);this.attach=this.withErrorHandling(this.attach.bind(this),"attach"),this.paymentRequestLockController.lock(this)}attach(e,t,n){var r=this;return op((function*(){var i;r.throwIfDestroyedOrAlreadyAttached();try{var o=!1===(i=function(e){var t=Ls(ep).validate(e);if(!t.isValid)throw t.issues.some((e=>"invalid_type"===e.code))?new ri(t.issues.map((e=>[e.propertyPath,e.expected]))):new ii(t.issues.map((e=>[e.propertyPath,e.expected])));var n,r=e;return!1===r||void 0===r||!("values"in r)||null!==(n=r.theme)&&void 0!==n||(r.theme=r.values),r}(t));if(n&&(r.tokenizeValidator=n),"function"!=typeof r.tokenizeValidator)throw new si;void 0===i||o||r.metricsHandler.logConfigurationEvent("CONFIGURED",t),r.status=Es.ATTACHED,r.element=o?Il(e):Sl(e);var a=document.createElement("div");a.id=sp,o?r.element.before(a):r.element.appendChild(a);var s="#".concat(sp);r.renderController=yield r.payKit.render(s,{button:i,manage:!1}),r.element.addEventListener("click",r.clickEventHandler)}catch(e){r.status=Es.DETACHED;var c=To(e);if("CashAppPayError"===c.name&&c.message.includes("already rendered"))throw new hi(Nr.CASH_APP_PAY);throw e}}))()}destroy(){return this.status===Es.DESTROYED?Promise.resolve(!1):(this.detachElement(Es.DESTROYED,"DESTROYED"),this.paymentRequestLockController.unlock(this),this.payKit.restart(),Qh.forEach((e=>{this.payKit.removeEventListener(e,this.cashAppEventHandler[e])})),Promise.resolve(!0))}detach(){return this.throwIfDestroyedOrNotAttached(),this.detachElement(Es.DETACHED,"DETACHED"),Promise.resolve(!0)}addEventListener(e,t){this.metricsHandler.logConfigurationEvent("EVENT_LISTENER_ADDED",e),super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}initializeCustomerRequest(){var e=this;return op((function*(){var t=np({actions:{payment:{amount:{currency:e.req.currencyCode,value:go.paymentRequestAmountToMoneyAmount(e.req.total.amount,e.req.currencyCode)},scopeId:e.cashAppPayMerchantIdentifier}}},e.cashAppPaymentRequestOptions);try{yield e.payKit.customerRequest(t)}catch(e){var n=e.name,r=e.message;if("CashAppPayError"===n&&"redirectURL must be a valid URL"===r)throw new oi(r);throw e}}))()}customerRequestApprovedEvent(e){var t=this;return op((function*(){var n=yield t.createNonce(e);t.dispatchEvent("ontokenization",{tokenResult:n})}))()}customerRequestDeclinedEvent(){var e={status:Dr};this.metricsHandler.logEvent("EXTERNAL_SESSION:CANCEL"),this.dispatchEvent("ontokenization",{tokenResult:e})}customerRequestFailedEvent(){var e={errors:[new Ci("tokenizing Cash App Pay")],status:Rr};this.metricsHandler.logEvent("EXTERNAL_SESSION:ERROR"),this.dispatchEvent("ontokenization",{tokenResult:e})}createNonce(e){var t=this;return op((function*(){var n=e.customerProfile.cashtag,r=e.grants,i=e.referenceId,o=r.payment,a=t.req,s=a.total.amount,c=a.currencyCode;try{if(!o)throw new Zh;var l=yield t.paymentMessenger.request("REQUEST_CASH_APP_PAY_INSTANT_WALLET_TOKEN",{applicationId:t.session.applicationId,cashAppPayData:{cashtag:n,grantId:o.grantId,isMobile:t.isMobile,referenceId:i,totalAmount:{amount:s,currency:c}},clientID:t.session.applicationId,instanceID:t.session.instanceId,locationID:t.session.locationId,paymentMethodTrackingID:t.context.getPaymentMethodTrackingId(),requestBillingContact:t.req.requestBillingContact,requestShippingContact:t.req.requestShippingContact,sessionID:t.session.sessionId,websdkVersion:dr.VERSION});return t.metricsHandler.logEvent("EXTERNAL_SESSION:OK"),{details:{cashAppPay:{cashtag:n,referenceId:i},method:Nr.CASH_APP_PAY},status:xr,token:l.token}}catch(e){var u;return t.metricsHandler.logEvent("EXTERNAL_SESSION:ERROR"),e instanceof _i?u=e:(t.errorLogger.captureException(e),u=new Ci("tokenizing CashAppPay")),{errors:[u],status:Rr}}}))()}beginAuthorizationFlow(){var e=this;return op((function*(){if(e.throwIfDestroyedOrNotAttached(),!e.renderController)throw new Ci("Could not begin Cash App Pay authorization flow");e.metricsHandler.logEvent("CASH_APP_PAY_CLICK:VALIDATING");try{(yield e.tokenizeValidator())?(e.renderController.begin(),e.metricsHandler.logEvent("CASH_APP_PAY_AUTH:START")):e.metricsHandler.logEvent("CASH_APP_PAY_CLICK:INVALID")}catch(t){throw e.metricsHandler.logEvent("CASH_APP_PAY_CLICK:ERROR"),t}}))()}registerExternalEventStart(e){this.metricsHandler.logEvent("EXTERNAL_SESSION:START"),this.wasFirstInteractionCalled||(this.wasFirstInteractionCalled=!0,this.metricsHandler.logEvent("FIRST_INTERACTION:OK")),this.isMobile=e.isMobile,this.dispatchEvent("customerInteraction",np({},e))}detachElement(e,t){this.renderController&&this.renderController.destroy();var n=document.getElementById(sp);n&&n.remove(),this.element&&this.element.removeEventListener("click",this.clickEventHandler),this.status=e,this.metricsHandler.logConfigurationEvent(t)}}function lp(){return(lp=op((function*(){var e="https://kit.cashstaging.app/v1/pay.js",t="SQ_SELLER";return"sandbox"===dr.env?(e="https://sandbox.kit.cash.app/v1/pay.js",t="CAS-CI_SQ_SELLER_SANDBOX"):"production"===dr.env&&(e="https://kit.cash.app/v1/pay.js",t="CA-CI_SQ_SELLER"),(yield $s.load("cash-app-pay",{src:e},"CashApp")).pay({clientId:t})}))).apply(this,arguments)}var up={initialize:function(){return lp.apply(this,arguments)}};function dp(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function hp(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){dp(o,r,i,a,s,"next",e)}function s(e){dp(o,r,i,a,s,"throw",e)}a(void 0)}))}}function pp(){return(pp=hp((function*(e,t){var n="production"===dr.env?"https://src.mastercard.com/srci/integration/2/lib.js":"https://sandbox.src.mastercard.com/srci/integration/2/lib.js",r=go.buildUrl(n,{locale:e,srcDpaId:t});return new(yield $s.load("mastercard-ctp",{src:r},"Click2Pay"))}))).apply(this,arguments)}var fp="https://src.mastercard.com/srci/integration/components/src-ui-kit/src-ui-kit.css",mp="sq-mastercard-ui-styles";function gp(){return(gp=hp((function*(){var e,t=document.querySelector('link[href="'.concat(fp,'"]'));null!==t?(t.id||(t.id=mp),e=Promise.resolve()):e=Dl(fp,mp,document.head),yield Promise.all([$s.load("mastercard-ui",{src:"https://src.mastercard.com/srci/integration/components/src-ui-kit/src-ui-kit.esm.js",type:"module"}),e])}))).apply(this,arguments)}var vp={attachUiScripts:function(){return gp.apply(this,arguments)},initialize:function(e,t){return pp.apply(this,arguments)}},yp=Ns({includeInputLabels:ws(vs()),style:ws(Ns())});function Ep(e){var t=Ls(yp),n=t.validate(e);if(n.isValid)return t.sanitize(e);throw wc(n.issues,"giftCard() configuration options")}function bp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bp(Object(n),!0).forEach((function(t){Cp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cp(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sp(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Ip(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Sp(o,r,i,a,s,"next",e)}function s(e){Sp(o,r,i,a,s,"throw",e)}a(void 0)}))}}class wp extends Ms{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e),this.methodType=Nr.GIFT_CARD,this.onResize=e=>{if(this.iframe&&this.wrapperElement&&this.iframeContainer&&void 0===this.currentResizeTimeout){var t=()=>{if(this.wrapperElement&&this.iframe&&this.iframeContainer){var e=this.inputLabelsIncluded?62:48;e+=2,this.iframe.style.height="".concat(e,"px"),this.iframeContainer.style.height="".concat(Math.round(e),"px")}};t(),this.currentResizeTimeout=window.setTimeout((()=>{t(),this.currentResizeTimeout=void 0}),100)}};var n=Ep(t);this.id=cs(),this.iframeName="".concat("gift-card","-").concat(this.id),this.paymentMessenger=new tl(this.context),this.tokenizeInProcess=!1,this.inputLabelsIncluded=Boolean(n.includeInputLabels),this.initializeMessageBus(),this.initialOptions=n,this.fieldState=new th([gr.GIFT_CARD_NUMBER]),this.attach=this.withErrorHandling(this.attach.bind(this),"attach"),this.configure=this.withErrorHandling(this.configure.bind(this),"configure"),this.tokenize=this.withErrorHandling(this.tokenize.bind(this),"tokenize")}attach(e){var t=this;return Ip((function*(){t.throwIfDestroyedOrAlreadyAttached(),t.status=Es.ATTACHED,t.metricsHandler.logConfigurationEvent("CONFIGURED",t.initialOptions);try{var n=Sl(e);t.attachPromise=t.buildElementOnIframe(n),yield t.attachPromise,t.attachPromise=void 0,t.throwIfDestroyed(),t.element=n,window.addEventListener("resize",t.onResize),t.showCardElement(),t.onResize()}catch(e){throw t.status=Es.DETACHED,e}}))()}detach(){return this.throwIfDestroyed(),this.detachElement(Es.DETACHED,"DETACHED")}destroy(){return this.status===Es.DESTROYED?Promise.resolve(!1):this.detachElement(Es.DESTROYED,"DESTROYED")}configure(e){var t=this;return Ip((function*(){t.throwIfDestroyedOrNotAttached();var n=Ep(e);void 0!==n.includeInputLabels&&(t.inputLabelsIncluded=n.includeInputLabels,t.onResize()),void 0!==n.style&&Ap(n.style,t.id),t.metricsHandler.logConfigurationEvent("CONFIG_UPDATED",n),yield t.paymentMessenger.request("giftCardConfigure",{includeInputLabels:t.inputLabelsIncluded,style:n.style,type:t.methodType})}))()}focus(e){var t=this;return Ip((function*(){if(t.throwIfDestroyedOrNotAttached(),!Object.values(gr).includes(e))throw new Zr(e);t.metricsHandler.logConfigurationEvent("FOCUSED",e);try{return yield t.paymentMessenger.request("giftCardSetFocus",{field:e})}catch(e){t.errorLogger.captureException(e)}return!1}))()}clear(){var e=this;return Ip((function*(){e.throwIfDestroyedOrNotAttached();try{return yield e.paymentMessenger.request("giftCardClear")}catch(t){e.errorLogger.captureException(t)}return e.metricsHandler.logConfigurationEvent("CLEAR"),!1}))()}addEventListener(e,t){this.throwIfDestroyed(),this.metricsHandler.logConfigurationEvent("EVENT_LISTENER_ADDED",e),super.addEventListener(e,t)}removeEventListener(e,t){this.throwIfDestroyed(),super.removeEventListener(e,t)}tokenize(){var e=this;return Ip((function*(){if(e.throwIfDestroyedOrNotAttached(),e.tokenizeInProcess)throw new _i([js]);e.tokenizeInProcess=!0;try{var t=yield e.paymentMessenger.request("giftCardRequestCardNonceIfValidForm",{type:e.methodType});return e.tokenizeInProcess=!1,e.context.setPaymentMethodTrackingId(t.paymentMethodTrackingId),r=(n=t).card,i=n.cardNonce,{details:{giftCard:r,method:Nr.GIFT_CARD},status:xr,token:i}}catch(e){if(e instanceof bo)return{errors:e.errors,status:Lr};throw e}finally{e.tokenizeInProcess=!1}var n,r,i}))()}setError(e){var t=this;return Ip((function*(){if(t.throwIfDestroyedOrNotAttached(),!Object.values(gr).includes(e))throw new Zr(e);t.metricsHandler.logConfigurationEvent("SET_ERROR",e);try{return yield t.paymentMessenger.request("giftCardSetError",{field:e})}catch(e){t.errorLogger.captureException(e)}return!1}))()}buildElementOnIframe(e){var t=this;return Ip((function*(){var n=Dl(dr.SINGLE_CARD_WRAPPER_STYLES,"sq-single-card-styles",document.head);yield t.buildCardElement(e),yield t.paymentMessenger.request("loadGiftCardsForm",{configuration:_p(_p({},t.initialOptions),{},{type:t.methodType}),iframeName:t.iframeName}),yield n}))()}buildCardElement(e){var t=this;return Ip((function*(){var n;t.wrapperElement=document.createElement("div"),t.wrapperElement.id=Op(t.id),t.wrapperElement.classList.add(dh),t.hideCardElement(),t.cardDetail=document.createElement("span"),t.cardDetail.classList.add(ph),e.appendChild(t.wrapperElement),t.context.getFeatureFlagValues().show_square_monochrome&&t.wrapperElement.classList.add(Nl),t.iframeContainer=document.createElement("div"),t.iframeContainer.classList.add(uh),t.wrapperElement.appendChild(t.iframeContainer),t.iframe=yield t.buildCardIframe(t.iframeContainer),t.iframe.classList.add(hh),t.wrapperElement.appendChild(t.cardDetail),null!==(n=t.initialOptions)&&void 0!==n&&n.style&&Ap(t.initialOptions.style,t.id)}))()}buildCardIframe(e){return Jd({frameborder:"0",height:"0px",name:this.iframeName,scrolling:"no",src:dr.GIFT_CARD_IFRAME,title:this.context.getLocaleString().paymentMethods.giftCards.formTitle,width:"100%"},e)}hideCardElement(){var e;null===(e=this.wrapperElement)||void 0===e||e.setAttribute("hidden","")}showCardElement(){var e;null===(e=this.wrapperElement)||void 0===e||e.removeAttribute("hidden")}updateCardDetailText(){if(this.cardDetail){var e=this.fieldState.fieldHelperMessage(this.context.getLocaleString()),t=e.message,n=e.isError;this.cardDetail.classList.toggle(fh,n),this.cardDetail.classList.toggle(mh,!n),this.cardDetail.textContent!==t&&(this.cardDetail.textContent=t),this.cardDetail.classList.toggle(gh,t.length>0)}}addErrorMessage(e){this.fieldState.setErrorOnField(e),this.updateCardDetailText()}removeErrorMessage(e){this.fieldState.removeErrorFromField(e),this.updateCardDetailText()}addFocusMessage(e){this.fieldState.setFocusOnField(e),this.updateCardDetailText()}removeFocusMessage(e){this.fieldState.removeFocusFromField(e),setTimeout((()=>{this.fieldState.hasFocus()||this.updateCardDetailText()}),50)}handleInputEvent(e){var t=e.data.payload.body;switch(t.eventType){case vr.ERROR_CLASS_ADDED:var n;this.addErrorMessage(t.field),null===(n=this.wrapperElement)||void 0===n||n.classList.add(Al);break;case vr.ERROR_CLASS_REMOVED:this.removeErrorMessage(t.field),this.removeErrorClass();break;case vr.FOCUS_CLASS_ADDED:var r;this.addFocusMessage(t.field),null===(r=this.wrapperElement)||void 0===r||r.classList.add(Ol);break;case vr.FOCUS_CLASS_REMOVED:this.removeFocusMessage(t.field),this.removeFocusClass()}super.dispatchEvent(t.eventType,t)}removeFocusClass(){setTimeout((()=>{var e;this.fieldState.hasFocus()||null===(e=this.wrapperElement)||void 0===e||e.classList.remove(Ol)}),50)}removeErrorClass(){var e;this.fieldState.hasError()||null===(e=this.wrapperElement)||void 0===e||e.classList.remove(Al)}initializeMessageBus(){var e=this.handleInputEvent.bind(this),t={cardBrandChanged:e,errorClassAdded:e,errorClassRemoved:e,escape:e,focusClassAdded:e,focusClassRemoved:e,submit:e};this.paymentMessenger.initializeMessageBus(t)}detachElement(e,t){var n=this;return Ip((function*(){var r=n.status;if(n.attachPromise)try{yield n.attachPromise}catch(e){}try{var i=yield n.paymentMessenger.request("giftCardDestroy");return n.element&&(Zd(n.element),window.removeEventListener("resize",n.onResize)),n.status=e,n.metricsHandler.logConfigurationEvent(t),i}catch(e){throw n.status=r,e}}))()}}function Op(e){return"".concat("gift-card-wrapper","-").concat(e)}function Ap(e,t){var n=function(e){return"".concat("sq-gift-card-custom-styles","-").concat(e)}(t),r=document.getElementById(n);null===r&&((r=document.createElement("style")).id=n,document.head.appendChild(r)),r.innerHTML=Dh(e,Op(t))}class Tp extends hr{constructor(e){super("The event listener for ".concat(e," timed out (30 seconds). If you've returned a promise, ensure it is resolving")),this.name="EventListenerTimeoutError",Object.setPrototypeOf(this,Tp.prototype)}}function Pp(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}class Np{constructor(){this.listenerRegistry=new as}addEventListener(e,t){this.listenerRegistry.addEventListener(e,t)}removeEventListener(e,t){this.listenerRegistry.removeEventListener(e,t)}dispatchEvent(e,t,n){var r,i=this;return(r=function*(){var r=new qi(e,t),o=i.listenerRegistry.listenersForType(e),a=function*(){var t,i;try{t=s(r)}catch(t){throw new Xr(e,Po(t))}if(t instanceof Promise)try{i=yield er((()=>t),3e4,new Tp(e))}catch(t){if(t instanceof Tp)throw t;throw new Xr(e,Po(t))}else i=t;n&&n(i)};for(var s of o)yield*a()},function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){Pp(o,n,i,a,s,"next",e)}function s(e){Pp(o,n,i,a,s,"throw",e)}a(void 0)}))})()}hasEventListener(e){return this.listenerRegistry.hasEventListener(e)}}function Dp(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Rp(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Dp(o,r,i,a,s,"next",e)}function s(e){Dp(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Lp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kp(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Mp{constructor(e,t,n){this.eventTarget=new Np,this.metricsBuffer=[],zl(e),this.localeStrings=t,this._requestBillingContact=Boolean(e.requestBillingContact),this._requestShippingContact=Boolean(e.requestShippingContact),this._countryCode=e.countryCode,this._currencyCode=e.currencyCode,this._lineItems=e.lineItems,this._shippingLineItems=e.shippingLineItems,this._taxLineItems=e.taxLineItems,this._discounts=e.discounts,this._total=e.total,this._shippingOptions=e.shippingOptions,this._shippingContact=e.shippingContact,this._pickupContact=e.pickupContact,this.updateLock=n,this.paymentMethodUsages=[]}get requestBillingContact(){return this._requestBillingContact}get requestShippingContact(){return this._requestShippingContact}get countryCode(){return this._countryCode}get currencyCode(){return this._currencyCode}get lineItems(){return this._lineItems}get pickupContact(){return this._pickupContact}get shippingLineItems(){return this._shippingLineItems}get taxLineItems(){return this._taxLineItems}get discounts(){return this._discounts}get total(){return this._total}get shippingOptions(){return this._shippingOptions}get shippingContact(){return this._shippingContact}addPaymentMethodUsage(e){this.paymentMethodUsages.push(e),"Google Pay"===e&&(this.total.amount=go.sanitizePaymentRequestAmount(this.total.amount,this.currencyCode))}update(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xp(Object(n),!0).forEach((function(t){kp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({countryCode:this.countryCode,currencyCode:this.currencyCode,discounts:this.discounts,lineItems:this.lineItems,pickupContact:this.pickupContact,requestBillingContact:this.requestBillingContact,requestShippingContact:this.requestShippingContact,shippingContact:this.shippingContact,shippingLineItems:this.shippingLineItems,shippingOptions:this.shippingOptions,taxLineItems:this.taxLineItems,total:this.total},e);if(this.updateLock.isLocked)return!1;zl(t),e.total&&(void 0!==this.metricsHandler&&Vl(t.total,t.currencyCode,this.metricsHandler,"update"),this._total=e.total,this.paymentMethodUsages.includes("Google Pay")&&(this._total.amount=go.sanitizePaymentRequestAmount(t.total.amount,t.currencyCode),t.total=this._total));var n=new Mp(t,this.localeStrings,this.updateLock);if(this.paymentMethodUsages.includes("AfterpayClearpay"))try{yu(n)}catch(e){var r;null===(r=this.metricsHandler)||void 0===r||r.logValidationEvent("REQUEST_AFTERPAY_INVALID",{exceptionMessage:Po(e),paymentMethodUsages:this.paymentMethodUsages})}return void 0!==e.requestBillingContact&&(this._requestBillingContact=Boolean(e.requestBillingContact)),void 0!==e.requestShippingContact&&(this._requestShippingContact=Boolean(e.requestShippingContact)),void 0!==e.countryCode&&(this._countryCode=e.countryCode),void 0!==e.currencyCode&&(this._currencyCode=e.currencyCode),e.lineItems&&(this._lineItems=e.lineItems),e.shippingLineItems&&(this._shippingLineItems=e.shippingLineItems),e.taxLineItems&&(this._taxLineItems=e.taxLineItems),e.discounts&&(this._discounts=e.discounts),e.pickupContact&&(this._pickupContact=e.pickupContact),e.shippingOptions&&(this._shippingOptions=e.shippingOptions),e.shippingContact&&(this._shippingContact=e.shippingContact),this.eventTarget.dispatchEvent(Ll.UPDATE,n),this.logMetrics("CONFIG_UPDATED",t),!0}addEventListener(e,t){switch(go.enumValues(Tr).includes(e)&&this.logMetrics("EVENT_LISTENER_ADDED",e),e){case Tr.SHIPPING_CONTACT_CHANGED:this.shippingContactEventListener(t);break;case Tr.SHIPPING_OPTION_CHANGED:this.shippingOptionEventListener(t);break;case Ll.UPDATE:this.updateEventListener(t);break;case Pr.AFTERPAY_SHIPPING_ADDRESS_CHANGED:this.afterpayShippingContactEventListener(t);break;case Pr.AFTERPAY_SHIPPING_OPTION_CHANGED:this.afterpayShippingOptionEventListener(t);break;default:throw new is("PaymentRequest.addEventListener","event","PaymentRequestEvent")}}dispatchEvent(e,t,n){return this.eventTarget.dispatchEvent(e,t,(r=>{if(e===Pr.AFTERPAY_SHIPPING_ADDRESS_CHANGED)return function(e){var t=Ls(eu).validate(e,"paymentRequestUpdate");if(!t.isValid)throw new Kr(t.issues.map((e=>[e.propertyPath,e.expected])))}(r),void n(r);if(e!==Pr.AFTERPAY_SHIPPING_OPTION_CHANGED)!function(e){var t=Ls(Hl).validate(e,"paymentRequestUpdate");if(!t.isValid)throw new Kr(t.issues.map((e=>[e.propertyPath,e.expected])))}(r),n(r);else try{this.logMetrics("SHIPPING_OPTION_UPDATE_RECEIVED",r),function(e){var t=Ls(tu).validate(e,"paymentRequestUpdate");if(!t.isValid)throw new Kr(t.issues.map((e=>[e.propertyPath,e.expected])))}(r),n(r)}catch(e){if("requireValidation"in t&&!0===t.requireValidation||!(e instanceof Kr))throw e}}))}hasEventListener(e){return this.eventTarget.hasEventListener(e)}setMetricsHandler(e){this.metricsHandler=e,this.metricsBuffer.length>0&&(this.metricsBuffer.forEach((t=>{var n,r,i=(r=2,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(n,r)||function(e,t){if(e){if("string"==typeof e)return Lp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lp(e,t):void 0}}(n,r)||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=i[0],a=i[1];e.logConfigurationEvent(o,a)})),this.metricsBuffer=[])}shippingContactEventListener(e){var t=this;this.eventTarget.addEventListener(Tr.SHIPPING_CONTACT_CHANGED,function(){var n=Rp((function*(n){var r=n.detail.contactOrOption;try{return yield e(r)}catch(e){return console.error("ShippingContactUpdateError",e),{error:t.localeStrings.getLocaleString().paymentMethods.wallets.callbackErrors.contactError}}}));return function(e){return n.apply(this,arguments)}}())}shippingOptionEventListener(e){var t=this;this.eventTarget.addEventListener(Tr.SHIPPING_OPTION_CHANGED,function(){var n=Rp((function*(n){var r=n.detail.contactOrOption;try{return yield e(r)}catch(e){return console.error("ShippingOptionUpdateError",e),{error:t.localeStrings.getLocaleString().paymentMethods.wallets.callbackErrors.optionsError}}}));return function(e){return n.apply(this,arguments)}}())}afterpayShippingContactEventListener(e){var t=this;this.eventTarget.addEventListener(Pr.AFTERPAY_SHIPPING_ADDRESS_CHANGED,function(){var n=Rp((function*(n){var r=n.detail.contactOrOption;try{return yield e(r)}catch(e){return{error:t.localeStrings.getLocaleString().paymentMethods.wallets.callbackErrors.optionsError}}}));return function(e){return n.apply(this,arguments)}}())}afterpayShippingOptionEventListener(e){var t=this;this.eventTarget.addEventListener(Pr.AFTERPAY_SHIPPING_OPTION_CHANGED,function(){var n=Rp((function*(n){var r=n.detail.contactOrOption;try{return yield e(r)}catch(e){return{error:t.localeStrings.getLocaleString().paymentMethods.wallets.callbackErrors.optionsError}}}));return function(e){return n.apply(this,arguments)}}())}updateEventListener(e){this.eventTarget.addEventListener(Ll.UPDATE,(t=>{e(t.detail)}))}logMetrics(e,t){this.metricsHandler?this.metricsHandler.logConfigurationEvent(e,t):this.metricsBuffer.push([e,t])}}function jp(e){return Boolean(e.shippingOptions&&e.shippingOptions.length>0)}function Up(e,t){return new Intl.NumberFormat(a.windowNavigatorLanguages,{currency:t,style:"currency"}).format(Number.parseFloat(e))}function Bp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qp(Object(n),!0).forEach((function(t){Fp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fp(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vp=["PAN_ONLY","CRYPTOGRAM_3DS"],Gp=["AMEX","DISCOVER","JCB","MASTERCARD","VISA"];function zp(e){return{label:e.label,price:e.amount,status:!0===e.pending?"ESTIMATED":"FINAL",type:"LINE_ITEM"}}function $p(e,t){var n=null!=t?t:e;return n?n.map((e=>zp(e))):[]}function Yp(e,t){return t.map((t=>function(e,t){return{description:Up(t.amount,e),id:t.id,label:t.label}}(e,t)))}function Wp(e,t,n,r){var i=null!=r?r:n;if(i&&i.length>0){var o={shippingOptions:Yp(e,i)},a=i.some((e=>e.id===t));return a&&(o.defaultSelectedOptionId=t),o}}function Kp(e,t){return null==t?void 0:t.find((t=>t.id===e))}function Xp(e,t,n,r,i,o){var a=t.countryCode,s=t.currencyCode,c=t.total,l=t.lineItems,u=t.taxLineItems,d=t.discounts,h=t.requestBillingContact,p=t.requestShippingContact,f=t.shippingOptions,m=jp(t),g=Boolean(p||m),v=Hp(Hp({},e),{},{emailRequired:Boolean(h),merchantInfo:i,shippingAddressRequired:g,shippingOptionRequired:m,transactionInfo:{countryCode:a,currencyCode:s,totalPrice:c.amount,totalPriceLabel:c.label,totalPriceStatus:r}});if(l&&l.length>0&&(v.transactionInfo.displayItems=$p([],Fl({discounts:d,lineItems:l,taxLineItems:u},t))),g&&(v.shippingAddressParameters={phoneNumberRequired:!0}),m){var y=Wp(s,o,[],f);y&&(v.shippingOptionParameters=y)}return n.length>0&&(v.callbackIntents=n),v}function Jp(e,t){var n=[];return void 0!==e.error&&n.push({intent:t,message:e.error,reason:xi.SHIPPING_ADDRESS_UNSERVICEABLE}),e.shippingErrors&&Object.entries(e.shippingErrors).forEach((e=>{var r,i,o=(i=2,function(e){if(Array.isArray(e))return e}(r=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(r,i)||function(e,t){if(e){if("string"==typeof e)return Bp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bp(e,t):void 0}}(r,i)||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.")}()),a=o[0],s=o[1];n.push({intent:t,message:"".concat(a,": ").concat(s),reason:xi.SHIPPING_ADDRESS_INVALID})})),n}function Zp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zp(Object(n),!0).forEach((function(t){ef(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ef(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tf(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function nf(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){tf(o,r,i,a,s,"next",e)}function s(e){tf(o,r,i,a,s,"throw",e)}a(void 0)}))}}var rf=["#google"];class of extends Ms{constructor(e,t,n,r,i){var o;super(n),this.methodType=Nr.GOOGLE_PAY,this.shippingOptions=void 0,this.wasFirstInteractionCalled=!1,this.validateConfiguration(),this.logDebugInfoIfEnabled("init"),this.paymentRequestLockController=i,this.req=t,this.req.addPaymentMethodUsage("Google Pay"),this.merchantInfo=r,this.element=null,this.isReadyToPayChecked=!1,this.paymentMethodMessenger=new tl(n),jp(this.req)&&(this.shippingOptions=this.req.shippingOptions,this.selectedShippingOptionId=null===(o=this.req.shippingOptions)||void 0===o?void 0:o[0].id),this.callbackIntents=function(e,t){var n=[],r=jp(e)&&t.includes(Tr.SHIPPING_OPTION_CHANGED),i=e.requestShippingContact&&t.includes(Tr.SHIPPING_CONTACT_CHANGED);return r?n.push("SHIPPING_ADDRESS","SHIPPING_OPTION"):i&&n.push("SHIPPING_ADDRESS"),(!a.isAndroid()||r||i)&&n.push("PAYMENT_AUTHORIZATION"),n}(this.req,this.handlers);var s,c,l,u,d=function(e,t,n){var r="TEST";"production"===dr.env&&(r="PRODUCTION");var i={environment:r,merchantInfo:n},o=e.includes("SHIPPING_OPTION")||e.includes("SHIPPING_ADDRESS");if(!a.isAndroid()||o){var s={onPaymentAuthorized:()=>({transactionState:"SUCCESS"})};o&&(s.onPaymentDataChanged=t),i.paymentDataCallbacks=s}return i}(this.callbackIntents,this.onPaymentDataChanged.bind(this),this.merchantInfo);this.googlePayClient=new e.api.PaymentsClient(d),this.isReadyToPayRequest=(s=this.session.applicationId,c=this.req.requestBillingContact,l=this.context.getFeatureFlagValues().can_use_interac,u=[...Gp],l&&u.push("INTERAC"),{allowedPaymentMethods:[{parameters:{allowedAuthMethods:Vp,allowedCardNetworks:u,billingAddressParameters:{format:c?"FULL":"MIN",phoneNumberRequired:Boolean(c)},billingAddressRequired:!0},tokenizationSpecification:{parameters:{gateway:"square",gatewayMerchantId:s},type:"PAYMENT_GATEWAY"},type:"CARD"}],apiVersion:2,apiVersionMinor:0}),this.attach=this.withErrorHandling(this.attach.bind(this),"attach"),this.tokenize=this.withErrorHandling(this.tokenize.bind(this),"tokenize")}get handlers(){var e=[];return this.req.hasEventListener(Tr.SHIPPING_OPTION_CHANGED)&&e.push(Tr.SHIPPING_OPTION_CHANGED),this.req.hasEventListener(Tr.SHIPPING_CONTACT_CHANGED)&&e.push(Tr.SHIPPING_CONTACT_CHANGED),e}attach(e,t){var n=this;return nf((function*(){n.throwIfDestroyedOrAlreadyAttached(),n.status=Es.ATTACHED,n.metricsHandler.logConfigurationEvent("CONFIGURED",t);try{n.element=Il(e),yield n.checkIfReadyToPay(),n.isReadyToPayChecked=!0;var r=null!=t?t:{},i=r.buttonColor,o=r.buttonSizeMode,a=r.buttonType,s=r.buttonBorderType,c=r.buttonRadius,l=n.context.getFeatureFlagValues().show_square_monochrome,u=l?20:void 0,d={buttonBorderType:null!=s?s:l?"no_border":"default_border",buttonColor:null!=i?i:Di.DEFAULT,buttonRadius:null!=c?c:u,buttonSizeMode:null!=o?o:Ri.STATIC,buttonType:null!=a?a:Li.LONG,onClick:()=>{}},h=n.googlePayClient.createButton(d);n.element.appendChild(h)}catch(e){throw n.status=Es.DETACHED,af(e)}}))()}detach(){return this.throwIfDestroyedOrNotAttached(),this.detachElement(Es.DETACHED,"DETACHED"),Promise.resolve(!0)}destroy(){return this.status===Es.DESTROYED?Promise.resolve(!1):(this.detachElement(Es.DESTROYED,"DESTROYED"),Promise.resolve(!0))}tokenize(e){var t=this;return nf((function*(){var n;t.throwIfDestroyed(),t.handleFirstInteraction();try{t.metricsHandler.logEvent("EXTERNAL_SESSION:START"),t.isReadyToPayChecked||(yield t.checkIfReadyToPay(),t.isReadyToPayChecked=!0),t.paymentRequestLockController.lock(t),n=yield t.loadPaymentData(),delete t.googlePayTokenDeferred,t.metricsHandler.logEvent("EXTERNAL_SESSION:OK")}catch(e){if(delete t.googlePayTokenDeferred,t.paymentRequestLockController.unlock(t),function(e){return null!==e&&"object"==typeof e&&"statusCode"in e}(e)&&"CANCELED"===e.statusCode)return t.metricsHandler.logEvent("EXTERNAL_SESSION:CANCEL"),{status:Dr};throw t.metricsHandler.logEvent("EXTERNAL_SESSION:ERROR"),af(e)}var r=yield t.requestGooglePayCardNonce(n),i=r.token,o=r.details;if(t.context.getFeatureFlagValues().one_shot_authentication_google_pay){var a,s=Qp(Qp({},e),{},{amount:t.req.total.amount,billingContact:null!==(a=o.billing)&&void 0!==a?a:{},currencyCode:t.req.currencyCode,customerInitiated:!0,intent:"CHARGE",sellerKeyedIn:!1});yield Mh(t.context,s,i)}return{details:o,status:xr,token:i}}))()}validateConfiguration(){var e=rf.join(", ");if(document.querySelectorAll(e).length>0)throw new gi(this.methodType,e)}logDebugInfoIfEnabled(e){"GOOGLE_PAY"===this.context.getFeatureFlagValues().enable_payment_debug_output&&console.debug(e)}checkIfReadyToPay(){var e=this;return nf((function*(){if(!(yield e.googlePayClient.isReadyToPay(e.isReadyToPayRequest)).result)throw new di(ts.GOOGLE_PAY_BROWSER_NOT_SUPPORTED);var t=e.callbackIntents.length>0?"NOT_CURRENTLY_KNOWN":"FINAL",n=Xp(e.isReadyToPayRequest,e.req,e.callbackIntents,t,e.merchantInfo,e.selectedShippingOptionId);e.logDebugInfoIfEnabled(n),e.googlePayClient.prefetchPaymentData(n)}))()}loadPaymentData(){if(this.googlePayTokenDeferred)return this.googlePayTokenDeferred;var e=Xp(this.isReadyToPayRequest,this.req,this.callbackIntents,"FINAL",this.merchantInfo,this.selectedShippingOptionId);return this.logDebugInfoIfEnabled(e),this.googlePayTokenDeferred=this.googlePayClient.loadPaymentData(e),this.googlePayTokenDeferred}onPaymentDataChanged(e){switch(e.callbackTrigger){case"INITIALIZE":case"SHIPPING_ADDRESS":return this.onPaymentDataChangedShippingAddress(e);case"SHIPPING_OPTION":return this.onPaymentDataChangedShippingOption(e);default:return this.errorLogger.captureException(new Qi("Unknown callbackTrigger: ".concat(e.callbackTrigger),Nr.GOOGLE_PAY)),Promise.resolve({})}}onPaymentDataChangedShippingOption(e){var t=this;return nf((function*(){var n;t.selectedShippingOptionId=null===(n=e.shippingOptionData)||void 0===n?void 0:n.id;var r=yield t.dispatchShippingOptionChanged(t.selectedShippingOptionId,t.shippingOptions),i=r.updatedOptionRequest,o=r.optionErrors;return t.paymentDataChangedComplete(i,o)}))()}dispatchShippingOptionChanged(e,t){var n=this,r={optionErrors:[],updatedOptionRequest:{}};if(!this.handlers.includes(Tr.SHIPPING_OPTION_CHANGED))return Promise.resolve(r);var i=Kp(e,t);return i?this.status===Es.DESTROYED?Promise.resolve({optionErrors:[{intent:"SHIPPING_OPTION",message:"An error occurred when attempting to submit payment, please close this window and try again.",reason:xi.PAYMENT_METHOD_DESTROYED}],updatedOptionRequest:{}}):new Promise((e=>{this.req.dispatchEvent(Tr.SHIPPING_OPTION_CHANGED,{contactOrOption:i},(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.metricsHandler.logConfigurationEvent("EVENT_LISTENER_ON_COMPLETE_RESPONSE",Qp(Qp({},t),{},{eventName:Tr.SHIPPING_OPTION_CHANGED})),n.metricsHandler.logEvent("SHIPPING_OPTION_CHANGE:OK"),e({optionErrors:Jp(t,"SHIPPING_OPTION"),updatedOptionRequest:t})}))})):Promise.resolve(r)}onPaymentDataChangedShippingAddress(e){var t=this;return nf((function*(){var n=yield t.dispatchShippingContactChanged(e),r=n.updatedContactRequest,i=n.contactErrors;if(void 0===t.req.shippingOptions||0===t.req.shippingOptions.length)return t.paymentDataChangedComplete(r,i);var o,a=t.shippingOptions;r.shippingOptions?(a=r.shippingOptions,t.selectedShippingOptionId=r.shippingOptions[0].id):t.selectedShippingOptionId=null===(o=t.shippingOptions)||void 0===o?void 0:o[0].id;var s=yield t.dispatchShippingOptionChanged(t.selectedShippingOptionId,a),c=s.updatedOptionRequest,l=s.optionErrors,u=Qp(Qp({},r),c),d=[...i,...l];return t.paymentDataChangedComplete(u,d)}))()}dispatchShippingContactChanged(e){var t=this,n={contactErrors:[],updatedContactRequest:{}};return new Promise((r=>{var i;void 0!==e.shippingAddress&&this.handlers.includes(Tr.SHIPPING_CONTACT_CHANGED)?this.status!==Es.DESTROYED?this.req.dispatchEvent(Tr.SHIPPING_CONTACT_CHANGED,{contactOrOption:(i=e.shippingAddress,{city:i.locality,countryCode:i.countryCode,postalCode:i.postalCode,state:i.administrativeArea})},(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.metricsHandler.logConfigurationEvent("EVENT_LISTENER_ON_COMPLETE_RESPONSE",Qp(Qp({},e),{},{eventName:Tr.SHIPPING_CONTACT_CHANGED})),t.metricsHandler.logEvent("SHIPPING_ADDRESS_CHANGE:OK"),r({contactErrors:Jp(e,"SHIPPING_ADDRESS"),updatedContactRequest:e})})):r({contactErrors:[{intent:"SHIPPING_ADDRESS",message:"An error occurred when attempting to submit payment, please close this window and try again.",reason:xi.PAYMENT_METHOD_DESTROYED}],updatedContactRequest:{}}):r(n)}))}paymentDataChangedComplete(e,t){e.shippingOptions&&e.shippingOptions.length>0&&(this.shippingOptions=e.shippingOptions);var n=function(e,t,n,r){var i,o=t.total,a=t.countryCode,s=t.currencyCode,c=n,l=zp(null!==(i=e.total)&&void 0!==i?i:o),u={countryCode:a,currencyCode:s,totalPrice:l.price,totalPriceLabel:l.label,totalPriceStatus:l.status},d=$p(Fl(t),Fl(e,t));d.length>0&&(u.displayItems=d);var h={newTransactionInfo:u},p=Wp(s,r,c,e.shippingOptions);return p&&(h.newShippingOptionParameters=p),h}(e,this.req,this.shippingOptions,this.selectedShippingOptionId);return t.length>0&&(n.error=t[0]),n}requestGooglePayCardNonce(e){var t=this;return nf((function*(){var n=Kp(t.selectedShippingOptionId,t.shippingOptions);try{var r=yield t.paymentMethodMessenger.request("REQUEST_GOOGLE_PAY_CARD_NONCE",e);return t.context.setPaymentMethodTrackingId(r.paymentMethodTrackingId),t.wasFirstInteractionCalled=!1,t.paymentRequestLockController.unlock(t),function(e,t){var n=e.card,r=e.cardNonce,i=e.shippingContact,o=e.billingContact,a={details:{card:n,method:Nr.GOOGLE_PAY},token:r};return i&&(a.details.shipping={contact:i},t&&(a.details.shipping.option=t)),o&&(a.details.card&&(a.details.card.billing=o),a.details.billing=o),a}(r,n)}catch(e){throw t.paymentRequestLockController.unlock(t),af(e)}}))()}handleFirstInteraction(){this.wasFirstInteractionCalled||(this.wasFirstInteractionCalled=!0,this.metricsHandler.logEvent("FIRST_INTERACTION:OK"))}detachElement(e,t){this.element&&(this.element.innerHTML=""),this.status=e,this.metricsHandler.logConfigurationEvent(t)}}function af(e){if(e instanceof Error)return"SecurityError"===e.name?new di(ts.MISC_THIRD_PARTY_IFRAME_NOT_ALLOWED):e;var t=e;return"DEVELOPER_ERROR"===t.statusCode&&t.statusMessage.includes("secure context")?new di(ts.GOOGLE_PAY_REQUIRES_HTTPS):new Qi(JSON.stringify(e),Nr.GOOGLE_PAY)}function sf(){return(sf=nf((function*(e,t){return{authJwt:(yield e.request("GENERATE_GOOGLE_PAY_AUTH_TOKEN",{session:t})).token,merchantId:"05498866192997955200",merchantName:t.merchantName}}))).apply(this,arguments)}var cf=function(e){var t=function(e,t){return sf.apply(this,arguments)}(e.messenger,e.getSession()),n=$s.load("google-link",{src:"https://pay.google.com/gp/p/js/pay.js"},"google.payments");return Promise.all([n,t])};class lf{constructor(){this.lockSet=new Set}get isLocked(){return this.lockSet.size>0}lock(e){this.lockSet.add(e)}unlock(e){this.lockSet.delete(e)}}class uf extends Error{constructor(e,t){super(e),this.name=t,this.type="VERIFY_BUYER_DEVELOPER_ERROR"}}const df=function(){return new uf("The Analytics library must be initialized with analyticsParameters to call verifyBuyer.","AnalyticsParametersRequiredError")},hf=function(e,t){return new uf(`The Analytics '${e}' argument must be of type '${t}'`,"InvalidArgumentError")},pf=function(e,t){return new uf(`An element with selector ${e} must be of type '${t}'`,"InvalidElementTypeError")},ff=function(e,t,n){return new uf(`The '${e}' function '${t}' argument must be of type '${n}'.`,"InvalidFunctionArgumentError")},mf=function(e,t){return new uf(`The '${e}' '${t}' callback must be a function.`,"InvalidFunctionCallbackError")},gf=function(e){return new uf(`The Analytics '${e}' argument is required.`,"MissingArgumentError")},vf=function(e,t){return new uf(`The '${e}' '${t}' is required when verificationDetails.intent is 'CHARGE'.`,"MissingChargeVerificationArgumentError")},yf=function(e,t){return new uf(`An element with selector '${e}' attribute '${t}' is required`,"MissingElementAttributeError")},Ef=function(e){return new uf(`An element with selector '${e}' cannot be found.`,"MissingElementError")},bf=function(e,t){return new uf(`The '${e}' '${t}' argument is required.`,"MissingFunctionArgumentError")},_f=function(e,t){return new uf(`The '${e}' '${t}' callback is required.`,"MissingFunctionCallbackError")},Cf=function(){return new uf("One of analyticsParameters.locationId or analyticsParameters.accountId must be specified.","NoIdsError")},Sf=function(e,t,n,r,i=!1){return new uf(`The '${e}' function '${t}' argument must be within range: ${n} and ${r} (${(i?"inclusive":"exclusive")+" of upper limit"}).`,"OutOfRangeArgumentError")},If=function(){return new uf("Only one of analyticsParameters.locationId or analyticsParameters.accountId can be specified.","TooManyIdsError")},wf=function(){const e=new Error("An unknown error has occurred");return e.name="UnexpectedAnalyticsClientError",e};class Of extends Error{constructor(e="Unknown error",t){super(e),void 0!==t&&(this.token=t),this.name="AnalyticsError"}}class Af extends Of{constructor(){super("Three ds method timed out while waiting for a response"),this.name="ThreeDSMethodTimeoutError"}}class Tf extends Of{constructor(){super("Form is no longer connected"),this.name="ThreeDSMethodFormError"}}class Pf extends Of{constructor(e){super("Three ds method failed with unexpected error"),this.name="ThreeDSMethodError","string"==typeof e&&""!==e&&(this.message+=`: ${e}`)}}class Nf extends Of{constructor(e,t){super(`Received 3DS method response with transaction ID ${e}, expected ${t}`),this.name="ThreeDSMethodTransactionIdError"}}class Df{constructor(e){this.iframeInputs=e,this.eventListenerReference=this.handleResponse.bind(this)}async handle(){const e=new Promise(((e,t)=>{this.threeDSPromiseResolve=e,this.threeDSPromiseReject=t}));return this.build(),this.submit(),e}build(){void 0!==this.iframeInputs.iframeSelector&&document.querySelector(this.iframeInputs.iframeSelector)?this.iframe=document.querySelector(this.iframeInputs.iframeSelector):this.buildDefault();const e=`${this.iframeInputs.baseID}-form`;if(document.getElementById(e))this.form=document.getElementById(e);else{this.form=document.createElement("form"),this.form.setAttribute("id",e),this.form.setAttribute("name",`${this.iframeInputs.baseName}Form`),this.form.setAttribute("method","POST"),this.form.setAttribute("action",this.iframeInputs.notificationURL),this.form.setAttribute("target",this.iframe.name);const t=document.createElement("input");t.setAttribute("name",this.iframeInputs.notificationData.name),t.setAttribute("value",this.iframeInputs.notificationData.data),t.setAttribute("type","hidden"),this.form.appendChild(t),document.body.appendChild(this.form)}window.addEventListener("message",this.eventListenerReference)}buildDefault(){const e=`${this.iframeInputs.baseID}-modal`;document.getElementById(e)?this.modal=document.getElementById(e):(this.modal=document.createElement("div"),this.modal.id=e,this.modal.classList.add("square_threeds_modal"),document.body.appendChild(this.modal));const t=`${this.iframeInputs.baseID}-iframe`,n=document.getElementById(t);n&&this.modal.contains(n)?this.iframe=document.getElementById(t):(this.iframe=document.createElement("iframe"),this.iframe.id=t,this.iframe.name=`${this.iframeInputs.baseName}Iframe`,this.iframe.setAttribute("frameBorder","0"),this.iframe.setAttribute("width",this.iframeInputs.width),this.iframe.setAttribute("height",this.iframeInputs.height),this.iframe.setAttribute("sandbox","allow-forms allow-scripts allow-same-origin allow-pointer-lock"),this.iframe.style.visibility="hidden",this.iframe.setAttribute("allowpaymentrequest","false"),this.iframe.setAttribute("allowfullscreen","false"),this.iframe.setAttribute("allow","payment *;publickey-credentials-get *"),this.iframe.classList.add("square_threeds_iframe"),this.modal.appendChild(this.iframe))}handleResponse(e){const t=e.data;if("object"==typeof t&&this.iframeInputs.listenerMessageTypes.includes(t.type)){this.destroy();try{this.iframeInputs.validateMessage(t),this.threeDSPromiseResolve(t)}catch(e){this.threeDSPromiseReject(e)}}}submit(){this.form.isConnected?(this.form.submit(),void 0!==this.iframeInputs.onShow&&this.iframeInputs.onShow(this.iframe,this.modal),void 0!==this.iframeInputs.timeoutSeconds&&(this.timeoutID=window.setTimeout(this.timedOut.bind(this),1e3*this.iframeInputs.timeoutSeconds))):(this.destroy(),this.threeDSPromiseReject(this.iframeInputs.getErrorMessage("SQUARE_3DS_IFRAME_FORM_DISCONNECTED")))}timedOut(){this.destroy(),this.threeDSPromiseReject(this.iframeInputs.getErrorMessage("SQUARE_3DS_IFRAME_TIMEOUT"))}destroy(){void 0!==this.timeoutID&&window.clearTimeout(this.timeoutID),window.removeEventListener("message",this.eventListenerReference),void 0!==this.iframeInputs.onDestroy&&this.iframeInputs.onDestroy(this.iframe),this.form.isConnected&&this.form.remove(),!0===this.modal?.isConnected&&(this.iframe.isConnected&&this.iframe.remove(),this.modal.remove())}}function Rf(e){switch(e){case"SQUARE_3DS_IFRAME_TIMEOUT":return new Af;case"SQUARE_3DS_IFRAME_FORM_DISCONNECTED":return new Tf;default:return new Pf}}class Lf{constructor(e){if(void 0===e.threeDsMethodUrl||void 0===e.threeDsMethodNotificationUrl)throw new Error(`Cannot complete 3DS method flow, one or more of threeDSMethodUrl and threeDSMethodNotificationUrl are undefined. Transaction data: ${JSON.stringify(e)}`);this.threeDsMethodUrl=e.threeDsMethodUrl,this.threeDSMethodData={threeDSMethodNotificationURL:e.threeDsMethodNotificationUrl,threeDSServerTransID:e.threeDSServerTransId},this.square3DSMethodIframe=new Df({baseID:"sq-threeds-3ds-method-"+1e6*Math.random(),baseName:"3DSMethod",getErrorMessage:Rf,height:"10",listenerMessageTypes:[`threeDsMethodResponse-${this.threeDSMethodData.threeDSServerTransID}`,"threeDsMethodError"],notificationData:{data:btoa(JSON.stringify(this.threeDSMethodData)),name:"threeDSMethodData"},notificationURL:this.threeDsMethodUrl,timeoutSeconds:11,validateMessage:this.validateMessage.bind(this),width:"10"})}async handle3DSMethod(){return this.square3DSMethodIframe.handle()}validateMessage(e){if("threeDsMethodError"===e.type)throw new Pf(e.error);if(e.threeDsServerTransId!==this.threeDSMethodData.threeDSServerTransID)throw new Nf(e.threeDsServerTransId,this.threeDSMethodData.threeDSServerTransID)}}class xf{constructor(e,t){this.threeDsMethodPromise=e,this.threeDsServerTransactionId=t}reset(){this.threeDsMethodPromise=void 0,this.threeDsServerTransactionId=void 0}}class kf extends Of{constructor(e){super(`The verification was not successful: ${e}`,e),this.name="VerificationError",this.type="VERIFICATION_NOT_SUCCESSFUL"}}class Mf extends Of{constructor(){super("A verification request is already in progress"),this.name="VerificationInProgressError",this.type="VERIFICATION_IN_PROGRESS"}}class jf extends Of{constructor(e){super(`The time to complete the verification has expired: ${e}`),this.name="VerificationTimeoutError",this.type="VERIFICATION_TIMEOUT"}}var Uf,Bf;!function(e){e.AUTHENTICATED="Y",e.AUTHENTICATION_ATTEMPTED="A",e.CHALLENGE_REQUIRED="C",e.DECOUPLED_CHALLENGE_REQUIRED="D",e.NOT_AUTHENTICATED="N",e.AUTHENTICATION_COULD_NOT_BE_PERFORMED="U",e.INFORMATIONAL_ONLY="I",e.REJECTED="R"}(Uf||(Uf={})),function(e){e._250X400="01",e._390X400="02",e._500X600="03",e._600X400="04",e.FULL_SCREEN="05"}(Bf||(Bf={}));class qf extends Of{constructor(){super("Form is no longer connected"),this.name="ChallengeFlowFormError"}}class Hf extends Of{constructor(e){super("Challenge flow failed with unknown error"),this.name="ChallengeFlowError","string"==typeof e&&""!==e&&(this.message+=`: ${e}`)}}class Ff extends Of{constructor(e,t){super(`Received Challenge response with transaction ID ${e}, expected ${t}`),this.name="ChallengeResponseTransactionIdError"}}const Vf="data-challenge-displayed",Gf="VISIBLE";function zf(e){return"SQUARE_3DS_IFRAME_FORM_DISCONNECTED"===e?new qf:new Hf}class $f{constructor(e,t,n,r){if(this.errorLogger=t,this.esLogger=n,void 0===e.acsUrl||void 0===e.encodedCReq)throw new Error(`Cannot complete Challenge flow, acsUrl or encodedCReq is undefined. Transaction data: ${JSON.stringify(e)}`);this.acsUrl=e.acsUrl,this.challengeFlowData={encodedCReq:e.encodedCReq,threeDSServerTransID:e.threeDSServerTransId};const i=this.decodeChallengeWindowSize();void 0!==r&&({challengeDisplayedCallback:this.challengeDisplayedCallback,challengeHiddenCallback:this.challengeHiddenCallback,elementSelector:this.iframeSelector}=r);const o={baseID:"sq-threeds-challenge-flow",baseName:"3DSChallengeFlow",getErrorMessage:zf,height:`${i.height}`,listenerMessageTypes:[`challengeResponse-${this.challengeFlowData.threeDSServerTransID}`,"challengeError"],notificationData:{data:this.challengeFlowData.encodedCReq,name:"creq"},notificationURL:this.acsUrl,onDestroy:this.onDestroy.bind(this),onShow:this.onShow.bind(this),timeoutSeconds:610,validateMessage:this.validateMessage.bind(this),width:`${i.width}`};void 0!==this.iframeSelector&&(o.iframeSelector=this.iframeSelector),this.squareChallengeFlowIframe=new Df(o)}async handleChallengeFlow(){const e=this.decodeCReq(this.challengeFlowData.encodedCReq);return e&&this.esLogger.trackTdsEvent({catalog_name:"tds_analyticsjs_c_req",tds_analyticsjs_c_req_message_version:e.messageVersion,tds_base_three_ds_server_trans_id:e.threeDsServerTransId||this.challengeFlowData.threeDSServerTransID}),this.squareChallengeFlowIframe.handle().then((e=>(this.esLogger.trackTdsEvent({catalog_name:"tds_analyticsjs_c_res",tds_analyticsjs_c_res_message_version:e.messageVersion,tds_analyticsjs_c_res_trans_status:e.transStatus,tds_base_three_ds_server_trans_id:e.threeDsServerTransId}),e)))}onShow(e,t){e.setAttribute(Vf,Gf),e.style.visibility="visible",void 0!==this.challengeDisplayedCallback&&this.challengeDisplayedCallback(),t&&t.classList.add("square_threeds_modal__show")}onDestroy(e){const t=e.getAttribute(Vf)===Gf;e.setAttribute(Vf,"REMOVED"),void 0!==this.challengeHiddenCallback&&t&&this.challengeHiddenCallback()}validateMessage(e){if("challengeError"===e.type)throw new Hf(e.error);if(e.threeDsServerTransId!==this.challengeFlowData.threeDSServerTransID)throw new Ff(e.threeDsServerTransId,this.challengeFlowData.threeDSServerTransID)}decodeChallengeWindowSize(){let e=Bf._250X400;try{const t=JSON.parse(atob(this.challengeFlowData.encodedCReq));null!==t&&"object"==typeof t&&"challengeWindowSize"in t&&(e=t.challengeWindowSize)}catch(e){this.errorLogger.captureException(e,{captureContext:{tags:{action:"nonFatal-challenge"}}})}switch(e){case Bf._390X400:return{height:400,width:390};case Bf._500X600:return{height:600,width:500};case Bf._600X400:return{height:400,width:600};case Bf.FULL_SCREEN:return{height:document.documentElement.clientHeight,width:document.documentElement.clientWidth};case Bf._250X400:default:return{height:400,width:250}}}decodeCReq(e){try{return JSON.parse(atob(e))}catch(t){return this.errorLogger.addBreadcrumb({data:{encodedCReq:e},message:"Unable to parse JSON for challenge request message",type:"error"}),this.errorLogger.captureException(t,{captureContext:{tags:{action:"nonFatal-challenge"}}}),null}}}var Yf;!function(e){e.COMPLETED="COMPLETED",e.ERROR="ERROR"}(Yf||(Yf={}));class Wf{constructor(e,t,n){this.userChallenged=!1,this.esLogger=e,this.errorLogger=t,this.threeDsMethodData=n}async execute3dsAuthentication(e,t){this.configuration=e,this.threeDsTransactionData=t,await this.handle3DSMethodFlow();try{const e=await this.authenticate();await this.handleAuthenticateResponse(e)}catch(e){this.handleError(e)}}async handle3DSMethodFlow(){if(void 0===this.threeDsMethodData.threeDsServerTransactionId||void 0===this.threeDsMethodData.threeDsMethodPromise){if(void 0!==this.threeDsTransactionData?.threeDsMethodUrl)try{const e=new Lf(this.threeDsTransactionData),t=new URL(this.threeDsTransactionData.threeDsMethodUrl).hostname;this.esLogger.trackAnalyticsEvent({analyticsjs_event:"three_ds_method_invoked",analyticsjsverification_id:this.threeDsTransactionData.verificationId,analyticsjsverification_verification_token:this.threeDsTransactionData.verificationToken,is_eager_three_ds_method_execution:!1,three_ds_method_url_hostname:t,three_ds_server_transaction_id:this.threeDsTransactionData.threeDSServerTransId}),await e.handle3DSMethod(),this.esLogger.trackAnalyticsEvent({analyticsjs_event:"three_ds_method_completed",analyticsjsverification_id:this.threeDsTransactionData.verificationId,analyticsjsverification_verification_token:this.threeDsTransactionData.verificationToken,is_eager_three_ds_method_execution:!1,three_ds_method_url_hostname:t,three_ds_server_transaction_id:this.threeDsTransactionData.threeDSServerTransId})}catch(e){this.errorLogger.captureException(e,{captureContext:{tags:{action:"nonFatal-challenge"}}})}}else try{await this.threeDsMethodData.threeDsMethodPromise}catch(e){this.errorLogger.captureException(e,{captureContext:{tags:{action:"nonFatal-challenge"}}})}}async handleChallengeFlow(e){this.esLogger.trackAnalyticsEvent({analyticsjs_event:"buyer_challenged",analyticsjsverification_challenge_type:"3DS",analyticsjsverification_id:this.threeDsTransactionData.verificationId,analyticsjsverification_user_challenged:!0,analyticsjsverification_verification_token:this.threeDsTransactionData.verificationToken});const t={threeDSServerTransId:e.three_ds_server_trans_id};return void 0!==e.encoded_creq&&(t.encodedCReq=e.encoded_creq),void 0!==e.challenge_acs_url&&(t.acsUrl=e.challenge_acs_url),new $f(t,this.errorLogger,this.esLogger,this.configuration.verifyBuyerCustomElement).handleChallengeFlow()}authenticate(){const e={browser_info:{color_depth:window.screen.colorDepth,java_enabled:!1,screen_height:window.innerHeight,screen_width:window.innerWidth},client_id:"",token:this.threeDsTransactionData.verificationToken};return this.configuration.callbacks.postAuthenticate(e)}async handleAuthenticateResponse(e){if(void 0===e.errors)if(e.three_ds_trans_status===Uf.CHALLENGE_REQUIRED)try{this.userChallenged=!0,await this.handleChallengeFlow(e),this.configuration.callbacks.onComplete({status:Yf.COMPLETED,threeDsServerTransId:this.threeDsTransactionData.threeDSServerTransId,userChallenged:!0})}catch(e){this.handleError(e)}else this.configuration.callbacks.onComplete({status:Yf.COMPLETED,threeDsServerTransId:this.threeDsTransactionData.threeDSServerTransId,userChallenged:this.userChallenged});else this.configuration.callbacks.onComplete({status:Yf.ERROR,threeDsServerTransId:this.threeDsTransactionData.threeDSServerTransId,userChallenged:this.userChallenged})}handleError(e){this.errorLogger.captureException(e,{captureContext:{tags:{action:"nonFatal-challenge"}}}),this.configuration.callbacks.onComplete({...e instanceof qf&&{error:{errorDescription:"BAD_REQUEST",errorDetail:"The verification could not be completed. Please try again in a different browser."}},status:Yf.ERROR,threeDsServerTransId:this.threeDsTransactionData.threeDSServerTransId,userChallenged:this.userChallenged})}}class Kf{constructor(e,t,n){this.callback=e,this.onError=n,this.called=!1,this.callback=e,this.timeout=window.setTimeout((()=>{this.timedOut()}),t),this.onError=n}invoke(...e){this.called?this.callback(...this.onError):(clearTimeout(this.timeout),this.called=!0,this.callback(...e))}timedOut(){this.invoke(...this.onError)}}function Xf(e){return e instanceof Of}function Jf(e,t,n){return Xf(e)?e:e instanceof Error&&"SqError"===e.name?new Of(e.message,n):new Of(t,n)}function Zf(e){return void 0!==e.square_three_ds_verification?.three_ds_server_transaction_id}class Qf{constructor(e,t,n,r,i,o){this.applicationId=e,this.analyticsParameters=t,this.esLogger=n,this.errorLogger=r,this.challengeUpdatesQueue=[],this.verificationUpdatePending=!1,this.userChallenged=!1,this.messenger=i,this.threeDsMethodData=o,this.squareThreeds=new Wf(this.esLogger,this.errorLogger,this.threeDsMethodData),(()=>{this.pendingVerifyBuyerCall&&this.verifyBuyer(this.pendingVerifyBuyerCall.verificationId,this.pendingVerifyBuyerCall.source,this.pendingVerifyBuyerCall.details,this.pendingVerifyBuyerCall.callback,this.pendingVerifyBuyerCall.verifyBuyerCustomElement)})()}verifyBuyer(e,t,n,r,i){void 0===this.verifyBuyerCallback?(this.verifyBuyerCallback=new Kf(((e,t)=>{r(e,t),delete this.verifyBuyerCallback}),9e5,[new jf(e)]),this.getVerification(e,t,n)):r(new Mf,null)}async updateVerification(e,t){const n=t.some((e=>{if("SQUARE_THREEDS"===e.type){const t=e.square_threeds_verification?.status;return function(e){return"CANCELED"===e||"REJECTED"===e||"AUTHENTICATED"===e||"COMPLETED"===e}(t)||"ERROR"===t}return!1}));if(!this.verificationUpdatePending||n){this.verificationUpdatePending=!n;try{const n={analyticsParameters:this.analyticsParameters,applicationId:this.applicationId,challengeUpdates:t,token:this.token,verificationId:e},r=await this.messenger.request("REQUEST_VERIFICATION_UPDATE",{body:{...n}});this.esLogger.trackAnalyticsEvent({analyticsjs_event:"receive_verification_update",analyticsjsverification_id:e,analyticsjsverification_verification_token:this.token}),this.handleChallenges(e,r)}catch(t){this.esLogger.trackAnalyticsEvent({analyticsjs_event:"receive_verification_update",analyticsjsverification_id:e,analyticsjsverification_verification_token:this.token}),this.handleChallenges(e,Jf(t,"Update verification failed",this.token))}}else this.challengeUpdatesQueue.push(t)}handleChallenges(e,t){if(void 0===this.verifyBuyerCallback)return;const n=this.challengeUpdatesQueue.shift();if(void 0!==n?this.updateVerification(e,n):this.verificationUpdatePending=!1,Xf(t))return void this.verifyBuyerCallback.invoke(this.consumeChallengeRenderError()??t,null);this.token=t.token;const r={token:this.token,userChallenged:this.userChallenged};switch(t.status){case"COMPLETED":this.verifyBuyerCallback.invoke(null,r);break;case"CANCELED":this.verifyBuyerCallback.invoke(this.consumeChallengeRenderError()??new kf(t.token),null);break;case"PENDING":if(void 0===t.challenges||0===t.challenges.length)return void this.verifyBuyerCallback.invoke(new kf(t.token),null);for(const n of t.challenges)if("SQUARE_THREEDS"===n.type){if(this.squareThreedsConfiguration={callbacks:{onComplete:t=>{this.handleSquareThreeDsComplete(t,e)},postAuthenticate:t=>this.handlePostAuthenticate(t,e)}},!Zf(n))return;this.squareThreeDsTransactionData={directoryServerId:n.square_three_ds_verification.directory_server_id,messageVersion:n.square_three_ds_verification.message_version,threeDSServerTransId:n.square_three_ds_verification.three_ds_server_transaction_id,...void 0!==n.square_three_ds_verification?.three_ds_method_notification_url&&{threeDsMethodNotificationUrl:n.square_three_ds_verification.three_ds_method_notification_url},...void 0!==n.square_three_ds_verification?.three_ds_method_url&&{threeDsMethodUrl:n.square_three_ds_verification.three_ds_method_url},verificationId:e,verificationToken:this.token},this.squareThreeds.execute3dsAuthentication(this.squareThreedsConfiguration,this.squareThreeDsTransactionData)}break;default:this.errorLogger.captureException(new Error(`Invalid verification response status: ${t.status}`),{captureContext:{tags:{action:"nonFatal-verify"}}})}}async getVerification(e,t,n){const r={analyticsParameters:this.analyticsParameters,applicationId:this.applicationId,source:t,verificationDetails:n,verificationId:e};try{const t=await this.messenger.request("REQUEST_VERIFICATION_CREATE",{body:{...r,...void 0!==this.threeDsMethodData.threeDsMethodPromise&&void 0!==this.threeDsMethodData.threeDsServerTransactionId?{threeDsServerTransactionId:this.threeDsMethodData.threeDsServerTransactionId}:{}}}),n=t.challenges?.find((e=>"SQUARE_THREEDS"===e.type));n?.square_three_ds_verification?.three_ds_server_transaction_id===this.threeDsMethodData.threeDsServerTransactionId||this.threeDsMethodData.reset(),this.esLogger.trackAnalyticsEvent({analyticsjs_event:"receive_verification",analyticsjsverification_id:e,analyticsjsverification_verification_token:t.token}),this.handleChallenges(e,t)}catch(t){this.esLogger.trackAnalyticsEvent({analyticsjs_event:"receive_verification",analyticsjsverification_id:e,analyticsjsverification_verification_token:this.token}),this.handleChallenges(e,Jf(t,"Create verification failed",this.token))}}handleSquareThreeDsComplete(e,t){this.userChallenged=e.userChallenged,void 0!==e.error&&(this.challengeRenderError=new Of(e.error.errorDetail,this.token));const n={square_threeds_verification:{directory_server_id:this.squareThreeDsTransactionData.directoryServerId,message_version:this.squareThreeDsTransactionData.messageVersion,status:e.status===Yf.COMPLETED?Yf.COMPLETED:Yf.ERROR,three_ds_server_transaction_id:e.threeDsServerTransId},type:"SQUARE_THREEDS"};this.updateVerification(t,[n])}async handlePostAuthenticate(e,t){const n={analyticsParameters:this.analyticsParameters,applicationId:this.applicationId,browser_info:e.browser_info,client_id:e.client_id,token:this.token,verificationId:t};try{const e=await this.messenger.request("REQUEST_THREE_DS_AUTHENTICATION",{body:{...n}});return this.esLogger.trackAnalyticsEvent({analyticsjs_event:"receive_three_ds_authenticate",analyticsjsverification_id:t,analyticsjsverification_verification_token:this.token}),e}catch(e){throw this.esLogger.trackAnalyticsEvent({analyticsjs_event:"receive_three_ds_authenticate",analyticsjsverification_id:t,analyticsjsverification_verification_token:this.token}),Jf(e,"Three ds authentication failed",this.token)}}consumeChallengeRenderError(){const e=this.challengeRenderError;return delete this.challengeRenderError,e}}function em(e,t){if(!e)throw _f("IframeCustomElement",t);if("function"!=typeof e)throw mf("IframeCustomElement",t)}function tm(e){return"string"==typeof e&&""!==e}function nm(e){if("object"!=typeof e||null===e)return"";const t=[];return"familyName"in e&&tm(e.familyName)&&t.push("familyName"),"givenName"in e&&tm(e.givenName)&&t.push("givenName"),"email"in e&&tm(e.email)&&t.push("email"),"country"in e&&tm(e.country)&&t.push("country"),"countryName"in e&&tm(e.countryName)&&t.push("countryName"),"region"in e&&tm(e.region)&&t.push("region"),"city"in e&&tm(e.city)&&t.push("city"),"addressLines"in e&&Array.isArray(e.addressLines)&&tm(e.addressLines.join())&&t.push("addressLines"),"postalCode"in e&&tm(e.postalCode)&&t.push("postalCode"),"phone"in e&&tm(e.phone)&&t.push("phone"),t.join(",")}function rm(){return`verify-buyer-${(new Date).getMilliseconds()}-${1e5*Math.random()}`}class im{constructor(e,t,n,r,i,o={generateVerificationId:rm}){this.verificationId=void 0,this.applicationId=e,this.esLogger=t,this.errorLogger=n,this.messenger=r,this.threeDsMethodData=new xf,this.verificationIdGenerator=o,function(e,t){if(!e)throw gf("applicationId");if("string"!=typeof e)throw hf("applicationId","string");if(t){const e="locationId"in t,n="accountId"in t;if(!e&&!n)throw Cf();if(e&&n)throw If();if(e&&"string"!=typeof t.locationId)throw hf("analyticsParameters.locationId","string");if(n&&"string"!=typeof t.accountId)throw hf("analyticsParameters.accountId","string")}}(e,i),i&&(this.verifier=new Qf(this.applicationId,i,this.esLogger,this.errorLogger,this.messenger,this.threeDsMethodData),this.analyticsParameters=i)}async execute3DSMethod(e){const t=new Lf({threeDSServerTransId:e.threeDSServerTransId,threeDsMethodNotificationUrl:e.threeDsMethodNotificationUrl,threeDsMethodUrl:e.threeDsMethodUrl});this.verificationId=this.verificationIdGenerator.generateVerificationId();const n=new URL(e.threeDsMethodUrl).hostname;this.esLogger.trackAnalyticsEvent({analyticsjs_event:"three_ds_method_invoked",analyticsjsverification_id:this.verificationId,analyticsjsverification_verification_token:void 0,is_eager_three_ds_method_execution:!0,three_ds_method_url_hostname:n,three_ds_server_transaction_id:e.threeDSServerTransId});const r=t.handle3DSMethod();this.threeDsMethodData.threeDsMethodPromise=r,this.threeDsMethodData.threeDsServerTransactionId=e.threeDSServerTransId;try{await r}catch(e){throw this.errorLogger.captureException(e,{captureContext:{tags:{action:"nonFatal-challenge"}}}),e}finally{this.esLogger.trackAnalyticsEvent({analyticsjs_event:"three_ds_method_completed",analyticsjsverification_id:this.verificationId,analyticsjsverification_verification_token:void 0,is_eager_three_ds_method_execution:!0,three_ds_method_url_hostname:n,three_ds_server_transaction_id:e.threeDSServerTransId})}}async verifyBuyer(e,t,n){return new Promise(((r,i)=>{this._verifyBuyer(e,t,((e,t)=>{this.threeDsMethodData.reset(),this.verificationId=void 0,e?i(e):r(t)}),n)}))}_verifyBuyer(e,t,n,r){const i=this.verificationId??this.verificationIdGenerator.generateVerificationId();try{this.esLogger.trackAnalyticsEvent({analyticsjs_event:"verify_buyer_invoked",analyticsjsverification_amount:t.amount,analyticsjsverification_contact_fields:nm(t.billingContact),analyticsjsverification_currency:t.currencyCode,analyticsjsverification_custom_score:null===t.customScore?void 0:t.customScore,analyticsjsverification_id:i,analyticsjsverification_intent:t.intent,analyticsjsverification_source:e,analyticsjsverification_source_prefix:e.substring(0,5),analyticsjsverification_square_product:t.squareProduct})}catch(e){throw this.errorLogger.captureException(e,{captureContext:{tags:{action:"verifyBuyer"}}}),wf()}try{!function(e,t,n,r,i){const o="verifyBuyer";if(!e)throw df();if(void 0===t)throw bf(o,"source");if("string"!=typeof t)throw ff(o,"source","string");if(!n)throw bf(o,"verificationDetails");if("object"!=typeof n)throw ff(o,"verificationDetails","object");if(function(e,t){const n="verificationDetails";if("object"!=typeof t.billingContact)throw ff(e,`${n}.billingContact`,"object");const{customScore:r}=t;if(null!=r){if("number"!=typeof r||Number.isNaN(r))throw ff(e,`${n}.customScore`,"integer");if(r<0||r>1e3)throw Sf(e,`${n}.customScore`,0,1e3,!0)}if("string"!=typeof t.intent)throw ff(e,`${n}.intent`,"string");if("CHARGE"===t.intent||"CHARGE_AND_STORE"===t.intent){if(!t.currencyCode)throw vf(e,`${n}.currencyCode`);if("string"!=typeof t.currencyCode)throw ff(e,`${n}.currencyCode`,"string");if(!t.amount)throw vf(e,`${n}.amount`);if("string"!=typeof t.amount)throw ff(e,`${n}.amount`,"string")}}(o,n),!r)throw _f(o,"verifyBuyerCallback");if("function"!=typeof r)throw mf(o,"verifyBuyerCallback");void 0!==i&&(function(e){if("string"!=typeof e)throw hf("iframeElementSelector","string");const t=document.querySelector(e);if(null===t)throw Ef(e);if(null===t.getAttribute("name"))throw yf(e,"name");if("iframe"!==t.tagName.toLowerCase()||null===t.contentDocument&&null===t.contentWindow)throw pf(e,"IFrameElement")}(i.elementSelector),em(i.challengeDisplayedCallback,"elementVisibleCallback"),em(i.challengeHiddenCallback,"elementRemovedCallback"))}(this.analyticsParameters,e,t,n,r)}catch(t){throw this.esLogger.trackAnalyticsEvent({analyticsjs_event:"verify_buyer_completed",analyticsjsverification_error:t.name,analyticsjsverification_id:i,analyticsjsverification_source:e}),t}try{this.verifier.verifyBuyer(i,e,t,((t,r)=>{const o={analyticsjs_event:"verify_buyer_completed",analyticsjsverification_id:i,analyticsjsverification_source:e};t&&(o.analyticsjsverification_error=t.name),r&&(o.analyticsjsverification_user_challenged=r.userChallenged,o.analyticsjsverification_verification_token=r.token),this.esLogger.trackAnalyticsEvent(o),n(t,r)}),r)}catch(e){throw this.errorLogger.captureException(e,{captureContext:{tags:{action:"verifyBuyer"}}}),wf()}}}const om=(e,t,n,r,i)=>new im(e,t,n,r,i),am={get documentVisibilityState(){return document.visibilityState},windowLocationHref:()=>window.location.href,get windowLocationOrigin(){return window.location.origin},get windowNavigationBeacon(){return window.navigator.sendBeacon.bind(window.navigator)}},sm=/^https?:\/\//;function cm(e){if(!e)return"";if(!sm.test(e))return"[Not Parsable]";const t=new URL(e);return`${t.protocol}//${t.host}`}const lm={buyer_challenged:"analyticsjsverification",receive_three_ds_authenticate:"analyticsjsverification",receive_verification:"analyticsjsverification",receive_verification_update:"analyticsjsverification",three_ds_method_completed:"analyticsjsverification",three_ds_method_invoked:"analyticsjsverification",verify_buyer_completed:"analyticsjsverification",verify_buyer_invoked:"analyticsjsverification"};function um(e){const t=document.cookie.split(";");for(const n of t){const[t,r]=n.split("=");if(void 0!==t&&t.trim()===e&&void 0!==r)return decodeURIComponent(r)}return null}class dm{constructor(e,t,n,r){this.telemetryStarts=new Map;const{locationId:i,avt:o}=n;this.es=e,this.errorLogger=r,this.baseEvent=function(e,t,n){return"accountId"in n?{anonymous_user_token:t,oauth_credential_account_id:n.accountId,oauth_credential_client_id:e}:{anonymous_user_token:t,oauth_credential_client_id:e,oauth_credential_location_id:n.locationId}}(t,o,{locationId:i??""})}trackAnalyticsEvent(e){try{const t={catalog_name:lm[e.analyticsjs_event],...this.baseEvent,analyticsjsverification_duration:this.getAnalyticsEventDuration(e),browser_height:window.innerHeight,browser_width:window.innerWidth,device_screen_height:window.screen.height,device_screen_width:window.screen.width,subject_anonymous_token:um("_savt"),webpage_base_url:am.windowLocationOrigin,webpage_full_url:cm(am.windowLocationHref()),webpage_path:"",webpage_referrer:cm(window.document.referrer),webpage_referrer_path:"",webpage_referrer_search:"",webpage_search:"",webpage_title:window.document.title,...e};this.es.trackV2(t)}catch(t){this.errorLogger.addBreadcrumb({data:{event:e},message:"Eventstream Track Error",type:"error"}),this.errorLogger.captureException(t,{captureContext:{tags:{action:"nonFatal-es2"}}})}}trackTdsEvent(e){try{this.es.trackV2(e)}catch(t){this.errorLogger.addBreadcrumb({data:{event:e},message:"Eventstream TrackTdsEvent Error",type:"error"}),this.errorLogger.captureException(t,{captureContext:{tags:{action:"nonFatal-es2"}}})}}getAnalyticsEventDuration(e){const{analyticsjs_event:t,analyticsjsverification_id:n}=e,r=e=>(this.telemetryStarts.set(e,performance.now()),null),i=e=>{const t=this.telemetryStarts.get(e);return void 0===t?null:(this.telemetryStarts.delete(e),performance.now()-t)};switch(t){case"verify_buyer_invoked":return r(n);case"verify_buyer_completed":return i(n);case"three_ds_method_invoked":return r(`three_ds_method_${n}`);case"three_ds_method_completed":return i(`three_ds_method_${n}`);default:return null}}}class hm{constructor(e){this.metricsBatchUrl=`${e.pciConnectApiUrl}/v2/analytics/aux`,this.errorLogger=e.errorLogger,this.analyticsClientVersion=e.analyticsClientVersion,this.webSdkVersion=e.webSdkVersion,this.metricsBuffer=[],this.disableBeacon=!1}trackV2(e){const t={u_library_name:"analytics-client",u_library_version:this.analyticsClientVersion,web_sdk_version:this.webSdkVersion,...e};this.postMetricsEvent(t,!1)}postMetricsEvent(e,t=!1){this.disableBeacon?cr(this.metricsBatchUrl,{body:{analytics:[e]}}).catch((t=>{this.errorLogger.addBreadcrumb({data:{event:e},message:"Unable to HTTP Post analytics event",type:"error"}),this.errorLogger.captureException(t,{captureContext:{tags:{action:"nonFatal-es2"}}})})):(this.metricsBuffer.push(e),t&&this.buildAndSendBeacon(),void 0===this.currentInterval&&(document.addEventListener("visibilitychange",(()=>{"hidden"===am.documentVisibilityState&&(this.buildAndSendBeacon(),clearInterval(this.currentInterval),this.currentInterval=void 0)})),this.currentInterval=setInterval((()=>{this.buildAndSendBeacon()}),1e3)))}buildAndSendBeacon(){if(0!==this.metricsBuffer.length){try{const e=new Blob([JSON.stringify({analytics:this.metricsBuffer})],{type:"text/plain;charset=UTF-8"});am.windowNavigationBeacon(this.metricsBatchUrl,e)}catch(e){this.errorLogger.addBreadcrumb({data:{events:this.metricsBuffer},message:"Unable to send beacons for analytics events",type:"error"}),this.errorLogger.captureException(e,{captureContext:{tags:{action:"nonFatal-es2"}}}),this.disableBeacon=!0,void 0!==this.currentInterval&&(clearInterval(this.currentInterval),this.currentInterval=void 0),cr(this.metricsBatchUrl,{body:{analytics:this.metricsBuffer}}).catch((e=>{this.errorLogger.addBreadcrumb({data:{events:this.metricsBuffer},message:"Unable to send HTTP request for analytics events",type:"error"}),this.errorLogger.captureException(e,{captureContext:{tags:{action:"nonFatal-es2"}}})}))}this.metricsBuffer=[]}}}const pm={setupClient(e,t){const{environment:n,hostname:r,locationId:i,pciConnectApiUrl:o,clientVersion:a,webSdkVersion:s,messenger:c}=t,l=void 0===a||""===a?`web-payments-sdk@${s}`:`analytics-client@${a}`,u=new Qn({dsn:"https://4197e265423545aba2d849d023e8cd33@o160250.ingest.sentry.io/1516559",environment:n,initialScope:{tags:{applicationId:e,applicationUrl:r,source:"analytics-client",webSdkVersion:s}},release:l}),d=new hm({analyticsClientVersion:l,errorLogger:u,pciConnectApiUrl:o,webSdkVersion:s}),h=new dm(d,e,t,u);return void 0===i?om(e,h,u,c):om(e,h,u,c,{locationId:i})}};function fm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fm(Object(n),!0).forEach((function(t){gm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gm(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vm="".concat(dr.ASSET_URL,"/square-threeds-modal.css");class ym{constructor(e){var t=e.applePayMerchantIdentifier,n=e.cashAppPayMerchantIdentifier,r=e.merchantName,i=e.applicationId,o=e.avt,a=e.hostname,s=e.locationId,c=e.instanceId,l=e.sessionId,u=e.sourceUrl,d=e.locale,h=e.srcDpaId,p=e.parentPathname;this.applicationId=i,this.locationId=s,this._sessionId=l,this.instanceId=c,this.applePayMerchantIdentifier=t,this.cashAppPayMerchantIdentifier=n,this.merchantName=r,this.hostname=a,this.sourceUrl=u,this._locale=d,this.avt=o,this.srcDpaId=h,this.parentPathname=p}get sessionId(){return this._sessionId}setSessionId(e){this._sessionId=e,this._serialized=void 0}setLocale(e){this._locale=e,this._serialized=void 0}serialize(){var e,t;return this._serialized||(this._serialized={applePayMerchantIdentifier:null!==(e=this.applePayMerchantIdentifier)&&void 0!==e?e:"",applicationId:this.applicationId,avt:this.avt,cashAppPayMerchantIdentifier:null!==(t=this.cashAppPayMerchantIdentifier)&&void 0!==t?t:"",hostname:this.hostname,instanceId:this.instanceId,locale:this._locale,locationId:this.locationId,merchantName:this.merchantName,parentPathname:this.parentPathname,sessionId:this._sessionId,sourceUrl:this.sourceUrl,srcDpaId:this.srcDpaId}),this._serialized}}function Em(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function bm(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Em(o,r,i,a,s,"next",e)}function s(e){Em(o,r,i,a,s,"throw",e)}a(void 0)}))}}function _m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Cm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cm(e,t):void 0}}(e,t)||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 Cm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Sm(){return(Sm=bm((function*(e,t){var n=yield Jd({frameborder:"0",height:"0",scrolling:"no",src:e,style:{border:"none",display:"block",visibility:"hidden"},width:"0"});return t.addBreadcrumb({message:"main iframe loaded"}),n}))).apply(this,arguments)}function Im(){return Im=bm((function*(e,t){var n=new Promise(((e,n)=>{var r=setTimeout((function(){var e;window.removeEventListener("message",i),n(((e=new Error("Web Payments SDK was unable to be initialized in time")).type="InitializationTimeoutError",e))}),1e4),i=function(n){"main-iframe:loaded"===n.data&&n.origin===dr.ASSET_BASE_URL&&(clearTimeout(r),window.removeEventListener("message",i),t.addBreadcrumb({message:"Processed main-iframe:loaded message"}),e())};window.addEventListener("message",i)})),r=function(e,t){return Sm.apply(this,arguments)}(e,t),i=_m(yield Promise.all([r,n]),2),o=i[0];return i[1],o})),Im.apply(this,arguments)}var wm={build:function(e,t){return Im.apply(this,arguments)},getIframeSrc:function(e){var t=new URL(dr.IFRAME_SRC);return Object.entries(e).forEach((e=>{var n=_m(e,2),r=n[0],i=n[1];t.searchParams.set(r,i)})),t.toString()}},Om=function(e){return fc({errorSerializer:{deserialize:e=>e instanceof Error?e:Do(e),serialize:e=>e instanceof hr?Ro(e):e},name:e})};function Am(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Tm(){var e;return e=function*(e,t,n,r){var i=Om(r);return i.setErrorHandler((function(e){"warning"!==e.severity&&t.captureException(e)})),i.connect({origin:dr.ASSET_URL,window:e.contentWindow},e.id),yield i.sendMessage("INITIALIZE",n),i},Tm=function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Am(o,r,i,a,s,"next",e)}function s(e){Am(o,r,i,a,s,"throw",e)}a(void 0)}))},Tm.apply(this,arguments)}var Pm={build:function(e,t,n,r){return Tm.apply(this,arguments)}};function Nm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Dm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rm(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Lm={ach_architecture_changes:"AMOUNT_SCHEMA",can_override_postal_code:!1,can_use_ach_auth:"REQUIRED",can_use_afterpay_on_shipping_options_changed:!1,can_use_apple_pay_recurring_payments:!1,can_use_interac:!1,click_to_pay_embedded_3ds:!1,eager_three_ds_method_execution_eligibility:!1,enable_payment_debug_output:"NONE",handle_insecure_contexts:"IGNORE",one_shot_authentication_apple_pay:!1,one_shot_authentication_click_to_pay:!1,one_shot_authentication_eligibility:!1,one_shot_authentication_google_pay:!1,show_square_monochrome:!1,use_new_afterpay_checkout_widget:!1},xm={ach_architecture_changes:["AMOUNT_SCHEMA"],can_use_ach_auth:["SUPPORTED","REQUIRED"],enable_payment_debug_output:["NONE","APPLE_PAY","GOOGLE_PAY"],handle_insecure_contexts:["IGNORE","WARN","BLOCK"]};function km(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Mm(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){km(o,r,i,a,s,"next",e)}function s(e){km(o,r,i,a,s,"throw",e)}a(void 0)}))}}function jm(){return jm=Mm((function*(e,t,n,r){var i=e.applicationId,o=e.locationId,s=e.hostname,c=e.sourceUrl,l=e.parentPathname;t.logEvent({errorMessage:JSON.stringify({hostname:s,sourceUrl:c}),event:"PAYMENTS_ENV_METADATA",eventSource:"WebSDK"}),t.logEvent({event:"INITIALIZATION:START",eventSource:"WebSDK"});var u,d,h=r.getCurrentLocale();try{u=yield function(e,t,n,r,i,o,a){return Um.apply(this,arguments)}(i,o,s,h,n,c,l)}catch(e){var p=(d=e)instanceof Error&&"type"in d&&"InitializationTimeoutError"===d.type?"good":"bad";if(t.logEvent({event:"INITIALIZATION:ERROR",eventSource:"WebSDK",sloStatus:p}),"bad"===p)throw n.captureException(e,{step:"MESSENGER_SETUP"}),new Ci("initializing the payment method");throw e}try{var f=yield u.request("REQUEST_HYDRATION",{body:{applicationId:i,hostname:s,locationId:o}}),m=f.avt,g=f.sessionId,v=f.applePartnerInternalMerchantIdentifier,y=f.cashAppPayMerchantIdentifier,E=f.merchantName,b=f.instanceId,_=f.paymentMethodSupportDetail,C=f.featureFlagValues,S=f.srcDpaId,I=function(e){var t,n,r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dm(Object(n),!0).forEach((function(t){Rm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Lm);for(var i of Object.entries(Lm)){var o=(n=2,function(e){if(Array.isArray(e))return e}(t=i)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,n)||function(e,t){if(e){if("string"==typeof e)return Nm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nm(e,t):void 0}}(t,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.")}()),a=o[0],s=o[1],c=a;if(c in e){var l=e[c],u=xm[c];r[c]=void 0===u?"true"===l:u.includes(l)?l:s}}return r}(C);if(!0!==a.isSecureContext){if("BLOCK"===I.handle_insecure_contexts)throw new ui;"WARN"===I.handle_insecure_contexts&&console.warn("[Square Web Payments SDK] WARNING: We have detected that this instance of the Web Payments SDK is being loaded in an insecure context.  As of October 31, 2025, the Web Payments SDK will block traffic from insecure contexts.  See https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts for more details.")}t.setAvt(m);var w=new ym({applePayMerchantIdentifier:v,applicationId:i,avt:m,cashAppPayMerchantIdentifier:y,hostname:s,instanceId:b,locale:h,locationId:o,merchantName:E,sessionId:g,sourceUrl:c,srcDpaId:S});t.setFeatureFlagValues(I),t.logEvent({event:"INITIALIZATION:OK",eventSource:"WebSDK",sloStatus:"good"},b,g);var O=function(e,t,n,r){var i,o=void 0!==t&&t.length>0?t:void 0,s=null!=n?n:"";function c(){if(i)return i;Dl(vm,"sq-threeds-modal-styles",document.head);var t=pm.setupClient(e,{avt:s,clientVersion:dr.ANALYTICS_CLIENT_VERSION,connectApiUrl:dr.CONNECT_API_URL,environment:dr.env,hostname:a.windowLocation.origin,locationId:o,messenger:r,pciConnectApiUrl:dr.API_URL,webSdkVersion:dr.VERSION});return i=t,t}return Object.freeze({execute3DSMethod:function(e){return c().execute3DSMethod(e)},verifyBuyer:function(e,t){var n,r=c(),i=mm(mm({},t),{},{billingContact:(n=t.billingContact,function(e){return"region"in e||"country"in e||"countryName"in e}(n)?n:{addressLines:n.addressLines,city:n.city,country:n.countryCode,email:n.email,familyName:n.familyName,givenName:n.givenName,phone:n.phone,postalCode:n.postalCode,region:n.state})});return r.verifyBuyer(e,i)}})}(w.applicationId,w.locationId,w.avt,u);return{analyticsBackend:O,featureFlagValues:I,localeStrings:r,messenger:u,paymentMethodSupportDetail:_,session:w}}catch(e){var A=To(e),T="WebSdkEmbedError"===A.name?"good":"bad";if(t.logEvent({event:"INITIALIZATION:ERROR",eventSource:"WebSDK",sloStatus:T}),"bad"===T)throw"AlreadyCapturedError"!==A.name&&n.captureException(e,{step:"HYDRATION_REQUEST"}),new Ci("initializing the payment method");throw A}})),jm.apply(this,arguments)}function Um(){return(Um=Mm((function*(e,t,n,r,i,o,a){var s=yield wm.build(wm.getIframeSrc({applicationId:e,hostname:n}),i);return yield Pm.build(s,i,{applicationId:e,hostname:n,locale:r,locationId:t,parentPathname:a,sourceUrl:o})}))).apply(this,arguments)}var Bm={initializePayment:function(e,t,n,r){return jm.apply(this,arguments)},validateVerificationDetails:function(e,t){var n=[];return Fo(e.billingContact)||n.push(new is(t,"details.billingContact","object")),e.intent&&"string"==typeof e.intent&&["CHARGE","STORE","CHARGE_AND_STORE"].includes(e.intent)||n.push(new is(t,"details.intent","string")),"CHARGE"!==e.intent&&"CHARGE_AND_STORE"!==e.intent||(e.amount&&"string"==typeof e.amount||n.push(new is(t,"details.amount","string")),e.currencyCode&&"string"==typeof e.currencyCode||n.push(new is(t,"details.currencyCode","string"))),n}};function qm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qm(Object(n),!0).forEach((function(t){Fm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fm(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vm(Object(n),!0).forEach((function(t){zm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zm(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ym={addressLines:"addressLines",city:"locality",country:"countryCode",postalCode:"postalCode",state:"administrativeArea"},Wm=["visa","masterCard","jcb","discover","amex"];function Km(e){var t;return{amount:e.amount,label:e.label,type:null!==(t=e.pending)&&void 0!==t&&t?"pending":"final"}}function Xm(e){return{amount:e.amount,detail:"",identifier:e.id,label:e.label}}function Jm(e,t){return t?Km(t):e}function Zm(e,t){return t?t.map(Km):e}function Qm(e,t){return t?t.map(Xm):e}function eg(e){for(var t=3;t>0&&!e.supportsVersion(t);)t-=1;return t}function tg(e){return{amount:e.amount,id:e.identifier,label:e.label}}function ng(e,t,n){return{errors:(r=e,i=[],void 0!==r.error&&i.push(new window.ApplePayError("addressUnserviceable","postalAddress",r.error)),r.shippingErrors&&Object.entries(r.shippingErrors).forEach((e=>{var t,n,r,o=(r=2,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(n,r)||function(e,t){if(e){if("string"==typeof e)return $m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$m(e,t):void 0}}(n,r)||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.")}()),a=o[0],s=o[1],c=null!==(t=Ym[a])&&void 0!==t?t:"postalAddress";i.push(new window.ApplePayError("shippingContactInvalid",c,s))})),i),newLineItems:Zm(t.lineItems,Fl(e,n)),newShippingMethods:Qm(t.shippingMethods,e.shippingOptions),newTotal:Jm(t.total,e.total)};var r,i}function rg(e){return new Date(e).toISOString()}function ig(e){var t,n={amount:e.amount,label:e.label,paymentTiming:"recurring",recurringPaymentIntervalCount:1,recurringPaymentIntervalUnit:"month",recurringPaymentStartDate:rg(e.startDate)};if(e.frequency){var r="yearly"in(t=e.frequency)?{recurringPaymentIntervalCount:t.yearly.occurrence,recurringPaymentIntervalUnit:"year"}:"daily"in t?{recurringPaymentIntervalCount:t.daily.occurrence,recurringPaymentIntervalUnit:"day"}:{recurringPaymentIntervalCount:t.monthly.occurrence,recurringPaymentIntervalUnit:"month"};n.recurringPaymentIntervalUnit=r.recurringPaymentIntervalUnit,n.recurringPaymentIntervalCount=r.recurringPaymentIntervalCount}return n}var og=Ns({name:Ds({nonBlank:!0}),value:Ds({nonBlank:!0})}),ag=Ns({amount:Ds({nonBlank:!0}),frequency:ws(fs()),label:Ds({nonBlank:!0}),startDate:Ds({nonBlank:!0})}),sg=Ns({billingAgreement:ws(Ds({nonBlank:!0})),managementURL:Ds({nonBlank:!0}),paymentDescription:Ds({nonBlank:!0}),regularBilling:ag,tokenNotificationURL:ws(Ds({nonBlank:!0})),trialBilling:ws(ag)}),cg=Is([{eligible:e=>Fo(e)&&"intent"in e&&"RECURRING_CHARGE"===e.intent,schemaOperation:Ns({intent:Ds({legalValues:["RECURRING_CHARGE"]}),recurringPaymentRequest:sg})},{eligible:e=>Fo(e)&&(!("intent"in e)||"CHARGE"===e.intent)&&!("recurringPaymentRequest"in e),schemaOperation:Ns({intent:ws(Ds({legalValues:["CHARGE"]}))})}],{code:"invalid_value",expected:"recurringPaymentRequest can only be present when intent is RECURRING_CHARGE",propertyPath:"recurringPaymentRequest"}),lg=ws(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{isRecordSchema:!0,sanitizeFunction:function(e){var n={};for(var r of t){var i=r.sanitizeFunction(e);n=Hm(Hm({},n),i)}return n},validateFunction:function(e,n){var r=[];for(var i of t)r.push(...i.validateFunction(e,n));return r}}}(Ns({additionalSignals:ws(gs(og)),cashCustomerToken:ws(Ds({nonBlank:!0})),squareProduct:ws(Ds({nonBlank:!0}))}),cg));function ug(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ug(Object(n),!0).forEach((function(t){hg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ug(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hg(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pg(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function fg(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){pg(o,r,i,a,s,"next",e)}function s(e){pg(o,r,i,a,s,"throw",e)}a(void 0)}))}}class mg extends Error{}var gg=[{messageContains:"",name:"SecurityError",unsupportedReason:ts.MISC_THIRD_PARTY_IFRAME_NOT_ALLOWED},{messageContains:"insecure document",name:"InvalidAccessError",unsupportedReason:ts.APPLE_PAY_REQUIRES_SECURE_CONTEXT},{messageContains:"insecure parent frame",name:"InvalidAccessError",unsupportedReason:ts.APPLE_PAY_REQUIRES_SECURE_CONTEXT},{messageContains:"different security origin",name:"InvalidAccessError",unsupportedReason:ts.APPLE_PAY_CONSISTENT_DOMAIN_REQUIRED}];class vg extends Ms{constructor(e,t,n){if(super(t),this.methodType=Nr.APPLE_PAY,this.sessionInProgress=!1,this.wasFirstInteractionCalled=!1,this.paymentMethodMessenger=new tl(this.context),this.paymentRequestLockController=n,this.req=e,this.req.addPaymentMethodUsage("Apple Pay"),void 0===window.ApplePaySession)throw new di(ts.APPLE_PAY_BROWSER_NOT_SUPPORTED);var r;try{r=window.ApplePaySession.canMakePayments()}catch(e){var i=To(e);for(var o of gg)if(i.name===o.name&&i.message.includes(o.messageContains))throw new di(o.unsupportedReason);throw e}if(!r)throw new di(ts.APPLE_PAY_DEVICE_NOT_SUPPORTED);this.SessionHandle=window.ApplePaySession,this.validateConfiguration(),this.tokenize=this.withErrorHandling(this.tokenize.bind(this),"tokenize")}tokenize(e){var t=this;return fg((function*(){t.handleFirstInteraction(),t.throwIfDestroyed();var n=function(e,t){return Ls(lg).logValidationFailures(t,Nr.APPLE_PAY,"tokenize",e,""),null!=e?e:{}}(e,t.metricsHandler),r=t.context.getFeatureFlagValues();if("RECURRING_CHARGE"===n.intent&&!r.can_use_apple_pay_recurring_payments)throw new di(ts.INVALID_CONFIG,"Apple Pay recurring payments are not enabled");var i,o="RECURRING_CHARGE"===n.intent?n.recurringPaymentRequest:void 0;if(t.sessionInProgress)throw new _i([js]);t.applePayPaymentRequest=function(e,t,n){var r=[...Wm];null!=t&&t&&r.push("interac");var i,o,a,s,c,l={countryCode:e.countryCode,currencyCode:e.currencyCode,lineItems:Zm([],Fl(e)),merchantCapabilities:["supports3DS"],requiredBillingContactFields:["postalAddress"],shippingMethods:Qm([],e.shippingOptions),supportedNetworks:r,total:Km(e.total)};return e.shippingContact&&(l.shippingContact={addressLines:(i=e.shippingContact).addressLines,administrativeArea:i.state,country:kl[null!==(o=i.countryCode)&&void 0!==o?o:""],countryCode:i.countryCode,emailAddress:i.email,familyName:i.familyName,givenName:i.givenName,locality:i.city,phoneNumber:i.phone,postalCode:i.postalCode}),e.requestBillingContact&&(l.requiredShippingContactFields=["email","name","phone"]),e.requestShippingContact&&(l.requiredShippingContactFields=["postalAddress","name","email","phone"]),n&&(l.recurringPaymentRequest=(s=ig((a=n).regularBilling),c={managementURL:a.managementURL,paymentDescription:a.paymentDescription,regularBilling:s},void 0!==a.trialBilling&&(c.trialBilling=ig(a.trialBilling)),go.isNonBlankString(a.billingAgreement)&&(c.billingAgreement=a.billingAgreement),go.isNonBlankString(a.tokenNotificationURL)&&(c.tokenNotificationURL=a.tokenNotificationURL),c)),l}(t.req,r.can_use_interac,o),t.logDebugInfoIfEnabled(t.applePayPaymentRequest);try{i=new t.SessionHandle(eg(t.SessionHandle),t.applePayPaymentRequest)}catch(e){var a=function(e){var t=To(e);if("InvalidAccessError"===t.name&&"Must create a new ApplePaySession from a user gesture handler."===t.message)return{detail:"Due to Apple Pay security requirements, no async operations (like API calls or await statements) can occur between the button click and the tokenize() call.",message:"Apple Pay session creation failed. No async operations can be called between the user gesture (click) and tokenize().",type:"INVALID_APPLE_PAY_SESSION_CONTEXT"}}(e);if(void 0!==a)throw new _i([a]);throw e}var s=t.shippingContactChanged.bind(t);i.onshippingcontactselected=e=>{s(e.shippingContact,t.applePayPaymentRequest)};var c=t.shippingOptionChanged.bind(t);i.onshippingmethodselected=e=>{c(e.shippingMethod,t.applePayPaymentRequest)};var l,u,d=new Promise(((e,t)=>{i.oncancel=()=>{t(new mg)}})),h=new Promise(((e,n)=>{i.onvalidatemerchant=r=>{t.requestApplePayMerchantValidity(r.validationURL,t.applePayPaymentRequest).then(e).catch((e=>{n(To(e))}))}})),p=new Promise(((e,n)=>{i.onpaymentauthorized=r=>{t.requestApplePayCardNonce(r).then(e).catch((e=>{n(To(e))}))}}));t.currentSession=i,t.sessionInProgress=!0,t.paymentRequestLockController.lock(t),t.metricsHandler.logEvent("EXTERNAL_SESSION:START"),i.begin();try{var f=yield Promise.race([h,d]);i.completeMerchantValidation(f);var m=yield Promise.race([p,d]);l=m.token,u=m.details,t.metricsHandler.logEvent("EXTERNAL_SESSION:OK")}catch(e){if(e instanceof mg)return t.metricsHandler.logEvent("EXTERNAL_SESSION:CANCEL"),{status:Dr};throw t.metricsHandler.logEvent("EXTERNAL_SESSION:ERROR"),e}finally{t.deleteApplePaySession()}if(t.context.getFeatureFlagValues().one_shot_authentication_apple_pay){var g,v=n.additionalSignals,y=n.squareProduct,E=n.cashCustomerToken,b=dg(dg(dg({},void 0!==v&&{additionalSignals:v}),{},{amount:t.req.total.amount,billingContact:null!==(g=u.billing)&&void 0!==g?g:{}},void 0!==E&&{cashCustomerToken:E}),{},{currencyCode:t.req.currencyCode,customerInitiated:!0,intent:"RECURRING_CHARGE"===n.intent?"CHARGE_AND_STORE":"CHARGE",sellerKeyedIn:!1},void 0!==y&&{squareProduct:y});yield Mh(t.context,b,l)}return{details:u,status:xr,token:l}}))()}destroy(){return this.currentSession&&(this.abortSessionSafely(),this.deleteApplePaySession()),this.status=Es.DESTROYED,this.metricsHandler.logConfigurationEvent("DESTROYED"),Promise.resolve(!0)}validateConfiguration(){var e=this.session;if(void 0===e.applePayMerchantIdentifier||""===e.applePayMerchantIdentifier)throw new di(ts.INVALID_CONFIG,"applePayMerchantIdentifier");if(void 0===e.locationId||""===e.locationId)throw new di(ts.INVALID_CONFIG,"locationId")}requestApplePayCardNonce(e){var t=this;return fg((function*(){var n,r={applepayData:e.payment},i=null!==(n=t.selectedShippingMethod)&&void 0!==n?n:t.getDefaultShippingMethod();try{var o=yield t.paymentMethodMessenger.request("REQUEST_APPLE_PAY_CARD_NONCE",r);return t.getApplePaySession().completePayment(t.SessionHandle.STATUS_SUCCESS),t.context.setPaymentMethodTrackingId(o.paymentMethodTrackingId),t.wasFirstInteractionCalled=!1,function(e,t){var n=e.card,r=e.cardNonce,i=e.shippingContact,o=e.billingContact,a={details:{card:n,method:Nr.APPLE_PAY},token:r};if(i){var s={contact:i};t&&(s.option=tg(t)),a.details.shipping=s}return o&&(a.details.card&&(a.details.card.billing=o),a.details.billing=o),a}(o,i)}catch(e){throw t.getApplePaySession().completePayment(t.SessionHandle.STATUS_FAILURE),e}}))()}requestApplePayMerchantValidity(e,t){var n=this;return fg((function*(){var r,i=t.total.label,o=n.session,a={clientId:o.applicationId,locationId:o.locationId,merchantName:i,sourceUrl:o.sourceUrl,validationUrl:e};try{r=yield n.paymentMethodMessenger.request("REQUEST_APPLE_PAY_MERCHANT_VALIDITY",a)}catch(e){throw n.abortSessionSafely(),e}try{return JSON.parse(r.session)}catch(e){throw n.abortSessionSafely(),e}}))()}shippingContactChanged(e,t){var n,r,i,o,a,s,c,l,u,d,h=eg(this.SessionHandle)>=3?this.updateApplePayShippingContactV3(t):this.updateApplePayShippingContactLegacy(t);this.req.hasEventListener(Tr.SHIPPING_CONTACT_CHANGED)?this.req.dispatchEvent(Tr.SHIPPING_CONTACT_CHANGED,{contactOrOption:(n=e,r=n.addressLines,i=n.locality,o=n.administrativeArea,a=n.postalCode,s=n.countryCode,c=n.givenName,l=n.familyName,u=n.emailAddress,d=n.phoneNumber,{addressLines:r,city:i,countryCode:null==s?void 0:s.toUpperCase(),email:u,familyName:l,givenName:c,phone:d,postalCode:a,state:o})},(e=>{this.metricsHandler.logConfigurationEvent("EVENT_LISTENER_ON_COMPLETE_RESPONSE",dg(dg({},e),{},{eventName:Tr.SHIPPING_CONTACT_CHANGED})),this.handleShippingContactUpdate(h,e)})):this.handleShippingContactUpdate(h)}handleShippingContactUpdate(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null===(t=n.shippingOptions)||void 0===t?void 0:t[0],i=this.getDefaultShippingMethod();void 0===r&&null!==i&&(r=tg(i)),void 0!==r&&this.req.hasEventListener(Tr.SHIPPING_OPTION_CHANGED)?(this.selectedShippingMethod=Xm(r),this.req.dispatchEvent(Tr.SHIPPING_OPTION_CHANGED,{contactOrOption:r},(t=>{this.metricsHandler.logConfigurationEvent("EVENT_LISTENER_ON_COMPLETE_RESPONSE",dg(dg({},t),{},{eventName:Tr.SHIPPING_OPTION_CHANGED})),e(dg(dg({},n),t))}))):e(n)}shippingOptionChanged(e,t){this.selectedShippingMethod=e;var n=eg(this.SessionHandle)>=3?this.updateApplePayShippingMethodV3(t):this.updateApplePayShippingMethodLegacy(t);this.req.hasEventListener(Tr.SHIPPING_OPTION_CHANGED)?this.req.dispatchEvent(Tr.SHIPPING_OPTION_CHANGED,{contactOrOption:tg(e)},n):n({})}updateApplePayPaymentRequest(e){this.applePayPaymentRequest.total=e.newTotal,e.newLineItems&&(this.applePayPaymentRequest.lineItems=e.newLineItems),function(e){return"newShippingMethods"in e}(e)&&(this.applePayPaymentRequest.shippingMethods=e.newShippingMethods)}updateApplePayShippingContactV3(e){return t=>{var n=ng(t,e,this.req);this.updateApplePayPaymentRequest(n),this.metricsHandler.logEvent("SHIPPING_ADDRESS_CHANGE:OK"),this.getApplePaySession().completeShippingContactSelection(n)}}updateApplePayShippingContactLegacy(e){return t=>{var n=function(e,t,n,r){return Gm({status:r},ng(e,t,n))}(t,e,this.req,this.SessionHandle.STATUS_SUCCESS);this.updateApplePayPaymentRequest(n),this.metricsHandler.logEvent("SHIPPING_ADDRESS_CHANGE:OK"),this.getApplePaySession().completeShippingContactSelection(n.status,n.newShippingMethods,n.newTotal,n.newLineItems)}}updateApplePayShippingMethodV3(e){return t=>{var n=function(e,t,n){return{newLineItems:Zm(t.lineItems,Fl(e,n)),newTotal:Jm(t.total,e.total)}}(t,e,this.req);this.updateApplePayPaymentRequest(n),this.metricsHandler.logEvent("SHIPPING_OPTION_CHANGE:OK"),this.getApplePaySession().completeShippingMethodSelection(n)}}updateApplePayShippingMethodLegacy(e){return t=>{var n=function(e,t,n,r){return Gm({status:r},ng(e,t,n))}(t,e,this.req,this.SessionHandle.STATUS_SUCCESS);this.updateApplePayPaymentRequest(n),this.metricsHandler.logEvent("SHIPPING_OPTION_CHANGE:OK"),this.getApplePaySession().completeShippingMethodSelection(n.status,n.newTotal,n.newLineItems)}}getDefaultShippingMethod(){return this.applePayPaymentRequest.shippingMethods.length>0?this.applePayPaymentRequest.shippingMethods[0]:null}deleteApplePaySession(){delete this.currentSession,this.paymentRequestLockController.unlock(this),this.sessionInProgress=!1}handleFirstInteraction(){this.wasFirstInteractionCalled||(this.metricsHandler.logEvent("FIRST_INTERACTION:OK"),this.wasFirstInteractionCalled=!0)}abortSessionSafely(){try{this.getApplePaySession().abort()}catch(e){}}getApplePaySession(){if(void 0===this.currentSession)throw new Ci("getting Apple Pay Session");return this.currentSession}logDebugInfoIfEnabled(e){"APPLE_PAY"===this.context.getFeatureFlagValues().enable_payment_debug_output&&console.debug(e)}}var yg=Is([{eligible:function(e){return Fo(e)&&"email"in e},schemaOperation:Ns({dpaPresentationName:ws(Ds({nonBlank:!0})),email:Ds({formatExample:"example@domain.com",matchRegexp:/^\S+@\S+\.\S+$/,nonBlank:!0})})},{eligible:function(e){return Fo(e)&&"mobileNumber"in e},schemaOperation:Ns({dpaPresentationName:ws(Ds({nonBlank:!0})),mobileNumber:Ns({countryCode:Ds({formatExample:"+X / +XX / +XXX (non-zero first digit)",matchRegexp:/^\+?[1-9]\d{0,2}$/,nonBlank:!0},(e=>e.replace(/\+/g,""))),phoneNumber:Ds({nonBlank:!0},(e=>e.replace(/[^\d]/g,"")))})})}],{code:"missing_property",expected:"string",propertyPath:"email"});class Eg extends Error{constructor(){super("Click to Pay checkout was canceled by the user."),this.name="ClickToPayCanceledError"}}function bg(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}var _g="".concat(dr.ASSET_URL,"/modal.css");class Cg{constructor(e){var t=e.paymentMethods.clickToPay.modal;this.modalVeilContext=document.createElement("div"),this.modalVeilContext.className="modal-veil-context";var n=document.createElement("div");n.className="modal-veil",this.modal=document.createElement("div"),this.modal.classList.add("modal"),this.modal.setAttribute("role","dialog"),this.modal.setAttribute("aria-modal","true"),this.modal.setAttribute("aria-labelledby","ctp-modal-title");var r=document.createElement("div");r.classList.add("header-left");var i=document.createElement("img");i.classList.add("ctp-logo"),i.src=dr.staticAsset("click-to-pay/ctp-logo.svg"),i.alt="",i.setAttribute("aria-hidden","true");var o=document.createElement("span");o.classList.add("header-title"),o.id="ctp-modal-title",o.textContent=t.headerTitle,r.appendChild(i),r.appendChild(o);var a=document.createElement("div");a.classList.add("header-right");var s,c=document.createElement("img");c.classList.add("card-networks"),c.src=dr.staticAsset("click-to-pay/card-networks.svg"),c.alt=t.cardNetworksAlt,this.cancelButton=document.createElement("button"),this.cancelButton.classList.add("cancel"),this.cancelButton.setAttribute("type","button"),this.cancelButton.setAttribute("aria-label",t.cancelAriaLabel),this.cancelButton.innerHTML='<svg width="'.concat(s=48,'" height="').concat(s,'" viewBox="0 0 ').concat(s," ").concat(s,'" fill="none" xmlns="http://www.w3.org/2000/svg">\n    <rect width="').concat(s,'" height="').concat(s,'" rx="').concat(Math.floor(24),'" fill="black" fill-opacity="0.05"/>\n    <path d="M18.71 30.71L24 25.41L29.29 30.71L30.71 29.29L25.41 24L30.71 18.71L29.29 17.29L24 22.59L18.71 17.29L17.29 18.71L22.59 24L17.29 29.29L18.71 30.71Z" fill="black" fill-opacity="0.9"/>\n  </svg>'),a.appendChild(c),a.appendChild(this.cancelButton);var l=document.createElement("div");l.classList.add("modal-header","content"),l.appendChild(r),l.appendChild(a),this.contentElement=document.createElement("div"),this.contentElement.classList.add("content"),this.contentElement.classList.add("modal-body"),this.contentElement.id="js-content",this.modal.appendChild(l),this.modal.appendChild(this.contentElement),n.appendChild(this.modal),this.modalVeilContext.appendChild(n)}getElement(){return this.modalVeilContext}getContentElement(){return this.contentElement}getCancelButton(){return this.cancelButton}loadStyles(){var e,t=this;return(e=function*(){yield Dl(_g,"click-to-pay-modal-styles",t.modalVeilContext)},function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){bg(o,r,i,a,s,"next",e)}function s(e){bg(o,r,i,a,s,"throw",e)}a(void 0)}))})()}showModal(){this.modalVeilContext.setAttribute("active",""),this.modal.removeAttribute("hidden"),this.contentElement.innerHTML=""}hideModal(){return this.modal.setAttribute("hidden",""),new Promise((e=>{setTimeout((()=>{this.modalVeilContext.removeAttribute("active"),e()}),240)}))}}function Sg(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Ig(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Sg(o,r,i,a,s,"next",e)}function s(e){Sg(o,r,i,a,s,"throw",e)}a(void 0)}))}}var wg=["mastercard","visa"];class Og extends Ms{constructor(e,t,n,r,i){var o;super(n),this.methodType="Click to Pay",this.tokenizeInProgress=!1,this.wasFirstInteractionCalled=!1,this.paymentRequestLockController=i,this.mastercardSdk=e,this.req=t,this.srcDpaId=n.getSession().srcDpaId,function(e){if(!Fo(e))throw new Jr("Click to Pay options must be an object.");var t=Ls(yg).validate(e);if(!t.isValid)throw wc(t.issues,"Click to Pay constructor")}(r),this.clickToPayOptions=(o=r,Ls(yg).sanitize(o)),this.clickToPayButton=null,this.element=null,this.modal=new Cg(this.context.getLocaleString()),this.paymentMessenger=new tl(this.context),this.attach=this.withErrorHandling(this.attach.bind(this),"attach"),this.tokenize=this.withErrorHandling(this.tokenize.bind(this),"tokenize"),this.paymentRequestLockController.lock(this),this.uiScriptsLoadedPromise=vp.attachUiScripts()}attach(e){var t=this;return Ig((function*(){t.throwIfDestroyedOrAlreadyAttached(),t.status=Es.ATTACHED;try{t.element=Il(e),yield t.uiScriptsLoadedPromise}catch(e){throw t.status=Es.DETACHED,e}return document.body.appendChild(t.modal.getElement()),yield t.modal.loadStyles(),t.clickToPayButton=document.createElement("src-button"),t.clickToPayButton.setAttribute("card-brands",wg.join(", ")),t.element.appendChild(t.clickToPayButton),Promise.resolve()}))()}initialize(){var e=this;return Ig((function*(){var t,n=e.context.getSession().locale;yield e.mastercardSdk.init({cardBrands:wg,checkoutExperience:"WITHIN_CHECKOUT",dpaData:{dpaName:"production"===dr.env?"Click To Pay":"ClickToPayStaging",dpaPresentationName:null!==(t=e.clickToPayOptions.dpaPresentationName)&&void 0!==t?t:"Square Inc."},dpaTransactionOptions:{consumerEmailAddressRequested:!0,consumerNameRequested:!0,consumerPhoneNumberRequested:!0,dpaBillingPreference:"FULL",dpaLocale:go.convertLocaleToUnderscore(n)},srcDpaId:e.srcDpaId});var r=function(e){if("email"in e)return{email:e.email};var t=e.mobileNumber,n=t.countryCode,r=t.phoneNumber;return{countryCode:n,phoneNumber:Number(r)}}(e.clickToPayOptions);try{if(!(yield e.mastercardSdk.idLookup(r)).consumerPresent)throw new di({message:"Buyer is not registered for Click to Pay",type:"BUYER_NOT_REGISTERED"})}catch(e){var i=To(e);if("click2PayError"===i.name&&"reason"in i&&"ACCT_INACCESSIBLE"===i.reason)throw new di({message:"Buyer is not registered for Click to Pay",type:"BUYER_NOT_REGISTERED"});throw e}}))()}tokenize(){var e=this;return Ig((function*(){if(e.throwIfDestroyedOrNotAttached(),e.handleFirstInteraction(),e.tokenizeInProgress)throw new _i([js]);e.tokenizeInProgress=!0;var t=!1;e.modal.showModal(),e.metricsHandler.logEvent("EXTERNAL_SESSION:START");var n=document.createElement("iframe");n.classList.add("embedded-iframe");var r=e.modal.getContentElement();r.appendChild(n);var i=function(e){if("email"in e)return{consumerIdentity:{identityType:"EMAIL_ADDRESS",identityValue:e.email}};var t=e.mobileNumber,n=t.countryCode,r=t.phoneNumber;return{consumerIdentity:{identityType:"MOBILE_PHONE_NUMBER",identityValue:n.concat(r)}}}(e.clickToPayOptions),o=e.modal.getCancelButton(),a=new Promise(((e,t)=>{o.addEventListener("click",(()=>{t(new Eg)}))}));try{var s=yield Promise.race([e.mastercardSdk.authenticate({accountReference:i,windowRef:n.contentWindow}),a]);if(r.removeChild(n),yield Promise.race([e.displayCards(s.cards,a),a]),void 0===e.selectedCardId)throw new Error("No card selected for Click to Pay");r.appendChild(n);var c=yield Promise.race([e.mastercardSdk.checkoutWithCard({srcDigitalCardId:e.selectedCardId,windowRef:n.contentWindow}),a]);if("CANCEL"===c.checkoutActionCode)throw new Eg;if("COMPLETE"!==c.checkoutActionCode)throw new Error("Click to Pay checkout did not complete successfully");var l=yield e.paymentMessenger.request("REQUEST_CLICK_TO_PAY_CARD_NONCE",{clickToPayData:{checkout_response:c.checkoutResponse,merchant_transaction_id:c.headers["merchant-transaction-id"],src_cx_flow_id:c.headers["x-src-cx-flow-id"]}}),u=l.cardNonce;e.metricsHandler.logEvent("EXTERNAL_SESSION:OK"),t=!0,e.context.setPaymentMethodTrackingId(l.paymentMethodTrackingId);var d=e.context.getFeatureFlagValues();if(d.one_shot_authentication_click_to_pay&&!d.click_to_pay_embedded_3ds){var h={amount:e.req.total.amount,billingContact:{},currencyCode:e.req.currencyCode,customerInitiated:!0,intent:"CHARGE",sellerKeyedIn:!1};yield Mh(e.context,h,u)}return{details:{card:l.card,method:"Click To Pay"},status:"OK",token:u}}catch(n){if(n instanceof Eg)return e.metricsHandler.logEvent("EXTERNAL_SESSION:CANCEL"),{status:"Cancel"};throw t||e.metricsHandler.logEvent("EXTERNAL_SESSION:ERROR"),n}finally{yield e.modal.hideModal(),e.tokenizeInProgress=!1,e.selectedCardId=void 0}}))()}destroy(){return this.status!==Es.ATTACHED?Promise.resolve(!1):(this.selectedCardId=void 0,document.body.removeChild(this.modal.getElement()),this.element.removeChild(this.clickToPayButton),this.status=Es.DESTROYED,this.paymentRequestLockController.unlock(this),Promise.resolve(!0))}handleFirstInteraction(){this.wasFirstInteractionCalled||(this.wasFirstInteractionCalled=!0,this.metricsHandler.logEvent("FIRST_INTERACTION:OK"))}displayCards(e,t){var n=this;return Ig((function*(){var r=n.context.getSession().locale,i=document.createElement("src-card-list");i.setAttribute("card-brands",wg.join(", ")),i.setAttribute("locale",go.convertLocaleToUnderscore(r)),i.setAttribute("card-selection-type","radioButton"),i.setAttribute("display-header","false");var o=document.createElement("button");o.classList.add("ctp-continue-button"),o.textContent=n.context.getLocaleString().paymentMethods.clickToPay.modal.continueButton;var a=n.modal.getContentElement();a.appendChild(i),a.appendChild(o),yield Promise.race([customElements.whenDefined("src-card-list"),t]);var s=i,c=!1;return s.addEventListener("selectSrcDigitalCardId",(e=>{var t=e;n.selectedCardId=t.detail,c||(c=!0,n.metricsHandler.logEvent("CARD_SELECTED:OK"))})),s.loadCards(e),n.metricsHandler.logEvent("CARDS_SHOWN:OK"),new Promise((e=>{o.addEventListener("click",(()=>{n.metricsHandler.logEvent("CONTINUE_CLICKED:OK"),a.removeChild(i),a.removeChild(o),e()}))}))}))()}}var Ag=function(e,t,n,r,i){return new Ru(e,t,n,r,i)},Tg=function(e,t,n){return new vg(e,t,n)},Pg=function(e,t,n,r,i){return new cp(e,t,n,r,i)},Ng=function(e,t,n,r,i){return new Og(e,t,r,n,i)},Dg=function(e,t,n,r,i){return new of(e,t,n,r,i)};function Rg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Lg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lg(e,t):void 0}}(e,t)||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 Lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xg(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function kg(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){xg(o,r,i,a,s,"next",e)}function s(e){xg(o,r,i,a,s,"throw",e)}a(void 0)}))}}var Mg=["addEventListener","attach","clear","configure","destroy","detach","focus","recalculateSize","removeEventListener","setError","tokenize"],jg=["addEventListener","attach","destroy","detach","removeEventListener","tokenize"],Ug=["addEventListener","destroy","removeEventListener","tokenize"],Bg=["addEventListener","destroy","removeEventListener","tokenize"],qg=["addEventListener","attach","clear","configure","destroy","detach","focus","removeEventListener","setError","tokenize"],Hg=["addEventListener","attach","attachCheckoutWidget","attachMessaging","destroy","detach","displayInformationModal","removeEventListener","tokenize"],Fg=["addEventListener","attach","destroy","detach","removeEventListener"],Vg=["attach","destroy","tokenize"],Gg=["addEventListener","attach","registerPayment"],zg=["destroy","tokenize"];function $g(e,t){var n=t.paymentMethodSupportDetail,r=t.getSession();if(!go.isNonBlankString(r.locationId))throw new di(ts.INVALID_CONFIG,"locationId");var i=n[e];if(void 0!==i&&!i.IsSupported){var o=i.UnsupportedReasonType,a=ts.UNKNOWN;throw function(e){return ns.includes(e)}(o)&&(a=rs[o]),new di(a)}}function Yg(e){if(!(e instanceof Mp))throw new Wr([["paymentRequest","PaymentRequest"]])}function Wg(e,t){var n=t instanceof Error&&go.isInstanceOf(t,es("build"));return e.metricsHandler.logEvent("BUILD:ERROR",n?"good":"bad"),n?(e.metricsHandler.logDeveloperError(t,"build"),t):t instanceof Ci?t:(e.errorLogger.captureException(t),new Ci("initializing ".concat(e.metricsHandler.methodType)))}class Kg{constructor(e,t,n){this.localeStrings=new qo(navigator.language),this.paymentOptions=e,this.metrics=t,this.errorLogger=n,this.paymentRequestLockMap=new WeakMap,this.paymentsNumCalls=1}setLocale(e){var t=this;return kg((function*(){try{var n=yield t.getPaymentContext("WebSDK");return n.metricsHandler.logConfigurationEvent("SET_LOCALE",e),n.setLocale(e)}catch(e){if(function(e){return Object.values(wo).some((t=>e instanceof t))}(e))throw t.errorLogger.captureException(e),new Ci("setting the locale");throw e}}))()}verifyBuyer(e,t){var n=this;return kg((function*(){var r=[];if(n.paymentOptions.locationId&&0!==n.paymentOptions.locationId.length||r.push(new is("verifyBuyer","locationId","string")),e&&"string"==typeof e&&0!==e.length||r.push(new is("verifyBuyer","source","string")),Fo(t)?r.push(...Bm.validateVerificationDetails(t,"verifyBuyer")):r.push(new is("verifyBuyer","details","object")),r.length>0)throw new os(r);var i=yield n.getPaymentContext("WebSDK");try{i.metricsHandler.logEvent("VERIFICATION:START");var o=yield i.analyticsBackend.verifyBuyer(e,t);return i.metricsHandler.logEvent("VERIFICATION:OK"),o}catch(e){if(i.metricsHandler.logEvent("VERIFICATION:ERROR"),Gr(e))throw new Vr(e);throw"UnexpectedAnalyticsClientError"!==To(e).name&&n.errorLogger.captureException(e),new Ci("verifying buyer")}}))()}card(e){var t=this;return kg((function*(){var n=yield t.getPaymentContext(Nr.CARD);n.metricsHandler.logEvent("BUILD:START");try{var r=new Jh(n,e);return n.metricsHandler.logEvent("BUILD:OK","good"),Xg(r,Mg)}catch(e){throw Wg(n,e)}}))()}paymentRequest(e){var t=new lf,n=new Mp(e,this.localeStrings,t);return this.paymentRequestLockMap.set(n,t),this.getPaymentContext("Payment Request").then((t=>{var r=t.metricsHandler;n.setMetricsHandler(r),Vl(e.total,e.currencyCode,r,"create"),r.logConfigurationEvent("CONFIGURED",e)})),n}googlePay(e){var t=this;return kg((function*(){var n=yield t.getPaymentContext(Nr.GOOGLE_PAY);n.metricsHandler.logEvent("BUILD:START");try{$g("GOOGLE_PAY",n),function(){if("undefined"==typeof ShadowRoot)throw new di(ts.GOOGLE_PAY_BROWSER_NOT_SUPPORTED)}(),Yg(e);var r=t.getPaymentRequestLock(e),i=Rg(yield cf(n),2),o=i[0],a=i[1],s=Dg(o,e,n,a,r);return n.metricsHandler.logEvent("BUILD:OK","good"),Xg(s,jg)}catch(e){throw Wg(n,e)}}))()}applePay(e){var t=this;return kg((function*(){var n=yield t.getPaymentContext(Nr.APPLE_PAY);n.metricsHandler.logEvent("BUILD:START");try{$g("APPLE_PAY",n),Yg(e);var r=t.getPaymentRequestLock(e),i=Tg(e,n,r);return n.metricsHandler.logEvent("BUILD:OK","good"),Xg(i,Ug)}catch(e){throw Wg(n,e)}}))()}ach(e){var t=this;return kg((function*(){var n=yield t.getPaymentContext(Nr.ACH);n.metricsHandler.logEvent("BUILD:START");try{$g("ACH",n);var r=yield $s.load("plaid-link",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js"},"Plaid"),i=new gl(n,r,e);return n.metricsHandler.logEvent("BUILD:OK","good"),Xg(i,Bg)}catch(e){throw Wg(n,e)}}))()}bitcoin(){var e=this;return kg((function*(){var t=yield e.getPaymentContext("Bitcoin");t.metricsHandler.logEvent("BUILD:START");try{$g("BITCOIN",t);var n=yield Yd.initialize(),r=new zd(t,n);return t.metricsHandler.logEvent("BUILD:OK","good"),Xg(r,Gg)}catch(e){throw Wg(t,e)}}))()}bank(){var e=this;return kg((function*(){var t=yield e.getPaymentContext("Bank");t.metricsHandler.logEvent("BUILD:START");try{$g("BANK",t);var n=new Mu(t);return yield n.initialize(),t.metricsHandler.logEvent("BUILD:OK","good"),Xg(n,zg)}catch(e){throw Wg(t,e)}}))()}giftCard(e){var t=this;return kg((function*(){var n=yield t.getPaymentContext(Nr.GIFT_CARD);n.metricsHandler.logEvent("BUILD:START");try{var r=new wp(n,e);return n.metricsHandler.logEvent("BUILD:OK","good"),Xg(r,qg)}catch(e){throw Wg(n,e)}}))()}afterpayClearpay(e){var t=this;return kg((function*(){var n=yield t.getPaymentContext(Nr.AFTERPAY_CLEARPAY);n.metricsHandler.logEvent("BUILD:START");try{$g("AFTERPAY",n),Yg(e);var r=t.getPaymentRequestLock(e),i=Rg(yield Lu(),2),o=i[0],a=i[1],s=Ag(o,a,e,n,r);return yield s.internalSetCheckoutToken(),n.metricsHandler.logEvent("BUILD:OK","good"),Xg(s,Hg)}catch(e){throw Wg(n,e)}}))()}cashAppPay(e,t){var n=this;return kg((function*(){var r=yield n.getPaymentContext(Nr.CASH_APP_PAY);r.metricsHandler.logEvent("BUILD:START");try{$g("CASH_APP_PAY_V1",r),Yg(e);var i=n.getPaymentRequestLock(e),o=yield up.initialize(),a=Pg(o,e,t,r,i);return yield a.initializeCustomerRequest(),r.metricsHandler.logEvent("BUILD:OK","good"),Xg(a,Fg)}catch(e){throw Wg(r,e)}}))()}clickToPay(e,t){var n=this;return kg((function*(){var r=yield n.getPaymentContext("Click to Pay");r.metricsHandler.logEvent("BUILD:START");try{Yg(e);var i=n.getPaymentRequestLock(e),o=r.getSession(),a=o.srcDpaId,s=o.locale;if(!go.isNonBlankString(a))throw new di(ts.INVALID_CONFIG,"srcDpaId");var c=yield vp.initialize(go.convertLocaleToUnderscore(s),a),l=Ng(c,e,t,r,i);return yield l.initialize(),r.metricsHandler.logEvent("BUILD:OK","good"),Xg(l,Vg)}catch(e){throw Wg(r,e)}}))()}markPaymentsReuse(){this.paymentsNumCalls+=1,this.metrics.logEvent({errorMessage:JSON.stringify({paymentsNumCalls:this.paymentsNumCalls}),event:"PAYMENTS_REUSE",eventSource:"WebSDK"})}getPaymentContext(e){var t=this;return kg((function*(){var n,r=yield t.initializePaymentMethod(),i=r.featureFlagValues,o=r.messenger,a=r.session,s=r.paymentMethodSupportDetail,c=r.analyticsBackend,l={instanceId:a.instanceId,sessionId:a.sessionId};void 0!==a.avt&&(t.errorLogger.setUser(a.avt),l.avt=a.avt),t.errorLogger.setCustomTags(l);var u=cs(),d=new ls(t.metrics,a,e,u);return null!==(n=t.contextEventTarget)&&void 0!==n||(t.contextEventTarget=new ss),new Za(t.errorLogger,o,d,a,s,t.localeStrings,t.contextEventTarget,i,c)}))()}initializePaymentMethod(){return this.initializePaymentParamPromise||(this.initializePaymentParamPromise=Bm.initializePayment(this.paymentOptions,this.metrics,this.errorLogger,this.localeStrings)),this.initializePaymentParamPromise}getPaymentRequestLock(e){var t=this.paymentRequestLockMap.get(e);if(!t){var n=new Ci("PaymentRequestLockMap entry does not exist. This should never happen.");throw this.errorLogger.captureException(n),n}return t}}function Xg(e,t){var n={};for(var r of t)"function"==typeof e[r]&&(n[r]=e[r].bind(e));return Object.freeze(n)}function Jg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Zg=new Map,Qg=["ach","afterpayClearpay","applePay","bitcoin","card","cashAppPay","clickToPay","giftCard","googlePay","paymentRequest","setLocale","verifyBuyer"],ev={errors:Oo,payments:function(e,t){var n,r,i,o=function(e){if(null!=e&&"string"!=typeof e)throw new Vi;return null!=e?e:""}(t),s="".concat(e,"-").concat(o),c=Zg.get(s);if(void 0!==c){var l=(i=2,function(e){if(Array.isArray(e))return e}(r=c)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(r,i)||function(e,t){if(e){if("string"==typeof e)return Jg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jg(e,t):void 0}}(r,i)||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.")}()),u=l[0],d=l[1];return u.markPaymentsReuse(),d}if(!(n=a.windowLocation).hostname.endsWith("localhost")&&"https:"!==n.protocol)throw new ui;if(!a.isSupported())throw new li;!function(e){if(!function(e){return!(e.length<22||e.length>37)&&oo.test(e)&&!ao.test(e)}(e))throw new Hi;var t=/^[\w-]{22}$/.exec(e),n=e.startsWith("sq0idp-"),r=e.startsWith("sandbox-sq0idb"),i=e.startsWith("sq0ids-");if(!(t||n||r||i))throw new Hi;if(n&&!co())throw new Fi("production",dr.env);if(r&&!so("sandbox"))throw new Fi("sandbox",dr.env)}(e);var h=a.windowLocation,p=h.hostname,f=h.origin,m=h.pathname,g=new Lo({applicationId:e,applicationUrl:f,source:"web-payments-sdk-public",useGlobalHandlers:!1}),v={applicationId:e,hostname:p,locationId:o,parentPathname:m,sourceUrl:f},y=new Wa(g,{applicationId:e,hostname:p,locationId:o});y.logEvent({event:"LOAD:OK",eventSource:"WebSDK"});var E=new Kg(v,y,g),b=Xg(E,Qg);return Zg.set(s,[E,b]),b}};"Square"in window?Object.assign(window.Square,ev):window.Square=ev})();
//# debugId=721a1ae8-0c8c-5dbf-81fc-b70c5c322f34
