From 5e0768e929aec1c7bb38ebb701e9796acd6243fd Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 00:23:43 +0000 Subject: [PATCH] chore: release v1.6.1 --- CHANGELOG.md | 4 +++- dist/amp-client.min.js | 2 +- dist/amp-client.standalone.min.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ca463f..461ab0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.6.1] - 2024-10-11 ### Added - Added support for banners closing. - HTML banners can be simply closed via any element with a data attribute `data-amp-banner-close=""`. @@ -126,7 +127,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Added missing getter `Banner.resources`. -[Unreleased]: https://github.com/68publishers/amp-client-js/compare/v1.6.0...HEAD +[Unreleased]: https://github.com/68publishers/amp-client-js/compare/v1.6.1...HEAD +[1.6.1]: https://github.com/68publishers/amp-client-js/compare/v1.6.0...v1.6.1 [1.6.0]: https://github.com/68publishers/amp-client-js/compare/v1.5.0...v1.6.0 [1.5.0]: https://github.com/68publishers/amp-client-js/compare/v1.4.0...v1.5.0 [1.4.0]: https://github.com/68publishers/amp-client-js/compare/v1.3.1...v1.4.0 diff --git a/dist/amp-client.min.js b/dist/amp-client.min.js index 484b8a1..3bd1c2b 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),d=n(6390),h=n(9881);t.exports=function(t,e,n,m,w,g,S){var E=d(t,n),T=d(e,n),j=S.get(T);if(j)r(t,n,j);else{var k=g?g(E,T,n+"",t,e,S):void 0,O=void 0===k;if(O){var P=l(T),_=!P&&f(T),N=!P&&!_&&b(T);k=T,P||_||N?l(E)?k=E:s(E)?k=a(E):_?(O=!1,k=o(T,!0)):N?(O=!1,k=i(T,!0)):k=[]:v(T)||c(T)?(k=E,c(E)?k=h(E):y(E)&&!p(E)||(k=u(T))):O=!1}O&&(S.set(T,k),w(k,T,m,g,S),S.delete(T)),r(t,n,k)}}},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,d=/(__e\(.*?\)|\b__t\)) \+\n'';/g,h=/[()=,{}\[\]\/\s]/,m=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/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 T,j,k=r({},e.imports,E.imports,a),O=s(k),P=i(k,O),_=0,N=e.interpolate||w,A="__p += '",R=RegExp((e.escape||w).source+"|"+N.source+"|"+(N===f?m: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(_,a).replace(g,u),n&&(T=!0,A+="' +\n__e("+n+") +\n'"),i&&(j=!0,A+="';\n"+i+";\n__p += '"),r&&(A+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),_=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=(j?A.replace(v,""):A).replace(b,"$1").replace(d,"$1;"),A="function("+(C||"obj")+") {\n"+(C?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(T?", __e = _.escape":"")+(j?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+A+"return __p\n}";var M=o((function(){return Function(O,I+"return "+A).apply(void 0,P)}));if(M.source=A,c(M))throw M;return M}},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:()=>fl});var t={};n.r(t),n.d(t,{exclude:()=>V,extract:()=>F,parse:()=>L,parseUrl:()=>z,pick:()=>H,stringify:()=>U,stringifyUrl:()=>$});const e=JSON.parse('{"i8":"1.6.0-beta.7"}');function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}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="<%- banner.positionData.dimensions.width %>"<% } %>\n <% if(null !== banner.positionData.dimensions.height) { %>height="<%- banner.positionData.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,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 d(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 d(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 d(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 x(t,e){return e.decode?P(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 W(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 F(t){const e=(t=W(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function L(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 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]=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 o=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[M(e,t),"[",o,"]"].join("")]:[...n,[M(e,t),"[",M(o,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,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[M(n,t),e,M(o,t)].join("")]:[[r,M(o,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),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?M(n,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?M(n,e)+"[]":o.reduce(r(n),[]).join("&"):M(n,e)+"="+M(o,e)})).filter((t=>t.length>0)).join("&")}function z(t,e){e={decode:!0,...e};let[n,r]=_(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:L(F(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:x(r,e)}:{}}}function $(t,e){e={encode:!0,strict:!0,[I]:!0,...e};const n=W(t.url).split("?")[0]||"";let r=U({...L(F(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[I]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${o}`}function H(t,e,n){n={parseFragmentIdentifier:!0,[I]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=z(t,n);return $({url:r,query:N(o,e),fragmentIdentifier:i},n)}function V(t,e,n){return H(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const G=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,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 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 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)}}])&&J(e.prototype,n),r&&J(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(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,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),dt(this,gt,{writable:!0,value:void 0}),dt(this,St,{writable:!0,value:void 0}),dt(this,Et,{writable:!0,value:void 0}),dt(this,Tt,{writable:!0,value:void 0}),dt(this,jt,{writable:!0,value:void 0}),dt(this,kt,{writable:!0,value:void 0}),dt(this,Ot,{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}}),mt(this,gt,e),mt(this,St,n),mt(this,Et,r),mt(this,Tt,{}),mt(this,jt,o),mt(this,kt,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=ht(this,Tt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,ht(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 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,Ot).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,kt)}}],n&&bt(e.prototype,n),r&&bt(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 Nt(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"!=ce(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),o.apply(this,t)}))}return t[Symbol.replace].call(this,n,o)},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!==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:ye(this.options[t],e)}},{key:"override",value:function(t){this.options=de(de({},this.options),Se(this,Ee,je).call(this,de({},t)))}}],n&&me(e.prototype,n),r&&me(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 ke(t){return ke="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},ke(t)}function Oe(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."));Ne(this,Me,t),Ne(this,xe,e.toString()),_e(this,De)[t]=(_e(this,De)[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){_e(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&&Oe(e.prototype,n),r&&Oe(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 Fe(t,e){for(var n=0;n=c&&(null===i||ic))&&(o=u,i=c,tn(t,cn)[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&&(tn(this,cn).min=a[u-1]),"min"===n&&u+1 in a&&(tn(this,cn).max=a[u+1]),en(this,un,null!==o?o: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,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 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,o=0;o0;)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 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 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 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,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 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,i),$n(Un(c=o.call(this,n,r,a,u,s)),or),$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=i,(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 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=qn(this,nr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Mn.randomByWeights(qn(this,nr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=Dn(t=qn(this,nr).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,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,dimensions:t.dimensions||{width:null,height:null}}),"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,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."):Gn(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(){Gn(this,or,ur).call(this)&&Gn(this,rr,ar).call(this,"Banner was successfully redrawn.")}}])&&Bn(e.prototype,n),r&&Bn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(We);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,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 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: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 br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=Er(this,kr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){var e=Er(this,Or)[t]||null;if(null===e)return null;if(Er(this,Pr))return e.content?e.content.breakpoint:null;var n,r=vr(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(!Er(this,Pr)){Tr(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(Er(this,Pr))for(var t in Er(this,Or)){var e=Er(this,Or)[t];if(e.needRedraw()){var n,r=e.content,o=vr(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()}}}}}])&&dr(e.prototype,n),r&&dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(We);function Nr(t){return Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nr(t)}function Ar(t,e){for(var n=0;n=Dr(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),Hr(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,Gr(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,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 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),to(this,oo,{writable:!0,value:void 0}),to(this,io,{writable:!0,value:void 0}),to(this,ao,{writable:!0,value:void 0}),to(this,uo,{writable:!0,value:void 0}),to(this,co,{writable:!0,value:[]}),no(this,oo,e),no(this,io,n),no(this,ao,r),no(this,uo,new Yr),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 _r(eo(this,io),eo(this,oo),eo(this,uo).getNextIdentifier(),t);return eo(this,co).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===eo(this,ao))throw new Error("Unable to add managed banner, renderer is not provided.");(t=Kr(t,o)).setAttribute("data-amp-attached","");var i=new ir(eo(this,io),eo(this,ao),eo(this,oo),eo(this,uo).getNextIdentifier(),t,e,n,r);return eo(this,co).push(i),i}},{key:"addEmbedBanner",value:function(t,e,n,r){t=Kr(t,window),e=Kr(e,window),t.setAttribute("data-amp-attached","");var o=new Ur(eo(this,oo),eo(this,uo).getNextIdentifier(),t,e,n,r);return eo(this,co).push(o),o}},{key:"removeBanner",value:function(t){var e=eo(this,co).length;return no(this,co,eo(this,co).filter((function(e){return e!==t}))),e!==eo(this,co).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 eo(this,co).filter((function(t){return t instanceof We&&t.state===e&&!(t instanceof ir&&!r||t instanceof _r&&!i||t instanceof Ur&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Le?t.value:t,r=Qr(eo(this,co));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof Ur)){var i,a=Qr(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=Qr(eo(this,co));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 so(t){return so="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},so(t)}function fo(t,e){for(var n=0;nTo(this,No)&&n.splice(n.length-To(this,No)),jo(this,Ao,n),Oo(this,Io,Do).call(this))}},{key:"isClosed",value:function(t){return-1!==Oo(this,Ro,xo).call(this).indexOf(t)}}])&&wo(e.prototype,n),r&&wo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xo(){if(null!==To(this,Ao))return To(this,Ao);var t=To(this,Po).getItem(To(this,_o)),e=null!==t&&""!==t?t.split(","):[];return jo(this,Ao,e)}function Do(){null!==To(this,Ao)&&To(this,Po).setItem(To(this,_o),To(this,Ao).join(","))}function Wo(){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 Fo(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 Qo(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_"+ti(this,ri).getNextIdentifier();return ti(this,oi)[t]=ti(this,oi)[t]||{},ti(this,oi)[t][i]={callback:e,scope:r,priority:o},t in ti(this,ii)&&delete ti(this,ii)[t],function(){t in ti(n,oi)&&i in ti(n,oi)[t]&&delete ti(n,oi)[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 Ni(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(Oi(Oi({},b),{},{entry:f})),!v.alreadySeen){var d=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&d?{fingerprintArgs:b,fingerprintMetadata:v,isIntersecting:d}: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 m=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(oe.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 ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(r),{channel_code:e,banner_id:t.bannerId,banner_name:t.bannerName,position_id:t.positionId,position_code:t.positionCode,position_name:t.positionName,campaign_id:t.campaignId,campaign_code:t.campaignCode,campaign_name:t.campaignName,breakpoint:r}};n.isEventEnabled(Zi.BANNER_LOADED)&&t.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(t){var e=t.banner;if(!e.isEmbed()&&ee.RENDERED===e.state&&1===e.stateCounter){var o,i=oa(e.fingerprints);try{for(i.s();!(o=i.n()).done;){var a=o.value;n.send(Zi.BANNER_LOADED,r(a,e))}}catch(t){i.e(t)}finally{i.f()}}})),n.isEventEnabled(Zi.BANNER_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(Zi.BANNER_DISPLAYED,r(e,o))})),n.isEventEnabled(Zi.BANNER_FULLY_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var e=t.fingerprint,o=t.banner;n.send(Zi.BANNER_FULLY_DISPLAYED,r(e,o))})),n.isEventEnabled(Zi.BANNER_CLICKED)&&t.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(t){var e=t.fingerprint,o=t.banner,i=t.target;n.send(Zi.BANNER_CLICKED,na(na({},r(e,o)),{},{link:i.href||""}))})),n.isEventEnabled(Zi.BANNER_CLOSED)&&t.subscribe(oe.ON_BANNER_AFTER_CLOSE,(function(t){var e=t.fingerprint,o=t.banner;n.send(Zi.BANNER_CLOSED,r(e,o))}))}}}}])&&aa(e.prototype,n),r&&aa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),ha=!1;const ma=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!ha&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(ha=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var wa=!1;const ga=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 Sa(t){return Sa="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},Sa(t)}function Ea(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 Ta(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Sa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Sa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Sa(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ja=!1;const ka=function(t,e){if(!("dataLayer"in window))return!ja&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(ja=!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 Na(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 Ka(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 Pu(t,e){if(t){if("string"==typeof t)return _u(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)?_u(t,e):void 0}}function _u(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, disabledEvents: array }, '.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(!Array.isArray(e.metrics.disabledEvents))throw new Error('The option "metrics.disabledEvents" must an array of strings (event names), "'.concat(e.metrics.disabledEvents,'" passed.'));for(var d in e.metrics.disabledEvents)if("string"!=typeof e.metrics.disabledEvents[d])throw new Error('The option "metrics.disabledEvents.'.concat(d,'" must be a string, "').concat(e.metrics.disabledEvents[d],'" 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)),Cu(this,Wu,new ai),Cu(this,Bu,new Ft(n.method,n.url,n.version,n.channel)),Cu(this,Fu,new Xt(n.url,n.version,n.channel)),Cu(this,Uu,new lo(Iu(this,Wu),ho.fromCurrentWindow(),new Ti(n.template))),Cu(this,zu,new Ki(Iu(this,Uu),Iu(this,Wu),n.interaction)),Cu(this,Hu,Wa.createFromReceivers(n.metrics.receiver,n.metrics.disabledEvents)),Cu(this,Vu,new da(Iu(this,Hu),Iu(this,Wu),n.channel)),Cu(this,Gu,new mu({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction}},bannerManager:Iu(this,Uu),metricsSender:Iu(this,Hu)})),Cu(this,$u,new Yo({bannerManager:Iu(this,Uu),eventBus:Iu(this,Wu),config:{storage:n.closing.storage,key:n.closing.key,maxItems:n.closing.maxItems},frameMessenger:Iu(this,Gu)})),this.setLocale(n.locale),Iu(this,Bu).origin=n.origin,n.resources)Iu(this,Bu).addDefaultResource(a,n.resources[a]),Iu(this,Fu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Ou(Iu(i,Uu).getBannersByState({state:Iu(i,Uu).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()}})),Iu(this,Gu).listen(),Iu(this,Vu).attach(),Iu(this,zu).start(),Iu(this,$u).attachUi()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Iu(this,xu)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Iu(this,Wu).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Iu(this,Bu).locale=t,Iu(this,Fu).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.");Cu(this,Lu,t)}},{key:"getGateway",value:function(){return null===Iu(this,Lu)&&this.setGateway(new tt),Iu(this,Lu)}},{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=Kr(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,qu,Ku).call(this,t,e,n,r),u=Iu(this,Uu).addEmbedBanner(t,a,e,r);return Iu(this,Gu).connectBanner(u),t.insertAdjacentElement("beforeend",a),u}return Iu(this,Uu).addManagedBanner(t,e,n,r,i)}},{key:"closeBanner",value:function(t){Iu(this,$u).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=Ou(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=Iu(this,Uu).addExternalBanner(o,n);else{var u=pr.parseResources(o),c=pr.parseOptions(o),l=o.dataset.ampMode||"managed";a=this.createBanner(o,i,u,c,l,n)}Iu(this,Wu).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=Iu(this,Uu).getBannersByState({state:Iu(this,Uu).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Iu(this,Bu).create(),o=Ou(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()}Iu(this,Wu).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,o=n.data,i=Ou(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.'));return e}function ec(t){return ec="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},ec(t)}function nc(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 rc(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 rc(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 rc(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 Dc(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 zc(this,Yc).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(zc(this,el))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=zc(this,Kc).addExternalBanner(t);$c(this,el,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),zc(this,Yc).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:e})}else console.warn("No banner found in the embed client.")}}],n&&Wc(e.prototype,n),r&&Wc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function al(t,e){zc(this,Jc).sendToParent("metrics",{eventName:t,eventArgs:e})}function ul(){var t,e=xc(zc(this,Kc).getBannersByState({state:ee.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function cl(t){return cl="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},cl(t)}function ll(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new Yu(new p(sl,"standard@".concat(sl)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new il(new p(sl,"embed@".concat(sl)),t)}},{key:"version",get:function(){return sl}}],(n=null)&&ll(e.prototype,n),r&&ll(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),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 diff --git a/dist/amp-client.standalone.min.js b/dist/amp-client.standalone.min.js index 3e9922f..cb4c55d 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:()=>pc});var n={};t.r(n),t.d(n,{exclude:()=>G,extract:()=>L,parse:()=>U,parseUrl:()=>$,pick:()=>V,stringify:()=>z,stringifyUrl:()=>H});const r=JSON.parse('{"i8":"1.6.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="<%- banner.positionData.dimensions.width %>"<% } %>\n <% if(null !== banner.positionData.dimensions.height) { %>height="<%- banner.positionData.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=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return d(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 d(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 d(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 W(t,e){return e.decode?P(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 x(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function F(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=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&&W(n,t).includes(t.arrayFormatSeparator);n=o?W(n,t):n;const a=i||o?n.split(t.arrayFormatSeparator).map((e=>W(e,t))):null===n?n:W(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?W(n,t):n);const o=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>W(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:W(a,e),n(W(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]=F(r,e);else r[t]=F(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 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]=N(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:U(L(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:W(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(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[C]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${i}`}function V(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 G(t,e,n){return V(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const q=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 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(q.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,kt,{writable:!0,value:void 0}),ht(this,Ot,{writable:!0,value:void 0}),ht(this,jt,{writable:!0,value:void 0}),ht(this,Pt,{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,kt,{}),wt(this,Ot,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=mt(this,kt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,mt(this,Ot)),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=mt(this,kt);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,St)}},{key:"endpoint",get:function(){return mt(this,Et)}},{key:"locale",get:function(){return mt(this,Tt)}},{key:"parameters",get:function(){var t=mt(this,Pt).call(this,mt(this,kt)),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&&dt(e.prototype,n),r&&dt(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 Rt(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)},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,Oe).call(this,he({},t)))}}],n&&we(e.prototype,n),r&&we(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Oe(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 Pe(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."));Re(this,De,t),Re(this,We,e.toString()),Ae(this,Be)[t]=(Ae(this,Be)[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&&Pe(e.prototype,n),r&&Pe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Fe(t){return Fe="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},Fe(t)}function Le(t,e){for(var n=0;n=l&&(null===o||ol))&&(i=u,o=l,en(t,cn)[n]=l)):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,cn).min=a[u-1]),"min"===n&&u+1 in a&&(en(this,cn).max=a[u+1]),nn(this,ln,null!==i?i:r)}},{key:"needRedraw",value:function(){if(null===en(this,ln))return!0;var t=en(this,on).width;return null!==en(this,cn).min&&ten(this,cn).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 Wn(t){return Wn="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},Wn(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 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(l=i.call(this,n,r,a,u,s)),or),Hn(zn(l),ir),Vn(zn(l),Qn,{writable:!0,value:void 0}),Vn(zn(l),Xn,{writable:!0,value:void 0}),Vn(zn(l),Zn,{writable:!0,value:[]}),Vn(zn(l),tr,{writable:!0,value:void 0}),Vn(zn(l),er,{writable:!0,value:!1}),Vn(zn(l),nr,{writable:!0,value:null}),Vn(zn(l),rr,{writable:!0,value:[]}),Kn(zn(l),Qn,t),Kn(zn(l),Xn,e),Kn(zn(l),tr,c),c)Yn(zn(l),Zn).push(new yt(f,c[f]));return l.setState(l.STATE.NEW,"Banner created."),l}return e=o,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Yn(this,Zn)}},{key:"rawResources",get:function(){return Yn(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!==Yn(this,nr))return Yn(this,nr);if(!Yn(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=Yn(this,rr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Dn.randomByWeights(Yn(this,rr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,i=Bn(t=Yn(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(Yn(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():Yn(this,nr)&&Yn(this,nr).id===e?(Kn(this,rr,[]),Kn(this,nr,null)):Kn(this,rr,Yn(this,rr).filter((function(t){return t.id!==e})));break;case n.isMultiple():Kn(this,rr,Yn(this,rr).filter((function(t){return t.id!==e}))),Yn(this,nr)&&Kn(this,nr,Yn(this,nr).filter((function(t){return t.id!==e})))}0>=Yn(this,rr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):n.isRandom()&&this.redrawIfNeeded()}}},{key:"setResponseData",value:function(t){if(Yn(this,er))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new le({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,dimensions:t.dimensions||{width:null,height:null}}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new kn(t.banners[n],t.breakpoint_type,Yn(this,Qn)));Kn(this,rr,e),Kn(this,er,!0),0>=Yn(this,rr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):qn(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(){qn(this,or,lr).call(this)&&qn(this,ir,ur).call(this,"Banner was successfully redrawn.")}}])&&Fn(e.prototype,n),r&&Fn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(xe);function ur(t){try{this.html=Yn(this,Xn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function lr(){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 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 dr(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,Pr)[t]||null;if(null===e)return null;if(Tr(this,Nr))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,Nr)){kr(this,Nr,!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,Nr))for(var t in Tr(this,Pr)){var e=Tr(this,Pr)[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 Rr(t){return Rr="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},Rr(t)}function _r(t,e){for(var n=0;n=Br(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),Vr(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,qr(e,Yr,"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),ei(this,oi,{writable:!0,value:void 0}),ei(this,ai,{writable:!0,value:void 0}),ei(this,ui,{writable:!0,value:void 0}),ei(this,li,{writable:!0,value:void 0}),ei(this,ci,{writable:!0,value:[]}),ri(this,oi,e),ri(this,ai,n),ri(this,ui,r),ri(this,li,new Kr),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)).setAttribute("data-amp-attached","");var e=new Ar(ni(this,ai),ni(this,oi),ni(this,li).getNextIdentifier(),t);return ni(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===ni(this,ui))throw new Error("Unable to add managed banner, renderer is not provided.");(t=Jr(t,i)).setAttribute("data-amp-attached","");var o=new ar(ni(this,ai),ni(this,ui),ni(this,oi),ni(this,li).getNextIdentifier(),t,e,n,r);return ni(this,ci).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n,r){t=Jr(t,window),e=Jr(e,window),t.setAttribute("data-amp-attached","");var i=new zr(ni(this,oi),ni(this,li).getNextIdentifier(),t,e,n,r);return ni(this,ci).push(i),i}},{key:"removeBanner",value:function(t){var e=ni(this,ci).length;return ri(this,ci,ni(this,ci).filter((function(e){return e!==t}))),e!==ni(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 ni(this,ci).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(ni(this,ci));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(ni(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&&ti(e.prototype,n),r&&ti(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fi(t){return fi="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},fi(t)}function pi(t,e){for(var n=0;nTi(this,Ai)&&n.splice(n.length-Ti(this,Ai)),ki(this,Ri,n),ji(this,Ii,Wi).call(this))}},{key:"isClosed",value:function(t){return-1!==ji(this,_i,Di).call(this).indexOf(t)}}])&&wi(e.prototype,n),r&&wi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Di(){if(null!==Ti(this,Ri))return Ti(this,Ri);var t=Ti(this,Pi).getItem(Ti(this,Ni)),e=null!==t&&""!==t?t.split(","):[];return ki(this,Ri,e)}function Wi(){null!==Ti(this,Ri)&&Ti(this,Pi).setItem(Ti(this,Ni),Ti(this,Ri).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 xi(t){return xi="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},xi(t)}function Fi(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 Qi(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_"+to(this,ro).getNextIdentifier();return to(this,io)[t]=to(this,io)[t]||{},to(this,io)[t][o]={callback:e,scope:r,priority:i},t in to(this,oo)&&delete to(this,oo)[t],function(){t in to(n,io)&&o in to(n,io)[t]&&delete to(n,io)[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 Ro(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={},c={},s=Ao(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(Po(Po({},v),{},{entry:f})),!b.alreadySeen){var d=f.intersectionRatio>=l(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&d?{fingerprintArgs:v,fingerprintMetadata:b,isIntersecting:d}:u[p]}if(!b.alreadyFullySeen){var h=.99<=f.intersectionRatio;c[p]=!(p in c)||!c[p].isFullyIntersecting&&h?{fingerprintArgs:v,fingerprintMetadata:b,isFullyIntersecting:h}:c[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var m=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 Wo(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 aa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(r),{channel_code:e,banner_id:t.bannerId,banner_name:t.bannerName,position_id:t.positionId,position_code:t.positionCode,position_name:t.positionName,campaign_id:t.campaignId,campaign_code:t.campaignCode,campaign_name:t.campaignName,breakpoint:r}};n.isEventEnabled(ta.BANNER_LOADED)&&t.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(t){var e=t.banner;if(!e.isEmbed()&&ne.RENDERED===e.state&&1===e.stateCounter){var i,o=oa(e.fingerprints);try{for(o.s();!(i=o.n()).done;){var a=i.value;n.send(ta.BANNER_LOADED,r(a,e))}}catch(t){o.e(t)}finally{o.f()}}})),n.isEventEnabled(ta.BANNER_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(t){var e=t.fingerprint,i=t.banner;n.send(ta.BANNER_DISPLAYED,r(e,i))})),n.isEventEnabled(ta.BANNER_FULLY_DISPLAYED)&&t.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var e=t.fingerprint,i=t.banner;n.send(ta.BANNER_FULLY_DISPLAYED,r(e,i))})),n.isEventEnabled(ta.BANNER_CLICKED)&&t.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(t){var e=t.fingerprint,i=t.banner,o=t.target;n.send(ta.BANNER_CLICKED,ra(ra({},r(e,i)),{},{link:o.href||""}))})),n.isEventEnabled(ta.BANNER_CLOSED)&&t.subscribe(oe.ON_BANNER_AFTER_CLOSE,(function(t){var e=t.fingerprint,i=t.banner;n.send(ta.BANNER_CLOSED,r(e,i))}))}}}}])&&ua(e.prototype,n),r&&ua(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),ma=!1;const wa=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!ma&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(ma=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var ga=!1;const Sa=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!ga&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(ga=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function Ea(t){return Ea="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},Ea(t)}function Ta(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 ka(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Ea(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Ea(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ea(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Oa=!1;const ja=function(t,e){if(!("dataLayer"in window))return!Oa&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Oa=!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 Ra(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 Ja(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 Nu(t,e){if(t){if("string"==typeof t)return Au(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)?Au(t,e):void 0}}function Au(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, disabledEvents: array }, '.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(!Array.isArray(e.metrics.disabledEvents))throw new Error('The option "metrics.disabledEvents" must an array of strings (event names), "'.concat(e.metrics.disabledEvents,'" passed.'));for(var d in e.metrics.disabledEvents)if("string"!=typeof e.metrics.disabledEvents[d])throw new Error('The option "metrics.disabledEvents.'.concat(d,'" must be a string, "').concat(e.metrics.disabledEvents[d],'" 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)),Mu(this,xu,new ao),Mu(this,Fu,new Lt(n.method,n.url,n.version,n.channel)),Mu(this,Lu,new Zt(n.url,n.version,n.channel)),Mu(this,zu,new si(Cu(this,xu),hi.fromCurrentWindow(),new ko(n.template))),Mu(this,$u,new Jo(Cu(this,zu),Cu(this,xu),n.interaction)),Mu(this,Vu,xa.createFromReceivers(n.metrics.receiver,n.metrics.disabledEvents)),Mu(this,Gu,new ha(Cu(this,Vu),Cu(this,xu),n.channel)),Mu(this,qu,new wu({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction}},bannerManager:Cu(this,zu),metricsSender:Cu(this,Vu)})),Mu(this,Hu,new Yi({bannerManager:Cu(this,zu),eventBus:Cu(this,xu),config:{storage:n.closing.storage,key:n.closing.key,maxItems:n.closing.maxItems},frameMessenger:Cu(this,qu)})),this.setLocale(n.locale),Cu(this,Fu).origin=n.origin,n.resources)Cu(this,Fu).addDefaultResource(a,n.resources[a]),Cu(this,Lu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Pu(Cu(o,zu).getBannersByState({state:Cu(o,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()}})),Cu(this,qu).listen(),Cu(this,Gu).attach(),Cu(this,$u).start(),Cu(this,Hu).attachUi()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Cu(this,Wu)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Cu(this,xu).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Cu(this,Fu).locale=t,Cu(this,Lu).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.");Mu(this,Uu,t)}},{key:"getGateway",value:function(){return null===Cu(this,Uu)&&this.setGateway(new et),Cu(this,Uu)}},{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,Yu,Ju).call(this,t,e,n,r),u=Cu(this,zu).addEmbedBanner(t,a,e,r);return Cu(this,qu).connectBanner(u),t.insertAdjacentElement("beforeend",a),u}return Cu(this,zu).addManagedBanner(t,e,n,r,o)}},{key:"closeBanner",value:function(t){Cu(this,Hu).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=Pu(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=Cu(this,zu).addExternalBanner(i,n);else{var u=yr.parseResources(i),l=yr.parseOptions(i),c=i.dataset.ampMode||"managed";a=this.createBanner(i,o,u,l,c,n)}Cu(this,xu).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=Cu(this,zu).getBannersByState({state:Cu(this,zu).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Cu(this,Fu).create(),i=Pu(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()}Cu(this,xu).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,i=n.data,o=Pu(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],l=Array.isArray(u.banners)?u.banners:Object.values(u.banners),c=[],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.'));return e}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 rl(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 il(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 il(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 il(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 Bl(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 $l(this,Kl).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if($l(this,nc))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=$l(this,Jl).addExternalBanner(t);Hl(this,nc,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),$l(this,Kl).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:e})}else console.warn("No banner found in the embed client.")}}],n&&xl(e.prototype,n),r&&xl(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function uc(t,e){$l(this,Ql).sendToParent("metrics",{eventName:t,eventArgs:e})}function lc(){var t,e=Wl($l(this,Jl).getBannersByState({state:ne.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function cc(t){return cc="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},cc(t)}function sc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new Ku(new p(fc,"standard@".concat(fc)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new ac(new p(fc,"embed@".concat(fc)),t)}},{key:"version",get:function(){return fc}}],(n=null)&&sc(e.prototype,n),r&&sc(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:()=>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 diff --git a/package-lock.json b/package-lock.json index 4de2f8d..09a3eda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@68publishers/amp-client", - "version": "1.6.0", + "version": "1.6.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@68publishers/amp-client", - "version": "1.6.0", + "version": "1.6.1", "license": "ISC", "dependencies": { "lodash": "^4.17.21", diff --git a/package.json b/package.json index ce6d318..d36e7bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@68publishers/amp-client", - "version": "1.6.0", + "version": "1.6.1", "description": "JS Client for 68publishers/amp", "homepage": "http://www.68publishers.io/", "main": "index.mjs",