diff --git a/dist/amp-client.min.js b/dist/amp-client.min.js index 3bd1c2b..ae9f3ef 100644 --- a/dist/amp-client.min.js +++ b/dist/amp-client.min.js @@ -1 +1 @@ -var AMPClientFactory;(()=>{var t={6384:(t,e,n)=>{var r=n(7040),o=n(4125),i=n(2117),a=n(7518),u=n(4705);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e{var r=n(5639).Uint8Array;t.exports=r},6874:t=>{t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},9932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n{var r=n(9465),o=n(7813);t.exports=function(t,e,n){(void 0!==n&&!o(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},4865:(t,e,n)=>{var r=n(9465),o=n(7813),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8470:(t,e,n)=>{var r=n(7813);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},9465:(t,e,n)=>{var r=n(8777);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},3118:(t,e,n)=>{var r=n(3218),o=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},8483:(t,e,n)=>{var r=n(5063)();t.exports=r},4239:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},2980:(t,e,n)=>{var r=n(6384),o=n(6556),i=n(8483),a=n(9783),u=n(3218),c=n(1704),l=n(6390);t.exports=function t(e,n,s,f,p){e!==n&&i(n,(function(i,c){if(p||(p=new r),u(i))a(e,n,c,s,t,f,p);else{var y=f?f(l(e,c),i,c+"",e,n,p):void 0;void 0===y&&(y=i),o(e,c,y)}}),c)}},9783:(t,e,n)=>{var r=n(6556),o=n(4626),i=n(7133),a=n(278),u=n(8517),c=n(5694),l=n(1469),s=n(9246),f=n(4144),p=n(3560),y=n(3218),v=n(8630),b=n(6719),m=n(6390),h=n(9881);t.exports=function(t,e,n,d,w,g,S){var E=m(t,n),j=m(e,n),O=S.get(j);if(O)r(t,n,O);else{var T=g?g(E,j,n+"",t,e,S):void 0,k=void 0===T;if(k){var _=l(j),P=!_&&f(j),N=!_&&!P&&b(j);T=j,_||P||N?l(E)?T=E:s(E)?T=a(E):P?(k=!1,T=o(j,!0)):N?(k=!1,T=i(j,!0)):T=[]:v(j)||c(j)?(T=E,c(E)?T=h(E):y(E)&&!p(E)||(T=u(j))):k=!1}k&&(S.set(j,T),w(T,j,d,g,S),S.delete(j)),r(t,n,T)}}},8674:t=>{t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},5976:(t,e,n)=>{var r=n(6557),o=n(5357),i=n(61);t.exports=function(t,e){return i(o(t,e,r),t+"")}},7415:(t,e,n)=>{var r=n(9932);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},4318:(t,e,n)=>{var r=n(1149);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},4626:(t,e,n)=>{t=n.nmd(t);var r=n(5639),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}},7133:(t,e,n)=>{var r=n(4318);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},278:t=>{t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n{var r=n(4865),o=n(9465);t.exports=function(t,e,n,i){var a=!n;n||(n={});for(var u=-1,c=e.length;++u{var r=n(5976),o=n(6612);t.exports=function(t){return r((function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,u&&o(n[0],n[1],u)&&(a=i<3?void 0:a,i=1),e=Object(e);++r{t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===n(i[c],c,i))break}return e}}},3833:(t,e,n)=>{var r=n(7813),o=Object.prototype,i=o.hasOwnProperty;t.exports=function(t,e,n,a){return void 0===t||r(t,o[n])&&!i.call(a,n)?e:t}},8777:(t,e,n)=>{var r=n(852),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},9464:(t,e,n)=>{var r=n(8674)({"&":"&","<":"<",">":">",'"':""","'":"'"});t.exports=r},1994:t=>{var e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};t.exports=function(t){return"\\"+e[t]}},1957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},852:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},5924:(t,e,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);t.exports=r},8517:(t,e,n)=>{var r=n(3118),o=n(5924),i=n(5726);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},6612:t=>{t.exports=function(){return!1}},5726:t=>{t.exports=function(){return!1}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,e,n)=>{var r=n(8470),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():o.call(e,n,1),--this.size,!0)}},2117:(t,e,n)=>{var r=n(8470);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},7518:(t,e,n)=>{var r=n(8470);t.exports=function(t){return r(this.__data__,t)>-1}},4705:(t,e,n)=>{var r=n(8470);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},5569:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},5357:(t,e,n)=>{var r=n(6874),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a{t.exports=/<%-([\s\S]+?)%>/g},6051:t=>{t.exports=/<%([\s\S]+?)%>/g},5712:t=>{t.exports=/<%=([\s\S]+?)%>/g},5639:(t,e,n)=>{var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},6390:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},61:t=>{t.exports=function(t){return t}},9018:(t,e,n)=>{var r=n(8363),o=n(1463),i=n(1704),a=o((function(t,e,n,o){r(e,i(e),t,o)}));t.exports=a},9591:(t,e,n)=>{var r=n(6874),o=n(5976),i=n(4647),a=o((function(t,e){try{return r(t,void 0,e)}catch(t){return i(t)?t:new Error(t)}}));t.exports=a},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},7187:(t,e,n)=>{var r=n(9464),o=n(9833),i=/[&<>"']/g,a=RegExp(i.source);t.exports=function(t){return(t=o(t))&&a.test(t)?t.replace(i,r):t}},6557:t=>{t.exports=function(t){return t}},5694:t=>{t.exports=function(){return!1}},1469:t=>{var e=Array.isArray;t.exports=e},8612:(t,e,n)=>{var r=n(3560),o=n(1780);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},9246:(t,e,n)=>{var r=n(8612),o=n(7005);t.exports=function(t){return o(t)&&r(t)}},4144:t=>{t.exports=function(){return!1}},4647:(t,e,n)=>{var r=n(4239),o=n(7005),i=n(8630);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!i(t)}},3560:(t,e,n)=>{var r=n(4239),o=n(3218);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,e,n)=>{var r=n(4239),o=n(5924),i=n(7005),a=Function.prototype,u=Object.prototype,c=a.toString,l=u.hasOwnProperty,s=c.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=l.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==s}},6719:t=>{t.exports=function(){return!1}},3674:(t,e,n)=>{var r=n(5569)(Object.keys,Object);t.exports=r},1704:t=>{t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},2492:(t,e,n)=>{var r=n(2980),o=n(1463)((function(t,e,n){r(t,e,n)}));t.exports=o},1106:(t,e,n)=>{var r=n(9018),o=n(9591),i=n(7415),a=n(3833),u=n(1994),c=n(4647),l=n(6612),s=n(3674),f=n(5712),p=n(5835),y=n(9833),v=/\b__p \+= '';/g,b=/\b(__p \+=) '' \+/g,m=/(__e\(.*?\)|\b__t\)) \+\n'';/g,h=/[()=,{}\[\]\/\s]/,d=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,w=/($^)/,g=/['\n\r\u2028\u2029\\]/g,S=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var E=p.imports._.templateSettings||p;n&&l(t,e,n)&&(e=void 0),t=y(t),e=r({},e,E,a);var j,O,T=r({},e.imports,E.imports,a),k=s(T),_=i(T,k),P=0,N=e.interpolate||w,A="__p += '",R=RegExp((e.escape||w).source+"|"+N.source+"|"+(N===f?d:w).source+"|"+(e.evaluate||w).source+"|$","g"),I=S.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(R,(function(e,n,r,o,i,a){return r||(r=o),A+=t.slice(P,a).replace(g,u),n&&(j=!0,A+="' +\n__e("+n+") +\n'"),i&&(O=!0,A+="';\n"+i+";\n__p += '"),r&&(A+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),P=a+e.length,e})),A+="';\n";var C=S.call(e,"variable")&&e.variable;if(C){if(h.test(C))throw new Error("Invalid `variable` option passed into `_.template`")}else A="with (obj) {\n"+A+"\n}\n";A=(O?A.replace(v,""):A).replace(b,"$1").replace(m,"$1;"),A="function("+(C||"obj")+") {\n"+(C?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(j?", __e = _.escape":"")+(O?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+A+"return __p\n}";var x=o((function(){return Function(k,I+"return "+A).apply(void 0,_)}));if(x.source=A,c(x))throw x;return x}},5835:(t,e,n)=>{var r=n(7187),o={escape:n(9865),evaluate:n(6051),interpolate:n(5712),variable:"",imports:{_:{escape:r}}};t.exports=o},9881:(t,e,n)=>{var r=n(8363),o=n(1704);t.exports=function(t){return r(t,o(t))}},9833:t=>{t.exports=function(t){return t}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";n.d(r,{default:()=>jl});var t={};n.r(t),n.d(t,{exclude:()=>H,extract:()=>W,parse:()=>L,parseUrl:()=>U,pick:()=>$,stringify:()=>F,stringifyUrl:()=>z});function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(t,n){for(var r=0;r\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>width="<%- data.content.dimensions.width %>"<% } %>\n <% if(null !== data.content.dimensions.height) { %>height="<%- data.content.dimensions.height %>"<% } %>\n <% if(\'\' !== data.content.title) { %>title="<%- data.content.title %>"<% } %>\n <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,A=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),R=Symbol("encodeFragmentIdentifier");function I(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function C(t,e){return e.encode?e.strict?A(t):encodeURIComponent(t):t}function x(t,e){return e.decode?k(t):t}function M(t){return Array.isArray(t)?t.sort():"object"==typeof t?M(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function D(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function B(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function W(t){const e=(t=D(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function L(t,e){I((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const o="string"==typeof n&&n.includes(t.arrayFormatSeparator),i="string"==typeof n&&!o&&x(n,t).includes(t.arrayFormatSeparator);n=i?x(n,t):n;const a=o||i?n.split(t.arrayFormatSeparator).map((e=>x(e,t))):null===n?n:x(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const o=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!o)return void(r[e]=n?x(n,t):n);const i=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>x(e,t)));void 0!==r[e]?r[e]=[...r[e],...i]:r[e]=i};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const o of t.split("&")){if(""===o)continue;const t=e.decode?o.replace(/\+/g," "):o;let[i,a]=_(t,"=");void 0===i&&(i=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:x(a,e),n(x(i,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=B(r,e);else r[t]=B(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=M(n):t[e]=n,t}),Object.create(null))}function F(t,e){if(!t)return"";I((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&N(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const o=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[C(e,t),"[",o,"]"].join("")]:[...n,[C(e,t),"[",C(o,t),"]=",C(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[C(e,t),"[]"].join("")]:[...n,[C(e,t),"[]=",C(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[C(e,t),":list="].join("")]:[...n,[C(e,t),":list=",C(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[C(n,t),e,C(o,t)].join("")]:[[r,C(o,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,C(e,t)]:[...n,[C(e,t),"=",C(r,t)].join("")]}}(e),o={};for(const[e,r]of Object.entries(t))n(e)||(o[e]=r);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map((n=>{const o=t[n];return void 0===o?"":null===o?C(n,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?C(n,e)+"[]":o.reduce(r(n),[]).join("&"):C(n,e)+"="+C(o,e)})).filter((t=>t.length>0)).join("&")}function U(t,e){e={decode:!0,...e};let[n,r]=_(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:L(W(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:x(r,e)}:{}}}function z(t,e){e={encode:!0,strict:!0,[R]:!0,...e};const n=D(t.url).split("?")[0]||"";let r=F({...L(W(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let o=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,o=e[R]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${o}`}function $(t,e,n){n={parseFragmentIdentifier:!0,[R]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=U(t,n);return z({url:r,query:P(o,e),fragmentIdentifier:i},n)}function H(t,e,n){return $(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const G=t;function V(t){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(t)}function Y(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return q(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function q(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var o=t.endpoint;"GET"===t.method&&(o+="?".concat(G.stringify(t.parameters))),r.open(t.method,o,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var i,a=Y(t.headers);try{for(a.s();!(i=a.n()).done;){var u=i.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&K(e.prototype,n),r&&K(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(g);function tt(t){return tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(t)}function et(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),bt(this,wt,{writable:!0,value:void 0}),bt(this,gt,{writable:!0,value:void 0}),bt(this,St,{writable:!0,value:void 0}),bt(this,Et,{writable:!0,value:void 0}),bt(this,jt,{writable:!0,value:void 0}),bt(this,Ot,{writable:!0,value:void 0}),bt(this,Tt,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var o=t[n][r].value.filter((function(t){return""!==t}));o.length&&(e[n][r]=o)}return e}}),ht(this,wt,e),ht(this,gt,n),ht(this,St,r),ht(this,Et,{}),ht(this,jt,o),ht(this,Ot,i)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=mt(this,Et);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,mt(this,jt)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof ft))throw new TypeError("Argument resource must be instance of Resource class.");var n=mt(this,Et);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return mt(this,wt)}},{key:"endpoint",get:function(){return mt(this,gt)}},{key:"locale",get:function(){return mt(this,St)}},{key:"parameters",get:function(){var t=mt(this,Tt).call(this,mt(this,Et)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return mt(this,Ot)}}],n&&vt(e.prototype,n),r&&vt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function Pt(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var o in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e]+)>/g,(function(t,e){var n=i[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof o){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=ue(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),o.apply(this,t)}))}return t[Symbol.replace].call(this,n,o)},ce.apply(this,arguments)}function le(t,e){return le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},le(t,e)}var se=ce(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),fe={};function pe(t,e){var n=function(t){if(t in fe)return fe[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==o.groups.EQ:i={eq:parseInt(o.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==o.groups.LT:i={lt:parseInt(o.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==o.groups.GTE:i={gte:parseInt(o.groups.GTE),matches:function(t){return t>=this.gte}};break;default:i={matches:function(){return!0}}}i&&(i.matches=i.matches.bind(i),i.value=o.groups.VALUE,n.push(i))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:pe(this.options[t],e)}},{key:"override",value:function(t){this.options=be(be({},this.options),ge(this,Se,je).call(this,be({},t)))}}],n&&he(e.prototype,n),r&&he(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function je(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,o='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(o+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(o),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function Oe(t){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(t)}function Te(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));Pe(this,Ce,t),Pe(this,xe,e.toString()),_e(this,Me)[t]=(_e(this,Me)[t]||0)+1,this._eventBus.dispatch(re.ON_BANNER_STATE_CHANGED,{banner:this})}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.startsWith("amp:banner:"))throw new Error('Unable to attach listener on event "'.concat(t,'" through a banner.'));return this._eventBus.subscribe(t,(function(t){t.banner===this&&(null!==n?e.call(n,t):e(t))}),this)}},{key:"getCurrentBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){_e(this,Ie).override(t)}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&Te(e.prototype,n),r&&Te(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Be(t){return Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Be(t)}function We(t,e){for(var n=0;n=c&&(null===i||ic))&&(o=u,i=c,Ze(t,un)[n]=c)):r=u})),null===o&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(i);return"max"===n&&u-1 in a&&(Ze(this,un).min=a[u-1]),"min"===n&&u+1 in a&&(Ze(this,un).max=a[u+1]),tn(this,an,null!==o?o:r)}},{key:"needRedraw",value:function(){if(null===Ze(this,an))return!0;var t=Ze(this,nn).width;return null!==Ze(this,un).min&&tZe(this,un).max}}])&&Je(e.prototype,n),r&&Je(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function sn(t,e){for(var n in t)e(t[n],n)}function fn(t){return fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fn(t)}function pn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return yn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function yn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,o=0;o0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&In(e.prototype,n),r&&In(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xn(t){return xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xn(t)}function Mn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Dn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var f in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),zn(Fn(c=o.call(this,n,r,a,u,s)),rr),zn(Fn(c),nr),$n(Fn(c),Kn,{writable:!0,value:void 0}),$n(Fn(c),Jn,{writable:!0,value:void 0}),$n(Fn(c),Qn,{writable:!0,value:[]}),$n(Fn(c),Xn,{writable:!0,value:void 0}),$n(Fn(c),Zn,{writable:!0,value:!1}),$n(Fn(c),tr,{writable:!0,value:null}),$n(Fn(c),er,{writable:!0,value:[]}),Yn(Fn(c),Kn,t),Yn(Fn(c),Jn,e),Yn(Fn(c),Xn,l),l)Vn(Fn(c),Qn).push(new ft(f,l[f]));return c.setState(c.STATE.NEW,"Banner created."),c}return e=i,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Vn(this,Qn)}},{key:"rawResources",get:function(){return Vn(this,Xn)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new An(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return null===t?[]:(this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint})))}},{key:"bannerData",get:function(){if(null!==Vn(this,tr))return Vn(this,tr);if(!Vn(this,er).length)return null;var t=null,e=this.positionData,n=function(t){return Le.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=Vn(this,er).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Cn.randomByWeights(Vn(this,er),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=Mn(t=Vn(this,er).sort((function(t,e){return e.score-t.score})));try{for(o.s();!(r=o.n()).done;){var i=r.value;i.fingerprint=n(i)}}catch(t){o.e(t)}finally{o.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}return Yn(this,tr,t),t}},{key:"unsetFingerprint",value:function(t){var e=t.bannerId,n=this.positionData;if(Vn(this,er).filter((function(t){return t.id===e}))[0]){switch(!0){case n.isSingle():Yn(this,er,[]),Yn(this,tr,null);break;case n.isRandom():Vn(this,tr)&&Vn(this,tr).id===e?(Yn(this,er,[]),Yn(this,tr,null)):Yn(this,er,Vn(this,er).filter((function(t){return t.id!==e})));break;case n.isMultiple():Yn(this,er,Vn(this,er).filter((function(t){return t.id!==e}))),Vn(this,tr)&&Yn(this,tr,Vn(this,tr).filter((function(t){return t.id!==e})))}0>=Vn(this,er).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):n.isRandom()&&this.redrawIfNeeded()}}},{key:"setResponseData",value:function(t){if(Vn(this,Zn))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ae({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new En(t.banners[n],t.breakpoint_type,Vn(this,Kn)));Yn(this,er,e),Yn(this,Zn,!0),0>=Vn(this,er).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):Gn(this,nr,ir).call(this,"Banner was successfully rendered.")}},{key:"getCurrentBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:e?[e]:[]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){Gn(this,rr,ar).call(this)&&Gn(this,nr,ir).call(this,"Banner was successfully redrawn.")}}])&&Bn(e.prototype,n),r&&Bn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(De);function ir(t){try{this.html=Vn(this,Jn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function ar(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function ur(t){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ur(t)}function cr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function vr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=Sr(this,Or).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){var e=Sr(this,Tr)[t]||null;if(null===e)return null;if(Sr(this,kr))return e.content?e.content.breakpoint:null;var n,r=yr(e.contents);try{for(r.s();!(n=r.n()).done;){var o=n.value;if("none"!==getComputedStyle(o.data).display)return o.breakpoint}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"isExternal",value:function(){return!0}},{key:"delegateResponsiveBehaviour",value:function(){if(!Sr(this,kr)){Er(this,kr,!0);var t,e=yr(this.element.querySelectorAll("style"));try{for(e.s();!(t=e.n()).done;)t.value.remove()}catch(t){e.e(t)}finally{e.f()}this.redrawIfNeeded()}}},{key:"redrawIfNeeded",value:function(){if(Sr(this,kr))for(var t in Sr(this,Tr)){var e=Sr(this,Tr)[t];if(e.needRedraw()){var n,r=e.content,o=yr(e.contents);try{for(o.s();!(n=o.n()).done;){var i=n.value;i.data.style.display=i===r?"block":"none"}}catch(t){o.e(t)}finally{o.f()}}}}}])&&br(e.prototype,n),r&&br(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(De);function Pr(t){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(t)}function Nr(t,e){for(var n=0;n=Mr(this,Lr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){throw new Error("Method EmbedBanner.getCurrentBreakpoint() is not readable.")}},{key:"isEmbed",value:function(){return!0}},{key:"updatePositionData",value:function(t){for(var e=this.positionData,n=0,r=["id","name","rotationSeconds","displayType","breakpointType","dimensions"];n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$r(this,Vr,{writable:!0,value:void 0}),Hr(this,Vr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Hr(this,Vr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Gr(e,Vr,"get")),++t))}}])&&zr(e.prototype,n),r&&zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function qr(t,e){if(t instanceof e.HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var n;if(!((n="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof e.HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return n}function Kr(t){return Kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kr(t)}function Jr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Qr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Qr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Zr(this,ro,{writable:!0,value:void 0}),Zr(this,oo,{writable:!0,value:void 0}),Zr(this,io,{writable:!0,value:void 0}),Zr(this,ao,{writable:!0,value:void 0}),Zr(this,uo,{writable:!0,value:[]}),eo(this,ro,e),eo(this,oo,n),eo(this,io,r),eo(this,ao,new Yr),this.STATE=te}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=qr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:window)).setAttribute("data-amp-attached","");var e=new _r(to(this,oo),to(this,ro),to(this,ao).getNextIdentifier(),t);return to(this,uo).push(e),e}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;if(null===to(this,io))throw new Error("Unable to add managed banner, renderer is not provided.");(t=qr(t,o)).setAttribute("data-amp-attached","");var i=new or(to(this,oo),to(this,io),to(this,ro),to(this,ao).getNextIdentifier(),t,e,n,r);return to(this,uo).push(i),i}},{key:"addEmbedBanner",value:function(t,e,n,r){t=qr(t,window),e=qr(e,window),t.setAttribute("data-amp-attached","");var o=new Fr(to(this,ro),to(this,ao).getNextIdentifier(),t,e,n,r);return to(this,uo).push(o),o}},{key:"removeBanner",value:function(t){var e=to(this,uo).length;return eo(this,uo,to(this,uo).filter((function(e){return e!==t}))),e!==to(this,uo).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,o=t.external,i=void 0===o||o,a=t.embed,u=void 0===a||a;return to(this,uo).filter((function(t){return t instanceof De&&t.state===e&&!(t instanceof or&&!r||t instanceof _r&&!i||t instanceof Fr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Le?t.value:t,r=Jr(to(this,uo));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof Fr)){var i,a=Jr(o.fingerprints);try{for(a.s();!(i=a.n()).done;)if(i.value.value===n)return o}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=Jr(to(this,uo));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&Xr(e.prototype,n),r&&Xr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function lo(t){return lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lo(t)}function so(t,e){for(var n=0;nEo(this,Po)&&n.splice(n.length-Eo(this,Po)),jo(this,No,n),To(this,Ro,Mo).call(this))}},{key:"isClosed",value:function(t){return-1!==To(this,Ao,xo).call(this).indexOf(t)}}])&&ho(e.prototype,n),r&&ho(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xo(){if(null!==Eo(this,No))return Eo(this,No);var t=Eo(this,ko).getItem(Eo(this,_o)),e=null!==t&&""!==t?t.split(","):[];return jo(this,No,e)}function Mo(){null!==Eo(this,No)&&Eo(this,ko).setItem(Eo(this,_o),Eo(this,No).join(","))}function Do(){var t={items:{}};return t.setItem=function(t,e){this.items[t]=e}.bind(t),t.getItem=function(t){return t in this.items?this.items[t]:null}.bind(t),t}function Bo(t){return Bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bo(t)}function Wo(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Jo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var i="idx_"+Zo(this,ni).getNextIdentifier();return Zo(this,ri)[t]=Zo(this,ri)[t]||{},Zo(this,ri)[t][i]={callback:e,scope:r,priority:o},t in Zo(this,oi)&&delete Zo(this,oi)[t],function(){t in Zo(n,ri)&&i in Zo(n,ri)[t]&&delete Zo(n,ri)[t][i]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Pi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){i.e(t)}finally{i.f()}return r};return new IntersectionObserver((function(r){var o,a=[],u={},l={},s=_i(r);try{for(s.s();!(o=s.n()).done;){var f=o.value,p=f.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var v=n[p];if(v){var b={fingerprint:v.fingerprint,element:f.target,banner:y};if(a.push(Ti(Ti({},b),{},{entry:f})),!v.alreadySeen){var m=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&m?{fingerprintArgs:b,fingerprintMetadata:v,isIntersecting:m}:u[p]}if(!v.alreadyFullySeen){var h=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&h?{fingerprintArgs:b,fingerprintMetadata:v,isFullyIntersecting:h}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var d=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,o=t.isIntersecting;o&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(re.ON_BANNER_FIRST_TIME_SEEN,n)}),i):o||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function la(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(o);var i={};return i[e.params.channel_code]=da(a,ja),i[e.params.banner_id]=n.bannerId,i[e.params.banner_name]=n.bannerName,i[e.params.position_id]=n.positionId,i[e.params.position_code]=n.positionCode,i[e.params.position_name]=n.positionName,i[e.params.campaign_id]=n.campaignId,i[e.params.campaign_code]=n.campaignCode,i[e.params.campaign_name]=n.campaignName,i[e.params.breakpoint]=o,fa(fa({},i),e.extraParams)}}),wa(this,Sa,e),wa(this,Ea,n),wa(this,ja,r),wa(this,Oa,!1)}var e,n,r;return e=t,(n=[{key:"collectBeforeAttach",value:function(){var t=this;if(!da(this,Ta).started&&!da(this,Oa)){da(this,Ta).started=!0;var e=da(this,Ea),n=new aa({}),r=n.events[Xi.BANNER_LOADED],o=n.events[Xi.BANNER_DISPLAYED],i=n.events[Xi.BANNER_FULLY_DISPLAYED],a=n.events[Xi.BANNER_CLICKED],u=n.events[Xi.BANNER_CLOSED];da(this,Ta).cleanup.push(e.subscribe(re.ON_BANNER_STATE_CHANGED,(function(e){var n=e.banner;if(!n.isEmbed()&&te.RENDERED===n.state&&1===n.stateCounter){var o,i=ca(n.fingerprints);try{for(i.s();!(o=i.n()).done;){var a=o.value;da(t,Ta).events.push({name:Xi.BANNER_LOADED,params:da(t,ka).call(t,{event:r,fingerprint:a,banner:n})})}}catch(t){i.e(t)}finally{i.f()}}}))),da(this,Ta).cleanup.push(e.subscribe(re.ON_BANNER_FIRST_TIME_SEEN,(function(e){var n=e.fingerprint,r=e.banner;da(t,Ta).events.push({name:Xi.BANNER_DISPLAYED,params:da(t,ka).call(t,{event:o,fingerprint:n,banner:r})})}))),da(this,Ta).cleanup.push(e.subscribe(re.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(e){var n=e.fingerprint,r=e.banner;da(t,Ta).events.push({name:Xi.BANNER_FULLY_DISPLAYED,params:da(t,ka).call(t,{event:i,fingerprint:n,banner:r})})}))),da(this,Ta).cleanup.push(e.subscribe(re.ON_BANNER_LINK_CLICKED,(function(e){var n=e.fingerprint,r=e.banner,o=e.target,i=da(t,ka).call(t,{event:a,fingerprint:n,banner:r});i[a.params.link]=o.href||"",da(t,Ta).events.push({name:Xi.BANNER_CLICKED,params:i})}))),da(this,Ta).cleanup.push(e.subscribe(re.ON_BANNER_AFTER_CLOSE,(function(e){var n=e.fingerprint,r=e.banner;da(t,Ta).events.push({name:Xi.BANNER_CLOSED,params:da(t,ka).call(t,{event:u,fingerprint:n,banner:r})})})))}}},{key:"attach",value:function(t){var e=this;if(!da(this,Oa)){wa(this,Oa,!0);var n=da(this,Ea),r=da(this,Sa);if(r.hasAnyReceiver()){var o=t.events[Xi.BANNER_LOADED],i=t.events[Xi.BANNER_DISPLAYED],a=t.events[Xi.BANNER_FULLY_DISPLAYED],u=t.events[Xi.BANNER_CLICKED],c=t.events[Xi.BANNER_CLOSED];if(da(this,Ta).started){for(var l in da(this,Ta).events){var s=da(this,Ta).events[l],f=s.name,p=s.params,y=t.events[f];if(y.enabled){var v={};for(var b in p)v[y.params[b]]=p[b];r.send(y.name,fa(fa({},v),y.extraParams))}}ha(this,_a,Na).call(this)}o.enabled&&n.subscribe(re.ON_BANNER_STATE_CHANGED,(function(t){var n=t.banner;if(!n.isEmbed()&&te.RENDERED===n.state&&1===n.stateCounter){var i,a=ca(n.fingerprints);try{for(a.s();!(i=a.n()).done;){var u=i.value;r.send(o.name,da(e,ka).call(e,{event:o,fingerprint:u,banner:n}))}}catch(t){a.e(t)}finally{a.f()}}})),i.enabled&&n.subscribe(re.ON_BANNER_FIRST_TIME_SEEN,(function(t){var n=t.fingerprint,o=t.banner;r.send(i.name,da(e,ka).call(e,{event:i,fingerprint:n,banner:o}))})),a.enabled&&n.subscribe(re.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var n=t.fingerprint,o=t.banner;r.send(a.name,da(e,ka).call(e,{event:a,fingerprint:n,banner:o}))})),u.enabled&&n.subscribe(re.ON_BANNER_LINK_CLICKED,(function(t){var n=t.fingerprint,o=t.banner,i=t.target,a=da(e,ka).call(e,{event:u,fingerprint:n,banner:o});a[u.params.link]=i.href||"",r.send(u.name,a)})),c.enabled&&n.subscribe(re.ON_BANNER_AFTER_CLOSE,(function(t){var n=t.fingerprint,o=t.banner;r.send(c.name,da(e,ka).call(e,{event:c,fingerprint:n,banner:o}))}))}else ha(this,_a,Na).call(this)}}}])&&ya(e.prototype,n),r&&ya(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Na(){for(var t in da(this,Ta).cleanup)da(this,Ta).cleanup[t]();da(this,Ta).events=[],da(this,Ta).cleanup=[]}var Aa=!1;const Ra=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!Aa&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(Aa=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Ia=!1;const Ca=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Ia&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Ia=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function xa(t){return xa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xa(t)}function Ma(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Da(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==xa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==xa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===xa(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ba=!1;const Wa=function(t,e){if(!("dataLayer"in window))return!Ba&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Ba=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function za(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function uu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Lu(t,e){if(t){if("string"==typeof t)return Fu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fu(t,e):void 0}}function Fu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1f||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==m(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, events: object, params: object }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(m(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var b in e.metrics.receiver)if(-1===["string","function"].indexOf(m(e.metrics.receiver[b])))throw new Error('The option "metrics.receiver.'.concat(b,'" must be a string or a function, "').concat(e.metrics.receiver[b],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if("object"!==m(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==m(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==m(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==m(e.closing)||"string"!=typeof e.closing.storage||"string"!=typeof e.closing.key||!Number.isInteger(e.closing.maxItems)||1>e.closing.maxItems)throw new Error('The option "closing" must be an object of the format { storage: "memoryStorage"|"localStorage"|"sessionStorage", key: string, maxItems: integer<1, max> }, '.concat(JSON.stringify(e.closing)," passed."));return e}(n)),Gu(this,Ku,new ii),Gu(this,Ju,new Wt(n.method,n.url,n.version,n.channel)),Gu(this,Qu,new Qt(n.url,n.version,n.channel)),Gu(this,Zu,new co(Hu(this,Ku),bo.fromCurrentWindow(),new Ei(n.template))),Gu(this,tc,new qi(Hu(this,Zu),Hu(this,Ku),n.interaction)),Gu(this,nc,Ka.createFromReceivers(n.metrics.receiver)),Gu(this,rc,new Pa(Hu(this,nc),Hu(this,Ku),n.channel)),Gu(this,oc,new Au({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction,metrics:{events:n.metrics.events,params:n.metrics.params,extraParams:n.metrics.extraParams}}},bannerManager:Hu(this,Zu),metricsSender:Hu(this,nc)})),Gu(this,ec,new Yo({bannerManager:Hu(this,Zu),eventBus:Hu(this,Ku),config:{storage:n.closing.storage,key:n.closing.key,maxItems:n.closing.maxItems},frameMessenger:Hu(this,oc)})),this.setLocale(n.locale),Hu(this,Ju).origin=n.origin,n.resources)Hu(this,Ju).addDefaultResource(a,n.resources[a]),Hu(this,Qu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Wu(Hu(i,Zu).getBannersByState({state:Hu(i,Zu).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Hu(this,oc).listen(),Hu(this,rc).attach(new aa({events:n.metrics.events,params:n.metrics.params,extraParams:n.metrics.extraParams})),Hu(this,tc).start(),Hu(this,ec).attachUi()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Hu(this,Yu)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Hu(this,Ku).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Hu(this,Ju).locale=t,Hu(this,Qu).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof g}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");Gu(this,Xu,t)}},{key:"getGateway",value:function(){return null===Hu(this,Xu)&&this.setGateway(new Z),Hu(this,Xu)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(t=qr(t,i),"embed"===o){var a=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,ic,uc).call(this,t,e,n,r),u=Hu(this,Zu).addEmbedBanner(t,a,e,r);return Hu(this,oc).connectBanner(u),t.insertAdjacentElement("beforeend",a),u}return Hu(this,Zu).addManagedBanner(t,e,n,r,i)}},{key:"closeBanner",value:function(t){Hu(this,ec).closeBanner(t)}},{key:"attachBanners",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,r=Wu(e.querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(r.s();!(t=r.n()).done;){var o=t.value,i=o.dataset.ampBanner;if(i){var a=void 0;if("ampBannerExternal"in o.dataset)a=Hu(this,Zu).addExternalBanner(o,n);else{var u=fr.parseResources(o),c=fr.parseOptions(o),l=o.dataset.ampMode||"managed";a=this.createBanner(o,i,u,c,l,n)}Hu(this,Ku).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:a})}else console.warn("Unable to attach a banner to the element ",o,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){r.e(t)}finally{r.f()}}},{key:"fetch",value:function(){var t=this,e=Hu(this,Zu).getBannersByState({state:Hu(this,Zu).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Hu(this,Ju).create(),o=Wu(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.addPosition(i.position,i.resources,"1"!==i.options.get("omit-default-resources","0").toString())}}catch(t){o.e(t)}finally{o.f()}Hu(this,Ku).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,o=n.data,i=Wu(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.position in o&&"banners"in o[a.position]&&Object.values(o[a.position].banners).length){for(var u=o[a.position],c=Array.isArray(u.banners)?u.banners:Object.values(u.banners),l=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==sc(e.metrics))throw new Error('The option "metrics" must be an object of the format { events: object, params: object }, '.concat(JSON.stringify(e.metrics)," passed."));if("object"!==sc(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==sc(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==sc(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));return e}function yc(t){return yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(t)}function vc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return bc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function bc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function qc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return tl(this,al).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(tl(this,yl))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=tl(this,ul).addExternalBanner(t);el(this,yl,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),tl(this,al).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:e})}else console.warn("No banner found in the embed client.")}}],n&&Kc(e.prototype,n),r&&Kc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function dl(t,e){tl(this,cl).sendToParent("metrics",{eventName:t,eventArgs:e})}function wl(){var t,e=Yc(tl(this,ul).getBannersByState({state:te.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function gl(t){return gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gl(t)}function Sl(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new ac(new f(El,"standard@".concat(El)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new hl(new f(El,"embed@".concat(El)),t)}},{key:"version",get:function(){return El}}],(n=null)&&Sl(e.prototype,n),r&&Sl(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()})(),AMPClientFactory=r.default})(); \ No newline at end of file +var AMPClientFactory;(()=>{var t={6384:(t,e,n)=>{var r=n(7040),i=n(4125),o=n(2117),a=n(7518),u=n(4705);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e{var r=n(5639).Uint8Array;t.exports=r},6874:t=>{t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},9932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n{var r=n(9465),i=n(7813);t.exports=function(t,e,n){(void 0!==n&&!i(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},4865:(t,e,n)=>{var r=n(9465),i=n(7813),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];o.call(t,e)&&i(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8470:(t,e,n)=>{var r=n(7813);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},9465:(t,e,n)=>{var r=n(8777);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},3118:(t,e,n)=>{var r=n(3218),i=Object.create,o=function(){function t(){}return function(e){if(!r(e))return{};if(i)return i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=o},8483:(t,e,n)=>{var r=n(5063)();t.exports=r},4239:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},2980:(t,e,n)=>{var r=n(6384),i=n(6556),o=n(8483),a=n(9783),u=n(3218),c=n(1704),l=n(6390);t.exports=function t(e,n,s,f,p){e!==n&&o(n,(function(o,c){if(p||(p=new r),u(o))a(e,n,c,s,t,f,p);else{var y=f?f(l(e,c),o,c+"",e,n,p):void 0;void 0===y&&(y=o),i(e,c,y)}}),c)}},9783:(t,e,n)=>{var r=n(6556),i=n(4626),o=n(7133),a=n(278),u=n(8517),c=n(5694),l=n(1469),s=n(9246),f=n(4144),p=n(3560),y=n(3218),v=n(8630),b=n(6719),h=n(6390),m=n(9881);t.exports=function(t,e,n,d,w,g,S){var E=h(t,n),O=h(e,n),T=S.get(O);if(T)r(t,n,T);else{var j=g?g(E,O,n+"",t,e,S):void 0,k=void 0===j;if(k){var _=l(O),N=!_&&f(O),P=!_&&!N&&b(O);j=O,_||N||P?l(E)?j=E:s(E)?j=a(E):N?(k=!1,j=i(O,!0)):P?(k=!1,j=o(O,!0)):j=[]:v(O)||c(O)?(j=E,c(E)?j=m(E):y(E)&&!p(E)||(j=u(O))):k=!1}k&&(S.set(O,j),w(j,O,d,g,S),S.delete(O)),r(t,n,j)}}},8674:t=>{t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},5976:(t,e,n)=>{var r=n(6557),i=n(5357),o=n(61);t.exports=function(t,e){return o(i(t,e,r),t+"")}},7415:(t,e,n)=>{var r=n(9932);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},4318:(t,e,n)=>{var r=n(1149);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},4626:(t,e,n)=>{t=n.nmd(t);var r=n(5639),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}},7133:(t,e,n)=>{var r=n(4318);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},278:t=>{t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n{var r=n(4865),i=n(9465);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var u=-1,c=e.length;++u{var r=n(5976),i=n(6612);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,u=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,u&&i(n[0],n[1],u)&&(a=o<3?void 0:a,o=1),e=Object(e);++r{t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),u=a.length;u--;){var c=a[t?u:++i];if(!1===n(o[c],c,o))break}return e}}},3833:(t,e,n)=>{var r=n(7813),i=Object.prototype,o=i.hasOwnProperty;t.exports=function(t,e,n,a){return void 0===t||r(t,i[n])&&!o.call(a,n)?e:t}},8777:(t,e,n)=>{var r=n(852),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},9464:(t,e,n)=>{var r=n(8674)({"&":"&","<":"<",">":">",'"':""","'":"'"});t.exports=r},1994:t=>{var e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};t.exports=function(t){return"\\"+e[t]}},1957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},852:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},5924:(t,e,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);t.exports=r},8517:(t,e,n)=>{var r=n(3118),i=n(5924),o=n(5726);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},6612:t=>{t.exports=function(){return!1}},5726:t=>{t.exports=function(){return!1}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,e,n)=>{var r=n(8470),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},2117:(t,e,n)=>{var r=n(8470);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},7518:(t,e,n)=>{var r=n(8470);t.exports=function(t){return r(this.__data__,t)>-1}},4705:(t,e,n)=>{var r=n(8470);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},5569:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},5357:(t,e,n)=>{var r=n(6874),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,u=i(o.length-e,0),c=Array(u);++a{t.exports=/<%-([\s\S]+?)%>/g},6051:t=>{t.exports=/<%([\s\S]+?)%>/g},5712:t=>{t.exports=/<%=([\s\S]+?)%>/g},5639:(t,e,n)=>{var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},6390:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},61:t=>{t.exports=function(t){return t}},9018:(t,e,n)=>{var r=n(8363),i=n(1463),o=n(1704),a=i((function(t,e,n,i){r(e,o(e),t,i)}));t.exports=a},9591:(t,e,n)=>{var r=n(6874),i=n(5976),o=n(4647),a=i((function(t,e){try{return r(t,void 0,e)}catch(t){return o(t)?t:new Error(t)}}));t.exports=a},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},7187:(t,e,n)=>{var r=n(9464),i=n(9833),o=/[&<>"']/g,a=RegExp(o.source);t.exports=function(t){return(t=i(t))&&a.test(t)?t.replace(o,r):t}},6557:t=>{t.exports=function(t){return t}},5694:t=>{t.exports=function(){return!1}},1469:t=>{var e=Array.isArray;t.exports=e},8612:(t,e,n)=>{var r=n(3560),i=n(1780);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},9246:(t,e,n)=>{var r=n(8612),i=n(7005);t.exports=function(t){return i(t)&&r(t)}},4144:t=>{t.exports=function(){return!1}},4647:(t,e,n)=>{var r=n(4239),i=n(7005),o=n(8630);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!o(t)}},3560:(t,e,n)=>{var r=n(4239),i=n(3218);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,e,n)=>{var r=n(4239),i=n(5924),o=n(7005),a=Function.prototype,u=Object.prototype,c=a.toString,l=u.hasOwnProperty,s=c.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=l.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==s}},6719:t=>{t.exports=function(){return!1}},3674:(t,e,n)=>{var r=n(5569)(Object.keys,Object);t.exports=r},1704:t=>{t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},2492:(t,e,n)=>{var r=n(2980),i=n(1463)((function(t,e,n){r(t,e,n)}));t.exports=i},1106:(t,e,n)=>{var r=n(9018),i=n(9591),o=n(7415),a=n(3833),u=n(1994),c=n(4647),l=n(6612),s=n(3674),f=n(5712),p=n(5835),y=n(9833),v=/\b__p \+= '';/g,b=/\b(__p \+=) '' \+/g,h=/(__e\(.*?\)|\b__t\)) \+\n'';/g,m=/[()=,{}\[\]\/\s]/,d=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,w=/($^)/,g=/['\n\r\u2028\u2029\\]/g,S=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var E=p.imports._.templateSettings||p;n&&l(t,e,n)&&(e=void 0),t=y(t),e=r({},e,E,a);var O,T,j=r({},e.imports,E.imports,a),k=s(j),_=o(j,k),N=0,P=e.interpolate||w,A="__p += '",R=RegExp((e.escape||w).source+"|"+P.source+"|"+(P===f?d:w).source+"|"+(e.evaluate||w).source+"|$","g"),I=S.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(R,(function(e,n,r,i,o,a){return r||(r=i),A+=t.slice(N,a).replace(g,u),n&&(O=!0,A+="' +\n__e("+n+") +\n'"),o&&(T=!0,A+="';\n"+o+";\n__p += '"),r&&(A+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),N=a+e.length,e})),A+="';\n";var C=S.call(e,"variable")&&e.variable;if(C){if(m.test(C))throw new Error("Invalid `variable` option passed into `_.template`")}else A="with (obj) {\n"+A+"\n}\n";A=(T?A.replace(v,""):A).replace(b,"$1").replace(h,"$1;"),A="function("+(C||"obj")+") {\n"+(C?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(O?", __e = _.escape":"")+(T?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+A+"return __p\n}";var x=i((function(){return Function(k,I+"return "+A).apply(void 0,_)}));if(x.source=A,c(x))throw x;return x}},5835:(t,e,n)=>{var r=n(7187),i={escape:n(9865),evaluate:n(6051),interpolate:n(5712),variable:"",imports:{_:{escape:r}}};t.exports=i},9881:(t,e,n)=>{var r=n(8363),i=n(1704);t.exports=function(t){return r(t,i(t))}},9833:t=>{t.exports=function(t){return t}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r](o,o.exports,n),o.loaded=!0,o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";n.d(r,{default:()=>Pl});var t={};n.r(t),n.d(t,{exclude:()=>G,extract:()=>L,parse:()=>F,parseUrl:()=>z,pick:()=>H,stringify:()=>U,stringifyUrl:()=>$});const e=JSON.parse('{"i8":"1.7.0-beta.7"}');function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>width="<%- data.content.dimensions.width %>"<% } %>\n <% if(null !== data.content.dimensions.height) { %>height="<%- data.content.dimensions.height %>"<% } %>\n <% if(\'\' !== data.content.title) { %>title="<%- data.content.title %>"<% } %>\n <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,R=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),I=Symbol("encodeFragmentIdentifier");function C(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function x(t,e){return e.encode?e.strict?R(t):encodeURIComponent(t):t}function M(t,e){return e.decode?_(t):t}function D(t){return Array.isArray(t)?t.sort():"object"==typeof t?D(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function B(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function W(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function L(t){const e=(t=B(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function F(t,e){C((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const i="string"==typeof n&&n.includes(t.arrayFormatSeparator),o="string"==typeof n&&!i&&M(n,t).includes(t.arrayFormatSeparator);n=o?M(n,t):n;const a=i||o?n.split(t.arrayFormatSeparator).map((e=>M(e,t))):null===n?n:M(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const i=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!i)return void(r[e]=n?M(n,t):n);const o=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>M(e,t)));void 0!==r[e]?r[e]=[...r[e],...o]:r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const i of t.split("&")){if(""===i)continue;const t=e.decode?i.replace(/\+/g," "):i;let[o,a]=N(t,"=");void 0===o&&(o=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:M(a,e),n(M(o,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=W(r,e);else r[t]=W(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=D(n):t[e]=n,t}),Object.create(null))}function U(t,e){if(!t)return"";C((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&A(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[x(e,t),"[",i,"]"].join("")]:[...n,[x(e,t),"[",x(i,t),"]=",x(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[x(e,t),"[]"].join("")]:[...n,[x(e,t),"[]=",x(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[x(e,t),":list="].join("")]:[...n,[x(e,t),":list=",x(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[x(n,t),e,x(i,t)].join("")]:[[r,x(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,x(e,t)]:[...n,[x(e,t),"=",x(r,t)].join("")]}}(e),i={};for(const[e,r]of Object.entries(t))n(e)||(i[e]=r);const o=Object.keys(i);return!1!==e.sort&&o.sort(e.sort),o.map((n=>{const i=t[n];return void 0===i?"":null===i?x(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?x(n,e)+"[]":i.reduce(r(n),[]).join("&"):x(n,e)+"="+x(i,e)})).filter((t=>t.length>0)).join("&")}function z(t,e){e={decode:!0,...e};let[n,r]=N(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:F(L(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:M(r,e)}:{}}}function $(t,e){e={encode:!0,strict:!0,[I]:!0,...e};const n=B(t.url).split("?")[0]||"";let r=U({...F(L(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let i=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,i=e[I]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${i}`}function H(t,e,n){n={parseFragmentIdentifier:!0,[I]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=z(t,n);return $({url:r,query:P(i,e),fragmentIdentifier:o},n)}function G(t,e,n){return H(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const V=t;function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function Y(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return K(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var i=t.endpoint;"GET"===t.method&&(i+="?".concat(V.stringify(t.parameters))),r.open(t.method,i,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var o,a=Y(t.headers);try{for(a.s();!(o=a.n()).done;){var u=o.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&J(e.prototype,n),r&&J(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(S);function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function nt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ht(this,gt,{writable:!0,value:void 0}),ht(this,St,{writable:!0,value:void 0}),ht(this,Et,{writable:!0,value:void 0}),ht(this,Ot,{writable:!0,value:void 0}),ht(this,Tt,{writable:!0,value:void 0}),ht(this,jt,{writable:!0,value:void 0}),ht(this,kt,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r].value.filter((function(t){return""!==t}));i.length&&(e[n][r]=i)}return e}}),dt(this,gt,e),dt(this,St,n),dt(this,Et,r),dt(this,Ot,{}),dt(this,Tt,i),dt(this,jt,o)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=mt(this,Ot);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,mt(this,Tt)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof pt))throw new TypeError("Argument resource must be instance of Resource class.");var n=mt(this,Ot);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return mt(this,gt)}},{key:"endpoint",get:function(){return mt(this,St)}},{key:"locale",get:function(){return mt(this,Et)}},{key:"parameters",get:function(){var t=mt(this,kt).call(this,mt(this,Ot)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return mt(this,jt)}}],n&&bt(e.prototype,n),r&&bt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Nt(t){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}function Pt(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var i in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e]+)>/g,(function(t,e){var n=o[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof i){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=ce(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),i.apply(this,t)}))}return t[Symbol.replace].call(this,n,i)},le.apply(this,arguments)}function se(t,e){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},se(t,e)}var fe=le(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),pe={};function ye(t,e){var n=function(t){if(t in pe)return pe[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==i.groups.EQ:o={eq:parseInt(i.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==i.groups.LT:o={lt:parseInt(i.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==i.groups.GTE:o={gte:parseInt(i.groups.GTE),matches:function(t){return t>=this.gte}};break;default:o={matches:function(){return!0}}}o&&(o.matches=o.matches.bind(o),o.value=i.groups.VALUE,n.push(o))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:ye(this.options[t],e)}},{key:"override",value:function(t){this.options=he(he({},this.options),Se(this,Ee,Te).call(this,he({},t)))}}],n&&de(e.prototype,n),r&&de(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Te(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,i='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(i+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(i),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function je(t){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(t)}function ke(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));Pe(this,xe,t),Pe(this,Me,e.toString()),Ne(this,De)[t]=(Ne(this,De)[t]||0)+1,this._eventBus.dispatch(ie.ON_BANNER_STATE_CHANGED,{banner:this})}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.startsWith("amp:banner:"))throw new Error('Unable to attach listener on event "'.concat(t,'" through a banner.'));return this._eventBus.subscribe(t,(function(t){t.banner===this&&(null!==n?e.call(n,t):e(t))}),this)}},{key:"getCurrentBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){Ne(this,Ce).override(t)}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&ke(e.prototype,n),r&&ke(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function We(t){return We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(t)}function Le(t,e){for(var n=0;n=c&&(null===o||oc))&&(i=u,o=c,tn(t,cn)[n]=c)):r=u})),null===i&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(o);return"max"===n&&u-1 in a&&(tn(this,cn).min=a[u-1]),"min"===n&&u+1 in a&&(tn(this,cn).max=a[u+1]),en(this,un,null!==i?i:r)}},{key:"needRedraw",value:function(){if(null===tn(this,un))return!0;var t=tn(this,rn).width;return null!==tn(this,cn).min&&ttn(this,cn).max}}])&&Qe(e.prototype,n),r&&Qe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fn(t,e){for(var n in t)e(t[n],n)}function pn(t){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn(t)}function yn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,i=0;i0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&Cn(e.prototype,n),r&&Cn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Mn(t){return Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mn(t)}function Dn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Bn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var f in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),$n(Un(c=i.call(this,n,r,a,u,s)),ir),$n(Un(c),rr),Hn(Un(c),Jn,{writable:!0,value:void 0}),Hn(Un(c),Qn,{writable:!0,value:void 0}),Hn(Un(c),Xn,{writable:!0,value:[]}),Hn(Un(c),Zn,{writable:!0,value:void 0}),Hn(Un(c),tr,{writable:!0,value:!1}),Hn(Un(c),er,{writable:!0,value:null}),Hn(Un(c),nr,{writable:!0,value:[]}),Yn(Un(c),Jn,t),Yn(Un(c),Qn,e),Yn(Un(c),Zn,l),l)qn(Un(c),Xn).push(new pt(f,l[f]));return c.setState(c.STATE.NEW,"Banner created."),c}return e=o,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return qn(this,Xn)}},{key:"rawResources",get:function(){return qn(this,Zn)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new Rn(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return null===t?[]:(this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint})))}},{key:"bannerData",get:function(){if(null!==qn(this,er))return qn(this,er);if(!qn(this,nr).length)return null;var t=null,e=this.positionData,n=function(t){return Fe.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=qn(this,nr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=xn.randomByWeights(qn(this,nr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,i=Dn(t=qn(this,nr).sort((function(t,e){return e.score-t.score})));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.fingerprint=n(o)}}catch(t){i.e(t)}finally{i.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}return Yn(this,er,t),t}},{key:"unsetFingerprint",value:function(t){var e=t.bannerId,n=this.positionData;if(qn(this,nr).filter((function(t){return t.id===e}))[0]){switch(!0){case n.isSingle():Yn(this,nr,[]),Yn(this,er,null);break;case n.isRandom():qn(this,er)&&qn(this,er).id===e?(Yn(this,nr,[]),Yn(this,er,null)):Yn(this,nr,qn(this,nr).filter((function(t){return t.id!==e})));break;case n.isMultiple():Yn(this,nr,qn(this,nr).filter((function(t){return t.id!==e}))),qn(this,er)&&Yn(this,er,qn(this,er).filter((function(t){return t.id!==e})))}0>=qn(this,nr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):n.isRandom()&&this.redrawIfNeeded()}}},{key:"setResponseData",value:function(t){if(qn(this,tr))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ue({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new On(t.banners[n],t.breakpoint_type,qn(this,Jn)));Yn(this,nr,e),Yn(this,tr,!0),0>=qn(this,nr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):Vn(this,rr,ar).call(this,"Banner was successfully rendered.")}},{key:"getCurrentBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:e?[e]:[]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){Vn(this,ir,ur).call(this)&&Vn(this,rr,ar).call(this,"Banner was successfully redrawn.")}}])&&Wn(e.prototype,n),r&&Wn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(Be);function ar(t){try{this.html=qn(this,Qn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function ur(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function cr(t){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(t)}function lr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=Er(this,jr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){var e=Er(this,kr)[t]||null;if(null===e)return null;if(Er(this,_r))return e.content?e.content.breakpoint:null;var n,r=vr(e.contents);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("none"!==getComputedStyle(i.data).display)return i.breakpoint}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"isExternal",value:function(){return!0}},{key:"delegateResponsiveBehaviour",value:function(){if(!Er(this,_r)){Or(this,_r,!0);var t,e=vr(this.element.querySelectorAll("style"));try{for(e.s();!(t=e.n()).done;)t.value.remove()}catch(t){e.e(t)}finally{e.f()}this.redrawIfNeeded()}}},{key:"redrawIfNeeded",value:function(){if(Er(this,_r))for(var t in Er(this,kr)){var e=Er(this,kr)[t];if(e.needRedraw()){var n,r=e.content,i=vr(e.contents);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.data.style.display=o===r?"block":"none"}}catch(t){i.e(t)}finally{i.f()}}}}}])&&hr(e.prototype,n),r&&hr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(Be);function Pr(t){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(t)}function Ar(t,e){for(var n=0;n=Dr(this,Fr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){throw new Error("Method EmbedBanner.getCurrentBreakpoint() is not readable.")}},{key:"isEmbed",value:function(){return!0}},{key:"updatePositionData",value:function(t){for(var e=this.positionData,n=0,r=["id","name","rotationSeconds","displayType","breakpointType","dimensions"];n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Hr(this,qr,{writable:!0,value:void 0}),Gr(this,qr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Gr(this,qr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Vr(e,qr,"get")),++t))}}])&&$r(e.prototype,n),r&&$r(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Kr(t,e){if(t instanceof e.HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var n;if(!((n="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof e.HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return n}function Jr(t){return Jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jr(t)}function Qr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ei(r=this,i=pi),i.add(r),ti(this,ai,{writable:!0,value:void 0}),ti(this,ui,{writable:!0,value:void 0}),ti(this,ci,{writable:!0,value:void 0}),ti(this,li,{writable:!0,value:void 0}),ti(this,si,{writable:!0,value:[]}),ti(this,fi,{writable:!0,value:void 0}),ii(this,ai,e),ii(this,ui,n),ii(this,ci,a),ii(this,li,new Yr),ii(this,fi,new MutationObserver((function(t){var e,n=Qr(t);try{for(n.s();!(e=n.n()).done;){var r,i=e.value;if(i.target instanceof HTMLElement){var a=null===(r=i.target.closest("[data-amp-attached]"))||void 0===r||null===(r=r.dataset)||void 0===r?void 0:r.ampAttached,u=void 0!==a?o.getBannerByUid(parseInt(a)):null;u&&ri(o,ai).dispatch(ie.ON_BANNER_MUTATED,{banner:u,mutation:i})}}}catch(t){n.e(t)}finally{n.f()}}))),this.STATE=ee}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){t=Kr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:window);var e=ri(this,li).getNextIdentifier();t.setAttribute("data-amp-attached",e);var n=new Nr(ri(this,ui),ri(this,ai),e,t);return ni(this,pi,vi).call(this,t),ri(this,si).push(n),n}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;if(null===ri(this,ci))throw new Error("Unable to add managed banner, renderer is not provided.");t=Kr(t,i);var o=ri(this,li).getNextIdentifier();t.setAttribute("data-amp-attached",o);var a=new or(ri(this,ui),ri(this,ci),ri(this,ai),o,t,e,n,r);return ni(this,pi,vi).call(this,t),ri(this,si).push(a),a}},{key:"addEmbedBanner",value:function(t,e,n,r){t=Kr(t,window),e=Kr(e,window);var i=ri(this,li).getNextIdentifier();t.setAttribute("data-amp-attached",i);var o=new Ur(ri(this,ai),i,t,e,n,r);return ni(this,pi,vi).call(this,t),ri(this,si).push(o),o}},{key:"removeBanner",value:function(t){var e=ri(this,si).length;return ii(this,si,ri(this,si).filter((function(e){return e!==t}))),e!==ri(this,si).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,i=t.external,o=void 0===i||i,a=t.embed,u=void 0===a||a;return ri(this,si).filter((function(t){return t instanceof Be&&t.state===e&&!(t instanceof or&&!r||t instanceof Nr&&!o||t instanceof Ur&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Fe?t.value:t,r=Qr(ri(this,si));try{for(r.s();!(e=r.n()).done;){var i=e.value;if(!(i instanceof Ur)){var o,a=Qr(i.fingerprints);try{for(a.s();!(o=a.n()).done;)if(o.value.value===n)return i}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=Qr(ri(this,si));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&Zr(e.prototype,n),r&&Zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vi(t){t._ampBannerMutationsObserved||(ri(this,fi).observe(t,{subtree:!0,childList:!0,characterData:!1,attributes:!0,attributeFilter:["data-amp-banner-close"]}),t._ampBannerMutationsObserved=!0)}function bi(t){return bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bi(t)}function hi(t,e){for(var n=0;n_i(this,Ci)&&n.splice(n.length-_i(this,Ci)),Ni(this,xi,n),Ai(this,Di,Fi).call(this))}},{key:"isClosed",value:function(t){return-1!==Ai(this,Mi,Li).call(this).indexOf(t)}}])&&Oi(e.prototype,n),r&&Oi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Li(){if(null!==_i(this,xi))return _i(this,xi);var t=_i(this,Ri).getItem(_i(this,Ii)),e=null!==t&&""!==t?t.split(","):[];return Ni(this,xi,e)}function Fi(){null!==_i(this,xi)&&_i(this,Ri).setItem(_i(this,Ii),_i(this,xi).join(","))}function Ui(){var t={items:{}};return t.setItem=function(t,e){this.items[t]=e}.bind(t),t.getItem=function(t){return t in this.items?this.items[t]:null}.bind(t),t}function zi(t){return zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zi(t)}function $i(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function eo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var o="idx_"+io(this,uo).getNextIdentifier();return io(this,co)[t]=io(this,co)[t]||{},io(this,co)[t][o]={callback:e,scope:r,priority:i},t in io(this,lo)&&delete io(this,lo)[t],function(){t in io(n,co)&&o in io(n,co)[t]&&delete io(n,co)[t][o]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function xo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){o.e(t)}finally{o.f()}return r};return new IntersectionObserver((function(r){var i,a=[],u={},l={},s=Co(r);try{for(s.s();!(i=s.n()).done;){var f=i.value,p=f.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var v=n[p];if(v){var b={fingerprint:v.fingerprint,element:f.target,banner:y};if(a.push(Ro(Ro({},b),{},{entry:f})),!v.alreadySeen){var h=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&h?{fingerprintArgs:b,fingerprintMetadata:v,isIntersecting:h}:u[p]}if(!v.alreadyFullySeen){var m=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&m?{fingerprintArgs:b,fingerprintMetadata:v,isFullyIntersecting:m}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var d=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,i=t.isIntersecting;i&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(ie.ON_BANNER_FIRST_TIME_SEEN,n)}),o):i||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Fo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function ba(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(i);var o={};return o[e.params.channel_code]=Ta(a,Pa),o[e.params.banner_id]=n.bannerId,o[e.params.banner_name]=n.bannerName,o[e.params.position_id]=n.positionId,o[e.params.position_code]=n.positionCode,o[e.params.position_name]=n.positionName,o[e.params.campaign_id]=n.campaignId,o[e.params.campaign_code]=n.campaignCode,o[e.params.campaign_name]=n.campaignName,o[e.params.breakpoint]=i,ma(ma({},o),e.extraParams)}}),ja(this,_a,e),ja(this,Na,n),ja(this,Pa,r),ja(this,Aa,!1)}var e,n,r;return e=t,(n=[{key:"collectBeforeAttach",value:function(){var t=this;if(!Ta(this,Ra).started&&!Ta(this,Aa)){Ta(this,Ra).started=!0;var e=Ta(this,Na),n=new pa({}),r=n.events[ia.BANNER_LOADED],i=n.events[ia.BANNER_DISPLAYED],o=n.events[ia.BANNER_FULLY_DISPLAYED],a=n.events[ia.BANNER_CLICKED],u=n.events[ia.BANNER_CLOSED];Ta(this,Ra).cleanup.push(e.subscribe(ie.ON_BANNER_STATE_CHANGED,(function(e){var n=e.banner;if(!n.isEmbed()&&ee.RENDERED===n.state&&1===n.stateCounter){var i,o=va(n.fingerprints);try{for(o.s();!(i=o.n()).done;){var a=i.value;Ta(t,Ra).events.push({name:ia.BANNER_LOADED,params:Ta(t,Ia).call(t,{event:r,fingerprint:a,banner:n})})}}catch(t){o.e(t)}finally{o.f()}}}))),Ta(this,Ra).cleanup.push(e.subscribe(ie.ON_BANNER_FIRST_TIME_SEEN,(function(e){var n=e.fingerprint,r=e.banner;Ta(t,Ra).events.push({name:ia.BANNER_DISPLAYED,params:Ta(t,Ia).call(t,{event:i,fingerprint:n,banner:r})})}))),Ta(this,Ra).cleanup.push(e.subscribe(ie.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(e){var n=e.fingerprint,r=e.banner;Ta(t,Ra).events.push({name:ia.BANNER_FULLY_DISPLAYED,params:Ta(t,Ia).call(t,{event:o,fingerprint:n,banner:r})})}))),Ta(this,Ra).cleanup.push(e.subscribe(ie.ON_BANNER_LINK_CLICKED,(function(e){var n=e.fingerprint,r=e.banner,i=e.target,o=Ta(t,Ia).call(t,{event:a,fingerprint:n,banner:r});o[a.params.link]=i.href||"",Ta(t,Ra).events.push({name:ia.BANNER_CLICKED,params:o})}))),Ta(this,Ra).cleanup.push(e.subscribe(ie.ON_BANNER_AFTER_CLOSE,(function(e){var n=e.fingerprint,r=e.banner;Ta(t,Ra).events.push({name:ia.BANNER_CLOSED,params:Ta(t,Ia).call(t,{event:u,fingerprint:n,banner:r})})})))}}},{key:"attach",value:function(t){var e=this;if(!Ta(this,Aa)){ja(this,Aa,!0);var n=Ta(this,Na),r=Ta(this,_a);if(r.hasAnyReceiver()){var i=t.events[ia.BANNER_LOADED],o=t.events[ia.BANNER_DISPLAYED],a=t.events[ia.BANNER_FULLY_DISPLAYED],u=t.events[ia.BANNER_CLICKED],c=t.events[ia.BANNER_CLOSED];if(Ta(this,Ra).started){for(var l in Ta(this,Ra).events){var s=Ta(this,Ra).events[l],f=s.name,p=s.params,y=t.events[f];if(y.enabled){var v={};for(var b in p)v[y.params[b]]=p[b];r.send(y.name,ma(ma({},v),y.extraParams))}}Oa(this,Ca,Ma).call(this)}i.enabled&&n.subscribe(ie.ON_BANNER_STATE_CHANGED,(function(t){var n=t.banner;if(!n.isEmbed()&&ee.RENDERED===n.state&&1===n.stateCounter){var o,a=va(n.fingerprints);try{for(a.s();!(o=a.n()).done;){var u=o.value;r.send(i.name,Ta(e,Ia).call(e,{event:i,fingerprint:u,banner:n}))}}catch(t){a.e(t)}finally{a.f()}}})),o.enabled&&n.subscribe(ie.ON_BANNER_FIRST_TIME_SEEN,(function(t){var n=t.fingerprint,i=t.banner;r.send(o.name,Ta(e,Ia).call(e,{event:o,fingerprint:n,banner:i}))})),a.enabled&&n.subscribe(ie.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var n=t.fingerprint,i=t.banner;r.send(a.name,Ta(e,Ia).call(e,{event:a,fingerprint:n,banner:i}))})),u.enabled&&n.subscribe(ie.ON_BANNER_LINK_CLICKED,(function(t){var n=t.fingerprint,i=t.banner,o=t.target,a=Ta(e,Ia).call(e,{event:u,fingerprint:n,banner:i});a[u.params.link]=o.href||"",r.send(u.name,a)})),c.enabled&&n.subscribe(ie.ON_BANNER_AFTER_CLOSE,(function(t){var n=t.fingerprint,i=t.banner;r.send(c.name,Ta(e,Ia).call(e,{event:c,fingerprint:n,banner:i}))}))}else Oa(this,Ca,Ma).call(this)}}}])&&wa(e.prototype,n),r&&wa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ma(){for(var t in Ta(this,Ra).cleanup)Ta(this,Ra).cleanup[t]();Ta(this,Ra).events=[],Ta(this,Ra).cleanup=[]}var Da=!1;const Ba=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!Da&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(Da=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Wa=!1;const La=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Wa&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Wa=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function Fa(t){return Fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fa(t)}function Ua(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function za(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Fa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Fa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Fa(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var $a=!1;const Ha=function(t,e){if(!("dataLayer"in window))return!$a&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void($a=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ya(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function yu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Gu(t,e){if(t){if("string"==typeof t)return Vu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vu(t,e):void 0}}function Vu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1f||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==m(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, events: object, params: object }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(m(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var p in e.metrics.receiver)if(-1===["string","function"].indexOf(m(e.metrics.receiver[p])))throw new Error('The option "metrics.receiver.'.concat(p,'" must be a string or a function, "').concat(e.metrics.receiver[p],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if("object"!==m(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==m(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==m(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==m(e.closing)||"string"!=typeof e.closing.storage||"string"!=typeof e.closing.key||!Number.isInteger(e.closing.maxItems)||1>e.closing.maxItems)throw new Error('The option "closing" must be an object of the format { storage: "memoryStorage"|"localStorage"|"sessionStorage", key: string, maxItems: integer<1, max> }, '.concat(JSON.stringify(e.closing)," passed."));return e}(n)),Qu(this,ec,new so),Qu(this,nc,new Lt(n.method,n.url,n.version,n.channel)),Qu(this,rc,new Xt(n.url,n.version,n.channel)),Qu(this,oc,new yi(Ju(this,ec),Si.fromCurrentWindow(),new No(n.template))),Qu(this,ac,new ta(Ju(this,oc),Ju(this,ec),n.interaction)),Qu(this,cc,eu.createFromReceivers(n.metrics.receiver)),Qu(this,lc,new xa(Ju(this,cc),Ju(this,ec),n.channel)),Qu(this,sc,new Du({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction,metrics:{events:n.metrics.events,params:n.metrics.params,extraParams:n.metrics.extraParams}}},bannerManager:Ju(this,oc),metricsSender:Ju(this,cc)})),Qu(this,uc,new Xi({bannerManager:Ju(this,oc),eventBus:Ju(this,ec),config:{storage:n.closing.storage,key:n.closing.key,maxItems:n.closing.maxItems},frameMessenger:Ju(this,sc)})),this.setLocale(n.locale),Ju(this,nc).origin=n.origin,n.resources)Ju(this,nc).addDefaultResource(a,n.resources[a]),Ju(this,rc).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Hu(Ju(o,oc).getBannersByState({state:Ju(o,oc).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Ju(this,sc).listen(),Ju(this,lc).attach(new pa({events:n.metrics.events,params:n.metrics.params,extraParams:n.metrics.extraParams})),Ju(this,ac).start(),Ju(this,uc).attachUi()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Ju(this,Zu)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Ju(this,ec).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Ju(this,nc).locale=t,Ju(this,rc).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof S}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");Qu(this,ic,t)}},{key:"getGateway",value:function(){return null===Ju(this,ic)&&this.setGateway(new tt),Ju(this,ic)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(t=Kr(t,o),"embed"===i){var a=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,fc,yc).call(this,t,e,n,r),u=Ju(this,oc).addEmbedBanner(t,a,e,r);return Ju(this,sc).connectBanner(u),t.insertAdjacentElement("beforeend",a),u}return Ju(this,oc).addManagedBanner(t,e,n,r,o)}},{key:"closeBanner",value:function(t){Ju(this,uc).closeBanner(t)}},{key:"attachBanners",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,r=Hu(e.querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.dataset.ampBanner;if(o){var a=void 0;if("ampBannerExternal"in i.dataset)a=Ju(this,oc).addExternalBanner(i,n);else{var u=pr.parseResources(i),c=pr.parseOptions(i),l=i.dataset.ampMode||"managed";a=this.createBanner(i,o,u,c,l,n)}Ju(this,ec).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:a})}else console.warn("Unable to attach a banner to the element ",i,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){r.e(t)}finally{r.f()}}},{key:"fetch",value:function(){var t=this,e=Ju(this,oc).getBannersByState({state:Ju(this,oc).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Ju(this,nc).create(),i=Hu(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.addPosition(o.position,o.resources,"1"!==o.options.get("omit-default-resources","0").toString())}}catch(t){i.e(t)}finally{i.f()}Ju(this,ec).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,i=n.data,o=Hu(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.position in i&&"banners"in i[a.position]&&Object.values(i[a.position].banners).length){for(var u=i[a.position],c=Array.isArray(u.banners)?u.banners:Object.values(u.banners),l=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==hc(e.metrics))throw new Error('The option "metrics" must be an object of the format { events: object, params: object }, '.concat(JSON.stringify(e.metrics)," passed."));if("object"!==hc(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==hc(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==hc(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));return e}function wc(t){return wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(t)}function gc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Sc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Sc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function tl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return al(this,pl).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(al(this,wl))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=al(this,yl).addExternalBanner(t);ul(this,wl,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),al(this,pl).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:e})}else console.warn("No banner found in the embed client.")}}],n&&el(e.prototype,n),r&&el(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Tl(t,e){al(this,vl).sendToParent("metrics",{eventName:t,eventArgs:e})}function jl(){var t,e=Zc(al(this,yl).getBannersByState({state:ee.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function kl(t){return kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kl(t)}function _l(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new pc(new p(Nl,"standard@".concat(Nl)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Ol(new p(Nl,"embed@".concat(Nl)),t)}},{key:"version",get:function(){return Nl}}],(n=null)&&_l(e.prototype,n),r&&_l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()})(),AMPClientFactory=r.default})(); \ No newline at end of file diff --git a/dist/amp-client.standalone.min.js b/dist/amp-client.standalone.min.js index cb4c55d..44c18ef 100644 --- a/dist/amp-client.standalone.min.js +++ b/dist/amp-client.standalone.min.js @@ -1 +1 @@ -var AMPClientFactory;(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:()=>kl});var n={};t.r(n),t.d(n,{exclude:()=>G,extract:()=>L,parse:()=>F,parseUrl:()=>z,pick:()=>H,stringify:()=>U,stringifyUrl:()=>$});function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>width="<%- data.content.dimensions.width %>"<% } %>\n <% if(null !== data.content.dimensions.height) { %>height="<%- data.content.dimensions.height %>"<% } %>\n <% if(\'\' !== data.content.title) { %>title="<%- data.content.title %>"<% } %>\n <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,R=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),I=Symbol("encodeFragmentIdentifier");function C(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function M(t,e){return e.encode?e.strict?R(t):encodeURIComponent(t):t}function D(t,e){return e.decode?j(t):t}function B(t){return Array.isArray(t)?t.sort():"object"==typeof t?B(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function W(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function x(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function L(t){const e=(t=W(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function F(t,e){C((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const i="string"==typeof n&&n.includes(t.arrayFormatSeparator),o="string"==typeof n&&!i&&D(n,t).includes(t.arrayFormatSeparator);n=o?D(n,t):n;const a=i||o?n.split(t.arrayFormatSeparator).map((e=>D(e,t))):null===n?n:D(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const i=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!i)return void(r[e]=n?D(n,t):n);const o=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>D(e,t)));void 0!==r[e]?r[e]=[...r[e],...o]:r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const i of t.split("&")){if(""===i)continue;const t=e.decode?i.replace(/\+/g," "):i;let[o,a]=N(t,"=");void 0===o&&(o=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:D(a,e),n(D(o,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=x(r,e);else r[t]=x(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=B(n):t[e]=n,t}),Object.create(null))}function U(t,e){if(!t)return"";C((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&A(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[M(e,t),"[",i,"]"].join("")]:[...n,[M(e,t),"[",M(i,t),"]=",M(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[M(e,t),"[]"].join("")]:[...n,[M(e,t),"[]=",M(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[M(e,t),":list="].join("")]:[...n,[M(e,t),":list=",M(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[M(n,t),e,M(i,t)].join("")]:[[r,M(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,M(e,t)]:[...n,[M(e,t),"=",M(r,t)].join("")]}}(e),i={};for(const[e,r]of Object.entries(t))n(e)||(i[e]=r);const o=Object.keys(i);return!1!==e.sort&&o.sort(e.sort),o.map((n=>{const i=t[n];return void 0===i?"":null===i?M(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?M(n,e)+"[]":i.reduce(r(n),[]).join("&"):M(n,e)+"="+M(i,e)})).filter((t=>t.length>0)).join("&")}function z(t,e){e={decode:!0,...e};let[n,r]=N(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:F(L(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:D(r,e)}:{}}}function $(t,e){e={encode:!0,strict:!0,[I]:!0,...e};const n=W(t.url).split("?")[0]||"";let r=U({...F(L(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let i=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,i=e[I]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${i}`}function H(t,e,n){n={parseFragmentIdentifier:!0,[I]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=z(t,n);return $({url:r,query:P(i,e),fragmentIdentifier:o},n)}function G(t,e,n){return H(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const V=n;function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function q(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return K(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var i=t.endpoint;"GET"===t.method&&(i+="?".concat(V.stringify(t.parameters))),r.open(t.method,i,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var o,a=q(t.headers);try{for(a.s();!(o=a.n()).done;){var u=o.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&J(e.prototype,n),r&&J(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(g);function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function nt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),mt(this,gt,{writable:!0,value:void 0}),mt(this,St,{writable:!0,value:void 0}),mt(this,Et,{writable:!0,value:void 0}),mt(this,Tt,{writable:!0,value:void 0}),mt(this,kt,{writable:!0,value:void 0}),mt(this,Ot,{writable:!0,value:void 0}),mt(this,jt,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r].value.filter((function(t){return""!==t}));i.length&&(e[n][r]=i)}return e}}),dt(this,gt,e),dt(this,St,n),dt(this,Et,r),dt(this,Tt,{}),dt(this,kt,i),dt(this,Ot,o)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=ht(this,Tt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,ht(this,kt)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof pt))throw new TypeError("Argument resource must be instance of Resource class.");var n=ht(this,Tt);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return ht(this,gt)}},{key:"endpoint",get:function(){return ht(this,St)}},{key:"locale",get:function(){return ht(this,Et)}},{key:"parameters",get:function(){var t=ht(this,jt).call(this,ht(this,Tt)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return ht(this,Ot)}}],n&&vt(e.prototype,n),r&&vt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Pt(t){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(t)}function At(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var i in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e]+)>/g,(function(t,e){var n=o[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof i){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=ce(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),i.apply(this,t)}))}return t[Symbol.replace].call(this,n,i)},le.apply(this,arguments)}function se(t,e){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},se(t,e)}var fe=le(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),pe={};function ye(t,e){var n=function(t){if(t in pe)return pe[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==i.groups.EQ:o={eq:parseInt(i.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==i.groups.LT:o={lt:parseInt(i.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==i.groups.GTE:o={gte:parseInt(i.groups.GTE),matches:function(t){return t>=this.gte}};break;default:o={matches:function(){return!0}}}o&&(o.matches=o.matches.bind(o),o.value=i.groups.VALUE,n.push(o))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:ye(this.options[t],e)}},{key:"override",value:function(t){this.options=me(me({},this.options),Se(this,Ee,ke).call(this,me({},t)))}}],n&&de(e.prototype,n),r&&de(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ke(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,i='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(i+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(i),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function Oe(t){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(t)}function je(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));Ae(this,Me,t),Ae(this,De,e.toString()),Pe(this,Be)[t]=(Pe(this,Be)[t]||0)+1,this._eventBus.dispatch(ie.ON_BANNER_STATE_CHANGED,{banner:this})}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.startsWith("amp:banner:"))throw new Error('Unable to attach listener on event "'.concat(t,'" through a banner.'));return this._eventBus.subscribe(t,(function(t){t.banner===this&&(null!==n?e.call(n,t):e(t))}),this)}},{key:"getCurrentBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){Pe(this,Ce).override(t)}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&je(e.prototype,n),r&&je(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xe(t){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(t)}function Le(t,e){for(var n=0;n=c&&(null===o||oc))&&(i=u,o=c,tn(t,cn)[n]=c)):r=u})),null===i&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(o);return"max"===n&&u-1 in a&&(tn(this,cn).min=a[u-1]),"min"===n&&u+1 in a&&(tn(this,cn).max=a[u+1]),en(this,un,null!==i?i:r)}},{key:"needRedraw",value:function(){if(null===tn(this,un))return!0;var t=tn(this,rn).width;return null!==tn(this,cn).min&&ttn(this,cn).max}}])&&Qe(e.prototype,n),r&&Qe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fn(t,e){for(var n in t)e(t[n],n)}function pn(t){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn(t)}function yn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return bn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,i=0;i0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&Cn(e.prototype,n),r&&Cn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Dn(t){return Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dn(t)}function Bn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Wn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Wn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var f in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),$n(Un(c=i.call(this,n,r,a,u,s)),ir),$n(Un(c),rr),Hn(Un(c),Jn,{writable:!0,value:void 0}),Hn(Un(c),Qn,{writable:!0,value:void 0}),Hn(Un(c),Xn,{writable:!0,value:[]}),Hn(Un(c),Zn,{writable:!0,value:void 0}),Hn(Un(c),tr,{writable:!0,value:!1}),Hn(Un(c),er,{writable:!0,value:null}),Hn(Un(c),nr,{writable:!0,value:[]}),qn(Un(c),Jn,t),qn(Un(c),Qn,e),qn(Un(c),Zn,l),l)Yn(Un(c),Xn).push(new pt(f,l[f]));return c.setState(c.STATE.NEW,"Banner created."),c}return e=o,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Yn(this,Xn)}},{key:"rawResources",get:function(){return Yn(this,Zn)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new Rn(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return null===t?[]:(this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint})))}},{key:"bannerData",get:function(){if(null!==Yn(this,er))return Yn(this,er);if(!Yn(this,nr).length)return null;var t=null,e=this.positionData,n=function(t){return Fe.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=Yn(this,nr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Mn.randomByWeights(Yn(this,nr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,i=Bn(t=Yn(this,nr).sort((function(t,e){return e.score-t.score})));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.fingerprint=n(o)}}catch(t){i.e(t)}finally{i.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}return qn(this,er,t),t}},{key:"unsetFingerprint",value:function(t){var e=t.bannerId,n=this.positionData;if(Yn(this,nr).filter((function(t){return t.id===e}))[0]){switch(!0){case n.isSingle():qn(this,nr,[]),qn(this,er,null);break;case n.isRandom():Yn(this,er)&&Yn(this,er).id===e?(qn(this,nr,[]),qn(this,er,null)):qn(this,nr,Yn(this,nr).filter((function(t){return t.id!==e})));break;case n.isMultiple():qn(this,nr,Yn(this,nr).filter((function(t){return t.id!==e}))),Yn(this,er)&&qn(this,er,Yn(this,er).filter((function(t){return t.id!==e})))}0>=Yn(this,nr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):n.isRandom()&&this.redrawIfNeeded()}}},{key:"setResponseData",value:function(t){if(Yn(this,tr))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ue({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new Tn(t.banners[n],t.breakpoint_type,Yn(this,Jn)));qn(this,nr,e),qn(this,tr,!0),0>=Yn(this,nr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):Vn(this,rr,ar).call(this,"Banner was successfully rendered.")}},{key:"getCurrentBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:e?[e]:[]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){Vn(this,ir,ur).call(this)&&Vn(this,rr,ar).call(this,"Banner was successfully redrawn.")}}])&&xn(e.prototype,n),r&&xn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(We);function ar(t){try{this.html=Yn(this,Qn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function ur(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function cr(t){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(t)}function lr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function vr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=Er(this,Or).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){var e=Er(this,jr)[t]||null;if(null===e)return null;if(Er(this,Nr))return e.content?e.content.breakpoint:null;var n,r=br(e.contents);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("none"!==getComputedStyle(i.data).display)return i.breakpoint}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"isExternal",value:function(){return!0}},{key:"delegateResponsiveBehaviour",value:function(){if(!Er(this,Nr)){Tr(this,Nr,!0);var t,e=br(this.element.querySelectorAll("style"));try{for(e.s();!(t=e.n()).done;)t.value.remove()}catch(t){e.e(t)}finally{e.f()}this.redrawIfNeeded()}}},{key:"redrawIfNeeded",value:function(){if(Er(this,Nr))for(var t in Er(this,jr)){var e=Er(this,jr)[t];if(e.needRedraw()){var n,r=e.content,i=br(e.contents);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.data.style.display=o===r?"block":"none"}}catch(t){i.e(t)}finally{i.f()}}}}}])&&mr(e.prototype,n),r&&mr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(We);function Ar(t){return Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(t)}function _r(t,e){for(var n=0;n=Br(this,Fr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){throw new Error("Method EmbedBanner.getCurrentBreakpoint() is not readable.")}},{key:"isEmbed",value:function(){return!0}},{key:"updatePositionData",value:function(t){for(var e=this.positionData,n=0,r=["id","name","rotationSeconds","displayType","breakpointType","dimensions"];n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Hr(this,Yr,{writable:!0,value:void 0}),Gr(this,Yr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Gr(this,Yr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Vr(e,Yr,"get")),++t))}}])&&$r(e.prototype,n),r&&$r(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Kr(t,e){if(t instanceof e.HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var n;if(!((n="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof e.HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return n}function Jr(t){return Jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jr(t)}function Qr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ti(this,ii,{writable:!0,value:void 0}),ti(this,oi,{writable:!0,value:void 0}),ti(this,ai,{writable:!0,value:void 0}),ti(this,ui,{writable:!0,value:void 0}),ti(this,ci,{writable:!0,value:[]}),ni(this,ii,e),ni(this,oi,n),ni(this,ai,r),ni(this,ui,new qr),this.STATE=ee}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=Kr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:window)).setAttribute("data-amp-attached","");var e=new Pr(ei(this,oi),ei(this,ii),ei(this,ui).getNextIdentifier(),t);return ei(this,ci).push(e),e}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;if(null===ei(this,ai))throw new Error("Unable to add managed banner, renderer is not provided.");(t=Kr(t,i)).setAttribute("data-amp-attached","");var o=new or(ei(this,oi),ei(this,ai),ei(this,ii),ei(this,ui).getNextIdentifier(),t,e,n,r);return ei(this,ci).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n,r){t=Kr(t,window),e=Kr(e,window),t.setAttribute("data-amp-attached","");var i=new Ur(ei(this,ii),ei(this,ui).getNextIdentifier(),t,e,n,r);return ei(this,ci).push(i),i}},{key:"removeBanner",value:function(t){var e=ei(this,ci).length;return ni(this,ci,ei(this,ci).filter((function(e){return e!==t}))),e!==ei(this,ci).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,i=t.external,o=void 0===i||i,a=t.embed,u=void 0===a||a;return ei(this,ci).filter((function(t){return t instanceof We&&t.state===e&&!(t instanceof or&&!r||t instanceof Pr&&!o||t instanceof Ur&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Fe?t.value:t,r=Qr(ei(this,ci));try{for(r.s();!(e=r.n()).done;){var i=e.value;if(!(i instanceof Ur)){var o,a=Qr(i.fingerprints);try{for(a.s();!(o=a.n()).done;)if(o.value.value===n)return i}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=Qr(ei(this,ci));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&Zr(e.prototype,n),r&&Zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function si(t){return si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},si(t)}function fi(t,e){for(var n=0;nEi(this,Pi)&&n.splice(n.length-Ei(this,Pi)),Ti(this,Ai,n),Oi(this,Ri,Di).call(this))}},{key:"isClosed",value:function(t){return-1!==Oi(this,_i,Mi).call(this).indexOf(t)}}])&&di(e.prototype,n),r&&di(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Mi(){if(null!==Ei(this,Ai))return Ei(this,Ai);var t=Ei(this,ji).getItem(Ei(this,Ni)),e=null!==t&&""!==t?t.split(","):[];return Ti(this,Ai,e)}function Di(){null!==Ei(this,Ai)&&Ei(this,ji).setItem(Ei(this,Ni),Ei(this,Ai).join(","))}function Bi(){var t={items:{}};return t.setItem=function(t,e){this.items[t]=e}.bind(t),t.getItem=function(t){return t in this.items?this.items[t]:null}.bind(t),t}function Wi(t){return Wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wi(t)}function xi(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ji(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var o="idx_"+Zi(this,no).getNextIdentifier();return Zi(this,ro)[t]=Zi(this,ro)[t]||{},Zi(this,ro)[t][o]={callback:e,scope:r,priority:i},t in Zi(this,io)&&delete Zi(this,io)[t],function(){t in Zi(n,ro)&&o in Zi(n,ro)[t]&&delete Zi(n,ro)[t][o]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ao(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){o.e(t)}finally{o.f()}return r};return new IntersectionObserver((function(r){var i,a=[],u={},l={},s=Po(r);try{for(s.s();!(i=s.n()).done;){var f=i.value,p=f.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var b=n[p];if(b){var v={fingerprint:b.fingerprint,element:f.target,banner:y};if(a.push(jo(jo({},v),{},{entry:f})),!b.alreadySeen){var m=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&m?{fingerprintArgs:v,fingerprintMetadata:b,isIntersecting:m}:u[p]}if(!b.alreadyFullySeen){var h=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&h?{fingerprintArgs:v,fingerprintMetadata:b,isFullyIntersecting:h}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var d=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,i=t.isIntersecting;i&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(ie.ON_BANNER_FIRST_TIME_SEEN,n)}),o):i||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Do(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function sa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(i);var o={};return o[e.params.channel_code]=wa(a,ka),o[e.params.banner_id]=n.bannerId,o[e.params.banner_name]=n.bannerName,o[e.params.position_id]=n.positionId,o[e.params.position_code]=n.positionCode,o[e.params.position_name]=n.positionName,o[e.params.campaign_id]=n.campaignId,o[e.params.campaign_code]=n.campaignCode,o[e.params.campaign_name]=n.campaignName,o[e.params.breakpoint]=i,pa(pa({},o),e.extraParams)}}),ga(this,Ea,e),ga(this,Ta,n),ga(this,ka,r),ga(this,Oa,!1)}var e,n,r;return e=t,(n=[{key:"collectBeforeAttach",value:function(){var t=this;if(!wa(this,ja).started&&!wa(this,Oa)){wa(this,ja).started=!0;var e=wa(this,Ta),n=new ua({}),r=n.events[Zo.BANNER_LOADED],i=n.events[Zo.BANNER_DISPLAYED],o=n.events[Zo.BANNER_FULLY_DISPLAYED],a=n.events[Zo.BANNER_CLICKED],u=n.events[Zo.BANNER_CLOSED];wa(this,ja).cleanup.push(e.subscribe(ie.ON_BANNER_STATE_CHANGED,(function(e){var n=e.banner;if(!n.isEmbed()&&ee.RENDERED===n.state&&1===n.stateCounter){var i,o=la(n.fingerprints);try{for(o.s();!(i=o.n()).done;){var a=i.value;wa(t,ja).events.push({name:Zo.BANNER_LOADED,params:wa(t,Na).call(t,{event:r,fingerprint:a,banner:n})})}}catch(t){o.e(t)}finally{o.f()}}}))),wa(this,ja).cleanup.push(e.subscribe(ie.ON_BANNER_FIRST_TIME_SEEN,(function(e){var n=e.fingerprint,r=e.banner;wa(t,ja).events.push({name:Zo.BANNER_DISPLAYED,params:wa(t,Na).call(t,{event:i,fingerprint:n,banner:r})})}))),wa(this,ja).cleanup.push(e.subscribe(ie.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(e){var n=e.fingerprint,r=e.banner;wa(t,ja).events.push({name:Zo.BANNER_FULLY_DISPLAYED,params:wa(t,Na).call(t,{event:o,fingerprint:n,banner:r})})}))),wa(this,ja).cleanup.push(e.subscribe(ie.ON_BANNER_LINK_CLICKED,(function(e){var n=e.fingerprint,r=e.banner,i=e.target,o=wa(t,Na).call(t,{event:a,fingerprint:n,banner:r});o[a.params.link]=i.href||"",wa(t,ja).events.push({name:Zo.BANNER_CLICKED,params:o})}))),wa(this,ja).cleanup.push(e.subscribe(ie.ON_BANNER_AFTER_CLOSE,(function(e){var n=e.fingerprint,r=e.banner;wa(t,ja).events.push({name:Zo.BANNER_CLOSED,params:wa(t,Na).call(t,{event:u,fingerprint:n,banner:r})})})))}}},{key:"attach",value:function(t){var e=this;if(!wa(this,Oa)){ga(this,Oa,!0);var n=wa(this,Ta),r=wa(this,Ea);if(r.hasAnyReceiver()){var i=t.events[Zo.BANNER_LOADED],o=t.events[Zo.BANNER_DISPLAYED],a=t.events[Zo.BANNER_FULLY_DISPLAYED],u=t.events[Zo.BANNER_CLICKED],c=t.events[Zo.BANNER_CLOSED];if(wa(this,ja).started){for(var l in wa(this,ja).events){var s=wa(this,ja).events[l],f=s.name,p=s.params,y=t.events[f];if(y.enabled){var b={};for(var v in p)b[y.params[v]]=p[v];r.send(y.name,pa(pa({},b),y.extraParams))}}da(this,Pa,_a).call(this)}i.enabled&&n.subscribe(ie.ON_BANNER_STATE_CHANGED,(function(t){var n=t.banner;if(!n.isEmbed()&&ee.RENDERED===n.state&&1===n.stateCounter){var o,a=la(n.fingerprints);try{for(a.s();!(o=a.n()).done;){var u=o.value;r.send(i.name,wa(e,Na).call(e,{event:i,fingerprint:u,banner:n}))}}catch(t){a.e(t)}finally{a.f()}}})),o.enabled&&n.subscribe(ie.ON_BANNER_FIRST_TIME_SEEN,(function(t){var n=t.fingerprint,i=t.banner;r.send(o.name,wa(e,Na).call(e,{event:o,fingerprint:n,banner:i}))})),a.enabled&&n.subscribe(ie.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var n=t.fingerprint,i=t.banner;r.send(a.name,wa(e,Na).call(e,{event:a,fingerprint:n,banner:i}))})),u.enabled&&n.subscribe(ie.ON_BANNER_LINK_CLICKED,(function(t){var n=t.fingerprint,i=t.banner,o=t.target,a=wa(e,Na).call(e,{event:u,fingerprint:n,banner:i});a[u.params.link]=o.href||"",r.send(u.name,a)})),c.enabled&&n.subscribe(ie.ON_BANNER_AFTER_CLOSE,(function(t){var n=t.fingerprint,i=t.banner;r.send(c.name,wa(e,Na).call(e,{event:c,fingerprint:n,banner:i}))}))}else da(this,Pa,_a).call(this)}}}])&&ba(e.prototype,n),r&&ba(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _a(){for(var t in wa(this,ja).cleanup)wa(this,ja).cleanup[t]();wa(this,ja).events=[],wa(this,ja).cleanup=[]}var Ra=!1;const Ia=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!Ra&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(Ra=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Ca=!1;const Ma=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Ca&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Ca=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function Da(t){return Da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Da(t)}function Ba(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wa(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Da(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Da(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Da(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var xa=!1;const La=function(t,e){if(!("dataLayer"in window))return!xa&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(xa=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function $a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function cu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Fu(t,e){if(t){if("string"==typeof t)return Uu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uu(t,e):void 0}}function Uu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1f||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==m(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, events: object, params: object }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(m(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var v in e.metrics.receiver)if(-1===["string","function"].indexOf(m(e.metrics.receiver[v])))throw new Error('The option "metrics.receiver.'.concat(v,'" must be a string or a function, "').concat(e.metrics.receiver[v],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if("object"!==m(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==m(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==m(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==m(e.closing)||"string"!=typeof e.closing.storage||"string"!=typeof e.closing.key||!Number.isInteger(e.closing.maxItems)||1>e.closing.maxItems)throw new Error('The option "closing" must be an object of the format { storage: "memoryStorage"|"localStorage"|"sessionStorage", key: string, maxItems: integer<1, max> }, '.concat(JSON.stringify(e.closing)," passed."));return e}(n)),Vu(this,Ju,new oo),Vu(this,Qu,new Lt(n.method,n.url,n.version,n.channel)),Vu(this,Xu,new Xt(n.url,n.version,n.channel)),Vu(this,tc,new li(Gu(this,Ju),mi.fromCurrentWindow(),new To(n.template))),Vu(this,ec,new Ko(Gu(this,tc),Gu(this,Ju),n.interaction)),Vu(this,rc,Ja.createFromReceivers(n.metrics.receiver)),Vu(this,ic,new Aa(Gu(this,rc),Gu(this,Ju),n.channel)),Vu(this,oc,new Ru({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction,metrics:{events:n.metrics.events,params:n.metrics.params,extraParams:n.metrics.extraParams}}},bannerManager:Gu(this,tc),metricsSender:Gu(this,rc)})),Vu(this,nc,new Yi({bannerManager:Gu(this,tc),eventBus:Gu(this,Ju),config:{storage:n.closing.storage,key:n.closing.key,maxItems:n.closing.maxItems},frameMessenger:Gu(this,oc)})),this.setLocale(n.locale),Gu(this,Qu).origin=n.origin,n.resources)Gu(this,Qu).addDefaultResource(a,n.resources[a]),Gu(this,Xu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Lu(Gu(o,tc).getBannersByState({state:Gu(o,tc).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Gu(this,oc).listen(),Gu(this,ic).attach(new ua({events:n.metrics.events,params:n.metrics.params,extraParams:n.metrics.extraParams})),Gu(this,ec).start(),Gu(this,nc).attachUi()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Gu(this,qu)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Gu(this,Ju).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Gu(this,Qu).locale=t,Gu(this,Xu).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof g}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");Vu(this,Zu,t)}},{key:"getGateway",value:function(){return null===Gu(this,Zu)&&this.setGateway(new tt),Gu(this,Zu)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(t=Kr(t,o),"embed"===i){var a=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,ac,cc).call(this,t,e,n,r),u=Gu(this,tc).addEmbedBanner(t,a,e,r);return Gu(this,oc).connectBanner(u),t.insertAdjacentElement("beforeend",a),u}return Gu(this,tc).addManagedBanner(t,e,n,r,o)}},{key:"closeBanner",value:function(t){Gu(this,nc).closeBanner(t)}},{key:"attachBanners",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,r=Lu(e.querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.dataset.ampBanner;if(o){var a=void 0;if("ampBannerExternal"in i.dataset)a=Gu(this,tc).addExternalBanner(i,n);else{var u=pr.parseResources(i),c=pr.parseOptions(i),l=i.dataset.ampMode||"managed";a=this.createBanner(i,o,u,c,l,n)}Gu(this,Ju).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:a})}else console.warn("Unable to attach a banner to the element ",i,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){r.e(t)}finally{r.f()}}},{key:"fetch",value:function(){var t=this,e=Gu(this,tc).getBannersByState({state:Gu(this,tc).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Gu(this,Qu).create(),i=Lu(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.addPosition(o.position,o.resources,"1"!==o.options.get("omit-default-resources","0").toString())}}catch(t){i.e(t)}finally{i.f()}Gu(this,Ju).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,i=n.data,o=Lu(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.position in i&&"banners"in i[a.position]&&Object.values(i[a.position].banners).length){for(var u=i[a.position],c=Array.isArray(u.banners)?u.banners:Object.values(u.banners),l=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==fc(e.metrics))throw new Error('The option "metrics" must be an object of the format { events: object, params: object }, '.concat(JSON.stringify(e.metrics)," passed."));if("object"!==fc(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==fc(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==fc(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));return e}function bc(t){return bc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(t)}function vc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return mc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function mc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Kc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return el(this,ul).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(el(this,bl))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=el(this,cl).addExternalBanner(t);nl(this,bl,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),el(this,ul).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:e})}else console.warn("No banner found in the embed client.")}}],n&&Jc(e.prototype,n),r&&Jc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function wl(t,e){el(this,ll).sendToParent("metrics",{eventName:t,eventArgs:e})}function gl(){var t,e=qc(el(this,cl).getBannersByState({state:ee.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function Sl(t){return Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sl(t)}function El(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new uc(new f(Tl,"standard@".concat(Tl)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new dl(new f(Tl,"embed@".concat(Tl)),t)}},{key:"version",get:function(){return Tl}}],(n=null)&&El(e.prototype,n),r&&El(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();AMPClientFactory=e.default})(); \ No newline at end of file +var AMPClientFactory;(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:()=>_l});var n={};t.r(n),t.d(n,{exclude:()=>V,extract:()=>F,parse:()=>U,parseUrl:()=>$,pick:()=>G,stringify:()=>z,stringifyUrl:()=>H});const r=JSON.parse('{"i8":"1.7.0-beta.7"}');function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>width="<%- data.content.dimensions.width %>"<% } %>\n <% if(null !== data.content.dimensions.height) { %>height="<%- data.content.dimensions.height %>"<% } %>\n <% if(\'\' !== data.content.title) { %>title="<%- data.content.title %>"<% } %>\n <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,I=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),C=Symbol("encodeFragmentIdentifier");function M(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function D(t,e){return e.encode?e.strict?I(t):encodeURIComponent(t):t}function B(t,e){return e.decode?N(t):t}function W(t){return Array.isArray(t)?t.sort():"object"==typeof t?W(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function x(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function L(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function F(t){const e=(t=x(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function U(t,e){M((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const i="string"==typeof n&&n.includes(t.arrayFormatSeparator),o="string"==typeof n&&!i&&B(n,t).includes(t.arrayFormatSeparator);n=o?B(n,t):n;const a=i||o?n.split(t.arrayFormatSeparator).map((e=>B(e,t))):null===n?n:B(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const i=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!i)return void(r[e]=n?B(n,t):n);const o=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>B(e,t)));void 0!==r[e]?r[e]=[...r[e],...o]:r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const i of t.split("&")){if(""===i)continue;const t=e.decode?i.replace(/\+/g," "):i;let[o,a]=P(t,"=");void 0===o&&(o=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:B(a,e),n(B(o,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=L(r,e);else r[t]=L(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=W(n):t[e]=n,t}),Object.create(null))}function z(t,e){if(!t)return"";M((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&R(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),"[",i,"]"].join("")]:[...n,[D(e,t),"[",D(i,t),"]=",D(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),"[]"].join("")]:[...n,[D(e,t),"[]=",D(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),":list="].join("")]:[...n,[D(e,t),":list=",D(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[D(n,t),e,D(i,t)].join("")]:[[r,D(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,D(e,t)]:[...n,[D(e,t),"=",D(r,t)].join("")]}}(e),i={};for(const[e,r]of Object.entries(t))n(e)||(i[e]=r);const o=Object.keys(i);return!1!==e.sort&&o.sort(e.sort),o.map((n=>{const i=t[n];return void 0===i?"":null===i?D(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?D(n,e)+"[]":i.reduce(r(n),[]).join("&"):D(n,e)+"="+D(i,e)})).filter((t=>t.length>0)).join("&")}function $(t,e){e={decode:!0,...e};let[n,r]=P(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:U(F(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:B(r,e)}:{}}}function H(t,e){e={encode:!0,strict:!0,[C]:!0,...e};const n=x(t.url).split("?")[0]||"";let r=z({...U(F(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let i=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,i=e[C]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${i}`}function G(t,e,n){n={parseFragmentIdentifier:!0,[C]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=$(t,n);return H({url:r,query:A(i,e),fragmentIdentifier:o},n)}function V(t,e,n){return G(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const Y=n;function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function K(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return J(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var i=t.endpoint;"GET"===t.method&&(i+="?".concat(Y.stringify(t.parameters))),r.open(t.method,i,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var o,a=K(t.headers);try{for(a.s();!(o=a.n()).done;){var u=o.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&Q(e.prototype,n),r&&Q(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(S);function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function rt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ht(this,St,{writable:!0,value:void 0}),ht(this,Et,{writable:!0,value:void 0}),ht(this,Tt,{writable:!0,value:void 0}),ht(this,Ot,{writable:!0,value:void 0}),ht(this,kt,{writable:!0,value:void 0}),ht(this,jt,{writable:!0,value:void 0}),ht(this,Nt,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r].value.filter((function(t){return""!==t}));i.length&&(e[n][r]=i)}return e}}),wt(this,St,e),wt(this,Et,n),wt(this,Tt,r),wt(this,Ot,{}),wt(this,kt,i),wt(this,jt,o)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=dt(this,Ot);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,dt(this,kt)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof yt))throw new TypeError("Argument resource must be instance of Resource class.");var n=dt(this,Ot);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return dt(this,St)}},{key:"endpoint",get:function(){return dt(this,Et)}},{key:"locale",get:function(){return dt(this,Tt)}},{key:"parameters",get:function(){var t=dt(this,Nt).call(this,dt(this,Ot)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return dt(this,jt)}}],n&&mt(e.prototype,n),r&&mt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function _t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var i in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e]+)>/g,(function(t,e){var n=o[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof i){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=le(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),i.apply(this,t)}))}return t[Symbol.replace].call(this,n,i)},se.apply(this,arguments)}function fe(t,e){return fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fe(t,e)}var pe=se(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),ye={};function be(t,e){var n=function(t){if(t in ye)return ye[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==i.groups.EQ:o={eq:parseInt(i.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==i.groups.LT:o={lt:parseInt(i.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==i.groups.GTE:o={gte:parseInt(i.groups.GTE),matches:function(t){return t>=this.gte}};break;default:o={matches:function(){return!0}}}o&&(o.matches=o.matches.bind(o),o.value=i.groups.VALUE,n.push(o))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:be(this.options[t],e)}},{key:"override",value:function(t){this.options=he(he({},this.options),Ee(this,Te,ke).call(this,he({},t)))}}],n&&we(e.prototype,n),r&&we(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ke(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,i='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(i+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(i),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function je(t){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(t)}function Ne(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));_e(this,De,t),_e(this,Be,e.toString()),Ae(this,We)[t]=(Ae(this,We)[t]||0)+1,this._eventBus.dispatch(oe.ON_BANNER_STATE_CHANGED,{banner:this})}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.startsWith("amp:banner:"))throw new Error('Unable to attach listener on event "'.concat(t,'" through a banner.'));return this._eventBus.subscribe(t,(function(t){t.banner===this&&(null!==n?e.call(n,t):e(t))}),this)}},{key:"getCurrentBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){Ae(this,Me).override(t)}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&Ne(e.prototype,n),r&&Ne(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function Fe(t,e){for(var n=0;n=c&&(null===o||oc))&&(i=u,o=c,en(t,ln)[n]=c)):r=u})),null===i&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(o);return"max"===n&&u-1 in a&&(en(this,ln).min=a[u-1]),"min"===n&&u+1 in a&&(en(this,ln).max=a[u+1]),nn(this,cn,null!==i?i:r)}},{key:"needRedraw",value:function(){if(null===en(this,cn))return!0;var t=en(this,on).width;return null!==en(this,ln).min&&ten(this,ln).max}}])&&Xe(e.prototype,n),r&&Xe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pn(t,e){for(var n in t)e(t[n],n)}function yn(t){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(t)}function bn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,i=0;i0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&Mn(e.prototype,n),r&&Mn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Bn(t){return Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bn(t)}function Wn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return xn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var f in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),Hn(zn(c=i.call(this,n,r,a,u,s)),or),Hn(zn(c),ir),Gn(zn(c),Qn,{writable:!0,value:void 0}),Gn(zn(c),Xn,{writable:!0,value:void 0}),Gn(zn(c),Zn,{writable:!0,value:[]}),Gn(zn(c),tr,{writable:!0,value:void 0}),Gn(zn(c),er,{writable:!0,value:!1}),Gn(zn(c),nr,{writable:!0,value:null}),Gn(zn(c),rr,{writable:!0,value:[]}),Kn(zn(c),Qn,t),Kn(zn(c),Xn,e),Kn(zn(c),tr,l),l)qn(zn(c),Zn).push(new yt(f,l[f]));return c.setState(c.STATE.NEW,"Banner created."),c}return e=o,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return qn(this,Zn)}},{key:"rawResources",get:function(){return qn(this,tr)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new In(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return null===t?[]:(this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint})))}},{key:"bannerData",get:function(){if(null!==qn(this,nr))return qn(this,nr);if(!qn(this,rr).length)return null;var t=null,e=this.positionData,n=function(t){return Ue.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=qn(this,rr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Dn.randomByWeights(qn(this,rr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,i=Wn(t=qn(this,rr).sort((function(t,e){return e.score-t.score})));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.fingerprint=n(o)}}catch(t){i.e(t)}finally{i.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}return Kn(this,nr,t),t}},{key:"unsetFingerprint",value:function(t){var e=t.bannerId,n=this.positionData;if(qn(this,rr).filter((function(t){return t.id===e}))[0]){switch(!0){case n.isSingle():Kn(this,rr,[]),Kn(this,nr,null);break;case n.isRandom():qn(this,nr)&&qn(this,nr).id===e?(Kn(this,rr,[]),Kn(this,nr,null)):Kn(this,rr,qn(this,rr).filter((function(t){return t.id!==e})));break;case n.isMultiple():Kn(this,rr,qn(this,rr).filter((function(t){return t.id!==e}))),qn(this,nr)&&Kn(this,nr,qn(this,nr).filter((function(t){return t.id!==e})))}0>=qn(this,rr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):n.isRandom()&&this.redrawIfNeeded()}}},{key:"setResponseData",value:function(t){if(qn(this,er))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ce({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new On(t.banners[n],t.breakpoint_type,qn(this,Qn)));Kn(this,rr,e),Kn(this,er,!0),0>=qn(this,rr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):Yn(this,ir,ur).call(this,"Banner was successfully rendered.")}},{key:"getCurrentBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:e?[e]:[]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){Yn(this,or,cr).call(this)&&Yn(this,ir,ur).call(this,"Banner was successfully redrawn.")}}])&&Ln(e.prototype,n),r&&Ln(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(xe);function ur(t){try{this.html=qn(this,Xn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function cr(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function lr(t){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(t)}function sr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return fr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=Tr(this,jr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){var e=Tr(this,Nr)[t]||null;if(null===e)return null;if(Tr(this,Pr))return e.content?e.content.breakpoint:null;var n,r=vr(e.contents);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("none"!==getComputedStyle(i.data).display)return i.breakpoint}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"isExternal",value:function(){return!0}},{key:"delegateResponsiveBehaviour",value:function(){if(!Tr(this,Pr)){Or(this,Pr,!0);var t,e=vr(this.element.querySelectorAll("style"));try{for(e.s();!(t=e.n()).done;)t.value.remove()}catch(t){e.e(t)}finally{e.f()}this.redrawIfNeeded()}}},{key:"redrawIfNeeded",value:function(){if(Tr(this,Pr))for(var t in Tr(this,Nr)){var e=Tr(this,Nr)[t];if(e.needRedraw()){var n,r=e.content,i=vr(e.contents);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.data.style.display=o===r?"block":"none"}}catch(t){i.e(t)}finally{i.f()}}}}}])&&hr(e.prototype,n),r&&hr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(xe);function _r(t){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(t)}function Rr(t,e){for(var n=0;n=Wr(this,Ur).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){throw new Error("Method EmbedBanner.getCurrentBreakpoint() is not readable.")}},{key:"isEmbed",value:function(){return!0}},{key:"updatePositionData",value:function(t){for(var e=this.positionData,n=0,r=["id","name","rotationSeconds","displayType","breakpointType","dimensions"];n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Gr(this,qr,{writable:!0,value:void 0}),Vr(this,qr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Vr(this,qr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Yr(e,qr,"get")),++t))}}])&&Hr(e.prototype,n),r&&Hr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Jr(t,e){if(t instanceof e.HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var n;if(!((n="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof e.HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return n}function Qr(t){return Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qr(t)}function Xr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Zr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Zr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ni(r=this,i=yi),i.add(r),ei(this,ui,{writable:!0,value:void 0}),ei(this,ci,{writable:!0,value:void 0}),ei(this,li,{writable:!0,value:void 0}),ei(this,si,{writable:!0,value:void 0}),ei(this,fi,{writable:!0,value:[]}),ei(this,pi,{writable:!0,value:void 0}),oi(this,ui,e),oi(this,ci,n),oi(this,li,a),oi(this,si,new Kr),oi(this,pi,new MutationObserver((function(t){var e,n=Xr(t);try{for(n.s();!(e=n.n()).done;){var r,i=e.value;if(i.target instanceof HTMLElement){var a=null===(r=i.target.closest("[data-amp-attached]"))||void 0===r||null===(r=r.dataset)||void 0===r?void 0:r.ampAttached,u=void 0!==a?o.getBannerByUid(parseInt(a)):null;u&&ii(o,ui).dispatch(oe.ON_BANNER_MUTATED,{banner:u,mutation:i})}}}catch(t){n.e(t)}finally{n.f()}}))),this.STATE=ne}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){t=Jr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:window);var e=ii(this,si).getNextIdentifier();t.setAttribute("data-amp-attached",e);var n=new Ar(ii(this,ci),ii(this,ui),e,t);return ri(this,yi,vi).call(this,t),ii(this,fi).push(n),n}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;if(null===ii(this,li))throw new Error("Unable to add managed banner, renderer is not provided.");t=Jr(t,i);var o=ii(this,si).getNextIdentifier();t.setAttribute("data-amp-attached",o);var a=new ar(ii(this,ci),ii(this,li),ii(this,ui),o,t,e,n,r);return ri(this,yi,vi).call(this,t),ii(this,fi).push(a),a}},{key:"addEmbedBanner",value:function(t,e,n,r){t=Jr(t,window),e=Jr(e,window);var i=ii(this,si).getNextIdentifier();t.setAttribute("data-amp-attached",i);var o=new zr(ii(this,ui),i,t,e,n,r);return ri(this,yi,vi).call(this,t),ii(this,fi).push(o),o}},{key:"removeBanner",value:function(t){var e=ii(this,fi).length;return oi(this,fi,ii(this,fi).filter((function(e){return e!==t}))),e!==ii(this,fi).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,i=t.external,o=void 0===i||i,a=t.embed,u=void 0===a||a;return ii(this,fi).filter((function(t){return t instanceof xe&&t.state===e&&!(t instanceof ar&&!r||t instanceof Ar&&!o||t instanceof zr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Ue?t.value:t,r=Xr(ii(this,fi));try{for(r.s();!(e=r.n()).done;){var i=e.value;if(!(i instanceof zr)){var o,a=Xr(i.fingerprints);try{for(a.s();!(o=a.n()).done;)if(o.value.value===n)return i}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=Xr(ii(this,fi));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&ti(e.prototype,n),r&&ti(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vi(t){t._ampBannerMutationsObserved||(ii(this,pi).observe(t,{subtree:!0,childList:!0,characterData:!1,attributes:!0,attributeFilter:["data-amp-banner-close"]}),t._ampBannerMutationsObserved=!0)}function mi(t){return mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mi(t)}function hi(t,e){for(var n=0;nPi(this,Mi)&&n.splice(n.length-Pi(this,Mi)),Ai(this,Di,n),Ri(this,Wi,Ui).call(this))}},{key:"isClosed",value:function(t){return-1!==Ri(this,Bi,Fi).call(this).indexOf(t)}}])&&Oi(e.prototype,n),r&&Oi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Fi(){if(null!==Pi(this,Di))return Pi(this,Di);var t=Pi(this,Ii).getItem(Pi(this,Ci)),e=null!==t&&""!==t?t.split(","):[];return Ai(this,Di,e)}function Ui(){null!==Pi(this,Di)&&Pi(this,Ii).setItem(Pi(this,Ci),Pi(this,Di).join(","))}function zi(){var t={items:{}};return t.setItem=function(t,e){this.items[t]=e}.bind(t),t.getItem=function(t){return t in this.items?this.items[t]:null}.bind(t),t}function $i(t){return $i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(t)}function Hi(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function no(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var o="idx_"+oo(this,co).getNextIdentifier();return oo(this,lo)[t]=oo(this,lo)[t]||{},oo(this,lo)[t][o]={callback:e,scope:r,priority:i},t in oo(this,so)&&delete oo(this,so)[t],function(){t in oo(n,lo)&&o in oo(n,lo)[t]&&delete oo(n,lo)[t][o]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Do(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){o.e(t)}finally{o.f()}return r};return new IntersectionObserver((function(r){var i,a=[],u={},l={},s=Mo(r);try{for(s.s();!(i=s.n()).done;){var f=i.value,p=f.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var b=n[p];if(b){var v={fingerprint:b.fingerprint,element:f.target,banner:y};if(a.push(Io(Io({},v),{},{entry:f})),!b.alreadySeen){var m=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&m?{fingerprintArgs:v,fingerprintMetadata:b,isIntersecting:m}:u[p]}if(!b.alreadyFullySeen){var h=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&h?{fingerprintArgs:v,fingerprintMetadata:b,isFullyIntersecting:h}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var d=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,i=t.isIntersecting;i&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(oe.ON_BANNER_FIRST_TIME_SEEN,n)}),o):i||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Uo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function ma(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(i);var o={};return o[e.params.channel_code]=ka(a,_a),o[e.params.banner_id]=n.bannerId,o[e.params.banner_name]=n.bannerName,o[e.params.position_id]=n.positionId,o[e.params.position_code]=n.positionCode,o[e.params.position_name]=n.positionName,o[e.params.campaign_id]=n.campaignId,o[e.params.campaign_code]=n.campaignCode,o[e.params.campaign_name]=n.campaignName,o[e.params.breakpoint]=i,da(da({},o),e.extraParams)}}),ja(this,Pa,e),ja(this,Aa,n),ja(this,_a,r),ja(this,Ra,!1)}var e,n,r;return e=t,(n=[{key:"collectBeforeAttach",value:function(){var t=this;if(!ka(this,Ia).started&&!ka(this,Ra)){ka(this,Ia).started=!0;var e=ka(this,Aa),n=new ya({}),r=n.events[oa.BANNER_LOADED],i=n.events[oa.BANNER_DISPLAYED],o=n.events[oa.BANNER_FULLY_DISPLAYED],a=n.events[oa.BANNER_CLICKED],u=n.events[oa.BANNER_CLOSED];ka(this,Ia).cleanup.push(e.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(e){var n=e.banner;if(!n.isEmbed()&&ne.RENDERED===n.state&&1===n.stateCounter){var i,o=va(n.fingerprints);try{for(o.s();!(i=o.n()).done;){var a=i.value;ka(t,Ia).events.push({name:oa.BANNER_LOADED,params:ka(t,Ca).call(t,{event:r,fingerprint:a,banner:n})})}}catch(t){o.e(t)}finally{o.f()}}}))),ka(this,Ia).cleanup.push(e.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(e){var n=e.fingerprint,r=e.banner;ka(t,Ia).events.push({name:oa.BANNER_DISPLAYED,params:ka(t,Ca).call(t,{event:i,fingerprint:n,banner:r})})}))),ka(this,Ia).cleanup.push(e.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(e){var n=e.fingerprint,r=e.banner;ka(t,Ia).events.push({name:oa.BANNER_FULLY_DISPLAYED,params:ka(t,Ca).call(t,{event:o,fingerprint:n,banner:r})})}))),ka(this,Ia).cleanup.push(e.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(e){var n=e.fingerprint,r=e.banner,i=e.target,o=ka(t,Ca).call(t,{event:a,fingerprint:n,banner:r});o[a.params.link]=i.href||"",ka(t,Ia).events.push({name:oa.BANNER_CLICKED,params:o})}))),ka(this,Ia).cleanup.push(e.subscribe(oe.ON_BANNER_AFTER_CLOSE,(function(e){var n=e.fingerprint,r=e.banner;ka(t,Ia).events.push({name:oa.BANNER_CLOSED,params:ka(t,Ca).call(t,{event:u,fingerprint:n,banner:r})})})))}}},{key:"attach",value:function(t){var e=this;if(!ka(this,Ra)){ja(this,Ra,!0);var n=ka(this,Aa),r=ka(this,Pa);if(r.hasAnyReceiver()){var i=t.events[oa.BANNER_LOADED],o=t.events[oa.BANNER_DISPLAYED],a=t.events[oa.BANNER_FULLY_DISPLAYED],u=t.events[oa.BANNER_CLICKED],c=t.events[oa.BANNER_CLOSED];if(ka(this,Ia).started){for(var l in ka(this,Ia).events){var s=ka(this,Ia).events[l],f=s.name,p=s.params,y=t.events[f];if(y.enabled){var b={};for(var v in p)b[y.params[v]]=p[v];r.send(y.name,da(da({},b),y.extraParams))}}Oa(this,Ma,Ba).call(this)}i.enabled&&n.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(t){var n=t.banner;if(!n.isEmbed()&&ne.RENDERED===n.state&&1===n.stateCounter){var o,a=va(n.fingerprints);try{for(a.s();!(o=a.n()).done;){var u=o.value;r.send(i.name,ka(e,Ca).call(e,{event:i,fingerprint:u,banner:n}))}}catch(t){a.e(t)}finally{a.f()}}})),o.enabled&&n.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(t){var n=t.fingerprint,i=t.banner;r.send(o.name,ka(e,Ca).call(e,{event:o,fingerprint:n,banner:i}))})),a.enabled&&n.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var n=t.fingerprint,i=t.banner;r.send(a.name,ka(e,Ca).call(e,{event:a,fingerprint:n,banner:i}))})),u.enabled&&n.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(t){var n=t.fingerprint,i=t.banner,o=t.target,a=ka(e,Ca).call(e,{event:u,fingerprint:n,banner:i});a[u.params.link]=o.href||"",r.send(u.name,a)})),c.enabled&&n.subscribe(oe.ON_BANNER_AFTER_CLOSE,(function(t){var n=t.fingerprint,i=t.banner;r.send(c.name,ka(e,Ca).call(e,{event:c,fingerprint:n,banner:i}))}))}else Oa(this,Ma,Ba).call(this)}}}])&&ga(e.prototype,n),r&&ga(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ba(){for(var t in ka(this,Ia).cleanup)ka(this,Ia).cleanup[t]();ka(this,Ia).events=[],ka(this,Ia).cleanup=[]}var Wa=!1;const xa=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!Wa&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(Wa=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var La=!1;const Fa=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!La&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(La=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function Ua(t){return Ua="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ua(t)}function za(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $a(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Ua(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Ua(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ua(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ha=!1;const Ga=function(t,e){if(!("dataLayer"in window))return!Ha&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Ha=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ka(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function bu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Vu(t,e){if(t){if("string"==typeof t)return Yu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yu(t,e):void 0}}function Yu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1f||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==h(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, events: object, params: object }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(h(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var p in e.metrics.receiver)if(-1===["string","function"].indexOf(h(e.metrics.receiver[p])))throw new Error('The option "metrics.receiver.'.concat(p,'" must be a string or a function, "').concat(e.metrics.receiver[p],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if("object"!==h(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==h(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==h(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==h(e.closing)||"string"!=typeof e.closing.storage||"string"!=typeof e.closing.key||!Number.isInteger(e.closing.maxItems)||1>e.closing.maxItems)throw new Error('The option "closing" must be an object of the format { storage: "memoryStorage"|"localStorage"|"sessionStorage", key: string, maxItems: integer<1, max> }, '.concat(JSON.stringify(e.closing)," passed."));return e}(n)),Xu(this,nc,new fo),Xu(this,rc,new Ft(n.method,n.url,n.version,n.channel)),Xu(this,ic,new Zt(n.url,n.version,n.channel)),Xu(this,ac,new bi(Qu(this,nc),Ei.fromCurrentWindow(),new Ao(n.template))),Xu(this,uc,new ea(Qu(this,ac),Qu(this,nc),n.interaction)),Xu(this,lc,nu.createFromReceivers(n.metrics.receiver)),Xu(this,sc,new Da(Qu(this,lc),Qu(this,nc),n.channel)),Xu(this,fc,new Wu({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction,metrics:{events:n.metrics.events,params:n.metrics.params,extraParams:n.metrics.extraParams}}},bannerManager:Qu(this,ac),metricsSender:Qu(this,lc)})),Xu(this,cc,new Zi({bannerManager:Qu(this,ac),eventBus:Qu(this,nc),config:{storage:n.closing.storage,key:n.closing.key,maxItems:n.closing.maxItems},frameMessenger:Qu(this,fc)})),this.setLocale(n.locale),Qu(this,rc).origin=n.origin,n.resources)Qu(this,rc).addDefaultResource(a,n.resources[a]),Qu(this,ic).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Gu(Qu(o,ac).getBannersByState({state:Qu(o,ac).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Qu(this,fc).listen(),Qu(this,sc).attach(new ya({events:n.metrics.events,params:n.metrics.params,extraParams:n.metrics.extraParams})),Qu(this,uc).start(),Qu(this,cc).attachUi()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Qu(this,tc)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Qu(this,nc).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Qu(this,rc).locale=t,Qu(this,ic).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof S}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");Xu(this,oc,t)}},{key:"getGateway",value:function(){return null===Qu(this,oc)&&this.setGateway(new et),Qu(this,oc)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(t=Jr(t,o),"embed"===i){var a=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,pc,bc).call(this,t,e,n,r),u=Qu(this,ac).addEmbedBanner(t,a,e,r);return Qu(this,fc).connectBanner(u),t.insertAdjacentElement("beforeend",a),u}return Qu(this,ac).addManagedBanner(t,e,n,r,o)}},{key:"closeBanner",value:function(t){Qu(this,cc).closeBanner(t)}},{key:"attachBanners",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,r=Gu(e.querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.dataset.ampBanner;if(o){var a=void 0;if("ampBannerExternal"in i.dataset)a=Qu(this,ac).addExternalBanner(i,n);else{var u=yr.parseResources(i),c=yr.parseOptions(i),l=i.dataset.ampMode||"managed";a=this.createBanner(i,o,u,c,l,n)}Qu(this,nc).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:a})}else console.warn("Unable to attach a banner to the element ",i,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){r.e(t)}finally{r.f()}}},{key:"fetch",value:function(){var t=this,e=Qu(this,ac).getBannersByState({state:Qu(this,ac).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Qu(this,rc).create(),i=Gu(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.addPosition(o.position,o.resources,"1"!==o.options.get("omit-default-resources","0").toString())}}catch(t){i.e(t)}finally{i.f()}Qu(this,nc).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,i=n.data,o=Gu(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.position in i&&"banners"in i[a.position]&&Object.values(i[a.position].banners).length){for(var u=i[a.position],c=Array.isArray(u.banners)?u.banners:Object.values(u.banners),l=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==hc(e.metrics))throw new Error('The option "metrics" must be an object of the format { events: object, params: object }, '.concat(JSON.stringify(e.metrics)," passed."));if("object"!==hc(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==hc(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==hc(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));return e}function gc(t){return gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(t)}function Sc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ec(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ec(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ec(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function el(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return ul(this,yl).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(ul(this,gl))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=ul(this,bl).addExternalBanner(t);cl(this,gl,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),ul(this,yl).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:e})}else console.warn("No banner found in the embed client.")}}],n&&nl(e.prototype,n),r&&nl(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function kl(t,e){ul(this,vl).sendToParent("metrics",{eventName:t,eventArgs:e})}function jl(){var t,e=tl(ul(this,bl).getBannersByState({state:ne.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function Nl(t){return Nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nl(t)}function Pl(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new yc(new p(Al,"standard@".concat(Al)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Ol(new p(Al,"embed@".concat(Al)),t)}},{key:"version",get:function(){return Al}}],(n=null)&&Pl(e.prototype,n),r&&Pl(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();AMPClientFactory=e.default})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 93efdfb..4689ae7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@68publishers/amp-client", - "version": "1.7.0-beta.6", + "version": "1.7.0-beta.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@68publishers/amp-client", - "version": "1.7.0-beta.6", + "version": "1.7.0-beta.7", "license": "ISC", "dependencies": { "lodash": "^4.17.21", diff --git a/package.json b/package.json index 826ed26..ed52950 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@68publishers/amp-client", - "version": "1.7.0-beta.6", + "version": "1.7.0-beta.7", "description": "JS Client for 68publishers/amp", "homepage": "http://www.68publishers.io/", "main": "index.mjs",