UNPKG

@paydock/client-sdk

Version:

Paydock client sdk

1 lines 1.06 MB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).paydock={})}(this,function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function n(e,t,n){return t=u(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,b(i.key),i)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=E(e))||t){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function s(e,t,n){return(t=b(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c.apply(null,arguments)}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},l.apply(null,arguments)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function p(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var c=i&&i.prototype instanceof s?i:s,l=Object.create(c.prototype);return f(l,"_invoke",function(n,i,r){var o,s,c,l=0,u=r||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,s=0,c=e,h.n=n,a}};function p(n,i){for(s=n,c=i,t=0;!d&&l&&!r&&t<u.length;t++){var r,o=u[t],p=h.p,f=o[2];n>3?(r=f===i)&&(c=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((r=n<2&&p<o[1])?(s=0,h.v=i,h.n=o[1]):p<f&&(r=n<3||o[0]>i||i>f)&&(o[4]=n,o[5]=i,h.n=f,s=0))}if(r||n>1)return a;throw d=!0,i}return function(r,u,f){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,f),s=u,c=f;(t=s<2?e:c)||!d;){o||(s?s<3?(s>1&&(h.n=-1),p(s,c)):h.n=c:h.v=c);try{if(l=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(c=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(d=h.n<0)?c:n.call(i,h))!==a)break}catch(t){o=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,r,o),!0),l}var a={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][i]?t(t([][i]())):(f(t={},i,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,f(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=l,f(d,"constructor",l),f(l,"constructor",c),c.displayName="GeneratorFunction",f(l,r,"GeneratorFunction"),f(d),f(d,r,"Generator"),f(d,i,function(){return this}),f(d,"toString",function(){return"[object Generator]"}),(p=function(){return{w:o,m:h}})()}function f(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}f=function(e,t,n,i){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,i)}function m(e){var t=Object(e),n=[];for(var i in t)n.unshift(i);return function e(){for(;n.length;)if((i=n.pop())in t)return e.value=i,e.done=!1,e;return e.done=!0,e}}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function C(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 i,r,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=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(e,t)||E(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 g(e,t,n,i){var r=l(u(e.prototype),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function y(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||E(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function E(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}function _(e){var t="function"==typeof Map?new Map:void 0;return _=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(h())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var r=new(e.bind.apply(e,i));return n&&v(r,n.prototype),r}(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)},_(e)}var k=function(){return o(function e(){i(this,e)},null,[{key:"insertToInput",value:function(e,t,n){if(void 0!==n[t]){var i=document.querySelector(e);i&&(i.value=n[t])}}},{key:"subscribe",value:function(e,t,n){t.addEventListener?t.addEventListener(e,n):t.attachEvent("on".concat(e),n)}}])}(),S=function(){return o(function e(t){i(this,e),this.selector=t},[{key:"isExist",value:function(){return!!this.getElement()}},{key:"getStyles",value:function(e){if(this.isExist()){var t=this.getElement().getAttribute("widget-style");if(!t)return{};var n=t.split(";");return void 0===n||n.length?this.convertConfigs(n,e):{}}}},{key:"on",value:function(e,t){this.isExist()&&k.subscribe(e,this.getElement(),t)}},{key:"getAttr",value:function(e){if(this.isExist()){var t=this.getElement(),n=[];for(var i in e)if(e.hasOwnProperty(i)){var r=e[i].replace(/_/g,"-"),o=t.getAttribute(r);o&&n.push("".concat(e[i],":").concat(o))}return void 0===n||n.length?this.convertConfigs(n,e):{}}}},{key:"getElement",value:function(){return document.querySelector(this.selector)}},{key:"getSelector",value:function(){return this.selector}},{key:"convertConfigs",value:function(e,t){var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i].split(":"),o=r[0].replace(/-/g,"_").trim();-1!==t.indexOf(o)&&(n[o]=r[1].trim())}return n}}])}(),T=function(e,t){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},T(e,t)};function A(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}T(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function M(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function O(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((i=i.apply(e,t||[])).next())})}function N(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function I(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function R(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var x,L=function(){return o(function e(){i(this,e),this.events={}},[{key:"emit",value:function(e,t){var n=this.events[e];n&&n.forEach(function(e){e.call(null,t)})}},{key:"emitWithResult",value:function(e,t){var n=this,i=this.events[e];if(i){var r=i.map(function(e){return O(n,void 0,void 0,p().m(function n(){return p().w(function(n){for(;;)if(0===n.n)return n.a(2,e.call(null,t))},n)}))});return Promise.all(r)}return Promise.resolve([])}},{key:"subscribe",value:function(e,t){var n=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){n.events[e]=n.events[e].filter(function(e){return t!==e})}}}])}();!function(e){e.CART="cart",e.PRODUCT="product"}(x||(x={}));var P,D="ON_SUCCESS",H="ON_ERROR";!function(e){e.UNAVAILABLE="unavailable",e.SCRIPT_ERROR="script_error",e.VALIDATION_ERROR="validation_error"}(P||(P={}));var U=function(){function e(t,n){i(this,e),this.eventEmitter=t,this.config=n}return o(e,[{key:"load",value:function(e){this.renderAfterpayOnSiteMessagingComponent(e)}},{key:"renderAfterpayOnSiteMessagingComponent",value:function(e){var t=this;if(this.isValidConfig(this.config)){var n=e.getElement(),i=document.createElement("script");i.src="https://js-sandbox.squarecdn.com/square-marketplace.js",i.async=!0,i.onload=function(){var e=document.createElement("square-placement");e.setAttribute("data-mpid",t.config.mpid),e.setAttribute("data-placement-id",t.config.placement_id),e.setAttribute("data-page-type",t.config.page_type),e.setAttribute("data-currency",t.config.currency),t.config.amount&&e.setAttribute("data-amount",t.config.amount),t.config.consumer_locale&&e.setAttribute("data-consumer-locale",t.config.consumer_locale),t.config.item_skus&&e.setAttribute("data-item-skus",t.config.item_skus),t.config.item_categories&&e.setAttribute("data-item-categories",t.config.item_categories),void 0!==t.config.is_eligible&&e.setAttribute("data-is-eligible",t.config.is_eligible?"true":"false"),n?(n.appendChild(e),t.eventEmitter.emit(D)):t.eventEmitter.emit(H,{error_code:P.UNAVAILABLE})},document.head.appendChild(i)}}},{key:"isValidConfig",value:function(e){return e?e.mpid?e.placement_id?e.page_type?e.currency?!!Object.values(x).includes(e.page_type)||(this.onError("Invalid page type: ".concat(e.page_type,". Allowed values are: ").concat(Object.values(x).join(", ")),P.VALIDATION_ERROR),!1):(this.onError("Currency is required",P.VALIDATION_ERROR),!1):(this.onError("Page type is required",P.VALIDATION_ERROR),!1):(this.onError("Placement ID is required",P.VALIDATION_ERROR),!1):(this.onError("MPID is required",P.VALIDATION_ERROR),!1):(this.onError("Config is required",P.VALIDATION_ERROR),!1)}},{key:"onError",value:function(e,t){this.eventEmitter.emit(H,{error_code:null!=t?t:P.SCRIPT_ERROR,message:e})}}],[{key:"fromConfig",value:function(t,n){return new e(t,n)}}])}(),F=function(){return o(function e(t,n){i(this,e),this.eventEmitter=new L,this.container=new S(t),this.service=U.fromConfig(this.eventEmitter,n)},[{key:"load",value:function(){try{this.service.load(this.container)}catch(e){throw this.eventEmitter.emit(H,null),e}}},{key:"onError",value:function(e){return this.eventEmitter.subscribe(H,e)}}])}(),B=function(){function e(){i(this,e)}return o(e,null,[{key:"isFacebook",value:function(){return-1!==navigator.userAgent.indexOf("FBSN/iOS")&&-1!==navigator.userAgent.indexOf("AppleWebKit")&&-1!==navigator.userAgent.indexOf("(KHTML, like Gecko)")}},{key:"isInstagram",value:function(){return-1!==navigator.userAgent.indexOf("iOS")&&-1!==navigator.userAgent.indexOf("Instagram")&&-1!==navigator.userAgent.indexOf("(KHTML, like Gecko)")}},{key:"isSupportPopUp",value:function(){return!e.isFacebook()&&!e.isInstagram()}},{key:"getLanguage",value:function(){return window.navigator.language||""}},{key:"getTimezoneOffset",value:function(){return(new Date).getTimezoneOffset()}},{key:"getBrowserName",value:function(){var e=navigator.userAgent;return e.indexOf("Firefox")>-1?"Mozilla Firefox":e.indexOf("Opera")>-1?"Opera":e.indexOf("Trident")>-1?"Microsoft Internet Explorer":e.indexOf("Edge")>-1?"Microsoft Edge":e.indexOf("Chrome")>-1?"Google Chrome or Chromium":e.indexOf("Safari")>-1?"Apple Safari":"unknown"}},{key:"isJavaEnabled",value:function(){return navigator.javaEnabled()}},{key:"getAgentUser",value:function(){return navigator.userAgent}},{key:"getColorDepth",value:function(){return screen.colorDepth}},{key:"getScreenHeight",value:function(){return screen.height}},{key:"getScreenWidth",value:function(){return screen.width}},{key:"getBrowserInfo",value:function(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(e=/\brv[ :](\d+)/.exec(t)||[])[1]||""}:"Chrome"===n[1]&&null!=(e=t.match(/\b(OPR|Edge)\/(\d+)/))?{name:"OPR"===e[1]?"Opera":"Edge",version:e[2]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})}}])}(),j="/v1/charges/3ds",V=function(){return o(function e(t){i(this,e),this.api=t},[{key:"preAuth",value:function(e,t){return"function"==typeof t?this.api.getClient("POST",j).send(c(c({},e),{_3ds:c(c({},e._3ds),{browser_details:{name:B.getBrowserName(),java_enabled:B.isJavaEnabled().toString(),language:B.getLanguage(),screen_height:B.getScreenHeight().toString(),screen_width:B.getScreenWidth().toString(),time_zone:B.getTimezoneOffset().toString(),color_depth:B.getColorDepth().toString()}})}),function(e){t(e)}):this.api.getClientPromise("POST",j).send(c(c({},e),{_3ds:c(c({},e._3ds),{browser_details:{name:B.getBrowserName(),java_enabled:B.isJavaEnabled().toString(),language:B.getLanguage(),screen_height:B.getScreenHeight().toString(),screen_width:B.getScreenWidth().toString(),time_zone:B.getTimezoneOffset().toString(),color_depth:B.getColorDepth().toString()}})}))}}])}(),z="sandbox",W="sandbox-kovena",G="sandbox-demo-kovena",q="production",Y="staging",K="staging_1",Z="staging_2",X="staging_3",J="staging_4",Q="staging_5",$="staging_6",ee="staging_7",te="staging_8",ne="staging_9",ie="staging_10",re="staging_11",oe="staging_12",ae="staging_13",se="staging_14",ce="staging_15",le=[{env:z,url:"https://widget-sandbox."},{env:W,url:"https://widget-sandbox."},{env:"sandbox-demo",url:"https://widget-sandbox-demo."},{env:G,url:"https://widget-sandbox-demo."},{env:q,url:"https://widget."},{env:Y,url:"https://widsta."},{env:K,url:"https://widsta-1."},{env:Z,url:"https://widsta-2."},{env:X,url:"https://widsta-3."},{env:J,url:"https://widsta-4."},{env:Q,url:"https://widsta-5."},{env:$,url:"https://widsta-6."},{env:ee,url:"https://widsta-7."},{env:te,url:"https://widsta-8."},{env:ne,url:"https://widsta-9."},{env:ie,url:"https://widsta-10."},{env:re,url:"https://widsta-11."},{env:oe,url:"https://widsta-12."},{env:ae,url:"https://widsta-13."},{env:se,url:"https://widsta-14."},{env:ce,url:"https://widsta-15."}],ue=[{env:z,url:"https://api-sandbox."},{env:q,url:"https://api."},{env:Y,url:"https://apista."},{env:K,url:"https://apista-1."},{env:Z,url:"https://apista-2."},{env:X,url:"https://apista-3."},{env:J,url:"https://apista-4."},{env:Q,url:"https://apista-5."},{env:$,url:"https://apista-6."},{env:ee,url:"https://apista-7."},{env:te,url:"https://apista-8."},{env:ne,url:"https://apista-9."},{env:ie,url:"https://apista-10."},{env:re,url:"https://apista-11."},{env:oe,url:"https://apista-12."},{env:ae,url:"https://apista-13."},{env:se,url:"https://apista-14."},{env:ce,url:"https://apista-15."}],de=[W,G],he="^([a-zA-Z0-9](?:(?:[a-zA-Z0-9-.]*(?!-)\\.(?![-.]))*[a-zA-Z0-9]+)?)$",pe=z,fe="paydock.com",me="kovena.com",ve=function(){return o(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pe;i(this,e),this.environmentConfigurations=t,this.setEnv(n)},[{key:"setEnv",value:function(e,t){this.validateAlias(t),this.validateEnvironmentId(e),this.environmentId=e,t?this.alias=t:de.includes(this.environmentId)?this.alias=me:this.alias=fe}},{key:"getEnv",value:function(){return this.environmentId}},{key:"getConf",value:function(){for(var e in this.environmentConfigurations)if(Object.hasOwn(this.environmentConfigurations,e)&&this.environmentConfigurations[e].env===this.getEnv())return{url:-1!==this.environmentConfigurations[e].url.indexOf("localhost")?this.environmentConfigurations[e].url:this.environmentConfigurations[e].url+this.alias,env:this.environmentConfigurations[e].env};throw new Error("Env could not obtain configuration. Unknown environmentId.")}},{key:"validateAlias",value:function(e){if(void 0!==e){if("string"!=typeof e)throw new TypeError("Env expects parameter 'alias' to be of type 'string' or 'undefined'.");if(!e.match(he))throw new Error("Env received malformed alias: ".concat(e,". Ensure it satisfies the regex: '").concat(he,"'."))}}},{key:"validateEnvironmentId",value:function(e){for(var t in this.environmentConfigurations)if(Object.hasOwn(this.environmentConfigurations,t)&&this.environmentConfigurations[t].env===e)return;throw new TypeError("Env received unknown environmentId: ".concat(e))}}])}(),Ce=function(){function e(){i(this,e)}return o(e,null,[{key:"version",get:function(){return e._version.trim()||null}}])}();function ge(e){return"function"==typeof e}function ye(e){var t=e(function(e){Error.call(e),e.stack=(new Error).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}Ce.type="client",Ce.headerKeys=Object.freeze({version:"x-sdk-version",type:"x-sdk-type"}),Ce._version="v1.142.0";var be=ye(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}});function we(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Ee=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=N(o),s=a.next();!s.done;s=a.next()){s.value.remove(this)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var c=this.initialTeardown;if(ge(c))try{c()}catch(e){r=e instanceof be?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=N(l),d=u.next();!d.done;d=u.next()){var h=d.value;try{Se(h)}catch(e){r=null!=r?r:[],e instanceof be?r=R(R([],I(r)),I(e.errors)):r.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}if(r)throw new be(r)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Se(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&we(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&we(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),_e=Ee.EMPTY;function ke(e){return e instanceof Ee||e&&"closed"in e&&ge(e.remove)&&ge(e.add)&&ge(e.unsubscribe)}function Se(e){ge(e)?e():e.unsubscribe()}var Te={Promise:void 0},Ae=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setTimeout.apply(void 0,R([e,t],I(n)))};function Me(){}function Oe(e){e()}var Ne=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,ke(t)&&t.add(n)):n.destination=Le,n}return A(t,e),t.create=function(e,t,n){return new Re(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ee),Ie=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){xe(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){xe(e)}else xe(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){xe(e)}},e}(),Re=function(e){function t(t,n,i){var r,o=e.call(this)||this;return r=ge(t)||!t?{next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=i?i:void 0}:t,o.destination=new Ie(r),o}return A(t,e),t}(Ne);function xe(e){!function(e){Ae(function(){throw e})}(e)}var Le={closed:!0,next:Me,error:function(e){throw e},complete:Me},Pe="function"==typeof Symbol&&Symbol.observable||"@@observable";function De(e){return e}var He=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var i,r=this,o=(i=e)&&i instanceof Ne||function(e){return e&&ge(e.next)&&ge(e.error)&&ge(e.complete)}(i)&&ke(i)?e:new Re(e,t,n);return Oe(function(){var e=r,t=e.operator,n=e.source;o.add(t?t.call(o,n):n?r._subscribe(o):r._trySubscribe(o))}),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Ue(t))(function(t,i){var r=new Re({next:function(t){try{e(t)}catch(e){i(e),r.unsubscribe()}},error:i,complete:t});n.subscribe(r)})},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[Pe]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(0===(e=t).length?De:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Ue(e))(function(e,n){var i;t.subscribe(function(e){return i=e},function(e){return n(e)},function(){return e(i)})})},e.create=function(t){return new e(t)},e}();function Ue(e){var t;return null!==(t=null!=e?e:Te.Promise)&&void 0!==t?t:Promise}var Fe=ye(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Be=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return A(t,e),t.prototype.lift=function(e){var t=new je(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Fe},t.prototype.next=function(e){var t=this;Oe(function(){var n,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var r=N(t.currentObservers),o=r.next();!o.done;o=r.next()){o.value.next(e)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;Oe(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Oe(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,i=n.hasError,r=n.isStopped,o=n.observers;return i||r?_e:(this.currentObservers=null,o.push(e),new Ee(function(){t.currentObservers=null,we(o,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,i=t.thrownError,r=t.isStopped;n?e.error(i):r&&e.complete()},t.prototype.asObservable=function(){var e=new He;return e.source=this,e},t.create=function(e,t){return new je(e,t)},t}(He),je=function(e){function t(t,n){var i=e.call(this)||this;return i.destination=t,i.source=n,i}return A(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:_e},t}(Be),Ve=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return A(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,i=e._value;if(t)throw n;return this._throwIfClosed(),i},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Be),ze="x-access-token",We="x-user-public-key",Ge=function(){function e(){i(this,e)}return o(e,null,[{key:"validateJWT",value:function(e){if(!e)return null;var t=C(e.split("."),3),n=t[0],i=t[1],r=t[2];if(!n||!i||!r)return null;if(2+n.length+i.length+r.length!==e.length)return null;try{return{head:JSON.parse(atob(n)),body:JSON.parse(atob(i)),signature:r}}catch(e){return null}}},{key:"extractData",value:function(e){try{return JSON.parse(atob(e.meta))}catch(e){return null}}},{key:"extractMeta",value:function(e){try{return JSON.parse(atob(e.meta)).meta}catch(e){return null}}},{key:"extractEnv",value:function(e){try{return JSON.parse(atob(e.meta)).env}catch(e){return null}}},{key:"validateJWTWhitelistedDomains",value:function(e){var t;try{if(!e.meta)return!0;var n=this.extractData(e);return!n||(!(null===(t=n.whitelist_domains)||void 0===t?void 0:t.length)||n.whitelist_domains.includes(window.location.hostname))}catch(e){return!0}}},{key:"getAccessHeaderNameByToken",value:function(t){return e.validateJWT(t)?ze:We}},{key:"isJwt",value:function(e){return/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/.test(e)}}])}(),qe=function(){function e(t){i(this,e),this.request=t}return o(e,[{key:"inner",value:function(){return this.request}},{key:"setHeader",value:function(e,t){return this.request.setRequestHeader(e,t),this}},{key:"setAccessToken",value:function(e){return this.setHeader("x-access-token",e)}},{key:"setPublicKey",value:function(e){return this.setHeader("x-user-public-key",e)}},{key:"setContentTypeJson",value:function(){return this.setHeader("Content-Type","application/json; charset=UTF-8")}},{key:"setSdkVersion",value:function(){return Ce.version&&(this.setHeader(Ce.headerKeys.version,Ce.version),this.setHeader(Ce.headerKeys.type,Ce.type)),this}}],[{key:"create",value:function(t,n){var i=new XMLHttpRequest;return i.open(t,n,!0),new e(i)}}])}();function Ye(){return Math.floor(performance.now())}const Ke="undefined"!=typeof window&&!!window.document,Ze="undefined"!=typeof WorkerGlobalScope&&("undefined"!=typeof self&&self instanceof WorkerGlobalScope&&self.navigator instanceof WorkerNavigator||"undefined"!=typeof globalThis&&globalThis instanceof WorkerGlobalScope&&globalThis.navigator instanceof WorkerNavigator),Xe=Ke?window:"undefined"!=typeof WorkerGlobalScope&&("undefined"!=typeof self&&self instanceof WorkerGlobalScope&&self||"undefined"!=typeof globalThis&&globalThis instanceof WorkerGlobalScope&&globalThis),Je="complete"===Xe?.document?.readyState,Qe=Boolean("hidden"===Xe?.document?.visibilityState),$e=""+Xe?.location,et=/iPad|iPhone|iPod/.test(Xe.navigator?.userAgent),tt=et&&"undefined"==typeof SharedWorker;(()=>{const e=Xe.navigator?.userAgent?.match(/Firefox[/\s](\d+\.\d+)/);Array.isArray(e)&&e.length>=2&&e[1]})();const nt=Boolean(Ke&&window.document.documentMode),it=!!Xe.navigator?.sendBeacon,rt=Date.now()-Ye(),ot="bam.nr-data.net",at="bam.nr-data.net";function st(){return Xe.NREUM||(Xe.NREUM={}),void 0===Xe.newrelic&&(Xe.newrelic=Xe.NREUM),Xe.NREUM}function ct(){let e=st();return e.o||(e.o={ST:Xe.setTimeout,SI:Xe.setImmediate,CT:Xe.clearTimeout,XHR:Xe.XMLHttpRequest,REQ:Xe.Request,EV:Xe.Event,PR:Xe.Promise,MO:Xe.MutationObserver,FETCH:Xe.fetch}),e}function lt(e){let t=st();return t.initializedAgents?.[e]}function ut(){return function(){let e=st();const t=e.info||{};e.info={beacon:ot,errorBeacon:at,...t}}(),function(){let e=st();const t=e.init||{};e.init={...t}}(),ct(),function(){let e=st();const t=e.loader_config||{};e.loader_config={...t}}(),st()}var dt=Object.prototype.hasOwnProperty;function ht(e,t,n){if(dt.call(e,t))return e[t];var i=n();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!1}),i}catch(e){}return e[t]=i,i}function pt(e,t){"function"==typeof console.warn&&(console.warn("New Relic: ".concat(e)),t&&console.warn(t))}function ft(e,t){try{if(!e||"object"!=typeof e)return pt("Setting a Configurable requires an object as input");if(!t||"object"!=typeof t)return pt("Setting a Configurable requires a model to set its initial properties");const n=Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t)),i=0===Object.keys(n).length?e:n;for(let r in i)if(void 0!==e[r])try{if(null===e[r]){n[r]=null;continue}Array.isArray(e[r])&&Array.isArray(t[r])?n[r]=Array.from(new Set([...e[r],...t[r]])):"object"==typeof e[r]&&"object"==typeof t[r]?n[r]=ft(e[r],t[r]):n[r]=e[r]}catch(e){pt("An error occurred while setting a property of a Configurable",e)}return n}catch(e){pt("An error occured while setting a Configurable",e)}}const mt={beacon:ot,errorBeacon:at,licenseKey:void 0,applicationID:void 0,sa:void 0,queueTime:void 0,applicationTime:void 0,ttGuid:void 0,user:void 0,account:void 0,product:void 0,extra:void 0,jsAttributes:{},userAttributes:void 0,atts:void 0,transactionName:void 0,tNamePlain:void 0},vt={};function Ct(e){if(!e)throw new Error("All info objects require an agent identifier!");if(!vt[e])throw new Error("Info for ".concat(e," was never set"));return vt[e]}function gt(e,t){if(!e)throw new Error("All info objects require an agent identifier!");vt[e]=ft(t,mt);const n=lt(e);n&&(n.info=vt[e])}const yt=e=>{if(!e||"string"!=typeof e)return!1;try{document.createDocumentFragment().querySelector(e)}catch{return!1}return!0},bt=144e5,wt=18e5,Et="session-started",_t="session-pause",kt="session-reset",St="session-resume",Tt="session-update",At="same-tab",Mt="cross-tab",Ot=0,Nt=1,It=2,Rt="[data-nr-mask]",xt={},Lt="All configuration objects require an agent identifier!";function Pt(e){if(!e)throw new Error(Lt);if(!xt[e])throw new Error("Configuration for ".concat(e," was never set"));return xt[e]}function Dt(e,t){if(!e)throw new Error(Lt);xt[e]=ft(t,(()=>{const e={mask_selector:"*",block_selector:"[data-nr-block]",mask_input_options:{color:!1,date:!1,"datetime-local":!1,email:!1,month:!1,number:!1,range:!1,search:!1,tel:!1,text:!1,time:!1,url:!1,week:!1,textarea:!1,select:!1,password:!0}};return{feature_flags:[],proxy:{assets:void 0,beacon:void 0},privacy:{cookies_enabled:!0},ajax:{deny_list:void 0,block_internal:!0,enabled:!0,harvestTimeSeconds:10,autoStart:!0},distributed_tracing:{enabled:void 0,exclude_newrelic_header:void 0,cors_use_newrelic_header:void 0,cors_use_tracecontext_headers:void 0,allowed_origins:void 0},session:{expiresMs:bt,inactiveMs:wt},ssl:void 0,obfuscate:void 0,jserrors:{enabled:!0,harvestTimeSeconds:10,autoStart:!0},metrics:{enabled:!0,autoStart:!0},page_action:{enabled:!0,harvestTimeSeconds:30,autoStart:!0},page_view_event:{enabled:!0,autoStart:!0},page_view_timing:{enabled:!0,harvestTimeSeconds:30,long_task:!1,autoStart:!0},session_trace:{enabled:!0,harvestTimeSeconds:10,autoStart:!0},harvest:{tooManyRequestsDelay:60},session_replay:{autoStart:!0,enabled:!1,harvestTimeSeconds:60,preload:!1,sampling_rate:10,error_sampling_rate:100,collect_fonts:!1,inline_images:!1,inline_stylesheet:!0,mask_all_inputs:!0,get mask_text_selector(){return e.mask_selector},set mask_text_selector(t){yt(t)?e.mask_selector="".concat(t,",").concat(Rt):""===t||null===t?e.mask_selector=Rt:pt("An invalid session_replay.mask_selector was provided. '*' will be used.",t)},get block_class(){return"nr-block"},get ignore_class(){return"nr-ignore"},get mask_text_class(){return"nr-mask"},get block_selector(){return e.block_selector},set block_selector(t){yt(t)?e.block_selector+=",".concat(t):""!==t&&pt("An invalid session_replay.block_selector was provided and will not be used",t)},get mask_input_options(){return e.mask_input_options},set mask_input_options(t){t&&"object"==typeof t?e.mask_input_options={...t,password:!0}:pt("An invalid session_replay.mask_input_option was provided and will not be used",t)}},spa:{enabled:!0,harvestTimeSeconds:10,autoStart:!0},soft_navigations:{enabled:!0,harvestTimeSeconds:10,autoStart:!0}}})());const n=lt(e);n&&(n.init=xt[e])}function Ht(e,t){if(!e)throw new Error(Lt);var n=Pt(e);if(n){for(var i=t.split("."),r=0;r<i.length-1;r++)if("object"!=typeof(n=n[i[r]]))return;n=n[i[i.length-1]]}return n}const Ut={accountID:void 0,trustKey:void 0,agentID:void 0,licenseKey:void 0,applicationID:void 0,xpid:void 0},Ft={};function Bt(e){if(!e)throw new Error("All loader-config objects require an agent identifier!");if(!Ft[e])throw new Error("LoaderConfig for ".concat(e," was never set"));return Ft[e]}const jt=ct().o,Vt="1.260.1",zt={buildEnv:"NPM",distMethod:"NPM",version:Vt,originTime:rt},Wt={customTransaction:void 0,disabled:!1,isolatedBacklog:!1,loaderType:void 0,maxBytes:3e4,onerror:void 0,origin:""+Xe.location,ptid:void 0,releaseIds:{},appMetadata:{},session:void 0,denyList:void 0,harvestCount:0,timeKeeper:void 0},Gt={};function qt(e){if(!e)throw new Error("All runtime objects require an agent identifier!");if(!Gt[e])throw new Error("Runtime for ".concat(e," was never set"));return Gt[e]}function Yt(e){return function(e){try{const t=Ct(e);return!!t.licenseKey&&!!t.errorBeacon&&!!t.applicationID}catch(e){return!1}}(e)}class Kt{constructor(e){this.contextId=e}}function Zt(e,t){return e?15&e[t]:16*Math.random()|0}function Xt(){const e=Xe?.crypto||Xe?.msCrypto;let t,n=0;return e&&e.getRandomValues&&(t=e.getRandomValues(new Uint8Array(30))),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".split("").map(e=>"x"===e?Zt(t,n++).toString(16):"y"===e?(3&Zt()|8).toString(16):e).join("")}function Jt(e){const t=Xe?.crypto||Xe?.msCrypto;let n,i=0;t&&t.getRandomValues&&(n=t.getRandomValues(new Uint8Array(e)));const r=[];for(var o=0;o<e;o++)r.push(Zt(n,i++).toString(16));return r.join("")}const Qt=Xt(),$t="nr@context:".concat(Qt),en=function e(t,n){var i={},r={},o={},a=!1;try{a=16===n.length&&qt(n).isolatedBacklog}catch(e){}var s={on:l,addEventListener:l,removeEventListener:function(e,t){var n=i[e];if(!n)return;for(var r=0;r<n.length;r++)n[r]===t&&n.splice(r,1)},emit:function(e,n,i,o,a){!1!==a&&(a=!0);if(en.aborted&&!o)return;t&&a&&t.emit(e,n,i);for(var l=c(i),d=u(e),p=d.length,f=0;f<p;f++)d[f].apply(l,n);var m=h()[r[e]];m&&m.push([s,e,n,l]);return l},get:d,listeners:u,context:c,buffer:function(e,t){const n=h();if(t=t||"feature",s.aborted)return;Object.entries(e||{}).forEach(e=>{let[i,o]=e;r[o]=t,t in n||(n[t]=[])})},abort:function(){s._aborted=!0,Object.keys(s.backlog).forEach(e=>{delete s.backlog[e]})},isBuffering:function(e){return!!h()[r[e]]},debugId:n,backlog:a?{}:t&&"object"==typeof t.backlog?t.backlog:{},isolatedBacklog:a};return Object.defineProperty(s,"aborted",{get:()=>{let e=s._aborted||!1;return e||(t&&(e=t.aborted),e)}}),s;function c(e){return e&&e instanceof Kt?e:e?ht(e,$t,()=>new Kt($t)):new Kt($t)}function l(e,t){i[e]=u(e).concat(t)}function u(e){return i[e]||[]}function d(t){return o[t]=o[t]||e(s,t)}function h(){return s.backlog}}(void 0,"globalEE"),tn=st();tn.ee||(tn.ee=en);var nn=en.get("handle");function rn(e,t,n,i,r){r?(r.buffer([e],i),r.emit(e,t,n)):(nn.buffer([e],i),nn.emit(e,t,n))}const on=(e,t)=>Object.entries(e||{}).map(e=>{let[n,i]=e;return t(n,i)});sn.on=cn;var an=sn.handlers={};function sn(e,t,n,i){cn(i||nn,an,e,t,n)}function cn(e,t,n,i,r){r||(r="feature"),e||(e=nn);var o=t[r]=t[r]||{};(o[n]=o[n]||[]).push([e,i])}const ln={ajax:"ajax",jserrors:"jserrors",metrics:"metrics",pageAction:"page_action",pageViewEvent:"page_view_event",pageViewTiming:"page_view_timing",sessionReplay:"session_replay",sessionTrace:"session_trace",softNav:"soft_navigations",spa:"spa"},un={[ln.pageViewEvent]:1,[ln.pageViewTiming]:2,[ln.metrics]:3,[ln.jserrors]:4,[ln.ajax]:5,[ln.sessionTrace]:6,[ln.pageAction]:7,[ln.spa]:8,[ln.softNav]:9,[ln.sessionReplay]:10},dn={};function hn(e,t){const n={staged:!1,priority:un[t]||0};fn(e),dn[e].get(t)||dn[e].set(t,n)}function pn(e,t){fn(e),dn[e].get(t)&&dn[e].delete(t),dn[e].size&&vn(e)}function fn(e){if(!e)throw new Error("agentIdentifier required");dn[e]||(dn[e]=new Map)}function mn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"feature",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(fn(e),!e||!dn[e].get(t)||n)return Cn(e,t);dn[e].get(t).staged=!0,vn(e)}function vn(e){const t=Array.from(dn[e]);t.every(e=>{let[t,n]=e;return n.staged})&&(t.sort((e,t)=>e[1].priority-t[1].priority),t.forEach(t=>{let[n]=t;dn[e].delete(n),Cn(e,n)}))}function Cn(e,t){const n=e?en.get(e):en,i=sn.handlers;if(n.backlog&&i){var r=n.backlog[t],o=i[t];if(o){for(var a=0;r&&a<r.length;++a)gn(r[a],o);on(o,function(e,t){on(t,function(t,n){n[0].on(e,n[1])})})}n.isolatedBacklog||delete i[t],n.backlog[t]=null,n.emit("drain-"+t,[])}}function gn(e,t){var n=e[1];on(t[n],function(t,n){var i=e[0];if(n[0]===i){var r=n[1],o=e[3],a=e[2];r.apply(o,a)}})}class yn{constructor(e,t,n){this.agentIdentifier=e,this.aggregator=t,this.ee=en.get(e),this.featureName=n,this.blocked=!1}}let bn=!1,wn=!1;try{const e={get passive(){return bn=!0,!1},get signal(){return wn=!0,!1}};Xe.addEventListener("test",null,e),Xe.removeEventListener("test",null,e)}catch(Dm){}function En(e,t){return bn||wn?{capture:!!e,passive:bn,signal:t}:!!e}function _n(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;window.addEventListener(e,t,En(n,i))}function kn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;document.addEventListener(e,t,En(n,i))}function Sn(){return"undefined"==typeof document||"complete"===document.readyState}function Tn(e,t){if(Sn())return e();_n("load",e,t)}const An=e=>Ke&&!0===Ht(e,"privacy.cookies_enabled");function Mn(e,t){return!!function(e){return!!jt.MO&&An(e)&&!0===Ht(e,"session_trace.enabled")}(e)&&(!!t?.isNew||!!t?.state.sessionReplayMode)}function On(e,t){const n=t.correctAbsoluteTimestamp(e);return{originalTimestamp:e,correctedTimestamp:n,timestampDiff:e-n,originTime:rt,correctedOriginTime:t.correctedOriginTime,originTimeDiff:Math.floor(rt-t.correctedOriginTime)}}function Nn(e){var t=this;let n=!1;return function(){if(!n){n=!0;for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];e.apply(t,r)}}}class In extends yn{constructor(e,t,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];super(e,t,n),this.auto=i,this.abortHandler=void 0,this.featAggregate=void 0,this.onAggregateImported=void 0,!1===Ht(this.agentIdentifier,"".concat(this.featureName,".autoStart"))&&(this.auto=!1),this.auto?hn(e,n):this.ee.on("manual-start-all",Nn(()=>{hn(this.agentIdentifier,this.featureName),this.auto=!0,this.importAggregator()}))}importAggregator(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.featAggregate||!this.auto)return;this.onAggregateImported=new Promise(t=>{e=t});const n=async()=>{let n;try{if(An(this.agentIdentifier)){const{setupAgentSession:e}=await Promise.resolve().then(function(){return Wu});n=e(this.agentIdentifier)}}catch(e){pt("A problem occurred when starting up session manager. This page will not start or extend any session.",e),this.featureName===ln.sessionReplay&&this.abortHandler?.()}try{if(!this.#e(this.featureName,n))return mn(this.agentIdentifier,this.featureName),void e(!1);const{lazyFeatureLoader:i}=await Promise.resolve().then(function(){return Gu}),{Aggregate:r}=await i(this.featureName,"aggregate");this.featAggregate=new r(this.agentIdentifier,this.aggregator,t),e(!0)}catch(t){pt("Downloading and initializing ".concat(this.featureName," failed..."),t),this.abortHandler?.(),mn(this.agentIdentifier,this.featureName,!0),e(!1),this.ee&&this.ee.abort()}};Ke?Tn(()=>n(),!0):n()}#e(e,t){return e!==ln.sessionReplay||Mn(this.agentIdentifier,t)}}const Rn=ln.jserrors,xn=ln.sessionReplay,Ln="recordReplay",Pn="pauseReplay",Dn="replayRunning",Hn="errorDuringReplay",Un=2,Fn=4,Bn={[It]:15e3,[Nt]:3e5,[Ot]:0},jn={message:"Session was reset",sm:"Reset"},Vn={message:"Recorder failed to import",sm:"Import"},zn={message:"429: Too Many Requests",sm:"Too-Many"},Wn={message:"Payload was too large",sm:"Too-Big"},Gn={message:"Session Entity was set to OFF on another tab",sm:"Cross-Tab"},qn={message:"Session Replay is not allowed and will not be started",sm:"Entitlement"},Yn="api";function Kn(e){try{return JSON.stringify(e,(()=>{const e=new WeakSet;return(t,n)=>{if("object"==typeof n&&null!==n){if(e.has(n))return;e.add(n)}return n}})())}catch(e){try{en.emit("internal-error",[e])}catch(e){}}}class Zn{constructor(e,t,n,i,r){this.name="UncaughtError",this.message="string"==typeof e?e:Kn(e),this.sourceURL=t,this.line=n,this.column=i,this.__newrelic=r}}function Xn(e){return $n(e)?e:new Zn(void 0!==e?.message?e.message:e,e?.filename||e?.sourceURL,e?.lineno||e?.line,e?.colno||e?.col,e?.__newrelic)}function Jn(e){let t="Unhandled Promise Rejection";if($n(e?.reason))try{return e.reason.message=t+": "+e.reason.message,Xn(e.reason)}catch(t){return Xn(e.reason)}if(void 0===e.reason)return Xn(t);const n=Xn(e.reason);return n.message=t+": "+n?.message,n}function Qn(e){if(e.error instanceof SyntaxError&&!/:\d+$/.test(e.error.stack?.trim())){const t=new Zn(e.message,e.filename,e.lineno,e.colno,e.error.__newrelic);return t.name=SyntaxError.name,t}return $n(e.error)?e.error:Xn(e)}function $n(e){return e instanceof Error&&!!e.stack}let ei=class extends In{static featureName=Rn;#t=!1;constructor(e,t){super(e,t,Rn,!(arguments.length>2&&void 0!==arguments[2])||arguments[2]);try{this.removeOnAbort=new AbortController}catch(e){}this.ee.on("internal-error",e=>{this.abortHandler&&rn("ierr",[Xn(e),Ye(),!0,{},this.#t],void 0,this.featureName,this.ee)}),this.ee.on(Dn,e=>{this.#t=e}),Xe.addEventListener("unhandledrejection",e=>{this.abortHandler&&rn("err",[Jn(e),Ye(),!1,{unhandledPromiseRejection:1},this.#t],void 0,this.featureName,this.ee)},En(!1,this.removeOnAbort?.signal)),Xe.addEventListener("error",e=>{this.abortHandler&&rn("err",[Qn(e),Ye(),!1,{},this.#t],void 0,this.featureName,this.ee)},En(!1,this.removeOnAbort?.signal)),this.abortHandler=this.#n,this.importAggregator()}#n(){this.removeOnAbort?.abort(),this.abortHandler=void 0}};const ti=ln.pageViewEvent;let ni=class extends In{static featureName=ti;constructor(e,t){super(e,t,ti,!(arguments.length>2&&void 0!==arguments[2])||arguments[2]),this.importAggregator()}};const ii=Object.values(ln);function ri(e){const t={};return ii.forEach(n=>{t[n]=function(e,t){return!0===Ht(t,"".concat(e,".enabled"))}(n,e)}),t}const oi=ln.metrics,ai="storeSupportabilityMetrics",si="storeEventMetrics",ci=["setErrorHandler","finished","addToTrace","addRelease","addPageAction","setCurrentRouteName","setPageViewName","setCustomAttribute","interaction","noticeError","setUserId","setApplicationVersion","start",Ln,Pn],li=["setErrorHandler","finished","addToTrace","addRelease"];function ui(){const e=ut();ci.forEach(t=>{e[t]=function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];let o=[];return Object.values(e.initializedAgents).forEach(e=>{e.exposed&&e.api[t]&&o.push(e.api[t](...i))}),o.length>1?o:o[0]}(t,...i)}})}const di={};const hi=new Set,pi={};function fi(e,t){const n=en.get(t);pi[t]??={},e&&"object"==typeof e&&(hi.has(t)||(n.emit("rumresp",[e]),pi[t]=e,hi.add(t),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{Xe.dispatchEvent(new CustomEvent("newrelic",{detail:e}))}catch(e){}}({loaded:!0})))}let mi=!1;function vi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,{init:r,info:o,loader_config:a,runtime:s={loaderType:n},exposed:c=!0}=t;const l=ut();o||(r=l.init,o=l.info,a=l.loader_config),Dt(e.agentIdentifier,r||{}),function(e,t){if(!e)throw new Error("All loader-config objects require an agent identifier!");Ft[e]=ft(t,Ut);const n=lt(e);n&&(n.loader_config=Ft[e])}(e.agentIdentifier,a||{}),o.jsAttributes??={},Ze&&(o.jsAttributes.isWorker=!0),gt(e.agentIdentifier,o);const u=Pt(e.agentIdentifier),d=[o.beacon,o.errorBeacon];var h,p;mi||(u.proxy.assets&&(u.proxy.assets,d.push(u.proxy.assets)),u.proxy.beacon&&d.push(u.proxy.beacon),ui(),h="activatedFeatures",p=pi,st()[h]=p,e.runSoftNavOverSpa&&=!0===u.soft_navigations.enabled&&u.feature_flags.includes("soft_nav")),s.denyList=[...u.ajax.deny_list||[],...u.ajax.block_internal?d:[]],s.ptid=e.agentIdentifier,function(e,t){if(!e)throw new Error("All runtime objects require an agent identifier!");Gt[e]={...ft(t,Wt),...zt};const n=lt(e);n&&(n.runtime=Gt[e])}(e.agentIdentifier,s),void 0===e.api&&(e.api=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||hn(e,"api");const i={};var r=en.get(e),o=r.get("tracer");di[e]=Ot,r.on(Dn,t=>{di[e]=t});var a="api-",s=a+"ixn-";function c(t,n,i,r){const o=Ct(e);return null===n?delete o.jsAttributes[t]:gt(e,{...o,jsAttributes:{...o.jsAttributes,[t]:n}}),d(a,i,!0,r||null===n?"session":void 0)(t,n)}function l(){}li.forEach(e=>{i[e]=d(a,e,!0,"api")}),i.addPageAction=d(a,"addPageAction",!0,ln.pageAction),i.setPageViewName=function(t,n){if("string"==typeo