@amplitude/experiment-tag 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @amplitude/experiment-tag v0.
|
|
2
|
-
!function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function n(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function r(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)};function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},u.apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function d(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function h(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var p="is",g="is not",m="contains",y="does not contain",b="less",w="less or equal",S="greater",x="greater or equal",k="version less",E="version less or equal",_="version greater",A="version greater or equal",T="set is",O="set is not",C="set contains",P="set does not contain",M="set contains any",I="set does not contain any",N="regex match",j="regex does not match",V=-862048943,L=461845907,U=function(e,t){void 0===t&&(t=0);for(var n=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return Uint8Array.from(t)}(e),r=n.length,i=r>>2,o=t,a=0;a<i;a++){var s=F(n,a<<2);o=R(s,o)}var l=i<<2,u=0;switch(r-l){case 3:u^=n[l+2]<<16,u^=n[l+1]<<8,u^=n[l],u=Math.imul(u,V),u=B(u,15),o^=u=Math.imul(u,L);break;case 2:u^=n[l+1]<<8,u^=n[l],u=Math.imul(u,V),u=B(u,15),o^=u=Math.imul(u,L);break;case 1:u^=n[l],u=Math.imul(u,V),u=B(u,15),o^=u=Math.imul(u,L)}return D(o^=r)>>>0},R=function(e,t){var n=e,r=t;return n=Math.imul(n,V),n=B(n,15),n=Math.imul(n,L),r=B(r^=n,13),(r=Math.imul(r,5))+-430675100|0},D=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},B=function(e,t,n){return void 0===n&&(n=32),t>n&&(t%=n),(e<<t|(e&4294967295<<n-t>>>0)>>>0>>>n-t>>>0)>>>0},F=function(e,t){void 0===t&&(t=0);var n=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return K(n)},K=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},q=function(e,t){var n,r;if(t&&0!==t.length){try{for(var i=f(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!a||!e||"object"!=typeof e)return;e=e[a]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null==e?void 0:e}},W="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),z=function(){function e(e,t,n,r){void 0===r&&(r=void 0),this.major=e,this.minor=t,this.patch=n,this.preRelease=r}return e.parse=function(t){if(t){var n=new RegExp(W).exec(t);if(n){var r=Number(n[1]),i=Number(n[2]);if(!isNaN(r)&&!isNaN(i))return new e(r,i,Number(n[4])||0,n[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),H=function(){function e(){}return e.prototype.evaluate=function(e,t){var n,r,i={},o={context:e,result:i};try{for(var a=f(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.evaluateWithTraces=function(e,t){var n,r,i={},o={},a={context:e,result:i};try{for(var s=f(t),l=s.next();!l.done;l=s.next()){var u=l.value,c=this.evaluateFlagWithTrace(a,u),d=c.variant,v=c.trace;d&&(i[u.key]=d),o[u.key]=v}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return{results:i,traces:o}},e.prototype.evaluateFlag=function(e,t){var n,r,i;try{for(var o=f(t.segments),a=o.next();!a.done;a=o.next()){var s=a.value;if(i=this.evaluateSegment(e,t,s)){var l=u(u(u({},t.metadata),s.metadata),i.metadata);i=u(u({},i),{metadata:l});break}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.prototype.evaluateFlagWithTrace=function(e,t){var n,r,i,o,a,s,l,c,d,v,h,p=[];try{for(var g=f(t.segments),m=g.next();!m.done;m=g.next()){var y=m.value;if(y.conditions){var b=[],w=!1;try{for(var S=(i=void 0,f(y.conditions)),x=S.next();!x.done;x=S.next()){var k=x.value,E=!0,_=[];try{for(var A=(a=void 0,f(k)),T=A.next();!T.done;T=A.next()){var O=T.value,C=q(e,O.selector),P=this.matchCondition(e,O);if(_.push({propValue:C,condition:O,matched:P}),!P){E=!1;break}}}catch(e){a={error:e}}finally{try{T&&!T.done&&(s=A.return)&&s.call(A)}finally{if(a)throw a.error}}if(b.push(_),E){w=!0;break}}}catch(e){i={error:e}}finally{try{x&&!x.done&&(o=S.return)&&o.call(S)}finally{if(i)throw i.error}}var M=!1,I=void 0;w&&(M=void 0!==(I=this.bucket(e,y))),p.push({segmentMetadata:y.metadata,conditionsPassed:w,bucketed:M,bucketVariant:I,conditionResult:b,matched:w&&M}),w&&void 0!==I&&!d&&(d=t.variants[I],v=y,h=null===(c=y.metadata)||void 0===c?void 0:c.segmentName)}else{var N=this.bucket(e,y),j=void 0!==N;p.push({segmentMetadata:y.metadata,conditionsPassed:!0,bucketed:j,bucketVariant:N,conditionResult:void 0,matched:j}),d||void 0===N||(d=t.variants[N],v=y,h=null===(l=y.metadata)||void 0===l?void 0:l.segmentName)}}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}if(d&&v){var V=u(u(u({},t.metadata),v.metadata),d.metadata);d=u(u({},d),{metadata:V})}return{variant:d,trace:{flagKey:t.key,matched:void 0!==d,matchedSegment:h,steps:p}}},e.prototype.evaluateSegment=function(e,t,n){var r;return n.conditions?this.evaluateConditions(e,n.conditions)&&void 0!==(r=this.bucket(e,n))?t.variants[r]:void 0:void 0!==(r=this.bucket(e,n))?t.variants[r]:void 0},e.prototype.evaluateConditions=function(e,t){var n,r,i,o;try{for(var a=f(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=!0;try{for(var c=(i=void 0,f(l)),d=c.next();!d.done;d=c.next()){var v=d.value;if(!(u=this.matchCondition(e,v)))break}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return!1},e.prototype.matchCondition=function(e,t){var n=q(e,t.selector);if(null==n)return this.matchNull(t.op,t.values);var r=this.coerceStringArray(n);if(this.isSetOperator(t.op))return!!r&&this.matchSet(r,t.op,t.values);if(r)return this.matchStringsNonSet(r,t.op,t.values);var i=this.coerceString(n);return void 0!==i&&this.matchString(i,t.op,t.values)},e.prototype.getHash=function(e){return U(e)},e.prototype.bucket=function(e,t){var n,r,i,o;if(!t.bucket)return t.variant;var a=this.coerceString(q(e,t.bucket.selector));if(!a||0===a.length)return t.variant;var s="".concat(t.bucket.salt,"/").concat(a),l=this.getHash(s),u=l%100,c=Math.floor(l/100);try{for(var d=f(t.bucket.allocations),v=d.next();!v.done;v=d.next()){var h=v.value,p=h.range[0],g=h.range[1];if(u>=p&&u<g)try{for(var m=(i=void 0,f(h.distributions)),y=m.next();!y.done;y=m.next()){var b=y.value,w=b.range[0],S=b.range[1];if(c>=w&&c<S)return b.variant}}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return t.variant},e.prototype.matchNull=function(e,t){var n=this.containsNone(t);switch(e){case p:case m:case b:case w:case S:case x:case k:case E:case _:case A:case T:case C:case M:return n;case g:case y:case P:case I:return!n;default:return!1}},e.prototype.matchSet=function(e,t,n){switch(t){case T:return this.setEquals(e,n);case O:return!this.setEquals(e,n);case C:return this.matchesSetContainsAll(e,n);case P:return!this.matchesSetContainsAll(e,n);case M:return this.matchesSetContainsAny(e,n);case I:return!this.matchesSetContainsAny(e,n);default:return!1}},e.prototype.matchString=function(e,t,n){var r=this;switch(t){case p:return this.matchesIs(e,n);case g:return!this.matchesIs(e,n);case m:return this.matchesContains(e,n);case y:return!this.matchesContains(e,n);case b:case w:case S:case x:return this.matchesComparable(e,t,n,function(e){return r.parseNumber(e)},this.comparator);case k:case E:case _:case A:return this.matchesComparable(e,t,n,function(e){return z.parse(e)},this.versionComparator);case N:return this.matchesRegex(e,n);case j:return!this.matchesRegex(e,n);default:return!1}},e.prototype.matchStringsNonSet=function(e,t,n){var r=this;return e.some(function(e){return r.matchString(e,t,n)})},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var n=e.toLowerCase();if("true"===n||"false"===n)return t.some(function(e){return e.toLowerCase()===n})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var n,r;try{for(var i=f(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.toLowerCase().includes(a.toLowerCase()))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.prototype.matchesComparable=function(e,t,n,r,i){var o=this,a=r(e),s=n.map(function(e){return r(e)}).filter(function(e){return void 0!==e});return void 0===a||0===s.length?n.some(function(n){return o.comparator(e,t,n)}):s.some(function(e){return i(a,t,e)})},e.prototype.comparator=function(e,t,n){switch(t){case b:case k:return e<n;case w:case E:return e<=n;case S:case _:return e>n;case x:case A:return e>=n;default:return!1}},e.prototype.versionComparator=function(e,t,n){var r=e.compareTo(n);switch(t){case b:case k:return r<0;case w:case E:return r<=0;case S:case _:return r>0;case x:case A:return r>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return Boolean(new RegExp(t).exec(e))})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map(function(e){return t.coerceString(e)}).filter(Boolean);var n=String(e);if(n.startsWith("["))try{var r=JSON.parse(n);return Array.isArray(r)?r.map(function(e){return t.coerceString(e)}).filter(Boolean):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case T:case O:case C:case P:case M:case I:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var n=new Set(e),r=new Set(t);return n.size===r.size&&h([],v(r),!1).every(function(e){return n.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var n,r;if(e.length<t.length)return!1;try{for(var i=f(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!this.matchesIs(a,e))return!1}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var n,r;try{for(var i=f(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(this.matchesIs(a,e))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e}(),J=function(e,t){var n,r,i=u({},e),o=[],a=t||Object.keys(i);try{for(var s=f(a),l=s.next();!l.done;l=s.next()){var c=l.value,d=G(c,i);d&&o.push.apply(o,h([],v(d),!1))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},G=function(e,t,n){var r,i;void 0===n&&(n=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];n.push(o.key);var a=[],s=function(e){if(n.some(function(t){return t===e}))throw Error("Detected a cycle between flags ".concat(n));var r=G(e,t,n);r&&a.push.apply(a,h([],v(r),!1))};try{for(var l=f(o.dependencies),u=l.next();!u.done;u=l.next()){s(u.value)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return a.push(o),n.pop(),delete t[o.key],a}};const X="function"==typeof Buffer,Q=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),$=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Z=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})($),Y=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ee=String.fromCharCode.bind(String),te=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_")),ne=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),re=e=>{let t,n,r,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((n=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|i,o+=$[t>>18&63]+$[t>>12&63]+$[t>>6&63]+$[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},ie="function"==typeof btoa?e=>btoa(e):X?e=>Buffer.from(e,"binary").toString("base64"):re,oe=X?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(ee.apply(null,e.subarray(n,n+4096)));return ie(t.join(""))},ae=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?ee(192|t>>>6)+ee(128|63&t):ee(224|t>>>12&15)+ee(128|t>>>6&63)+ee(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return ee(240|t>>>18&7)+ee(128|t>>>12&63)+ee(128|t>>>6&63)+ee(128|63&t)},se=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,le=e=>e.replace(se,ae),ue=X?e=>Buffer.from(e,"utf8").toString("base64"):Q?e=>oe(Q.encode(e)):e=>ie(le(e)),ce=(e,t=!1)=>t?te(ue(e)):ue(e),de=e=>ce(e,!0),fe=e=>{if(e=e.replace(/\s+/g,""),!Y.test(e))throw new TypeError("malformed base64.");let t,n,r;e+="==".slice(2-(3&e.length));let i=[];for(let o=0;o<e.length;)t=Z[e.charAt(o++)]<<18|Z[e.charAt(o++)]<<12|(n=Z[e.charAt(o++)])<<6|(r=Z[e.charAt(o++)]),64===n?i.push(ee(t>>16&255)):64===r?i.push(ee(t>>16&255,t>>8&255)):i.push(ee(t>>16&255,t>>8&255,255&t));return i.join("")},ve=de;var he=function(e){function t(n,r){var i=e.call(this,r)||this;return i.statusCode=n,Object.setPrototypeOf(i,t.prototype),i}return l(t,e),t}(Error),pe=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return l(t,e),t}(Error),ge=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getVariants=function(e,t){return c(this,void 0,void 0,function(){var n,r,i,o;return d(this,function(a){switch(a.label){case 0:return n=ve(JSON.stringify(e)),r={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":n},(null==t?void 0:t.flagKeys)&&(r["X-Amp-Exp-Flag-Keys"]=ve(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(r["X-Amp-Exp-Track"]=t.trackingOption),(null==t?void 0:t.exposureTrackingOption)&&(r["X-Amp-Exp-Exposure-Track"]=t.exposureTrackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:r,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=a.sent()).status)throw new he(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),me=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getFlags=function(e){return c(this,void 0,void 0,function(){var t,n;return d(this,function(r){switch(r.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=ve(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(n=r.sent()).status)throw Error("Flags error response: status=".concat(n.status));return[2,JSON.parse(n.body).reduce(function(e,t){return e[t.key]=t,e},{})]}})})},e}(),ye="undefined"!=typeof globalThis?globalThis:global||self,be=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},we=function(){var e=be();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1},Se=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=ye.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(ye.clearInterval(this.poller),this.poller=void 0)},e}(),xe=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ke(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ke=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ee=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),_e=function(){return _e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_e.apply(this,arguments)};function Ae(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Te(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var Oe=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Ae(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next()){if(a.value===i)return e===t}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var s=Array.isArray(e),l=Array.isArray(t);if(s!==l)return!1;if(!s||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!Oe(u,c))return!1;var d=!0;return Object.keys(e).forEach(function(n){Oe(e[n],t[n])||(d=!1)}),d}for(var f=0;f<e.length;f++)if(!Oe(e[f],t[f]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var Ce=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=_e({},this.identity.userProperties),n=_e(_e({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,a,s,l=n.userProperties||{};try{for(var u=Ae(Object.entries(e)),c=u.next();!c.done;c=u.next()){var d=Te(c.value,2),f=d[0],v=d[1];switch(f){case"$set":try{for(var h=(i=void 0,Ae(Object.entries(v))),p=h.next();!p.done;p=h.next()){var g=Te(p.value,2),m=g[0],y=g[1];l[m]=y}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(a=void 0,Ae(Object.keys(v))),w=b.next();!w.done;w=b.next()){delete l[m=w.value]}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return n.userProperties=l,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return _e({},this.identity)},e.prototype.setIdentity=function(e){var t=_e({},this.identity);this.identity=_e({},e),Oe(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),Pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,Me=function(){function e(){this.identityStore=new Ce,this.eventBridge=new Ee,this.applicationContextProvider=new xe}return e.getInstance=function(t){return Pe.analyticsConnectorInstances||(Pe.analyticsConnectorInstances={}),Pe.analyticsConnectorInstances[t]||(Pe.analyticsConnectorInstances[t]=new e),Pe.analyticsConnectorInstances[t]},e}(),Ie="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var Ne,je,Ve,Le=(Ne=function(e,t){!function(n,r){var i="function",o="undefined",a="object",s="string",l="model",u="name",c="type",d="vendor",f="version",v="architecture",h="console",p="mobile",g="tablet",m="smarttv",y="wearable",b="embedded",w="Amazon",S="Apple",x="ASUS",k="BlackBerry",E="Browser",_="Chrome",A="Firefox",T="Google",O="Huawei",C="LG",P="Microsoft",M="Motorola",I="Opera",N="Samsung",j="Sharp",V="Sony",L="Xiaomi",U="Zebra",R="Facebook",D=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},B=function(e,t){return typeof e===s&&-1!==F(t).indexOf(F(e))},F=function(e){return e.toLowerCase()},K=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},q=function(e,t){for(var n,o,s,l,u,c,d=0;d<t.length&&!u;){var f=t[d],v=t[d+1];for(n=o=0;n<f.length&&!u;)if(u=f[n++].exec(e))for(s=0;s<v.length;s++)c=u[++o],typeof(l=v[s])===a&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):r:this[l[0]]=c?l[1].call(this,c,l[2]):r:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):r):this[l]=c||r;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(B(t[n][i],e))return"?"===n?r:n}else if(B(t[n],e))return"?"===n?r:n;return e},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},H={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,f],[/opios[\/ ]+([\w\.]+)/i],[f,[u,I+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[u,I]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[u,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+E],f],[/\bfocus\/([\w\.]+)/i],[f,[u,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[u,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[u,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[u,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[f,[u,A]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+E],f],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,R],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[u,_+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,_+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[u,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[f,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[u,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,f],[/(cobalt)\/([\w\.]+)/i],[u,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[v,"amd64"]],[/(ia32(?=;))/i],[[v,F]],[/((?:i[346]|x)86)[;\)]/i],[[v,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[v,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[v,"armhf"]],[/windows (ce|mobile); ppc;/i],[[v,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[v,/ower/,"",F]],[/(sun4\w)[;\)]/i],[[v,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[v,F]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,N],[c,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,N],[c,p]],[/((ipod|iphone)\d+,\d+)/i],[l,[d,S],[c,p]],[/(ipad\d+,\d+)/i],[l,[d,S],[c,g]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[d,S],[c,p]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,S],[c,g]],[/(macintosh);/i],[l,[d,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,O],[c,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,O],[c,p]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,L],[c,p]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,L],[c,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[c,p]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[c,p]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[c,p]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,M],[c,p]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,M],[c,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,C],[c,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,C],[c,p]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[c,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[c,p]],[/(pixel c)\b/i],[l,[d,T],[c,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,T],[c,p]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,V],[c,p]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,V],[c,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[c,p]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,w],[c,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,w],[c,p]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[c,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,k],[c,p]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,x],[c,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,x],[c,p]],[/(nexus 9)/i],[l,[d,"HTC"],[c,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[c,p]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[c,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[c,p]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,j],[c,p]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[c,p]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[c,g]],[/(surface duo)/i],[l,[d,P],[c,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[c,p]],[/(u304aa)/i],[l,[d,"AT&T"],[c,p]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[c,p]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[c,g]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[c,g]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[c,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[c,g]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[c,g]],[/\b(k88) b/i],[l,[d,"ZTE"],[c,g]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[c,p]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[c,p]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[c,g]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[c,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[c,g]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[c,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[c,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[c,p]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[c,p]],[/\b(ph-1) /i],[l,[d,"Essential"],[c,p]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[c,g]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[c,g]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[c,g]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[c,g]],[/(sprint) (\w+)/i],[d,l,[c,p]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,P],[c,p]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,U],[c,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,U],[c,p]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[c,h]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[c,h]],[/(playstation [345portablevi]+)/i],[l,[d,V],[c,h]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,P],[c,h]],[/smart-tv.+(samsung)/i],[d,[c,m]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,N],[c,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,C],[c,m]],[/(apple) ?tv/i],[d,[l,S+" TV"],[c,m]],[/crkey/i],[[l,_+"cast"],[d,T],[c,m]],[/droid.+aft(\w)( bui|\))/i],[l,[d,w],[c,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,j],[c,m]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,V],[c,m]],[/(mitv-\w{5}) bui/i],[l,[d,L],[c,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,K],[l,K],[c,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,m]],[/((pebble))app/i],[d,l,[c,y]],[/droid.+; (glass) \d/i],[l,[d,T],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,U],[c,y]],[/(quest( 2)?)/i],[l,[d,R],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,p]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,p]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[f,W,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[f,W,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,f],[/\(bb(10);/i],[f,[u,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[u,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[u,_+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,f],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,f]]},J=function(e,t){if(typeof e===a&&(t=e,e=r),!(this instanceof J))return new J(e,t).getResult();var i=e||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),h=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(H,t):H;return this.getBrowser=function(){var e={};return e[u]=r,e[f]=r,q.call(e,i,h.browser),e.major=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r}(e.version),e},this.getCPU=function(){var e={};return e[v]=r,q.call(e,i,h.cpu),e},this.getDevice=function(){var e={};return e[d]=r,e[l]=r,e[c]=r,q.call(e,i,h.device),e},this.getEngine=function(){var e={};return e[u]=r,e[f]=r,q.call(e,i,h.engine),e},this.getOS=function(){var e={};return e[u]=r,e[f]=r,q.call(e,i,h.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===s&&e.length>350?K(e,350):e,this},this.setUA(i),this};J.VERSION="0.7.33",J.BROWSER=D([u,f,"major"]),J.CPU=D([v]),J.DEVICE=D([l,d,c,h,p,m,g,y,b]),J.ENGINE=J.OS=D([u,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var G=typeof n!==o&&(n.jQuery||n.Zepto);if(G&&!G.ua){var X=new J;G.ua=X.getResult(),G.ua.get=function(){return X.getUA()},G.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var n in t)G.ua[n]=t[n]}}}("object"==typeof window?window:Ie)},Ne(Ve={path:je,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&Ve.path)}},Ve.exports),Ve.exports),Ue=function(){function e(e){this.amplitudeInstance=e}return e.prototype.getUser=function(){var e,t,n,r,i,o,a,s,l,u;return{device_id:null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e.options)||void 0===t?void 0:t.deviceId,user_id:null===(r=null===(n=this.amplitudeInstance)||void 0===n?void 0:n.options)||void 0===r?void 0:r.userId,version:null===(o=null===(i=this.amplitudeInstance)||void 0===i?void 0:i.options)||void 0===o?void 0:o.versionName,language:null===(s=null===(a=this.amplitudeInstance)||void 0===a?void 0:a.options)||void 0===s?void 0:s.language,platform:null===(u=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===u?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},e.prototype.getOs=function(){var e,t,n,r,i,o;return[null===(n=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.browser)||void 0===n?void 0:n.name,null===(o=null===(i=null===(r=this.amplitudeInstance)||void 0===r?void 0:r._ua)||void 0===i?void 0:i.browser)||void 0===o?void 0:o.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(){var e,t,n;return null===(n=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.os)||void 0===n?void 0:n.name},e}(),Re=function(){function e(e){this.amplitudeInstance=e}return e.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},e.prototype.setUserProperty=function(e){var t,n;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null===(n=e.variant)||void 0===n?void 0:n.value,t))},e.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:(t={},t[e.userProperty]="-",t)})},e}(),De=function(){return De=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},De.apply(this,arguments)};
|
|
3
|
-
/* @amplitude/experiment-js-client v1.21.1 - For license info see https://app.unpkg.com/@amplitude/experiment-js-client@1.21.1/files/LICENSE */function Be(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function Fe(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Ke(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function qe(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function We(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var ze=function(e,t){var n,r;void 0===t&&(t=!1);var i=He(e,t),o=void 0,a=ye.document.cookie.split("; ");try{for(var s=Ke(a),l=s.next();!l.done;l=s.next()){var u=qe(l.value.split("=",2),2),c=u[0],d=u[1];c===i&&(o=decodeURIComponent(d))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}if(o)try{if(t){var f=atob(o);return JSON.parse(decodeURIComponent(f))}var v=o.split("."),h=void 0;return v.length>=2&&v[1]&&(h=atob(v[1])),{deviceId:v[0],userId:h}}catch(e){return}},He=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},Je=function(){function e(e,t,n){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=n,this.loadPersistedState(),n<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return Be(this,void 0,void 0,function(){return Fe(this,function(n){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener(function(){null==t||t.fetch()}),[2,this.waitForConnectorIdentity(this.timeoutMillis)]})})},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=ze(this.apiKey,!0);return(e||(e=ze(this.apiKey,!1))||(e=function(e){var t=He(e,!0);try{var n=ye.localStorage.getItem(t);if(!n)return;var r=JSON.parse(n);if("object"!=typeof r)return;return r}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=He(e,!0);try{var n=ye.sessionStorage.getItem(t);if(!n)return;var r=JSON.parse(n);if("object"!=typeof r)return;return r}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return Be(this,void 0,void 0,function(){var t,n=this;return Fe(this,function(r){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise(function(e){var t=function(){e(),n.identityStore.removeIdentityListener(t)};n.identityStore.addIdentityListener(t)}),new Promise(function(t,n){ye.setTimeout(n,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}();var Ge,Xe,Qe,$e=ye.fetch||function(e,t){return t=t||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n}),n(l())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)})},Ze=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Be(this,void 0,void 0,function(){return Fe(this,function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}})})},e}(),Ye={request:function(e,t,n,r,i){return function(e,t){return null==t||t<=0?e:new Promise(function(n,r){ye.setTimeout(function(){r(new pe("Request timeout after "+t+" milliseconds"))},t),e.then(n,r)})}(Be(void 0,void 0,void 0,function(){var i,o;return Fe(this,function(a){switch(a.label){case 0:return[4,$e(e,{method:t,headers:n,body:r})];case 1:return i=a.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=a.sent(),[2,o]}})}),i)}};!function(e){e[e.Disable=0]="Disable",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose"}(Ge||(Ge={})),function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(Xe||(Xe={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(Qe||(Qe={}));var et=function(e){return!e||e===Qe.FallbackInline||e===Qe.FallbackConfig||e===Qe.SecondaryInitialVariants},tt={debug:!1,logLevel:Ge.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:Xe.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:Ye},nt="1.21.1",rt=function(){function e(e,t){var n,r=this;this.isReady=new Promise(function(e){r.resolve=e}),this.config=e,this.client=t;var i=null!==(n=e.instanceName)&&void 0!==n?n:tt.instanceName;this.queue=new ot(i),this.cache=new it(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()},function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e,t){if(this.cache.shouldTrack(e,t)){var n=this.getExposureEvent(e);this.queue.push(n)}},e.prototype.getExposureEvent=function(e){var t,n,r,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(n=e.metadata)||void 0===n?void 0:n.exposureEvent,eventProperties:e}:"web"===(null===(r=e.metadata)||void 0===r?void 0:r.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),it=function(){function e(e){this.isSessionStorageAvailable=at(),this.inMemoryCache={},this.identity={},this.storageKey="EXP_sent_v3_".concat(e),this.isSessionStorageAvailable&&(ye.sessionStorage.removeItem("EXP_sent_".concat(e)),ye.sessionStorage.removeItem("EXP_sent_v2_".concat(e)))}return e.prototype.shouldTrack=function(e,t){var n,r;if("web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod))return!0;var i={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,i)||this.clearCache(),this.identity=i,this.loadCache();var o=e.flag_key in this.inMemoryCache,a=this.inMemoryCache[e.flag_key],s=null!==(r=e.variant)&&void 0!==r?r:null,l=!1;return o&&(null!=a?a:null)===s||(l=!0,this.inMemoryCache[e.flag_key]=s),this.storeCache(),l},e.prototype.clearCache=function(){this.inMemoryCache={},this.isSessionStorageAvailable&&ye.sessionStorage.removeItem(this.storageKey)},e.prototype.identityEquals=function(e,t){return e.userId&&t.userId?e.userId===t.userId:!e.userId&&!t.userId&&e.deviceId===t.deviceId},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=ye.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){if(this.isSessionStorageAvailable)try{ye.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))}catch(e){}},e}(),ot=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=we(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=ye.setInterval(function(){t.loadFlushStore()},1e3),this.loadFlushStore()},e.prototype.flush=function(){if(this.tracker&&0!==this.inMemoryQueue.length){for(var e=0;e<this.inMemoryQueue.length;e++)try{if(!this.tracker(this.inMemoryQueue[e]))break}catch(e){break}this.inMemoryQueue=this.inMemoryQueue.slice(e),0===this.inMemoryQueue.length&&this.poller&&(ye.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=ye.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),ye.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),at=function(){var e=be();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},st=function(){function e(e,t){void 0===t&&(t=Ge.Error),this.logger=e,this.logLevel=t}return e.prototype.error=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Error&&(t=this.logger).error.apply(t,We([e],qe(n),!1))},e.prototype.warn=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Warn&&(t=this.logger).warn.apply(t,We([e],qe(n),!1))},e.prototype.info=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Info&&(t=this.logger).info.apply(t,We([e],qe(n),!1))},e.prototype.debug=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Debug&&(t=this.logger).debug.apply(t,We([e],qe(n),!1))},e.prototype.verbose=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Verbose&&(t=this.logger).verbose.apply(t,We([e],qe(n),!1))},e}(),lt=function(){function e(){}return e.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.error.apply(console,We([e],qe(t),!1))},e.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.warn.apply(console,We([e],qe(t),!1))},e.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.info.apply(console,We([e],qe(t),!1))},e.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.debug.apply(console,We([e],qe(t),!1))},e.prototype.verbose=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.debug.apply(console,We([e],qe(t),!1))},e}(),ut=function(){function e(){this.globalScope=be()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var n;null===(n=this.globalScope)||void 0===n||n.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),ct=function(){function e(e,t){this.namespace=e,this.storage=t}return e.prototype.get=function(){return this.value},e.prototype.put=function(e){this.value=e},e.prototype.load=function(){var e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))},e.prototype.store=function(){void 0===this.value?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e}(),dt=function(){function e(e,t,n){this.cache={},this.namespace=e,this.storage=t,this.transformer=n}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return De({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,n;try{for(var r=Ke(Object.keys(e)),i=r.next();!i.done;i=r.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,n,r=this.storage.get(this.namespace);try{n=JSON.parse(r)||{}}catch(e){return}var i={};try{for(var o=Ke(Object.keys(n)),a=o.next();!a.done;a=o.next()){var s=a.value;try{var l=void 0;(l=this.transformer?this.transformer(n[s]):n[s])&&(i[s]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),ft=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,n=e.value,r=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var a={};return t?a.key=t:n&&(a.key=n),n&&(a.value=n),i&&(a.metadata=i),r&&(a.payload=r),o&&(a.expKey=o),a}},vt=function(){function e(){this.globalScope=be()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var n;null===(n=this.globalScope)||void 0===n||n.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),ht=function(e){return null==e},pt=function(e){return!!ht(e)||e&&0===Object.keys(e).length},gt=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},mt=function(){function e(e,t,n,r){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=n,this.scalar=r}return e.prototype.start=function(e){return Be(this,void 0,void 0,function(){return Fe(this,function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}})})},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,n){return Be(this,void 0,void 0,function(){var r=this;return Fe(this,function(i){return this.done||(this.timeoutHandle=ye.setTimeout(function(){return Be(r,void 0,void 0,function(){var r,i;return Fe(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(r=t+1)<this.attempts&&(i=Math.min(n*this.scalar,this.max),this.backoff(e,r,i)),[3,3];case 3:return[2]}})})},n)),[2]})})},e}(),yt=function(e){var t,n,r,i;if(!e)return{};var o={user:e},a=be();a&&(o.page={url:a.location.href});var s={};if(!e.groups)return o;try{for(var l=Ke(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e.groups[c];if(d.length>0&&d[0]){var f=d[0],v={group_name:f},h=null===(i=null===(r=e.group_properties)||void 0===r?void 0:r[c])||void 0===i?void 0:i[f];h&&Object.keys(h).length>0&&(v.group_properties=h),s[c]=v}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return Object.keys(s).length>0&&(o.groups=s),delete o.user.groups,delete o.user.group_properties,o},bt=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},wt=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var n={};return e.key&&(n.key=e.key),e.value&&(n.value=e.value),e.payload&&(n.payload=e.payload),t&&(n.expKey=t),e.metadata&&(n.metadata=e.metadata),n},St=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),xt=function(){function e(e){this.tracked={},this.identity={},this.exposureTrackingProvider=e}return e.prototype.track=function(e,t){var n={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,n)||(this.tracked={}),this.identity=n;var r=e.flag_key in this.tracked,i=this.tracked[e.flag_key];r&&i===e.variant||(this.tracked[e.flag_key]=e.variant,this.exposureTrackingProvider.track(e))},e.prototype.identityEquals=function(e,t){return e.userId===t.userId&&e.deviceId===t.deviceId},e}(),kt=function(){function e(t,n){var r,i,o,a,s=this;this.engine=new H,this.isRunning=!1,this.apiKey=t,n=function(e){var t,n;if(!e||"object"!=typeof e)return{};var r={};try{for(var i=Ke(Object.entries(e)),o=i.next();!o.done;o=i.next()){var a=qe(o.value,2),s=a[0],l=a[1];ht(l)||(r[s]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(n),this.config=De(De(De({},tt),n),{serverUrl:(null==n?void 0:n.serverUrl)||("eu"===(null===(r=null==n?void 0:n.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":tt.serverUrl),flagsServerUrl:(null==n?void 0:n.flagsServerUrl)||("eu"===(null===(i=null==n?void 0:n.serverZone)||void 0===i?void 0:i.toLowerCase())?"https://flag.lab.eu.amplitude.com":tt.flagsServerUrl),flagConfigPollingIntervalMillis:n.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=n.flagConfigPollingIntervalMillis)&&void 0!==o?o:tt.flagConfigPollingIntervalMillis}),this.logger=new st(this.config.loggerProvider||new lt,e.getLogLevel(n));var l=null===(a=this.config)||void 0===a?void 0:a.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new Se(function(){return Be(s,void 0,void 0,function(){var e;return Fe(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this.logger.info(e),[3,3];case 3:return[2]}})})},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=ft(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new St(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new xt(this.config.exposureTrackingProvider)),this.integrationManager=new rt(this.config,this);var c,d=new Ze(this.config.httpClient||Ye);this.flagApi=new me(this.apiKey,this.config.flagsServerUrl,d),this.evaluationApi=new ge(this.apiKey,this.config.serverUrl,d);var f=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;c=this.isWebExperiment?new vt:new ut,this.variants=function(e,t,n){var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r);return new dt(i,n,ft)}(this.apiKey,f,c),this.flags=function(e,t,n){void 0===n&&(n=new ut);var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r,"-flags");return new dt(i,n)}(this.apiKey,f,c),this.fetchVariantsOptions=function(e,t,n){void 0===n&&(n=new ut);var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r,"-variants-options");return new ct(i,n)}(this.apiKey,f,c);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return Be(this,void 0,void 0,function(){var t,n,r;return Fe(this,function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:return i.trys.push([1,6,,7]),t=this.doFlags(),null===(r=this.config.fetchOnStart)||void 0===r||r?[4,Promise.all([this.fetch(e),t])]:[3,3];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(n=i.sent(),this.config.throwOnError)throw n;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}})})},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return Be(this,arguments,void 0,function(e,t){var n;return void 0===e&&(e=this.user),Fe(this,function(r){switch(r.label){case 0:this.setUser(e||{}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return r.sent(),[3,4];case 3:if(n=r.sent(),this.config.throwOnError)throw n;return n instanceof pe?this.logger.debug(n):this.logger.error(n),[3,4];case 4:return[2,this]}})})},e.prototype.variant=function(e,t){var n,r;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.logger.debug("[Experiment] variant for ".concat(e," is ").concat((null===(n=i.variant)||void 0===n?void 0:n.key)||(null===(r=i.variant)||void 0===r?void 0:r.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var n=this.flags.get(t);gt(n)||delete e[t]}return De(De(De({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=De({},this.user.user_properties);return De(De({},this.user),{user_properties:t})}return De({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var n=De({},e.user_properties);this.user=De(De({},e),{user_properties:n})}else this.user=De({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach(function(t){e.flags.get(t.key)||e.flags.put(t.key,t)})},e.prototype.evaluate=function(e){var t,n,r=this.addContext(this.user),i=J(this.flags.getAll(),e),o=yt(r),a=this.engine.evaluate(o,i),s={};try{for(var l=Ke(Object.keys(a)),u=l.next();!u.done;u=l.next()){var c=u.value;s[c]=wt(a[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return s},e.prototype.getEvaluationTraces=function(e){var t=this.addContext(this.user),n=J(this.flags.getAll(),e),r=yt(t);return this.engine.evaluateWithTraces(r,n).traces},e.prototype.variantAndSource=function(e,t){var n={};this.config.source===Xe.LocalStorage?n=this.localStorageVariantAndSource(e,t):this.config.source===Xe.InitialVariants&&(n=this.initialVariantsVariantAndSource(e,t));var r=this.flags.get(e);return(gt(r)||!n.variant&&r)&&(n=this.localEvaluationVariantAndSource(e,r,t)),n},e.prototype.localEvaluationVariantAndSource=function(e,t,n){var r,i={},o=this.evaluate([t.key])[e],a=Qe.LocalEvaluation,s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!ht(o)&&!s)return{variant:bt(o),source:a,hasDefaultVariant:!1};if(s&&(i={variant:bt(o),source:a,hasDefaultVariant:!0}),!ht(n))return{variant:bt(n),source:Qe.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!ht(l))return{variant:bt(l),source:Qe.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=bt(this.config.fallbackVariant),c={variant:u,source:Qe.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return pt(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var n,r={},i=this.variants.get(e),o=null===(n=null==i?void 0:i.metadata)||void 0===n?void 0:n.default;if(!ht(i)&&!o)return{variant:bt(i),source:Qe.LocalStorage,hasDefaultVariant:!1};if(o&&(r={variant:bt(i),source:Qe.LocalStorage,hasDefaultVariant:!0}),!ht(t))return{variant:bt(t),source:Qe.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var a=this.config.initialVariants[e];if(!ht(a))return{variant:bt(a),source:Qe.SecondaryInitialVariants,hasDefaultVariant:r.hasDefaultVariant};var s=bt(this.config.fallbackVariant),l={variant:s,source:Qe.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return pt(s)?r:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var n,r={},i=this.config.initialVariants[e];if(!ht(i))return{variant:bt(i),source:Qe.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!ht(o)&&!a)return{variant:bt(o),source:Qe.LocalStorage,hasDefaultVariant:!1};if(a&&(r={variant:bt(o),source:Qe.LocalStorage,hasDefaultVariant:!0}),!ht(t))return{variant:bt(t),source:Qe.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var s=bt(this.config.fallbackVariant),l={variant:s,source:Qe.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return pt(s)?r:l},e.prototype.fetchInternal=function(e,t,n,r){return Be(this,void 0,void 0,function(){var i,o,a;return Fe(this,function(s){switch(s.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(n)),n&&this.stopRetries(),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,this.doFetch(e,t,De({trackingOption:null===(a=this.fetchVariantsOptions.get())||void 0===a?void 0:a.trackingOption},r))];case 2:return i=s.sent(),[4,this.storeVariants(i,r)];case 3:return s.sent(),[2,i];case 4:throw o=s.sent(),n&&this.shouldRetryFetch(o)&&this.startRetries(e,r),o;case 5:return[2]}})})},e.prototype.setTracksAssignment=function(e){return Be(this,void 0,void 0,function(){return Fe(this,function(t){return this.fetchVariantsOptions.put(De(De({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(e){var t=De({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,n){return Be(this,void 0,void 0,function(){var r,i,o,a,s,l,u;return Fe(this,function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,De({timeoutMillis:t},n))];case 2:r=c.sent(),i={};try{for(o=Ke(Object.keys(r)),a=o.next();!a.done;a=o.next())s=a.value,i[s]=wt(r[s])}catch(e){l={error:e}}finally{try{a&&!a.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.logger.debug("[Experiment] Received variants: ",i),[2,i]}})})},e.prototype.doFlags=function(){return Be(this,void 0,void 0,function(){var e,t,n;return Fe(this,function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=r.sent(),r.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:nt,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=r.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((n=r.sent())instanceof pe))throw n;if(this.logger.debug(n),this.config.throwOnError)throw n;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}})})},e.prototype.storeVariants=function(e,t){return Be(this,void 0,void 0,function(){var n,r,i,o;return Fe(this,function(a){for(o in 0===(n=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),r=function(t){n=n.filter(function(e){return e!==t}),i.variants.put(t,e[t])},i=this,e)r(o);for(o in n)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.logger.debug("[Experiment] Stored variants: ",e),[2]})})},e.prototype.startRetries=function(e,t){return Be(this,void 0,void 0,function(){var n=this;return Fe(this,function(r){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new mt(8,500,1e4,1.5),this.retriesBackoff.start(function(){return Be(n,void 0,void 0,function(){return Fe(this,function(n){switch(n.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return n.sent(),[2]}})})}),[2]})})},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,n=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),r=this.integrationManager.getUser(),i=De(De(De({},null==n?void 0:n.user_properties),r.user_properties),null==e?void 0:e.user_properties);return De(De(De(De({library:"experiment-js-client/".concat(nt)},n),r),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return Be(this,void 0,void 0,function(){return Fe(this,function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}})})},e.prototype.sourceVariants=function(){return this.config.source==Xe.LocalStorage?this.variants.getAll():this.config.source==Xe.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==Xe.LocalStorage?this.config.initialVariants:this.config.source==Xe.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var n,r,i,o,a,s,l,u,c;if(null===(i=null===(r=null===(n=t.variant)||void 0===n?void 0:n.metadata)||void 0===r?void 0:r.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var d={flag_key:e},f=et(t.source);if(!f||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(d.experiment_key=null===(a=t.variant)||void 0===a?void 0:a.expKey);var v=null===(s=t.variant)||void 0===s?void 0:s.metadata;if(f||(null==v?void 0:v.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(d.variant=t.variant.value)),v&&(d.metadata=v),this.isWebExperiment&&(d.time=Date.now()),this.isWebExperiment){var h=be();if(null==h?void 0:h.location)try{var p=h.location.href;d.metadata.url=p.split("?")[0]||""}catch(e){}}var g=this.addContext(this.getUser());null===(c=this.userSessionExposureTracker)||void 0===c||c.track(d,g),this.integrationManager.track(d,g)}}},e.prototype.legacyExposureInternal=function(e,t,n){var r,i,o,a,s;if(this.analyticsProvider){var l=function(e,t,n,r){var i,o=null==n?void 0:n.value,a="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:n,userProperty:a,properties:{key:t,variant:o,source:r},userProperties:(i={},i[a]=o,i)}}(this.addContext(this.getUser()),e,t,n);et(n)||!(null==t?void 0:t.value)?null===(i=null===(r=this.analyticsProvider)||void 0===r?void 0:r.unsetUserProperty)||void 0===i||i.call(r,l):(null==t?void 0:t.value)&&(null===(a=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===a||a.call(o,l),null===(s=this.analyticsProvider)||void 0===s||s.track(l))}},e.getLogLevel=function(e){var t;return!0===e.debug?Ge.Debug:null!==(t=e.logLevel)&&void 0!==t?t:Ge.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof he)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),Et=function(){function e(e,t){var n,r,i;this.globalScope=be(),this.userAgent=void 0!==(null===(n=this.globalScope)||void 0===n?void 0:n.navigator)?null===(r=this.globalScope)||void 0===r?void 0:r.navigator.userAgent:void 0,this.ua=new Le.UAParser(this.userAgent).getResult(),this.localStorage=new ut,this.sessionStorage=new vt,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,n,r,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return De({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(n=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==n?n:"desktop",referring_url:null===(i=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,n;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(n=e.browser)||void 0===n?void 0:n.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,n=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==n?void 0:n.includes("Chrom"))&&(n="Chrome"),(null==n?void 0:n.includes("Firefox"))&&(n="Firefox"),(null==n?void 0:n.includes("Safari"))&&(n="Safari"),(null==n?void 0:n.includes("Edge"))&&(n="Edge"),(null==n?void 0:n.includes("Opera"))&&(n="Opera"),n},e.prototype.getCookie=function(){var e,t,n,r,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(r=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===r?void 0:r.cookie)||void 0===i?void 0:i.split("; ").map(function(e){return e.split("=")}))},e.prototype.getLandingUrl=function(){var e,t;try{var n=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return n.landing_url||(n.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(n))),n.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,n;if(this.globalScope){var r={};try{var i=new URL(this.globalScope.location.href);try{for(var o=Ke(i.searchParams),a=o.next();!a.done;a=o.next()){var s=qe(a.value,2),l=s[0],u=s[1];r[l]=We(We([],qe(null!==(n=r[l])&&void 0!==n?n:[]),!1),qe(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(r).reduce(function(e,t){var n=qe(t,2),r=n[0],i=n[1];return e[r]=1==i.length?i[0]:i,e},{})}},e}();ye.experimentInstances={};var _t,At=ye.experimentInstances,Tt=function(e,t){return Pt(e,t)},Ot=function(e,t){return Pt(e,t,function(){return new Je(e,Me.getInstance(Ct(t)),1e4)})},Ct=function(e){return(null==e?void 0:e.instanceName)||tt.instanceName},Pt=function(e,t,n){var r=function(e,t){var n=Ct(t),r=null==t?void 0:t.internalInstanceNameSuffix;return r?"".concat(n,".").concat(e,".").concat(r):"".concat(n,".").concat(e)}(e,t),i=At[r];return i||(i=function(e,t){return new kt(e,De(De({},t),{userProvider:new Et(null==t?void 0:t.userProvider,e)}))}(e,t),n&&i.addPlugin(n()),At[r]=i,i)},Mt={initialize:Tt,initializeWithAmplitudeAnalytics:Ot},It=function(){function e(){}return e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return Be(this,void 0,void 0,function(){return Fe(this,function(e){return[2]})})},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return Be(this,void 0,void 0,function(){return Fe(this,function(e){return[2,this]})})},e.prototype.getUserProvider=function(){return null},e.prototype.setUserProvider=function(e){return this},e.prototype.variant=function(e,t){return tt.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){},e}(),Nt=Object.freeze({__proto__:null,AmplitudeAnalyticsProvider:Re,AmplitudeIntegrationPlugin:Je,AmplitudeUserProvider:Ue,ConsoleLogger:lt,Experiment:Mt,ExperimentClient:kt,get LogLevel(){return Ge},get Source(){return Xe},StubExperimentClient:It,initialize:Tt,initializeWithAmplitudeAnalytics:Ot});var jt="undefined"==typeof document?void 0:document,Vt=!!jt&&"content"in jt.createElement("template"),Lt=!!jt&&jt.createRange&&"createContextualFragment"in jt.createRange();function Ut(e){return e=e.trim(),Vt?function(e){var t=jt.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(e):Lt?function(e){return _t||(_t=jt.createRange()).selectNode(jt.body),_t.createContextualFragment(e).childNodes[0]}(e):function(e){var t=jt.createElement("body");return t.innerHTML=e,t.childNodes[0]}(e)}function Rt(e,t){var n,r,i=e.nodeName,o=t.nodeName;return i===o||(n=i.charCodeAt(0),r=o.charCodeAt(0),n<=90&&r>=97?i===o.toUpperCase():r<=90&&n>=97&&o===i.toUpperCase())}function Dt(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var Bt={OPTION:function(e,t){var n=e.parentNode;if(n){var r=n.nodeName.toUpperCase();"OPTGROUP"===r&&(r=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==r||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}Dt(e,t,"selected")},INPUT:function(e,t){Dt(e,t,"checked"),Dt(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var r=e.firstChild;if(r){var i=r.nodeValue;if(i==n||!n&&i==e.placeholder)return;r.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,r,i=-1,o=0,a=e.firstChild;a;)if("OPTGROUP"===(r=a.nodeName&&a.nodeName.toUpperCase()))(a=(n=a).firstChild)||(a=n.nextSibling,n=null);else{if("OPTION"===r){if(a.hasAttribute("selected")){i=o;break}o++}!(a=a.nextSibling)&&n&&(a=n.nextSibling,n=null)}e.selectedIndex=i}}};function Ft(){}function Kt(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var qt=function(e){return function(t,n,r){if(r||(r={}),"string"==typeof n)if("#document"===t.nodeName||"HTML"===t.nodeName){var i=n;(n=jt.createElement("html")).innerHTML=i}else if("BODY"===t.nodeName){var o=n;(n=jt.createElement("html")).innerHTML=o;var a=n.querySelector("body");a&&(n=a)}else n=Ut(n);else 11===n.nodeType&&(n=n.firstElementChild);var s=r.getNodeKey||Kt,l=r.onBeforeNodeAdded||Ft,u=r.onNodeAdded||Ft,c=r.onBeforeElUpdated||Ft,d=r.onElUpdated||Ft,f=r.onBeforeNodeDiscarded||Ft,v=r.onNodeDiscarded||Ft,h=r.onBeforeElChildrenUpdated||Ft,p=r.skipFromChildren||Ft,g=r.addChild||function(e,t){return e.appendChild(t)},m=!0===r.childrenOnly,y=Object.create(null),b=[];function w(e){b.push(e)}function S(e,t){if(1===e.nodeType)for(var n=e.firstChild;n;){var r=void 0;t&&(r=s(n))?w(r):(v(n),n.firstChild&&S(n,t)),n=n.nextSibling}}function x(e,t,n){!1!==f(e)&&(t&&t.removeChild(e),v(e),S(e,n))}function k(e){if(1===e.nodeType||11===e.nodeType)for(var t=e.firstChild;t;){var n=s(t);n&&(y[n]=t),k(t),t=t.nextSibling}}function E(e){u(e);for(var t=e.firstChild;t;){var n=t.nextSibling,r=s(t);if(r){var i=y[r];i&&Rt(t,i)?(t.parentNode.replaceChild(i,t),_(i,t)):E(t)}else E(t);t=n}}function _(t,n,r){var i=s(n);if(i&&delete y[i],!r){var o=c(t,n);if(!1===o)return;if(o instanceof HTMLElement&&k(t=o),e(t,n),d(t),!1===h(t,n))return}"TEXTAREA"!==t.nodeName?function(e,t){var n,r,i,o,a,u=p(e,t),c=t.firstChild,d=e.firstChild;e:for(;c;){for(o=c.nextSibling,n=s(c);!u&&d;){if(i=d.nextSibling,c.isSameNode&&c.isSameNode(d)){c=o,d=i;continue e}r=s(d);var f=d.nodeType,v=void 0;if(f===c.nodeType&&(1===f?(n?n!==r&&((a=y[n])?i===a?v=!1:(e.insertBefore(a,d),r?w(r):x(d,e,!0),r=s(d=a)):v=!1):r&&(v=!1),(v=!1!==v&&Rt(d,c))&&_(d,c)):3!==f&&8!=f||(v=!0,d.nodeValue!==c.nodeValue&&(d.nodeValue=c.nodeValue))),v){c=o,d=i;continue e}r?w(r):x(d,e,!0),d=i}if(n&&(a=y[n])&&Rt(a,c))u||g(e,a),_(a,c);else{var h=l(c);!1!==h&&(h&&(c=h),c.actualize&&(c=c.actualize(e.ownerDocument||jt)),g(e,c),E(c))}c=o,d=i}!function(e,t,n){for(;t;){var r=t.nextSibling;(n=s(t))?w(n):x(t,e,!0),t=r}}(e,d,r);var m=Bt[e.nodeName];m&&m(e,t)}(t,n):Bt.TEXTAREA(t,n)}k(t);var A,T,O=t,C=O.nodeType,P=n.nodeType;if(!m)if(1===C)1===P?Rt(t,n)||(v(t),O=function(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}(t,(A=n.nodeName,(T=n.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==T?jt.createElementNS(T,A):jt.createElement(A)))):O=n;else if(3===C||8===C){if(P===C)return O.nodeValue!==n.nodeValue&&(O.nodeValue=n.nodeValue),O;O=n}if(O===n)v(t);else{if(n.isSameNode&&n.isSameNode(O))return;if(_(O,n,m),b)for(var M=0,I=b.length;M<I;M++){var N=y[b[M]];N&&x(N,N.parentNode,!1)}}return!m&&O!==t&&t.parentNode&&(O.actualize&&(O=O.actualize(t.ownerDocument||jt)),t.parentNode.replaceChild(O,t)),O}}(function(e,t){var n,r,i,o,a=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var s=a.length-1;s>=0;s--)r=(n=a[s]).name,i=n.namespaceURI,o=n.value,i?(r=n.localName||r,e.getAttributeNS(i,r)!==o&&("xmlns"===n.prefix&&(r=n.name),e.setAttributeNS(i,r,o))):e.getAttribute(r)!==o&&e.setAttribute(r,o);for(var l=e.attributes,u=l.length-1;u>=0;u--)r=(n=l[u]).name,(i=n.namespaceURI)?(r=n.localName||r,t.hasAttributeNS(i,r)||e.removeAttributeNS(i,r)):t.hasAttribute(r)||e.removeAttribute(r)}});function Wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function zt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Wt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ht(){return Ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ht.apply(null,arguments)}var Jt=["selector","action","value","attribute","shadowHosts"],Gt=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Xt={revert:function(){}},Qt=new Map,$t=[],Zt=new Set,Yt=new Set,en=!1,tn=1;function nn(e){for(var t,n=document,r=zt(null!=e?e:[]);!(t=r()).done;){var i=t.value,o=n.querySelector(i);if(null==o||!o.shadowRoot)return null;n=o.shadowRoot}return n}function rn(e){var t=nn(e.shadowHosts);return t?{root:t,elements:Array.from(t.querySelectorAll(e.selector))}:{root:document,elements:[]}}function on(e){return rn(e).elements}function an(e,t,n,r){void 0===n&&(n={childList:!0,subtree:!0,attributes:!0,characterData:!0});var i=[],o=new WeakSet,a=!1,s=!1,l=function(e){var o=e instanceof ShadowRoot,l=new MutationObserver(function(n,i){if(s)for(var a=Yt.size>0?Array.from(Yt).join(","):"",l=0;l<n.length;l++)for(var c=n[l].addedNodes,d=0;d<c.length;d++){var f=c[d];f.nodeType===Node.ELEMENT_NODE&&u(f,a)}o&&r?r(e):t(n,i)});l.__params=[e,n],i.push(l),a||l.observe(e,n)},u=function(e,t){if(t){e instanceof Element&&e.matches(t)&&e.shadowRoot&&!o.has(e.shadowRoot)&&(o.add(e.shadowRoot),l(e.shadowRoot),u(e.shadowRoot,t));for(var n=e.querySelectorAll(t),r=0;r<n.length;r++){var i=n[r];i.shadowRoot&&!o.has(i.shadowRoot)&&(o.add(i.shadowRoot),l(i.shadowRoot),u(i.shadowRoot,t))}}};return l(e),{disconnect:function(){for(var e=0,t=i;e<t.length;e++){t[e].disconnect()}i.length=0},pause:function(){if(!a){a=!0;for(var e=0,t=i;e<t.length;e++){t[e].disconnect()}}},resume:function(){if(a){a=!1;for(var e=0,t=i;e<t.length;e++){var n=t[e];n.__params&&n.observe.apply(n,n.__params)}}},enableShadowAwareness:function(){s=!0;var t=Yt.size>0?Array.from(Yt).join(","):"";t&&(e.nodeType===Node.ELEMENT_NODE?u(e,t):e===document&&u(document.documentElement,t))}}}function sn(e){return"html"===e?{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[e]}}function ln(e){var t=Qt.get(e);return t||(t={element:e,attributes:{}},Qt.set(e,t)),t}function un(e,t){return e.parentNode===t.parentNode&&e.insertBeforeNode===t.insertBeforeNode}function cn(e,t){Zt.add(e),e.__params=t,en||e.observe.apply(e,e.__params)}function dn(e,t,n,r,i){var o,a=n(e),s=function(e,t){Jn(),i(e,t),Gn()},l={isDirty:!1,originalValue:a,virtualValue:a,mutations:[],el:e,rateLimitCount:0,observer:new MutationObserver(function(r){if(!(l.rateLimitCount>=10))if(l.rateLimitCount++,setTimeout(function(){l.rateLimitCount=l.rateLimitCount-1,l.rateLimitCount<=0&&(l.rateLimitCount=0)},1e3),"html"!==t){var i=n(e);if("position"===t||"insert"===t){if(un(i,l.virtualValue))return;var o=l.mutations.at(-1);if(!o)return;if(Dn(l.virtualValue.parentNode,o))return}i!==l.virtualValue&&("position"!==t&&"insert"!==t&&(l.originalValue=i),s(l))}else{var a=l.modifiedNodes;Jn();for(var u=function(){var t=r[c],n=t.target,i=t.type,o=t.oldValue;if("childList"===i)return null!=a&&a.has(n)?(t.removedNodes.forEach(function(e){n.insertBefore(e,t.nextSibling)}),t.addedNodes.forEach(function(e){e.remove()}),0):0;if("characterData"===i){var s=n.parentNode;return null!==s&&null!=a&&a.has(s)?(n.nodeValue=o,0):0}if("attributes"===i&&n instanceof Element){if(n===e)return 0;if(null==a||!a.has(n))return 0;var l=t.attributeName;if(!l)return 0;null===o?n.removeAttribute(l):n.setAttribute(l,o)}},c=r.length-1;c>=0;c--)u();Gn()}}),mutationRunner:s,setValue:r,getCurrentValue:n};return"html"===t&&(l.originalValue=e.cloneNode(!0),l.discardStacks=[]),o="position"===t||"insert"===t?[e.parentNode||document,{childList:!0,subtree:!0,attributes:!1,characterData:!1}]:[e,sn(t)],cn(l.observer,o),l}function fn(e,t){var n=t.getCurrentValue(t.el);t.virtualValue=e,!e||"string"==typeof e||"string"==typeof n||n instanceof Element||e instanceof Element?e!==n&&(t.isDirty=!0,Un()):n&&un(n,e)||(t.isDirty=!0,Un())}var vn=new DOMParser;function hn(e,t){if(t){var n=t.originalClones.get(e.el);if(!n)return;fn(n,e)}else{var r=e.originalValue.cloneNode(!0),i=r.innerHTML,o=i;if(e.mutations.forEach(function(e){o=e.mutate(o)}),o!==i){var a=vn.parseFromString(o,"text/html").body.childNodes;r.innerHTML="",r.append.apply(r,Array.from(a))}fn(r,e)}}function pn(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach(function(e){return e.mutate(t)}),fn(Array.from(t).filter(Boolean).join(" "),e)}function gn(e){var t=e.originalValue;e.mutations.forEach(function(e){t=e.mutate(t)}),fn(t,e)}function mn(e,t){if("insertSelector"in e){var n,r=e.insertSelector,i=e.direction,o=t.querySelector(r);if(!o)return null;switch(i){case"prepend":n={parentNode:o,insertBeforeNode:o.firstChild};break;case"append":n={parentNode:o,insertBeforeNode:null};break;case"before":n={parentNode:o.parentNode,insertBeforeNode:o};break;case"after":n={parentNode:o.parentNode,insertBeforeNode:o.nextSibling}}return Ht({},n,{insertNode:o,direction:i})}var a=e.parentSelector,s=e.insertBeforeSelector,l=t.querySelector(a);if(!l)return null;var u=s?t.querySelector(s):null;return s&&!u?null:{parentNode:l,insertBeforeNode:u}}function yn(e){for(var t=e.originalValue,n=e.mutations.length-1;n>=0;n--){var r,i=e.mutations[n];if(!i.newPosition||!i.newPosition.parentNode.isConnected||!1===(null==(r=i.newPosition.insertBeforeNode)?void 0:r.isConnected)){var o=nn(i.shadowHosts);i.newPosition=o?mn(i.mutate(),o):null}if(i.newPosition){t=i.newPosition;break}}fn(t,e)}function bn(e,t){var n=t.get(e);if(void 0!==n)return n;if(e.id)return e.id;for(var r=e.parentElement,i=bn(r,t),o=new Map,a=r.firstElementChild;a;){var s=o.get(a.tagName)||0;o.set(a.tagName,s+1),a.id||t.set(a,i+" "+a.tagName+":"+s),a=a.nextElementSibling}return t.get(e)||""}var wn=function(e){return e},Sn=function(e,t,n){var r,i,o,a,s,l,u=(null!=(r=null==(i=n.discardStacks)?void 0:i.length)?r:0)>(null!=(o=n.mutations.length)?o:0);u?a=(null==(s=n.discardStacks)?void 0:s.pop())||new Map:(a=new Map,null==(l=n.discardStacks)||l.push(a));n.modifiedNodes=new WeakSet([e]);var c=new WeakMap([[e,""],[t,""]]);!function(e,t){var n=e.querySelector("svg");if(n)for(var r=n.getAttributeNode("xmlns"),i=null==r?void 0:r.namespaceURI,o=t.querySelectorAll("svg"),a=0;a<o.length;a++){var s=o[a].getAttributeNode("xmlns");(null==s?void 0:s.namespaceURI)!==i&&(s&&o[a].removeAttributeNode(s),r&&(i?o[a].setAttributeNS(i,"xmlns",r.value):o[a].setAttribute("xmlns",r.value)))}}(e,t),qt(e,t,{childrenOnly:!0,getNodeKey:function(e){return e.nodeType!==Node.ELEMENT_NODE?"":bn(e,c)},onBeforeElUpdated:function(e,t){var r;return!e.isEqualNode(t)&&(null==(r=n.modifiedNodes)||r.add(e),!0)},onNodeAdded:function(e){var t,r;e.parentNode&&(null==(t=n.modifiedNodes)||t.add(e.parentNode),null==(r=n.modifiedNodes)||r.add(e));return e},addChild:function(e,t){var n,r;u&&t.nodeType===Node.ELEMENT_NODE&&null!=(n=a.get(e))&&n.length?(e.appendChild(null==(r=a.get(e))?void 0:r.shift()),t.remove()):e.appendChild(t)},onBeforeNodeDiscarded:function(e){var t,r,i=e.parentNode;i&&(null==(t=n.modifiedNodes)||t.add(i),e.nodeType===Node.ELEMENT_NODE&&(e.__removedByDomMutator__=!0,u||(a.has(i)||a.set(i,[]),null==(r=a.get(i))||r.push(e))));return!0}})};function xn(e){var t=ln(e);return t.html||(t.html=dn(e,"html",wn,Sn,hn)),t.html}var kn=function(e){return{parentNode:e.parentNode,insertBeforeNode:e.nextSibling}},En=function(e,t,n){if("insertNode"in t){t.insertNode[t.direction](e),t.insertBeforeNode=e.nextSibling||null}else{if(t.insertBeforeNode&&!t.parentNode.contains(t.insertBeforeNode))return;t.parentNode.insertBefore(e,t.insertBeforeNode)}null!=n&&n.__params&&(n.disconnect(),cn(n,[e.parentNode,n.__params[1]]))};function _n(e){var t=ln(e);return t.position||(t.position=dn(e,"position",kn,An,yn)),t.position}var An=function(e,t){var n;En(e,t,null==(n=ln(e).position)?void 0:n.observer)},Tn=function(e,t){var n;En(e,t,null==(n=ln(e).insert)?void 0:n.observer)};function On(e){var t=ln(e);return t.insert||(t.insert=dn(e,"insert",kn,Tn,yn)),t.insert}var Cn=function(e,t){t?e.className=t:e.removeAttribute("class")},Pn=function(e){return e.className};function Mn(e){var t=ln(e);return t.classes||(t.classes=dn(e,"class",Pn,Cn,pn)),t.classes}var In=function(e){return function(t){var n;return"style"===e?t.style.cssText:null!=(n=t.getAttribute(e))?n:null}},Nn=function(e){return function(t,n){null!==n?"style"===e?n?t.style.cssText=n:t.removeAttribute("style"):t.setAttribute(e,n):t.removeAttribute(e)}};function jn(e,t){var n=ln(e);return n.attributes[t]||(n.attributes[t]=dn(e,t,In(t),Nn(t),gn)),n.attributes[t]}function Vn(e,t,n){if(n.isDirty){n.isDirty=!1;var r=n.virtualValue;n.mutations.length||function(e,t){var n,r=Qt.get(e);if(r){var i,o;if("html"===t)i=null==(o=r.html)?void 0:o.observer,delete r.html;else if("class"===t){var a;i=null==(a=r.classes)?void 0:a.observer,delete r.classes}else if("position"===t){var s;i=null==(s=r.position)?void 0:s.observer,delete r.position}else if("insert"===t){var l;i=null==(l=r.insert)?void 0:l.observer,delete r.insert}else{var u;i=null==(u=r.attributes)||null==(u=u[t])?void 0:u.observer,delete r.attributes[t]}null==(n=i)||n.disconnect(),Zt.delete(i)}}(e,t),n.setValue(e,r,n)}}function Ln(e,t){e.insert&&Vn(t,"insert",e.insert),e.html&&Vn(t,"html",e.html),e.classes&&Vn(t,"class",e.classes),e.position&&Vn(t,"position",e.position),Object.keys(e.attributes).forEach(function(n){Vn(t,n,e.attributes[n])})}function Un(){Qt.forEach(Ln)}function Rn(e,t){var n=null;"html"===e.kind?(n=xn(t),e.originalClones.set(t,t.cloneNode(!0))):"class"===e.kind?n=Mn(t):"attribute"===e.kind?n=jn(t,e.attribute):"position"===e.kind?n=_n(t):"insert"===e.kind&&(n=On(t)),n&&(n.mutations.push(e),n.mutationRunner(n),t.__mutationRecord__=ln(t))}function Dn(e,t){for(var n=t._priority||0,r=e;r;){var i;if(((null==(i=Qt.get(r))||null==(i=i.html)||null==(i=i.mutations.at(-1))?void 0:i._priority)||0)>n)return!0;r=r.parentElement}return!1}function Bn(e){var t=Array.from(e.elements);if(!t.some(function(e){return e.isConnected})){if(t.length>0){for(var n=t.at(-1);n.parentElement;)n=n.parentElement;if(n.__removedByDomMutator__)return}var r=new Set(e.elements),i="insert"===e.kind?function(e){if(!e.newPosition&&e.elements.size>0)return[];var t=vn.parseFromString(e.html(),"text/html").body.firstElementChild;return e.elements.clear(),t?[t]:[]}(e):on(e);i.forEach(function(t){r.has(t)||Dn(t.parentElement,e)||(e.elements.add(t),Rn(e,t))})}}function Fn(e){var t=$t.indexOf(e);if(-1!==t){for(var n=[],r=Jn(!0),i=$t.length-1;i>t;i--){var o=$t[i];if("position"===o.kind||"insert"===o.kind){var a=o.newPosition;if(a){var s=!("direction"in a)||"before"===a.direction,l=Kn(a.insertBeforeNode,e.elements,s);if(a.insertBeforeNode=l,"insertNode"in a)if("before"===a.direction)null===l?(a.insertNode=a.parentNode,a.direction="append"):a.insertNode=l;else if("after"===a.direction){var u,c=new Set(Array.from(e.elements).concat(Array.from(o.elements))),d=qn((null==(u=a.insertBeforeNode)?void 0:u.previousElementSibling)||a.parentNode.lastElementChild,c);null===d?(a.direction="prepend",a.insertNode=a.parentNode):a.insertNode=d}}}n.push(o),Fn(o)}e.elements.forEach(function(t){return function(e,t){var n=null;if("html"===e.kind?n=xn(t):"class"===e.kind?n=Mn(t):"attribute"===e.kind?n=jn(t,e.attribute):"position"===e.kind?n=_n(t):"insert"===e.kind&&(n=On(t)),n){var r=n.mutations.indexOf(e);-1!==r&&n.mutations.splice(r,1),e.rollback&&(n.originalValue=e.rollback(n.originalValue)),n.mutationRunner(n,e)}}(e,t)}),$t.splice(t,1),r();for(var f=function(){var e=n.pop();if(!e)return 1;$n(e),e.elements.forEach(function(t){return Rn(e,t)})};n.length>0;)f()}}function Kn(e,t,n){for(var r=e;r instanceof Element&&t.has(r);)r=n?r.nextElementSibling:r.nextSibling;return r}function qn(e,t){for(var n=e;n instanceof Element&&t.has(n);)n=n.previousElementSibling;return n}function Wn(){$t.forEach(Bn)}function zn(e){for(var t=0;t<$t.length;t++){var n=$t[t];if(n.shadowHosts&&0!==n.shadowHosts.length){for(var r,i=document,o=!1,a=zt(n.shadowHosts);!(r=a()).done;){var s=r.value,l=i.querySelector(s);if(null==l||!l.shadowRoot)break;if((i=l.shadowRoot)===e){o=!0;break}}o&&Bn(n)}}}var Hn=!1;function Jn(e){var t;return void 0===e&&(e=!1),en=!0,Zt.forEach(function(e){return e.disconnect()}),null==(t=Xn)||t.pause(),e&&!Hn?(Hn=!0,function(){Hn=!1,Gn()}):function(){}}function Gn(){var e;en&&!Hn&&(en=!1,Zt.forEach(function(e){return e.__params&&e.observe.apply(e,e.__params)}),null==(e=Xn)||e.resume(),Wn())}var Xn=null;function Qn(){"undefined"!=typeof document&&(Wn(),Xn||(Xn=an(document.documentElement,function(){Wn()},{childList:!0,subtree:!0,attributes:!1,characterData:!1},zn),$t.some(function(e){return e.shadowHosts&&e.shadowHosts.length>0})&&Xn.enableShadowAwareness(),en&&Xn.pause()))}function $n(e){if("undefined"==typeof document)return Xt;var t;e.shadowHosts&&e.shadowHosts.length>0&&(Yt.add(e.shadowHosts[0]),null==(t=Xn)||t.enableShadowAwareness());return e._priority=tn++,$t.push(e),Bn(e),{__mutation:e,revert:function(){Fn(e)}}}function Zn(e,t,n){return $n({kind:"html",elements:new Set,mutate:t,selector:e,originalClones:new WeakMap,shadowHosts:n})}function Yn(e,t,n){return $n({kind:"position",elements:new Set,mutate:t,selector:e,shadowHosts:n})}function er(e,t,n){return $n({kind:"insert",elements:new Set,selector:"",mutate:e,html:t,shadowHosts:n})}function tr(e,t,n,r){return $n({kind:"class",elements:new Set,mutate:t,selector:e,shadowHosts:r,rollback:n})}function nr(e,t,n,r,i){return Gt.test(t)?"class"===t||"className"===t?tr(e,function(e){var t=n(Array.from(e).join(" "));e.clear(),t&&t.split(/\s+/g).filter(Boolean).forEach(function(t){return e.add(t)})},r,i):$n({kind:"attribute",attribute:t,elements:new Set,mutate:n,selector:e,shadowHosts:i,rollback:r}):Xt}Qn();var rr={html:Zn,classes:tr,attribute:nr,position:Yn,insert:er,declarative:function(e){if("insert"===e.action){var t,n=e.value,r=e.shadowHosts;if("insertSelector"in e){var i=e.insertSelector,o=e.direction;t={insertSelector:i,direction:o}}else{if(!("parentSelector"in e))return Xt;var a=e.parentSelector,s=e.insertBeforeSelector;t={parentSelector:a,insertBeforeSelector:s}}return er(function(){return t},function(){return null!=n?n:""},r)}var l=e.selector,u=e.action,c=e.value,d=e.attribute,f=e.shadowHosts,v=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,Jt);if("html"===d){if("append"===u)return Zn(l,function(e){return e+(null!=c?c:"")},f);if("set"===u)return Zn(l,function(){return null!=c?c:""},f)}else if("class"===d){if("append"===u)return tr(l,function(e){c&&e.add(c)},function(e){if(c&&e){var t=new Set(e.split(/\s+/).filter(Boolean));return t.delete(c),Array.from(t).join(" ")}return e},f);if("remove"===u)return tr(l,function(e){c&&e.delete(c)},void 0,f);if("set"===u)return tr(l,function(e){e.clear(),c&&e.add(c)},void 0,f)}else if("position"===d){if("set"===u){if("insertSelector"in v)return Yn(l,function(){return{insertSelector:v.insertSelector,direction:v.direction}},f);if("parentSelector"in v)return Yn(l,function(){return{insertBeforeSelector:v.insertBeforeSelector,parentSelector:v.parentSelector}},f)}}else{var h=c||"";if("append"===u)return"style"===d?nr(l,d,function(e){return e?e+h:h},function(e){if(null===e)return null;var t=e.lastIndexOf(h);return-1!==t?e.substring(0,t)+e.substring(t+h.length):e},f):nr(l,d,function(e){return null!==e?e+h:h},void 0,f);if("set"===u)return nr(l,d,function(){return h},void 0,f);if("remove"===u)return nr(l,d,function(){return null},void 0,f)}return Xt}},ir={observeShadowAwareMutations:an,outermostShadowHostSelectors:Yt},or=Object.freeze({__proto__:null,default:rr,_testing:ir,connectGlobalObserver:Qn,disconnectGlobalObserver:function(){var e;null==(e=Xn)||e.disconnect(),Xn=null},isGlobalObserverPaused:function(){return en},pauseGlobalObserver:Jn,resolveScope:rn,resolveTargets:on,resumeGlobalObserver:Gn,validAttributeName:Gt}),ar=function(){function e(e){this.eventStorage=e,this.evaluationEngine=new H}return e.prototype.evaluate=function(e){var t,n;try{for(var r=i(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(this.evaluateAndGroup(a))return!0}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!1},e.prototype.evaluateAndGroup=function(e){var t,n;try{for(var r=i(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(!this.evaluateConditionSet(a))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},e.prototype.evaluateConditionSet=function(e){var t=this.evaluateCondition(e.condition);return e.negated?!t:t},e.prototype.evaluateCondition=function(e){var t=this,n=this.eventStorage.getEventsInTimeWindow(e.event_type,e.time_type,e.time_value,e.interval).filter(function(n){return t.evaluatePropertyFilters(n,e.event_props||[])}).length;return this.evaluateCountOperator(n,e.op,e.value)},e.prototype.evaluatePropertyFilters=function(e,t){if(!t||0===t.length)return!0;var n={context:e.properties,result:{}};return this.evaluationEngine.evaluateConditions(n,[t])},e.prototype.evaluateCountOperator=function(e,t,n){switch(t){case x:return e>=n;case S:return e>n;case p:return e===n;case b:return e<n;case w:return e<=n;case g:return e!==n;default:return!1}},e}(),sr=function(){function e(e,t,n){var r=this;this.debouncedWriteTimeout=null,this.hasPendingWrites=!1,this.handleBeforeUnload=function(){r.flushToLocalStorage()},this.handleVisibilityChange=function(){"hidden"===document.visibilityState&&r.flushToLocalStorage()},this.storageKey="EXP_".concat(e.slice(0,10),"_rtbt_events"),this.sessionManager=t,this.persistedEvents=n,this.memoryCache=this.loadFromLocalStorage(),this.setupFlushHandlers()}return e.prototype.addEvent=function(t,n,r){if(void 0===n&&(n={}),!this.persistedEvents||this.persistedEvents.has(t)){var i=this.sessionManager.getOrCreateSessionId(),o={id:this.memoryCache.nextId++,event_type:t,timestamp:null!=r?r:Date.now(),session_id:i,properties:n};this.memoryCache.events.push(o),this.memoryCache.events.length>e.MAX_EVENTS&&(this.memoryCache.events=this.memoryCache.events.slice(-e.MAX_EVENTS)),this.scheduleDebouncedWrite()}},e.prototype.getAllEvents=function(){return this.memoryCache.events},e.prototype.getEventsByType=function(e){return this.memoryCache.events.filter(function(t){return t.event_type===e})},e.prototype.getEventsInTimeWindow=function(e,t,n,r){var i=this.memoryCache.events.filter(function(t){return t.event_type===e});if("current_session"===t){var o=this.sessionManager.getOrCreateSessionId();i=i.filter(function(e){return e.session_id===o})}else{var a=Date.now()-("day"===r?24*n*60*60*1e3:60*n*60*1e3);i=i.filter(function(e){return e.timestamp>=a})}return i},e.prototype.clearEvents=function(){this.memoryCache={events:[],nextId:1},this.hasPendingWrites=!0,this.flushToLocalStorage()},e.prototype.flush=function(){this.flushToLocalStorage()},e.prototype.getEventCount=function(e){return this.getEventsByType(e).length},e.prototype.getEventCountInTimeWindow=function(e,t,n,r){return this.getEventsInTimeWindow(e,t,n,r).length},e.prototype.loadFromLocalStorage=function(){var e=localStorage.getItem(this.storageKey);if(e)try{var t=JSON.parse(e);return t&&"object"==typeof t&&Array.isArray(t.events)&&"number"==typeof t.nextId?t:{events:[],nextId:1}}catch(e){return{events:[],nextId:1}}return{events:[],nextId:1}},e.prototype.scheduleDebouncedWrite=function(){var t=this;this.hasPendingWrites=!0,this.debouncedWriteTimeout&&clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=setTimeout(function(){t.flushToLocalStorage()},e.DEBOUNCE_MS)},e.prototype.flushToLocalStorage=function(){if(this.hasPendingWrites)try{localStorage.setItem(this.storageKey,JSON.stringify(this.memoryCache)),this.hasPendingWrites=!1,this.debouncedWriteTimeout&&(clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=null)}catch(e){}},e.prototype.setupFlushHandlers=function(){window.addEventListener("beforeunload",this.handleBeforeUnload),document.addEventListener("visibilitychange",this.handleVisibilityChange)},e.prototype.cleanup=function(){this.flushToLocalStorage(),this.debouncedWriteTimeout&&(clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=null),window.removeEventListener("beforeunload",this.handleBeforeUnload),document.removeEventListener("visibilitychange",this.handleVisibilityChange)},e.MAX_EVENTS=500,e.DEBOUNCE_MS=500,e}(),lr=function(){function e(e){this.storageKey="EXP_".concat(e.slice(0,10),"_rtbt_session")}return e.prototype.getOrCreateSessionId=function(){if(this.sessionId)return this.sessionId;var e=sessionStorage.getItem(this.storageKey);if(e)try{var t=JSON.parse(e);if(t.sessionId&&"string"==typeof t.sessionId)return this.sessionId=t.sessionId,this.sessionStartTime=t.sessionStartTime,t.sessionId}catch(e){}return this.sessionId=this.generateSessionId(),this.sessionStartTime=Date.now(),sessionStorage.setItem(this.storageKey,JSON.stringify({sessionId:this.sessionId,sessionStartTime:this.sessionStartTime})),this.sessionId},e.prototype.getSessionStartTime=function(){return this.sessionStartTime||this.getOrCreateSessionId(),this.sessionStartTime},e.prototype.generateSessionId=function(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))},e.prototype.clearSession=function(){this.sessionId=void 0,this.sessionStartTime=void 0,sessionStorage.removeItem(this.storageKey)},e}(),ur=function(){function e(e,t){void 0===t&&(t={}),this.matchedBehaviors=new Map,this.eventToBehaviors=new Map,this.rules=t,this.sessionManager=new lr(e),this.buildEventToBehaviorsMap(),this.eventStorage=new sr(e,this.sessionManager,new Set(this.eventToBehaviors.keys())),this.evaluator=new ar(this.eventStorage),this.evaluateAll()}return e.prototype.trackEvent=function(e,t){this.eventStorage.addEvent(e,t),this.evaluateEvent(e)},e.prototype.hasRules=function(e){return!!this.rules[e]},e.prototype.getMatchedBehaviors=function(){return this.matchedBehaviors},e.prototype.cleanup=function(){this.eventStorage.cleanup()},e.prototype.buildEventToBehaviorsMap=function(){var e,t,n,r;for(var a in this.rules){var s=this.rules[a];try{for(var l=(e=void 0,i(Object.entries(s))),u=l.next();!u.done;u=l.next()){var c=o(u.value,2),d=c[0],f=c[1],v=this.extractEventTypes(f);try{for(var h=(n=void 0,i(v)),p=h.next();!p.done;p=h.next()){var g=p.value,m=this.eventToBehaviors.get(g);m||(m=[],this.eventToBehaviors.set(g,m)),m.push({id:d,flagKey:a})}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}}},e.prototype.extractEventTypes=function(e){var t,n,r,o,a=new Set;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var u=l.value;try{for(var c=(r=void 0,i(u)),d=c.next();!d.done;d=c.next()){var f=d.value;"behavior"===f.condition.type&&a.add(f.condition.event_type)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a},e.prototype.evaluateAll=function(){for(var e in this.rules)this.evaluateFlag(e)},e.prototype.evaluateEvent=function(e){var t,n,r=this.eventToBehaviors.get(e);if(r)try{for(var o=i(r),a=o.next();!a.done;a=o.next()){var s=a.value,l=s.id,u=s.flagKey;this.evaluateBehaviorId(u,l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},e.prototype.evaluateFlag=function(e){var t,n,r=this.rules[e];if(r){var a=new Set;try{for(var s=i(Object.entries(r)),l=s.next();!l.done;l=s.next()){var u=o(l.value,2),c=u[0],d=u[1];this.evaluator.evaluate(d)&&a.add(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}a.size>0?this.matchedBehaviors.set(e,a):this.matchedBehaviors.delete(e)}else this.matchedBehaviors.delete(e)},e.prototype.evaluateBehaviorId=function(e,t){var n=this.rules[e];if(n&&n[t]){var r=this.matchedBehaviors.get(e)||new Set,i=n[t];this.evaluator.evaluate(i)?r.add(t):r.delete(t),r.size>0?this.matchedBehaviors.set(e,r):this.matchedBehaviors.delete(e)}},e}();function cr(e,t){var n,r,i,s=new(null!==(i=null===(r=(e.nodeType===Node.DOCUMENT_NODE?e:null!==(n=e.ownerDocument)&&void 0!==n?n:document).defaultView)||void 0===r?void 0:r.CSSStyleSheet)&&void 0!==i?i:CSSStyleSheet);s.replaceSync(t);var l=!1,u=function(){l||(e.adoptedStyleSheets=a(a([],o(e.adoptedStyleSheets),!1),[s],!1),l=!0)};return u(),{revert:function(){l&&(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(function(e){return e!==s}),l=!1)},reapply:u}}var dr,fr=function(e){if(document.body)e();else{var t=be();if(null==t?void 0:t.requestAnimationFrame){var n=function(){document.body?e():t.requestAnimationFrame(n)};t.requestAnimationFrame(n)}else e()}},vr=function(){function e(e){this.modal=null,this.options=e}return e.prototype.show=function(){document.getElementById("amp-preview-modal")||(this.createModal(),this.attachEventListeners())},e.prototype.hide=function(){var e,t;this.modal&&(this.modal.remove(),this.modal=null),null===(t=(e=this.options).onDismiss)||void 0===t||t.call(e)},e.prototype.createModal=function(){var e=this;if(document.body){this.modal=document.createElement("div"),this.modal.id="amp-preview-modal",this.modal.className="amp-preview-modal";var t=document.createElement("div");t.className="amp-preview-modal-container",Object.entries(this.options.flags).forEach(function(e){var n=o(e,2),r=n[0],i=n[1],a=document.createElement("div");a.className="amp-preview-modal-row";var s=document.createElement("div");s.className="amp-preview-modal-icon",s.innerHTML='\n <svg class="amp-preview-modal-icon-img" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.1389 11.4324L18.2087 18.1956H6.04109L11.1109 11.4324V6.02794H13.1389V11.4324ZM16.1402 4H8.10959C7.68372 4 7.45051 4.4867 7.71414 4.82131L9.083 6.53492V10.7632L3.20198 18.6011C2.70514 19.2704 3.1817 20.2235 4.01316 20.2235H20.2366C21.0681 20.2235 21.5447 19.2704 21.0478 18.6011L15.1668 10.7632V6.53492L16.5357 4.82131C16.7993 4.4867 16.5661 4 16.1402 4Z" fill="currentColor"/>\n </svg>\n ';var l=document.createElement("span");l.className="amp-preview-modal-title",l.textContent=r;var u=document.createElement("div");u.className="amp-preview-modal-badge amp-preview-modal-preview-badge",u.innerHTML='\n <svg class="amp-preview-modal-preview-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 6C15.79 6 19.17 8.13 20.82 11.5C19.17 14.87 15.79 17 12 17C8.21 17 4.83 14.87 3.18 11.5C4.83 8.13 8.21 6 12 6ZM12 4C7 4 2.73 7.11 1 11.5C2.73 15.89 7 19 12 19C17 19 21.27 15.89 23 11.5C21.27 7.11 17 4 12 4ZM12 9C13.38 9 14.5 10.12 14.5 11.5C14.5 12.88 13.38 14 12 14C10.62 14 9.5 12.88 9.5 11.5C9.5 10.12 10.62 9 12 9ZM12 7C9.52 7 7.5 9.02 7.5 11.5C7.5 13.98 9.52 16 12 16C14.48 16 16.5 13.98 16.5 11.5C16.5 9.02 14.48 7 12 7Z" fill="currentColor"/>\n </svg>\n Preview Mode\n ';var c=document.createElement("span");c.className="amp-preview-modal-badge amp-preview-modal-variant-badge amp-preview-modal-variant-".concat(i.toLowerCase());var d=document.createElement("span");d.className="amp-preview-modal-variant-dot",c.appendChild(d),c.appendChild(document.createTextNode(i)),a.appendChild(s),a.appendChild(l),a.appendChild(u),a.appendChild(c),t.appendChild(a)});var n=document.createElement("button");n.className="amp-preview-modal-close",n.setAttribute("aria-label","Dismiss preview mode notification"),n.innerHTML="×",this.modal.appendChild(t),this.modal.appendChild(n),this.injectStyles(),requestAnimationFrame(function(){e.modal&&document.body&&document.body.appendChild(e.modal)})}},e.prototype.attachEventListeners=function(){var e=this;if(this.modal){var t=this.modal.querySelector(".amp-preview-modal-close");t&&t.addEventListener("click",function(){return e.hide()})}},e.prototype.injectStyles=function(){if(!dr){dr=cr(document,"\n .amp-preview-modal {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 10000;\n background-color: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.4;\n color: #2d3748;\n animation: amp-preview-modal-slide-in 0.3s ease-out;\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 12px 16px;\n max-width: 600px;\n }\n\n @keyframes amp-preview-modal-slide-in {\n from {\n transform: translateX(100%);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n\n .amp-preview-modal-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n\n .amp-preview-modal-row {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .amp-preview-modal-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .amp-preview-modal-icon-img {\n width: 16px;\n height: 16px;\n color: #718096;\n }\n\n .amp-preview-modal-title {\n font-weight: 600;\n color: #1a202c;\n font-size: 14px;\n white-space: nowrap;\n max-width: 300px;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /* Base badge styles */\n .amp-preview-modal-badge {\n background-color: #ffffff;\n color: #4a5568;\n padding: 4px 8px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n display: flex;\n align-items: center;\n gap: 6px;\n border: 1px solid #e2e8f0;\n }\n\n .amp-preview-modal-preview-badge {\n color: #718096;\n }\n\n .amp-preview-modal-preview-icon {\n width: 14px;\n height: 14px;\n color: currentColor;\n }\n\n .amp-preview-modal-variant-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: #68d391;\n flex-shrink: 0;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n\n .amp-preview-modal-close {\n background: none;\n border: none;\n cursor: pointer;\n padding: 4px;\n border-radius: 6px;\n color: #a0aec0;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 18px;\n line-height: 1;\n width: 24px;\n height: 24px;\n transition: all 0.2s ease;\n align-self: flex-start;\n }\n\n .amp-preview-modal-close:hover {\n background-color: #f7fafc;\n color: #718096;\n }\n\n .amp-preview-modal-close:focus {\n outline: 2px solid #3182ce;\n outline-offset: 1px;\n }\n\n /* Dark mode support */\n @media (prefers-color-scheme: dark) {\n .amp-preview-modal {\n background-color: #2d3748;\n border-color: #4a5568;\n color: #e2e8f0;\n }\n\n .amp-preview-modal-title {\n color: #f7fafc;\n }\n\n .amp-preview-modal-badge {\n background-color: #2d3748;\n color: #e2e8f0;\n border-color: #4a5568;\n }\n\n .amp-preview-modal-preview-badge {\n color: #a0aec0;\n }\n\n .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n\n .amp-preview-modal-close {\n color: #718096;\n }\n\n .amp-preview-modal-close:hover {\n background-color: #4a5568;\n color: #e2e8f0;\n }\n }\n ")}},e}();function hr(e){var t=new vr(e),n=!1,r=!1,i=function(){n&&r&&t.show()};return fr(function(){n=!0,i()}),setTimeout(function(){r=!0,i()},500),t}var pr=function(){function e(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map}return e.prototype.subscribe=function(e,t,n){void 0===n&&(n=void 0);var r=this.messageToSubscriberGroup.get(e);r||(r={subscribers:[]},this.messageToSubscriberGroup.set(e,r));var i={identifier:n,callback:t};r.subscribers.push(i)},e.prototype.groupSubscribe=function(e,t){this.subscriberGroupCallback.set(e,t),this.messageToSubscriberGroup.has(e)||this.messageToSubscriberGroup.set(e,{subscribers:[]})},e.prototype.publish=function(e,t){var n,r=this.messageToSubscriberGroup.get(e);r&&(t=t||{},r.subscribers.forEach(function(e){e.callback(t)}),null===(n=this.subscriberGroupCallback.get(e))||void 0===n||n(t))},e.prototype.unsubscribeAll=function(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map},e}();var gr=[],mr=!1,yr="not_started",br=null,wr=function(e){var t;if(!0!==e.__AMP_DEBUG)try{mr="true"===(null===(t=e.localStorage)||void 0===t?void 0:t.getItem("amp-ve-debug"))}catch(e){mr=!1}else mr=!0},Sr=function(){return mr},xr=function(e,t){mr&&gr.push({timestamp:Date.now(),event:e,detail:t})},kr=function(e){yr=e},Er=function(e){br=e},_r=function(){var e,n=null!==(e=null==br?void 0:br())&&void 0!==e?e:{flags:{},visualEditor:{isActive:!1},currentUrl:""};return{flags:n.flags,visualEditor:t(t({},n.visualEditor),{messengerState:yr}),events:gr,currentUrl:n.currentUrl,timestamp:Date.now()}};function Ar(e,t){var n,r,o,a,s=[];try{for(var l=i(Object.values(e)),u=l.next();!u.done;u=l.next()){var c=u.value;try{for(var d=(o=void 0,i(Object.values(c))),f=d.next();!f.done;f=d.next()){var v=f.value;t.includes(v.trigger_type)&&s.push(v)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return s}var Tr="amp-device-iframe",Or="amp-overlay-device-iframe-container";function Cr(){try{return"true"===sessionStorage.getItem("amp-visual-editor-mobile-mode")}catch(e){return!1}}function Pr(){return document.getElementById(Tr)}function Mr(e,t){var n=t.location.href;n&&n!==e.location.href&&e.history.replaceState(e.history.state,"",n)}function Ir(e){var t=e.document,n=function(){for(cr(t,"body > *:not(#".concat(Or,"):not(#").concat("overlay-shadow-host",") { display: none !important; }"));t.body.firstChild;)t.body.removeChild(t.body.firstChild);t.body.style.cssText='\n margin: 0;\n padding: 0;\n overflow: auto;\n min-height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fff;\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABZSURBVHgB7dG7DYBADANQJxexAiXSTXw9uyExBih34SOxQhr83Li2ASIiIiIiIpo7QbLW1tms1zijq9puSDaGLxhhuBPaqyKZTFK+/r6AZOJlg8shqv5ccAGZWRnaKiSy9QAAAABJRU5ErkJggg==");\n ';var n=t.createElement("div");n.id=Or,n.style.cssText="\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n ";var r=t.createElement("iframe");r.id=Tr,r.src=e.location.href,r.style.cssText="\n width: ".concat(402,"px;\n height: ").concat(874,"px;\n border: 1px solid #dedfe2;\n border-radius: 20px;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);\n background: #fff;\n transition: all 0.1s ease;\n "),r.addEventListener("load",function(){var t=r.contentWindow;if(t)try{Mr(e,t),function(e,t){var n=t.history,r=function(n){return function(r,i,o){n.call(this,r,i,o),Mr(e,t)}};n.pushState=r(n.pushState.bind(n)),n.replaceState=r(n.replaceState.bind(n)),t.addEventListener("popstate",function(){Mr(e,t)})}(e,t)}catch(e){}}),n.appendChild(r),t.body.appendChild(n)};return new Promise(function(r){if("complete"===t.readyState&&t.body)n(),r();else{var i=function(){"complete"===t.readyState&&t.body?(n(),r()):e.requestAnimationFrame(i)};e.requestAnimationFrame(i)}})}var Nr,jr={observerOptions:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]},debounceMs:100},Vr=function(){function e(n,r,i,s){void 0===i&&(i=[]),void 0===s&&(s={});var l=this;this.mutationObserver=null,this.pendingMutations=[],this.processMutationsImmediately=function(){if(l.mutationObserver)try{l.pendingMutations.length>0&&l.onMutations(l.pendingMutations)}catch(e){}finally{l.pendingMutations=[]}},this.handleMutations=function(t){var n,r;try{var i=t.filter(function(e){return l.shouldProcessMutation(e)});if(0===i.length)return;if(l.pendingMutations.length+i.length>e.MAX_PENDING_MUTATIONS)return(n=l.pendingMutations).push.apply(n,a([],o(i),!1)),l.processMutationsDebounced.cancel(),void l.processMutationsImmediately();(r=l.pendingMutations).push.apply(r,a([],o(i),!1)),l.processMutationsDebounced()}catch(e){}},this.target=n,this.onMutations=r,this.filters=i,this.options=t(t({},jr),s),this.processMutationsDebounced=function(e,t,n){void 0===n&&(n={});var r=null,i=null,s=function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];n.maxWait&&!i&&(i=setTimeout(function(){r&&(clearTimeout(r),r=null),i=null,e.apply(void 0,a([],o(s),!1))},n.maxWait)),r&&clearTimeout(r),r=setTimeout(function(){i&&(clearTimeout(i),i=null),e.apply(void 0,a([],o(s),!1))},t)};return s.cancel=function(){r&&clearTimeout(r),i&&clearTimeout(i),r=null,i=null},s}(this.processMutationsImmediately,this.options.debounceMs,{maxWait:2*this.options.debounceMs})}return e.prototype.shouldProcessMutation=function(e){if(0===this.filters.length)return!0;try{return this.filters.every(function(t){return t(e)})}catch(e){return!1}},e.prototype.cleanup=function(){var e;this.processMutationsDebounced.cancel(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.pendingMutations=[],this.mutationObserver=null},e.prototype.observe=function(){var e=this;return this.mutationObserver&&this.cleanup(),this.mutationObserver=new MutationObserver(this.handleMutations),this.mutationObserver.observe(this.target,this.options.observerOptions),function(){e.cleanup()}},e.MAX_PENDING_MUTATIONS=1e3,e}(),Lr=new H,Ur=function(){function e(e,n,r,s,l,u){var c=this;this.pageChangeSubscribers=new Set,this.lastNotifiedActivePages={},this.lastNotifiedActiveBehavioralFlags=new Map,this.intersectionObservers=new Map,this.elementVisibilityState=new Map,this.elementAppearedState=new Set,this.manuallyActivatedPageObjects=new Set,this.targetedElementSelectors=new Set,this.scrolledToObservers=new Map,this.scrolledToElementState=new Map,this.analyticsEventState=new Set,this.maxScrollPercentage=0,this.timeOnPageTimeouts={},this.firedUserInteractions=new Set,this.clickTimeouts=new Map,this.hoverTimeouts=new WeakMap,this.focusTimeouts=new WeakMap,this.userInteractionAbortController=null,this.pageLoadTime=Number.POSITIVE_INFINITY,this.lastPublishedUrl=null,this.debugStateSubscribers=new Set,this.debugDebounceTimer=null,this.setPageObjects=function(e){c.pageObjects=e},this.markUrlAsPublished=function(e){c.lastPublishedUrl=e},this.initSubscriptions=function(){c.setupPageObjectSubscriptions(),c.options.useDefaultNavigationHandler&&c.setupLocationChangePublisher(),c.setupMutationObserverPublisher(),c.setupVisibilityPublisher(),c.setupUserInteractionPublisher(),c.setupExitIntentPublisher(),c.setupScrolledToPublisher(),c.setupTimeOnPagePublisher(),c.setupVisibilityChangeHandler(),c.checkInitialElements()},this.addPageChangeSubscriber=function(e){return c.pageChangeSubscribers.add(e),function(){c.pageChangeSubscribers.delete(e)}},this.addDebugStateSubscriber=function(e){return c.debugStateSubscribers.add(e),function(){c.debugStateSubscribers.delete(e)}},this.scheduleDebugNotification=function(){c.options.isDebugActive&&0!==c.debugStateSubscribers.size&&(null!==c.debugDebounceTimer&&c.globalScope.clearTimeout(c.debugDebounceTimer),c.debugDebounceTimer=c.globalScope.setTimeout(function(){var e,t;c.debugDebounceTimer=null;var n=c.webExperimentClient.getDebugState();try{for(var r=i(c.debugStateSubscribers),o=r.next();!o.done;o=r.next()){(0,o.value)(n)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},100))},this.setupPageObjectSubscriptions=function(){var e,n,r,s,l,u,d,f,v={url_change:new Set};c.behavioralTargetingManager&&(v.analytics_event=new Set);try{for(var h=i(Object.entries(c.pageObjects)),p=h.next();!p.done;p=h.next()){var g=o(p.value,2),m=g[0],y=g[1];try{for(var b=(r=void 0,i(Object.values(y))),w=b.next();!w.done;w=b.next()){var S=w.value;v[S.trigger_type]||(v[S.trigger_type]=new Set),v[S.trigger_type].add(m)}}catch(e){r={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{p&&!p.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}var x=function(e,t){var n,r,o=function(t){c.messageBus.subscribe(t.trigger_type,function(n){var r,i=!!(null===(r=c.webExperimentClient.getActivePages()[e])||void 0===r?void 0:r[t.id]),o=c.isPageObjectActive(t,n);c.webExperimentClient.updateActivePages(e,t,o),o&&!i&&xr("trigger_fired","flag=".concat(e,", page=").concat(t.name||t.id,", ")+"type=".concat(t.trigger_type))})};try{for(var a=(n=void 0,i(Object.values(t))),s=a.next();!s.done;s=a.next()){o(s.value)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}};try{for(var k=i(Object.entries(c.pageObjects)),E=k.next();!E.done;E=k.next()){var _=o(E.value,2);x(m=_[0],y=_[1])}}catch(e){l={error:e}}finally{try{E&&!E.done&&(u=k.return)&&u.call(k)}finally{if(l)throw l.error}}var A=function(e){c.messageBus.groupSubscribe(e,function(n){var r,s,l,u,d="url_change"===e,f="analytics_event"===e;d&&(xr("url_change","navigated to ".concat(c.globalScope.location.href)),c.resetTriggerStates(),c.revertInjections());var h=c.webExperimentClient.getActivePages(),p=!function(e,t){var n,r,o,a,s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;try{for(var u=i(s),c=u.next();!c.done;c=u.next()){var d=c.value,f=e[d],v=t[d];if(!v)return!1;var h=Object.keys(f),p=Object.keys(v);if(h.length!==p.length)return!1;try{for(var g=(o=void 0,i(h)),m=g.next();!m.done;m=g.next()){var y=m.value,b=f[y],w=v[y];if(!w||b.id!==w.id)return!1}}catch(e){o={error:e}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return!0}(h,c.lastNotifiedActivePages),g=null===(l=c.webExperimentClient.behavioralTargetingManager)||void 0===l?void 0:l.getMatchedBehaviors(),m=f&&!function(e,t){var n,r,a,s;if(!e&&t.size>0)return!1;if(e&&e.size!==t.size)return!1;if(!e)return!0;try{for(var l=i(e),u=l.next();!u.done;u=l.next()){var c=o(u.value,2),d=c[0],f=c[1],v=t.get(d);if(!v)return!1;if(f.size!==v.size)return!1;try{for(var h=(a=void 0,i(f)),p=h.next();!p.done;p=h.next()){var g=p.value;if(!v.has(g))return!1}}catch(e){a={error:e}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return!0}(g,c.lastNotifiedActiveBehavioralFlags);if(m&&c.webExperimentClient.updateUserWithBehaviors(),!("updateActivePages"in n&&n.updateActivePages)&&!c.options.isVisualEditorMode&&(p||m||d)){var y;if(d)y=void 0;else{var b=Array.from(v[e]||[]),w=m?Array.from(new Set(a(a([],o(Array.from((null==g?void 0:g.keys())||[])),!1),o(Array.from((null===(u=c.lastNotifiedActiveBehavioralFlags)||void 0===u?void 0:u.keys())||[])),!1))):[];y=Array.from(new Set(a(a([],o(b),!1),o(w),!1)))}if(c.webExperimentClient.applyVariants({flagKeys:null==y?void 0:y.filter(function(e){return!c.webExperimentClient.previewFlags[e]})}),c.webExperimentClient.isPreviewMode){var S=y?Object.fromEntries(Object.entries(c.webExperimentClient.previewFlags).filter(function(e){var t=o(e,1)[0];return y.includes(t)})):c.webExperimentClient.previewFlags;c.webExperimentClient.previewVariants({keyToVariant:S})}}c.lastNotifiedActivePages=function(e){var n={};for(var r in e)for(var i in n[r]={},e[r])n[r][i]=t({},e[r][i]);return n}(h);try{for(var x=(r=void 0,i(c.pageChangeSubscribers)),k=x.next();!k.done;k=x.next()){(0,k.value)({activePages:h})}}catch(e){r={error:e}}finally{try{k&&!k.done&&(s=x.return)&&s.call(x)}finally{if(r)throw r.error}}(p||d)&&c.scheduleDebugNotification(),m&&g&&(c.lastNotifiedActiveBehavioralFlags=new Map(Array.from(g.entries()).map(function(e){var t=o(e,2),n=t[0],r=t[1];return[n,new Set(r)]})))})};try{for(var T=i(Object.keys(v)),O=T.next();!O.done;O=T.next()){A(O.value)}}catch(e){d={error:e}}finally{try{O&&!O.done&&(f=T.return)&&f.call(T)}finally{if(d)throw d.error}}},this.toggleManualPageObject=function(e,t){t?c.manuallyActivatedPageObjects.add(e):c.manuallyActivatedPageObjects.delete(e),c.messageBus.publish("manual")},this.resetTriggerStates=function(){var e,t,n,r,a,s;xr("trigger_reset","all non-url_change triggers cleared"),c.elementAppearedState.clear(),c.elementVisibilityState.clear(),c.firedUserInteractions.clear(),c.scrolledToElementState.clear(),c.manuallyActivatedPageObjects.clear(),c.maxScrollPercentage=0,c.pageLoadTime=Date.now(),c.analyticsEventState.clear(),c.lastNotifiedActiveBehavioralFlags=new Map;try{for(var l=i(c.clickTimeouts.values()),u=l.next();!u.done;u=l.next()){var d=u.value;c.globalScope.clearTimeout(d)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}c.clickTimeouts.clear();try{for(var f=i(Object.entries(c.pageObjects)),v=f.next();!v.done;v=f.next()){var h=o(v.value,2),p=h[0],g=h[1];try{for(var m=(a=void 0,i(Object.values(g))),y=m.next();!y.done;y=m.next()){var b=y.value;"url_change"!==b.trigger_type&&c.webExperimentClient.updateActivePages(p,b,!1)}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}c.setupTimeOnPagePublisher(),c.checkInitialElements()},this.revertInjections=function(){Object.values(c.webExperimentClient.appliedMutations).forEach(function(e){Object.values(e).forEach(function(e){e[Ii]&&Object.values(e[Ii]).forEach(function(e){var t;null===(t=e.revert)||void 0===t||t.call(e)})})});var e=c.webExperimentClient.appliedMutations;Object.keys(e).forEach(function(t){var n=e[t];Object.keys(n).forEach(function(e){n[e][Ii]&&(delete n[e][Ii],0===Object.keys(n[e]).length&&delete n[e])}),0===Object.keys(n).length&&delete e[t]})},this.updateElementAppearedState=function(e,t){var n,r,o,a;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var u=l.value;if(0===t.length||c.isMutationRelevantToSelector(t,u))try{var d=c.contentDocument.querySelectorAll(u);try{for(var f=(o=void 0,i(Array.from(d))),v=f.next();!v.done;v=f.next()){var h=v.value,p=c.contentWindow.getComputedStyle(h);if("none"!==p.display&&"hidden"!==p.visibility){c.elementAppearedState.add(u);break}}}catch(e){o={error:e}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},this.checkInitialElements=function(){c.updateElementAppearedState(c.targetedElementSelectors,[]),c.messageBus.publish("element_appeared",{mutationList:[]})},this.setupMutationObserverPublisher=function(){if(c.targetedElementSelectors=function(e){var t,n,r,o,a=new Set;try{for(var s=i(Object.values(e)),l=s.next();!l.done;l=s.next()){var u=l.value;try{for(var c=(r=void 0,i(Object.values(u))),d=c.next();!d.done;d=c.next()){var f=d.value;if("element_appeared"===f.trigger_type||"element_visible"===f.trigger_type){var v=(h=f.trigger_value).selector;v&&a.add(v)}else if("scrolled_to"===f.trigger_type){var h;"element"===(h=f.trigger_value).mode&&h.selector&&a.add(h.selector)}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}(c.pageObjects),0!==c.targetedElementSelectors.size){var e=[function(e){return Array.from(c.targetedElementSelectors).some(function(t){return c.isMutationRelevantToSelector([e],t)})}];return new Vr(c.contentDocument.documentElement,function(e){c.updateElementAppearedState(c.targetedElementSelectors,e),c.messageBus.publish("element_appeared",{mutationList:e})},e).observe()}},this.setupVisibilityPublisher=function(){var e,t,n,r,a;if(0!==Ar(c.pageObjects,["element_visible"]).length){try{for(var s=i(Object.values(c.pageObjects)),l=s.next();!l.done;l=s.next()){var u=l.value,d=function(e){if("element_visible"===e.trigger_type){var t=e.trigger_value,n=t.selector,r=null!==(a=t.visibilityRatio)&&void 0!==a?a:0,i="".concat(n,"\0").concat(r);if(c.intersectionObservers.has(i))return"continue";var o=new IntersectionObserver(function(e){e.forEach(function(e){var t=e.intersectionRatio>=r;c.elementVisibilityState.set(i,t),t&&c.messageBus.publish("element_visible")})},{threshold:r});c.intersectionObservers.set(i,o);try{c.contentDocument.querySelectorAll(n).forEach(function(e){o.observe(e)})}catch(e){}}};try{for(var f=(n=void 0,i(Object.values(u))),v=f.next();!v.done;v=f.next()){d(v.value)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}c.messageBus.subscribe("element_appeared",function(e){var t,n,r=e.mutationList,a=function(e,t){var n=o(e.split("\0"),1)[0];if(0===r.length||c.isMutationRelevantToSelector(r,n))try{c.contentDocument.querySelectorAll(n).forEach(function(e){t.observe(e)})}catch(e){}};try{for(var s=i(c.intersectionObservers.entries()),l=s.next();!l.done;l=s.next()){var u=o(l.value,2);a(u[0],u[1])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}})}},this.setupExitIntentPublisher=function(){var e,t,n;c.pageLoadTime=Date.now();var r=Object.values(c.pageObjects).flatMap(function(e){return Object.values(e).filter(function(e){return"exit_intent"===e.trigger_type})});if(0!==r.length){var o=1/0;try{for(var a=i(r),s=a.next();!s.done;s=a.next()){var l=s.value.trigger_value;o=Math.min(o,null!==(n=l.minTimeOnPageMs)&&void 0!==n?n:0)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}var u=function(e){e.clientY<=50&&null===e.relatedTarget&&c.messageBus.publish("exit_intent",{durationMs:Date.now()-c.pageLoadTime})};o>0?c.globalScope.setTimeout(function(){c.contentDocument.addEventListener("mouseleave",u)},o):c.contentDocument.addEventListener("mouseleave",u)}},this.setupLocationChangePublisher=function(){c.globalScope.addEventListener("popstate",function(){var e=c.globalScope.location.href;e!==c.lastPublishedUrl&&(c.lastPublishedUrl=e,c.messageBus.publish("url_change"))});var e,t,n=function(){var e=c.globalScope.location.href;e!==c.lastPublishedUrl&&(c.lastPublishedUrl=e,c.messageBus.publish("url_change"),c.globalScope.webExperiment.previousUrl=e)};e=history.pushState,t=history.replaceState,history.pushState=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=e.apply(this,t);return n(),i},history.replaceState=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=t.apply(this,e);return n(),i}},this.setupUserInteractionPublisher=function(){var e,t,n,r,o,a,s,l;null===(o=c.userInteractionAbortController)||void 0===o||o.abort(),c.userInteractionAbortController=new AbortController;var u=c.userInteractionAbortController.signal,d=new Map,f=new Map,v=new Map;try{for(var h=i(Object.values(c.pageObjects)),p=h.next();!p.done;p=h.next()){var g=p.value;try{for(var m=(n=void 0,i(Object.values(g))),y=m.next();!y.done;y=m.next()){var b=y.value;if("user_interaction"===b.trigger_type){var w=b.trigger_value,S=w.selector,x=w.interactionType,k=w.minThresholdMs;"click"===x?(d.has(S)||d.set(S,new Set),null===(a=d.get(S))||void 0===a||a.add(k||0)):"hover"===x?(f.has(S)||f.set(S,new Set),null===(s=f.get(S))||void 0===s||s.add(k||0)):"focus"===x&&(v.has(S)||v.set(S,new Set),null===(l=v.get(S))||void 0===l||l.add(k||0))}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}0===d.size&&0===f.size&&0===v.size||(d.size>0&&c.setupClickDelegation(d,u),f.size>0&&c.setupHoverDelegation(f,u),v.size>0&&c.setupFocusDelegation(v,u))},this.setupClickDelegation=function(e,t){c.contentDocument.addEventListener("click",function(t){var n,r,a,s,l=t.target;if(l)try{for(var u=i(e),d=u.next();!d.done;d=u.next()){var f=o(d.value,2),v=f[0],h=f[1];try{if(l.closest(v)){var p=function(e){var t="".concat(v,"\0click\0").concat(e);if(c.firedUserInteractions.has(t))return"continue";if(c.clickTimeouts.has(t))return"continue";var n=function(){c.firedUserInteractions.add(t),c.messageBus.publish("user_interaction"),c.clickTimeouts.delete(t)};if(e>0){var r=c.globalScope.setTimeout(n,e);c.clickTimeouts.set(t,r)}else n()};try{for(var g=(a=void 0,i(h)),m=g.next();!m.done;m=g.next()){p(m.value)}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}break}}catch(e){}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}},{signal:t})},this.setupThresholdBasedDelegation=function(e,t,n){c.contentDocument.addEventListener(n.startEvent,function(t){var r,a,s,l,u=t.target;if(u)try{for(var d=i(e),f=d.next();!f.done;f=d.next()){var v=o(f.value,2),h=v[0],p=v[1];try{var g=u.closest(h);if(g){var m=function(e){var t="".concat(h,"\0").concat(n.interactionType,"\0").concat(e);if(c.firedUserInteractions.has(t))return"continue";var r=n.timeoutStorage.get(g);r||(r=new Map,n.timeoutStorage.set(g,r));var i="".concat(h,"\0").concat(e);if(!r.get(i)){var o=function(){c.firedUserInteractions.add(t),c.messageBus.publish("user_interaction"),null==r||r.delete(i)};if(e){var a=c.globalScope.setTimeout(o,e);r.set(i,a)}else o()}};try{for(var y=(s=void 0,i(p)),b=y.next();!b.done;b=y.next()){m(b.value)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(l=y.return)&&l.call(y)}finally{if(s)throw s.error}}break}}catch(e){}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}},{signal:t}),c.contentDocument.addEventListener(n.endEvent,function(t){var r,a,s,l,u=t.target;if(u){var d=t.relatedTarget;try{for(var f=i(e),v=f.next();!v.done;v=f.next()){var h=o(v.value,1)[0];try{var p=u.closest(h);if(p){if(!d||!p.contains(d)){var g=n.timeoutStorage.get(p);if(g){try{for(var m=(s=void 0,i(g.values())),y=m.next();!y.done;y=m.next()){var b=y.value;c.globalScope.clearTimeout(b)}}catch(e){s={error:e}}finally{try{y&&!y.done&&(l=m.return)&&l.call(m)}finally{if(s)throw s.error}}n.timeoutStorage.delete(p)}}break}}catch(e){}}}catch(e){r={error:e}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}},{signal:t})},this.setupHoverDelegation=function(e,t){c.setupThresholdBasedDelegation(e,t,{interactionType:"hover",startEvent:"mouseover",endEvent:"mouseout",timeoutStorage:c.hoverTimeouts})},this.setupFocusDelegation=function(e,t){c.setupThresholdBasedDelegation(e,t,{interactionType:"focus",startEvent:"focusin",endEvent:"focusout",timeoutStorage:c.focusTimeouts})},this.setupTimeOnPagePublisher=function(){var e,t,n,r;Object.values(c.timeOnPageTimeouts).forEach(clearTimeout),c.timeOnPageTimeouts={};var o=new Set;try{for(var a=i(Object.values(c.pageObjects)),s=a.next();!s.done;s=a.next()){var l=s.value;try{for(var u=(n=void 0,i(Object.values(l))),d=u.next();!d.done;d=u.next()){var f=d.value;if("time_on_page"===f.trigger_type){var v=f.trigger_value;o.add(v.durationMs)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}0!==o.size&&c.setUpTimeouts(o)},this.setUpTimeouts=function(e){e.forEach(function(e){c.timeOnPageTimeouts[e]=c.globalScope.setTimeout(function(){c.messageBus.publish("time_on_page",{durationMs:e}),delete c.timeOnPageTimeouts[e]},e)})},this.setupVisibilityChangeHandler=function(){if(0!==Ar(c.pageObjects,["time_on_page"]).length){c.globalScope.document.addEventListener("visibilitychange",function(){if(c.globalScope.document.hidden)Object.values(c.timeOnPageTimeouts).forEach(clearTimeout);else{var e=new Set(Object.keys(c.timeOnPageTimeouts).map(Number));c.setUpTimeouts(e)}})}},this.setupScrolledToPublisher=function(){var e,t,n,r,a=Ar(c.pageObjects,["scrolled_to"]);if(0!==a.length){var s=!1,l=!1;try{for(var u=i(a),d=u.next();!d.done;d=u.next()){var f=d.value.trigger_value;"percent"===f.mode?s=!0:"element"===f.mode&&(l=!0)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}if(s){var v=null,h=function(){var e=c.calculateScrollPercentage();e>c.maxScrollPercentage&&(c.maxScrollPercentage=e,c.messageBus.publish("scrolled_to",{}))};c.contentWindow.addEventListener("scroll",function(){null===v&&(v=c.globalScope.requestAnimationFrame(function(){h(),v=null}))},{passive:!0}),h()}if(l){var p=function(e){if("scrolled_to"===e.trigger_type){var t=e.trigger_value;if("element"===t.mode){var n=t.selector,r=t.offsetPx||0,i="".concat(n,"\0").concat(r);if(c.scrolledToObservers.has(i))return"continue";var o="0px 0px ".concat(r,"px 0px"),a=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(c.scrolledToElementState.set(i,!0),c.messageBus.publish("scrolled_to",{}))})},{rootMargin:o,threshold:0});c.scrolledToObservers.set(i,a);try{c.contentDocument.querySelectorAll(n).forEach(function(e){a.observe(e)})}catch(e){}}}};try{for(var g=i(a),m=g.next();!m.done;m=g.next()){p(m.value)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}c.messageBus.subscribe("element_appeared",function(e){var t,n,r=e.mutationList,a=function(e,t){var n=o(e.split("\0"),1)[0];if(0===r.length||c.isMutationRelevantToSelector(r,n))try{c.contentDocument.querySelectorAll(n).forEach(function(e){t.observe(e)})}catch(e){}};try{for(var s=i(c.scrolledToObservers.entries()),l=s.next();!l.done;l=s.next()){var u=o(l.value,2);a(u[0],u[1])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}})}}},this.isPageObjectActive=function(e,t){var n,r,i,o={page:{url:c.globalScope.location.href}};if(e.conditions&&e.conditions.length>0&&!Lr.evaluateConditions({context:o,result:{}},e.conditions))return!1;switch(e.trigger_type){case"url_change":return!0;case"manual":var a=e.trigger_value;return c.manuallyActivatedPageObjects.has(a.name);case"analytics_event":var s=e.id;if(c.analyticsEventState.has(s))return!0;a=e.trigger_value;var l=t,u={type:"analytics_event",data:{event:l.event,properties:l.properties}},d=Lr.evaluateConditions({context:u,result:{}},a);return d&&c.analyticsEventState.add(s),d;case"element_appeared":var f=(a=e.trigger_value).selector;return c.elementAppearedState.has(f);case"element_visible":f=(a=e.trigger_value).selector;var v=null!==(n=a.visibilityRatio)&&void 0!==n?n:0,h="".concat(f,"\0").concat(v);return null!==(r=c.elementVisibilityState.get(h))&&void 0!==r&&r;case"exit_intent":var p=t.durationMs;return void 0===(a=e.trigger_value).minTimeOnPageMs||p>=a.minTimeOnPageMs;case"user_interaction":a=e.trigger_value;var g="".concat(a.selector,"\0").concat(a.interactionType,"\0").concat(a.minThresholdMs||0);return c.firedUserInteractions.has(g);case"time_on_page":var m=t;a=e.trigger_value;return m.durationMs>=a.durationMs;case"scrolled_to":if("percent"===(a=e.trigger_value).mode)return c.maxScrollPercentage>=a.percentage;if("element"===a.mode){var y=a.offsetPx||0;h="".concat(a.selector,"\0").concat(y);return null!==(i=c.scrolledToElementState.get(h))&&void 0!==i&&i}return!1;default:return!1}},this.webExperimentClient=e,this.messageBus=n,this.pageObjects=r,this.behavioralTargetingManager=s,this.options=l,this.globalScope=u}return Object.defineProperty(e.prototype,"contentDocument",{get:function(){return e=this.globalScope,Cr()&&null!==(n=null===(t=Pr())||void 0===t?void 0:t.contentDocument)&&void 0!==n?n:e.document;var e,t,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentWindow",{get:function(){return e=this.globalScope,Cr()&&null!==(n=null===(t=Pr())||void 0===t?void 0:t.contentWindow)&&void 0!==n?n:e;var e,t,n},enumerable:!1,configurable:!0}),e.prototype.getDebugPageObjects=function(){var e,t,n=this,r={},a=this.webExperimentClient.getActivePages(),s=function(e,t){r[e]=Object.values(t).map(function(t){var r=n.evaluateUrlConditions(t),i=n.buildTriggerDebugInfo(t,e,a);return{id:t.id,name:t.name,urlConditionsPassed:r,triggerPassed:i.passed,trigger:i,overallStatus:r&&i.passed?"pass":"fail"}})};try{for(var l=i(Object.entries(this.pageObjects)),u=l.next();!u.done;u=l.next()){var c=o(u.value,2);s(c[0],c[1])}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}return r},e.prototype.evaluateUrlConditions=function(e){return!e.conditions||0===e.conditions.length||Lr.evaluateConditions({context:{page:{url:this.globalScope.location.href}},result:{}},e.conditions)},e.prototype.buildTriggerDebugInfo=function(e,t,n){var r,i,o;switch(e.trigger_type){case"url_change":return{type:"url_change",passed:!0};case"element_appeared":var a=e.trigger_value.selector;return{type:"element_appeared",passed:this.elementAppearedState.has(a),config:{selector:a}};case"element_visible":var s=e.trigger_value,l=(a=s.selector,s.visibilityRatio),u=null!=l?l:0,c="".concat(a,"\0").concat(u);return{type:"element_visible",passed:null!==(r=this.elementVisibilityState.get(c))&&void 0!==r&&r,config:{selector:a,visibilityRatio:u}};case"manual":var d=e.trigger_value.name;return{type:"manual",passed:this.manuallyActivatedPageObjects.has(d),config:{name:d}};case"analytics_event":return{type:"analytics_event",passed:this.analyticsEventState.has(e.id),config:{conditions:e.trigger_value}};case"user_interaction":var f=e.trigger_value,v=(a=f.selector,f.interactionType),h=f.minThresholdMs||0;c="".concat(a,"\0").concat(v,"\0").concat(h);return{type:"user_interaction",passed:this.firedUserInteractions.has(c),config:{selector:a,interactionType:v,minThresholdMs:h}};case"exit_intent":var p=e.trigger_value.minTimeOnPageMs;return{type:"exit_intent",passed:!!(null===(i=n[t])||void 0===i?void 0:i[e.id]),config:{minTimeOnPageMs:p}};case"time_on_page":var g=e.trigger_value.durationMs,m=Math.max(0,Date.now()-this.pageLoadTime);return{type:"time_on_page",passed:!(g in this.timeOnPageTimeouts),config:{durationMs:g},elapsedMs:m};case"scrolled_to":var y=e.trigger_value;if("percent"===y.mode){var b=y.percentage;return{type:"scrolled_to",passed:this.maxScrollPercentage>=b,config:{mode:"percent",percentage:b},currentPercentage:Math.round(this.maxScrollPercentage)}}a=y.selector;var w=y.offsetPx,S=w||0;c="".concat(a,"\0").concat(S);return{type:"scrolled_to",passed:null!==(o=this.scrolledToElementState.get(c))&&void 0!==o&&o,config:{mode:"element",selector:a,offsetPx:w}};default:return{type:"url_change",passed:!1}}},e.prototype.isMutationRelevantToSelector=function(e,t){var n,r,o,a;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var u=l.value;if(u.addedNodes.length>0)try{for(var c=(o=void 0,i(Array.from(u.addedNodes))),d=c.next();!d.done;d=c.next()){var f=d.value;if(f.nodeType===Node.ELEMENT_NODE)try{var v=f;if(v.matches(t))return!0;if(v.querySelector(t))return!0}catch(e){}}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}if(u.target.nodeType===Node.ELEMENT_NODE)try{var h=u.target;if(h.matches(t))return!0;if(h.querySelector(t))return!0}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!1},e.prototype.calculateScrollPercentage=function(){var e=this.contentWindow.innerHeight,t=this.contentDocument.documentElement.scrollHeight,n=this.contentWindow.scrollY,r=t-e;return r<=0?0:n/r*100},e}(),Rr={useDefaultNavigationHandler:!0},Dr=function(){var e;if(!Nr){var t=be(),n=cr(null!==(e=null==t?void 0:t.document)&&void 0!==e?e:document,"* { visibility: hidden !important; background-image: none !important; }");Nr=n,null==t||t.window.setTimeout(function(){Nr===n&&Br()},1e3)}},Br=function(){var e;null==Nr||Nr.revert(),Nr=void 0;var t=be();null===(e=null==t?void 0:t.document.getElementById("amp-exp-css"))||void 0===e||e.remove()},Fr="AMP",Kr="dclid",qr="fbclid",Wr="gbraid",zr="gclid",Hr="ko_click_id",Jr="li_fat_id",Gr="msclkid",Xr="rdt_cid",Qr="ttclid",$r="twclid",Zr="wbraid",Yr={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},ei="MKTG",ti=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},ni=function(){var e,t=ti();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=ri(n[0]),i=ri(n[1]);return i?(e[r]=i,e):e},{}):{}},ri=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},ii=function(){function e(e,n){void 0===n&&(n={}),this.options=t({},e),this.config=n}return e.prototype.isEnabled=function(){return n(this,void 0,void 0,function(){var n,i,o,a,s=this;return r(this,function(r){switch(r.label){case 0:return n="AMP_TEST",i=t({},this.options),o=new e(i),a=String(Date.now()),[4,o.transaction(n,function(e){var t,r;try{e.set(a);var i=e.get()===a;return!i&&s.config.diagnosticsClient&&(null===(t=s.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:n,testValue:a,sync:!0})),i}catch(e){if(s.config.diagnosticsClient){var o=e instanceof Error?e.message:String(e);null===(r=s.config.diagnosticsClient)||void 0===r||r.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:n,testValue:a,error:o,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,r.sent()]}})})},e.prototype.get=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return t=n.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var n=oi(t);return void 0===n?void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)):JSON.parse(n)}catch(n){return void console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t))}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,o;return n(this,void 0,void 0,function(){var n,a,s,l,u,c,d,f,v;return r(this,function(r){switch(r.label){case 0:n=ti(),a=n,r.label=1;case 1:return r.trys.push([1,4,,5]),(s=null==a?void 0:a.cookieStore)?[4,s.getAll(e)]:[3,3];case 2:if(l=r.sent()){l.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:l.map(function(e){return e.domain})}),null===(o=this.config.diagnosticsClient)||void 0===o||o.increment("cookies.duplicate.occurrence.cookieStore"));try{for(u=i(l),c=u.next();!c.done;c=u.next())if(d=c.value,ai(d.domain,this.options.domain))return[2,d.value]}catch(e){f={error:e}}finally{try{c&&!c.done&&(v=u.return)&&v.call(u)}finally{if(f)throw f.error}}}r.label=3;case 3:return[3,5];case 4:return r.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,n,r=this,i=ti(),o=(null!==(n=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[]).filter(function(t){return 0===t.indexOf(e+"=")}),a=void 0,s=this.config.duplicateResolverFn;if("function"==typeof s&&o.length>1&&(a=o.find(function(t){var n;try{var i=s(t.substring(e.length+1));return i||null===(n=r.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),a||(a=o[0]),a)return a.substring(e.length+1)},e.prototype.set=function(e,t){return n(this,void 0,void 0,function(){return r(this,function(n){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var n;try{var r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,i=null!==t?r:-1,o=void 0;if(i){var a=new Date;a.setTime(a.getTime()+24*i*60*60*1e3),o=a}var s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));o&&(s+="; expires=".concat(o.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite));var l=ti();(null==l?void 0:l.document)&&(l.document.cookie=s)}catch(t){var u=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}},e.prototype.remove=function(e){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return n(this,void 0,void 0,function(){return r(this,function(e){return[2]})})},e.isDomainWritable=function(t){return n(this,void 0,void 0,function(){var n,i;return r(this,function(r){switch(r.label){case 0:if(e.cachedTlds[t])return[2,!0];n="AMP_TLDTEST",i=new e({domain:"."+t}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i.transaction(n,function(n){if(e.cachedTlds[t])return!0;try{n.set(1);var r=!!n.get();return r&&(e.cachedTlds[t]=!0),r}finally{n.set(null)}})];case 2:return[2,!!r.sent()];case 3:return r.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return n(this,void 0,void 0,function(){var n,i,o=this;return r(this,function(r){switch(r.label){case 0:if(n=function(){var e,t=ti();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks}(),i=function(){return t({get:function(){return o.getSync(e)},set:function(t){return o.setSync(e,t)}})},!n)return[2,i()];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),i)];case 2:return[2,r.sent()];case 3:return r.sent(),[2,i()];case 4:return[2]}})})},e.cachedTlds={},e}(),oi=function(e){var t;return null!==(t=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}}(e))&&void 0!==t?t:function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}}(e)},ai=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},si=function(){function e(){}return e.prototype.parse=function(){return n(this,void 0,void 0,function(){return r(this,function(e){return[2,t(t(t(t({},Yr),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=ni();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=ni();return(e={})[Kr]=t[Kr],e[qr]=t[qr],e[Wr]=t[Wr],e[zr]=t[zr],e[Hr]=t[Hr],e[Jr]=t[Jr],e[Gr]=t[Gr],e[Xr]=t[Xr],e[Qr]=t[Qr],e[$r]=t[$r],e[Zr]=t[Zr],e},e}(),li=function(e,t){var n;try{var r=null===(n=di(e))||void 0===n?void 0:n.getItem(t);return r?JSON.parse(r):null}catch(t){return console.warn("Failed to get and parse JSON from ".concat(e,":"),t),null}},ui=function(e,t,n){var r;try{var i=JSON.stringify(n);null===(r=di(e))||void 0===r||r.setItem(t,i)}catch(t){console.warn("Failed to stringify and set JSON in ".concat(e,":"),t)}},ci=function(e,t){var n;try{null===(n=di(e))||void 0===n||n.removeItem(t)}catch(t){console.warn("Failed to remove item from ".concat(e,":"),t)}},di=function(e){var t=be();return t?t[e]:null};function fi(e,a){return n(this,void 0,void 0,function(){var n,s,l,u,c,d,f,v,h,p,g,m,y,b,w,S,x,k,E;return r(this,function(r){switch(r.label){case 0:return n="EXP_".concat(ei,"_").concat(e.substring(0,10)),[4,vi(e)];case 1:s=o.apply(void 0,[r.sent(),2]),l=s[0],u=s[1],c=li("localStorage",n),d={},f=[u,c,l];try{for(v=i(f),h=v.next();!h.done;h=v.next())if(p=h.value)try{for(k=void 0,g=i(Object.entries(p)),m=g.next();!m.done;m=g.next())y=o(m.value,2),b=y[0],w=y[1],b.startsWith("utm_")&&void 0!==w&&(d[b]=w)}catch(e){k={error:e}}finally{try{m&&!m.done&&(E=g.return)&&E.call(g)}finally{if(k)throw k.error}}}catch(e){S={error:e}}finally{try{h&&!h.done&&(x=v.return)&&x.call(v)}finally{if(S)throw S.error}}return Object.keys(d).length>0?(function(e,t){var n="EXP_".concat(ei,"_").concat(e.substring(0,10));ui("localStorage",n,t)}(e,d),[2,t(t({},a),{persisted_url_param:d})]):[2,a]}})})}function vi(e){return n(this,void 0,void 0,function(){var t,n,i,o;return r(this,function(r){switch(r.label){case 0:return t=new ii,n=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[Fr,t,e.substring(0,n)].filter(Boolean).join("_")}(e,ei),[4,(new si).parse()];case 1:return i=r.sent(),[4,t.get(n)];case 2:return o=r.sent(),[2,[i,o]]}})})}var hi,pi="amp-exp-loading",gi=function(){if(!document.getElementById(pi)){var e=document.createElement("div");e.id=pi,hi=setTimeout(function(){mi()},1e4),e.innerHTML="\n <style>\n #".concat(pi," {\n position: fixed;\n inset: 0;\n background: rgba(33, 33, 36, 0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 2147483647;\n }\n\n #").concat(pi," .modal {\n background: white;\n border-radius: 8px;\n padding: 32px 48px;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n }\n\n #").concat(pi," .spinner {\n width: 32px;\n height: 32px;\n border: 3px solid #e5e7eb;\n border-top-color: ").concat("#1e61f0",";\n border-radius: 50%;\n animation: amp-spin 1s linear infinite;\n }\n\n @keyframes amp-spin {\n to { transform: rotate(360deg); }\n }\n\n #").concat(pi,' .text {\n color: #212124;\n font-size: 16px;\n font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n }\n </style>\n\n <div class="modal">\n <div class="spinner"></div>\n <div class="text">Loading Visual Editor</div>\n </div>\n '),fr(function(){document.body&&!document.getElementById(pi)&&void 0!==hi&&document.body.appendChild(e)})}},mi=function(){var e;hi&&(clearTimeout(hi),hi=void 0),null===(e=document.getElementById(pi))||void 0===e||e.remove()},yi=function(){try{var e=be();if(!e)return!0;var t=e.opener;return!t||t.closed}catch(e){return!0}},bi="visual-editor-state",wi=function(){function e(){}return e.setup=function(){var t,n="closed";xr("opener_check",yi()?"FAIL: window.opener is null, closed, or inaccessible":"PASS");var r=e.getStoredSession();if(r)return xr("setup","stored session found, loading ".concat(r.injectSrc)),kr("loading"),n="opening",gi(),void Si(r.injectSrc).then(function(){n="open",kr("loaded"),xr("script_load_success","from stored session")}).catch(function(e){console.warn("Failed to load overlay from stored session:",e),n="closed",kr("error"),xr("script_load_error","from stored session: ".concat((null==e?void 0:e.message)||e)),mi()});xr("setup","no stored session, registering message listener"),kr("waiting"),null===(t=be())||void 0===t||t.addEventListener("message",function(e){var t=/^.*\.amplitude\.com$/;try{if(!e.origin||!t.test(new URL(e.origin).hostname))return void xr("origin_validation","FAIL: ".concat(e.origin||"(empty)"))}catch(t){return void xr("origin_validation","FAIL: exception parsing origin ".concat(e.origin))}if("OpenOverlay"===e.data.type){xr("message_received","origin=".concat(e.origin,", type=OpenOverlay")),xr("origin_validation","PASS");var r=new URL(e.data.context.injectSrc);if("closed"!==n)return void xr("state_guard","rejected: state=".concat(n));if("https:"!==r.protocol||!t.test(r.hostname))return void xr("injectSrc_validation","FAIL: ".concat(r.href));xr("injectSrc_validation","PASS (".concat(r.hostname,")")),kr("loading"),n="opening",gi(),Si(e.data.context.injectSrc).then(function(){n="open",kr("loaded"),xr("script_load_success")}).catch(function(){n="closed",kr("error"),xr("script_load_error","Failed to load ".concat(e.data.context.injectSrc)),mi()})}})},e.getStoredSession=function(){var e=li("sessionStorage",bi);if(!e)return null;try{var t=new URL(e.injectSrc);if("https:"!==t.protocol||!/^.*\.amplitude\.com$/.test(t.hostname))return null}catch(e){return null}return e},e}(),Si=function(e){return new Promise(function(t,n){xr("script_load_start","loading ".concat(e));xr("readyState",document.readyState),fr(function(){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e;var o=document.querySelector("[nonce]");if(o){var a=o.nonce||o.nonce||o.getAttribute("nonce");i.setAttribute("nonce",a),xr("nonce_check","found: ".concat(a))}else xr("nonce_check","not found, skipping");i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(e)})}),null===(r=document.head)||void 0===r||r.appendChild(i)}catch(e){n(e)}})})},xi="amp-exp-opener-severed",ki=function(){var e=document.getElementById(xi);e&&("function"==typeof e.close&&e.open&&e.close(),e.remove())};var Ei=Symbol.for("@amplitude/spa-link-interceptor-initiated");function _i(){if(!window[Ei]){window[Ei]=!0;document.addEventListener("click",function(e){var t,n,r=e.target.closest("a");if(r){var i=r.__mutationRecord__;if(null===(n=null===(t=null==i?void 0:i.attributes)||void 0===t?void 0:t.href)||void 0===n?void 0:n.mutations.length){var o=r.getAttribute("href"),a=r.getAttribute("target");o&&function(e,t,n){var r=n&&"_self"!==n||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button>0,i=new URL(t,window.location.href),o=i.href.split("#")[0]===window.location.href.split("#")[0],a=i.origin===window.location.origin;return!r&&a&&!o}(e,o,a)&&function(e){var t,n,r=Object.keys(e).find(function(e){return e.startsWith("__reactFiber")});return!!r&&String(null===(n=null===(t=e[r])||void 0===t?void 0:t.memoizedProps)||void 0===n?void 0:n.onClick).includes(".defaultPrevented")}(r)&&(e.preventDefault(),function(e){var t,n;if(null===(n=null===(t=window.next)||void 0===t?void 0:t.router)||void 0===n?void 0:n.push)return void window.next.router.push(e);history.pushState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate",{state:history.state}))}(o))}}},!0)}}var Ai=function(){var e,t,n=be(),r=new URLSearchParams(null==n?void 0:n.location.search),a={};try{for(var s=i(r),l=s.next();!l.done;l=s.next()){var u=o(l.value,2),c=u[0],d=u[1];a[c]=d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return a},Ti=function(e){if(!e)return"";var t=new URL(e);return t.search="",t.hash="",t.toString()},Oi=function(e,t){var n,r,o=new URL(e);try{for(var a=i(t),s=a.next();!s.done;s=a.next()){var l=s.value;o.searchParams.delete(l)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o.toString()},Ci=function(e,t){return t=t.replace(/\/$/,""),e.some(function(e){e=(e=(e=e.replace(/\/$/,"")).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).replace(/\\\*/,".*");var n=new RegExp("^".concat(e,"$"));return n.test(t)||n.test(t+"/")})},Pi=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Pi)},Mi="mutate",Ii="inject",Ni="PREVIEW",ji="amp-preview-mode",Vi="VISUAL_EDITOR";ye.Experiment=Nt;var Li=function(){function e(e,n,r){void 0===r&&(r={});var i,o=this;this.appliedInjections=new Set,this.appliedMutations={},this.previousUrl=void 0,this.urlExposureCache={},this.flagVariantMap={},this.localFlagKeys=[],this.remoteFlagKeys=[],this.isRemoteBlocking=!1,this.isRunning=!1,this.activePages={},this.behavioralTargetingRules={},this.isVisualEditorMode=!1,this.isDebugActive=!1,this.isPreviewMode=!1,this.previewFlags={};var a=be();if(!a||!we())throw new Error("Amplitude Web Experiment Client could not be initialized.");this.globalScope=a,this.apiKey=e,this.initialFlags=JSON.parse(n.initialFlags),this.pageObjects=JSON.parse(n.pageObjects),this.behavioralTargetingRules=n.behavioralTargetingRules?JSON.parse(n.behavioralTargetingRules):{},Object.keys(this.behavioralTargetingRules).length>0&&(this.behavioralTargetingManager=new ur(this.apiKey,this.behavioralTargetingRules)),this.config=t(t(t({},Rr),r),null!==(i=this.globalScope.experimentConfig)&&void 0!==i?i:{}),this.initialFlags.forEach(function(e){var t=e.key,n=e.variants,r=e.metadata,i=void 0===r?{}:r;o.flagVariantMap[t]={},Object.keys(n).forEach(function(e){o.flagVariantMap[t][e]=function(e){if(!e)return{};var t=void 0;e.metadata&&(t="string"==typeof e.metadata.experimentKey?e.metadata.experimentKey:void 0);var n={};return e.key&&(n.key=e.key),e.value&&(n.value=e.value),e.payload&&(n.payload=e.payload),t&&(n.expKey=t),e.metadata&&(n.metadata=e.metadata),n}(n[e]),o.flagVariantMap[t][e].metadata={deliveryMethod:"web"}}),"local"!==i.evaluationMode&&o.remoteFlagKeys.push(t)});for(var s=new Set,l=!0;l;)l=!1,this.initialFlags.forEach(function(e){var t;!o.remoteFlagKeys.includes(e.key)&&(null===(t=e.dependencies)||void 0===t?void 0:t.some(function(e){return o.remoteFlagKeys.includes(e)}))&&(o.remoteFlagKeys.push(e.key),s.add(e.key),l=!0)});var u=JSON.stringify(this.initialFlags);this.experimentClient=Mt.initialize(this.apiKey,t({internalInstanceNameSuffix:"web",initialFlags:u,fetchTimeoutMillis:1e3,pollOnStart:!1,fetchOnStart:!1,automaticExposureTracking:!1},this.config));var c=this.experimentClient.all();this.localFlagKeys=Object.keys(c).filter(function(e){var t,n;return"local"===(null===(n=null===(t=c[e])||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.evaluationMode)&&!s.has(e)}),this.messageBus=new pr}return e.prototype.start=function(){return n(this,void 0,void 0,function(){var e,n,a,s,l,u,c,d,f,v,h,p,g,m,y,b,w,S=this;return r(this,function(r){switch(r.label){case 0:if(this.isRunning)return[2];HTMLElement.prototype.removeChild=function(e){return e&&e.parentNode!==this?e:Node.prototype.removeChild.call(this,e)},_i(),e=Ai(),n=!1;try{n=(null===(b=this.globalScope.frameElement)||void 0===b?void 0:b.id)===Tr}catch(e){n=!1}return n&&Cr()?(this.globalScope.ampDomMutator=or,this.isRunning=!0,[2]):(this.isVisualEditorMode="true"===e[Vi]||null!==li("sessionStorage",bi),wr(this.globalScope),this.isDebugActive=Sr(),this.subscriptionManager=new Ur(this,this.messageBus,this.pageObjects,this.behavioralTargetingManager,t(t({},this.config),{isVisualEditorMode:this.isVisualEditorMode,isDebugActive:this.isDebugActive}),this.globalScope),this.setupPreviewMode(e),this.subscriptionManager.initSubscriptions(),Er(function(){return{flags:S.buildFlagDebugInfo(),visualEditor:{isActive:S.isVisualEditorMode,source:S.isVisualEditorMode?null!==li("sessionStorage",bi)?"session_storage":"url_param":null},currentUrl:S.globalScope.location.href}}),this.isVisualEditorMode?(a="true"===e[Vi]?"url_param":"session_storage",xr("ve_mode_detected","source=".concat(a)),yi()?(xr("opener_check","FAIL: window.opener is null, closed, or inaccessible"),kr("error"),function(){if(!document.getElementById(xi)){var e=document.createElement("dialog");e.id=xi,e.setAttribute("role","alertdialog"),e.setAttribute("aria-labelledby","".concat(xi,"-title")),e.innerHTML="\n <style>\n @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600&display=swap');\n\n #".concat(xi,",\n #").concat(xi," * {\n font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;\n }\n #").concat(xi," code {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;\n }\n\n /* Defensive resets — host pages often style h2/h3/p with\n * text-transform, letter-spacing, etc. that would otherwise leak in. */\n #").concat(xi," h2,\n #").concat(xi," h3,\n #").concat(xi," p,\n #").concat(xi," button,\n #").concat(xi," code,\n #").concat(xi," hr {\n text-transform: none !important;\n letter-spacing: normal !important;\n text-decoration: none !important;\n font-style: normal !important;\n }\n\n #").concat(xi," {\n border: none;\n padding: 0;\n background: white;\n border-radius: 8px;\n max-width: 480px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n color: #212124;\n }\n\n #").concat(xi,"::backdrop {\n background: rgba(33, 33, 36, 0.4);\n }\n\n #").concat(xi," .modal {\n position: relative;\n padding: 32px;\n }\n\n #").concat(xi," .close-icon {\n position: absolute;\n top: 16px;\n right: 16px;\n width: 28px;\n height: 28px;\n padding: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n border-radius: 6px;\n color: #5a5e68;\n cursor: pointer;\n }\n\n #").concat(xi," .close-icon:hover {\n background: #f3f4f6;\n color: #212124;\n }\n\n #").concat(xi," .close-icon svg {\n width: 16px;\n height: 16px;\n }\n\n #").concat(xi," .title {\n font-size: 18px;\n font-weight: 600;\n margin: 0 0 12px 0;\n padding-right: 24px;\n }\n\n #").concat(xi," .body {\n font-size: 14px;\n line-height: 1.5;\n margin: 0 0 12px 0;\n color: #5a5e68;\n }\n\n #").concat(xi," .divider {\n border: none;\n border-top: 1px solid #e5e7eb;\n margin: 20px 0;\n }\n\n #").concat(xi," .subtitle {\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 8px 0;\n color: #212124;\n }\n\n #").concat(xi," code {\n background: #f3f4f6;\n padding: 1px 6px;\n border-radius: 4px;\n font-size: 13px;\n }\n\n #").concat(xi," .actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 24px;\n }\n\n #").concat(xi," .secondary {\n font-size: 14px;\n padding: 8px 16px;\n border-radius: 6px;\n background: white;\n color: #212124;\n border: 1px solid #d1d5db;\n cursor: pointer;\n }\n\n #").concat(xi,' .secondary:hover {\n background: #f9fafb;\n }\n </style>\n\n <div class="modal">\n <button\n type="button"\n class="close-icon"\n data-action="close"\n aria-label="Close"\n >\n <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">\n <path d="M3 3 L13 13 M13 3 L3 13" />\n </svg>\n </button>\n <h2 id="').concat(xi,'-title" class="title">Can\'t connect to this page</h2>\n <p class="body">\n The Visual Editor lost its connection to this page and can\'t make\n edits here. This is usually a configuration issue on the site.\n </p>\n <hr class="divider" />\n <h3 class="subtitle">Technical Details</h3>\n <p class="body">\n This page sends a <code>Cross-Origin-Opener-Policy</code> header that\n isolates it from the editor window. To resolve this:\n </p>\n <p class="body">\n Remove the <code>Cross-Origin-Opener-Policy</code> header, or set its\n value to <code>unsafe-none</code> on pages you want to edit.\n </p>\n <div class="actions">\n <button type="button" class="secondary" data-action="close">Close</button>\n </div>\n </div>\n '),fr(function(){document.body&&!document.getElementById(xi)&&(document.body.appendChild(e),"function"==typeof e.showModal?e.showModal():e.setAttribute("open",""),e.querySelectorAll('button[data-action="close"]').forEach(function(e){e.addEventListener("click",function(){ki()})}))})}}(),this.globalScope.history.replaceState({},"",Oi(this.globalScope.location.href,[Vi])),this.isRunning=!0,[2]):(xr("opener_check","PASS"),Cr()?[4,Ir(this.globalScope)]:[3,2])):[3,3]);case 1:r.sent(),r.label=2;case 2:return wi.setup(),this.globalScope.history.replaceState({},"",Oi(this.globalScope.location.href,[Vi])),xr("url_param_removed","cleaned URL: ".concat(this.globalScope.location.href)),this.subscriptionManager.markUrlAsPublished(this.globalScope.location.href),this.messageBus.publish("url_change",{updateActivePages:!0}),this.isRunning=!0,Wi(this),[2];case 3:this.subscriptionManager.markUrlAsPublished(this.globalScope.location.href),this.messageBus.publish("url_change",{updateActivePages:!0}),s="EXP_".concat(this.apiKey.slice(0,10)),(l=li("localStorage",s)||{}).web_exp_id?l.web_exp_id&&l.device_id&&(delete l.device_id,ui("localStorage",s,l)):(l.web_exp_id=l.device_id||Pi(),delete l.device_id,ui("localStorage",s,l)),u=this.getVariants();try{for(c=i(Object.entries(u)),d=c.next();!d.done;d=c.next())f=o(d.value,2),v=f[0],h=f[1],this.remoteFlagKeys.includes(v)&&(null===(w=h.metadata)||void 0===w?void 0:w.blockingEvaluation)&&Object.keys(this.activePages).includes(v)&&!this.remoteFlagKeys.every(function(e){return Object.keys(S.previewFlags).includes(e)})&&(this.isRemoteBlocking=!0,Dr())}catch(e){m={error:e}}finally{try{d&&!d.done&&(y=c.return)&&y.call(c)}finally{if(m)throw m.error}}return[4,fi(this.apiKey,l)];case 4:return p=r.sent(),this.globalScope.experimentIntegration||(g=Me.getInstance("$default_instance"),this.globalScope.experimentIntegration=new Je(this.apiKey,g,1e3)),this.globalScope.experimentIntegration.type="integration",this.experimentClient.addPlugin(this.globalScope.experimentIntegration),this.experimentClient.setUser(p),this.updateUserWithBehaviors(),this.initialFlags.some(function(e){return e.key.startsWith("holdout-")||e.key.startsWith("mutex-")})?[4,this.experimentClient.integrationManager.ready()]:[3,6];case 5:r.sent(),r.label=6;case 6:return this.isRemoteBlocking||Br(),this.applyVariants({flagKeys:this.localFlagKeys}),this.previewVariants({keyToVariant:this.previewFlags}),this.remoteFlagKeys.every(function(e){return Object.keys(S.previewFlags).includes(e)})?(this.isRunning=!0,Wi(this),[2]):[4,this.fetchRemoteFlags()];case 7:return r.sent(),this.applyVariants({flagKeys:this.remoteFlagKeys}),this.isRunning=!0,Wi(this),[2]}})})},e.getInstance=function(t,n,r){void 0===r&&(r={});var i=be();if(!i)throw new Error("Amplitude Web Experiment Client could not be initialized.");if(i.webExperiment&&!i.webExperiment.isStub){var o=i.webExperiment;return o.isRunning&&Wi(o),o}var a=new e(t,n,r);return i.webExperiment=a,a},e.prototype.getExperimentClient=function(){return this.experimentClient},e.prototype.hideLoadingIndicator=function(){mi()},e.prototype.applyVariants=function(e){var t,n,r=(e||{}).flagKeys,i=this.getVariants();if(0!==Object.keys(i).length){var o=Ti(this.globalScope.location.href);for(var a in(null===(t=this.urlExposureCache)||void 0===t?void 0:t[o])||(this.urlExposureCache={},this.urlExposureCache[o]={}),this.fireStoredRedirectImpressions(),i)if(!(r&&!r.includes(a)||this.previewFlags[a])){var s=i[a],l=s.key||"";if(this.appliedMutations[a]){var u=Object.keys(this.appliedMutations[a]);u.length>0&&!u.includes(l)&&(this.revertVariants({flagKeys:[a]}),delete this.appliedMutations[a])}if("web"===(null===(n=s.metadata)||void 0===n?void 0:n.deliveryMethod)){var c=Array.isArray(s.payload);if(("off"===s.key||"control"===s.key)&&(this.isActionActiveOnPage(a,void 0)&&this.exposureWithDedupe(a,s),"off"===s.key)){this.revertVariants({flagKeys:[a]});continue}c&&this.handleVariantAction(a,s)}}}},e.prototype.revertVariants=function(e){var t,n,r,o;if(this.appliedMutations){var a=(e||{}).flagKeys;a||(a=Object.keys(this.appliedMutations));try{for(var s=i(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=this.appliedMutations[u];if(c){for(var d in c){var f=c[d];if(f)for(var v in f)for(var h in f[v])null===(o=null===(r=f[v][h])||void 0===r?void 0:r.revert)||void 0===o||o.call(r)}delete this.appliedMutations[u]}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},e.prototype.previewVariants=function(e){var t=e.keyToVariant;if(t)for(var n in this.revertVariants({flagKeys:Object.keys(t)}),t){var r=t[n],i=this.flagVariantMap[n];if(!i)return;var o=i[r];if(!o)return;this.isPreviewMode&&hr({flags:this.previewFlags});var a=o.payload;if(!a||!Array.isArray(a))return void(this.isActionActiveOnPage(n,void 0)&&this.exposureWithDedupe(n,o));this.handleVariantAction(n,o)}},e.prototype.getVariants=function(){var e,t,n={};try{for(var r=i(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),s=r.next();!s.done;s=r.next()){var l=s.value;n[l]=this.experimentClient.variant(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n},e.prototype.getActiveExperiments=function(){return Object.keys(this.appliedMutations)},e.prototype.getActivePages=function(){return this.activePages},e.prototype.addPageChangeSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addPageChangeSubscriber(e)},e.prototype.updateUserWithBehaviors=function(){var e,n;if(this.behavioralTargetingManager){var r=[];try{for(var s=i(this.behavioralTargetingManager.getMatchedBehaviors().values()),l=s.next();!l.done;l=s.next()){var u=l.value;r.push.apply(r,a([],o(u),!1))}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}var c=this.experimentClient.getUser(),d=t(t({},c),{behavioral_targeting:r});this.experimentClient.setUser(d)}},e.prototype.setPageObjects=function(e){var t,n;this.isVisualEditorMode&&(this.pageObjects=e,null===(t=this.subscriptionManager)||void 0===t||t.setPageObjects(e),this.activePages={},this.messageBus.unsubscribeAll(),null===(n=this.subscriptionManager)||void 0===n||n.initSubscriptions(),this.messageBus.publish("url_change",{updateActivePages:!0}))},e.prototype.setRedirectHandler=function(e){this.customRedirectHandler=e},e.prototype.toggleManualPageObject=function(e,t){var n;void 0===t&&(t=!0),null===(n=this.subscriptionManager)||void 0===n||n.toggleManualPageObject(e,t)},e.prototype.getDebugState=function(){return _r()},e.prototype.buildFlagDebugInfo=function(){var e,t,n,r,s,l,u={},c=this.getVariants(),d=null!==(r=null===(n=this.subscriptionManager)||void 0===n?void 0:n.getDebugPageObjects())&&void 0!==r?r:{},f=this.localFlagKeys.length>0?this.experimentClient.getEvaluationTraces(this.localFlagKeys):void 0;try{for(var v=i(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),h=v.next();!h.done;h=v.next()){var p=h.value,g=c[p],m=this.activePages[p],y=void 0,b=null==f?void 0:f[p];b?y={matched:b.matched,matchedSegment:b.matchedSegment,steps:b.steps}:(null===(s=null==g?void 0:g.metadata)||void 0===s?void 0:s.segmentName)&&(y={matched:!0,matchedSegment:g.metadata.segmentName,steps:[]}),u[p]={flagKey:p,variant:(null==g?void 0:g.key)?{key:g.key,value:g.value,metadata:g.metadata}:null,isActive:!!m&&Object.keys(m).length>0,audienceEvaluation:y,pageObjects:null!==(l=d[p])&&void 0!==l?l:[]}}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=v.return)&&t.call(v)}finally{if(e)throw e.error}}return u},e.prototype.addDebugStateSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addDebugStateSubscriber(e)},e.prototype.plugin=function(){var e=this;return{name:"@amplitude/experiment-tag",type:"enrichment",setup:function(){return n(e,void 0,void 0,function(){return r(this,function(e){return[2]})})},execute:function(t){return n(e,void 0,void 0,function(){return r(this,function(e){return this.trackEvent(t.event_type,t.event_properties),[2,t]})})}}},e.prototype.trackEvent=function(e,t){var n;null===(n=this.behavioralTargetingManager)||void 0===n||n.trackEvent(e,t||{}),this.messageBus.publish("analytics_event",{event:e,properties:t||{}})},e.prototype.fetchRemoteFlags=function(){return n(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.experimentClient.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn("Error fetching remote flags:",e),[3,3];case 3:return[2]}})})},e.prototype.handleVariantAction=function(e,t){var n,r;try{for(var o=i(t.payload),a=o.next();!a.done;a=o.next()){var s=a.value;"redirect"===s.action?this.handleRedirect(s,e,t):s.action===Mi?this.handleMutate(s,e,t):s.action===Ii&&this.handleInject(s,e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.handleRedirect=function(e,t,i){var o,a,s;if(this.isActionActiveOnPage(t,null===(a=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.metadata)||void 0===a?void 0:a.scope)){var l=Ti(this.previousUrl||this.globalScope.document.referrer),u=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.url;if(Ti(this.globalScope.location.href)!==l){var c=function(e,t){var n=new URL(e),r=new URL(t),i=new URL(t);return n.searchParams.forEach(function(e,t){r.searchParams.has(t)||i.searchParams.append(t,e)}),i.toString()}(this.globalScope.location.href,u);this.globalScope.location.href!==c&&(this.storeRedirectImpressions(t,i,u),this.previousUrl=this.globalScope.location.href,function(e){return n(this,void 0,void 0,function(){var t,n,i,o;return r(this,function(r){switch(r.label){case 0:return t=new ii({sameSite:"Lax"}),n=new si,i="AMP_".concat(ei,"_ORIGINAL_").concat(e.substring(0,10)),[4,n.parse()];case 1:return o=r.sent(),[4,t.set(i,o)];case 2:return r.sent(),[2]}})})}(this.apiKey).then(),this.customRedirectHandler?this.customRedirectHandler(c):this.globalScope.location.replace(c))}}},e.prototype.handleMutate=function(e,n,r){var i,o,a,s,l,u=this,c=(null===(i=e.data)||void 0===i?void 0:i.mutations)||[],d=r.key||"";if(0!==c.length){var f={};c.forEach(function(e,t){var i,o,a,s,l,c,v,h,p,g,m;u.isActionActiveOnPage(n,null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.scope)?(u.exposureWithDedupe(n,r),(null===(m=null===(g=null===(p=u.appliedMutations[n])||void 0===p?void 0:p[d])||void 0===g?void 0:g[Mi])||void 0===m?void 0:m[t])||(f[t]=rr.declarative(e))):(null===(s=null===(a=null===(o=u.appliedMutations[n])||void 0===o?void 0:o[d])||void 0===a?void 0:a[Mi])||void 0===s?void 0:s[t])&&(null===(h=null===(v=null===(c=null===(l=u.appliedMutations[n])||void 0===l?void 0:l[d])||void 0===c?void 0:c[Mi])||void 0===v?void 0:v[t])||void 0===h||h.revert(),delete u.appliedMutations[n][d][Mi][t])}),null!==(o=(s=this.appliedMutations)[n])&&void 0!==o||(s[n]={}),null!==(a=(l=this.appliedMutations[n])[d])&&void 0!==a||(l[d]={}),this.appliedMutations[n][d][Mi]=t(t({},this.appliedMutations[n][d][Mi]),f),0===Object.keys(this.appliedMutations[n][d][Mi]||{}).length&&delete this.appliedMutations[n][d][Mi],0===Object.keys(this.appliedMutations[n][d]||{}).length&&delete this.appliedMutations[n]}},e.prototype.handleInject=function(e,t,i){var o,a,s,l,u,c,d,f,v,h,p,g,m=this,y=i.key||"";if(this.isActionActiveOnPage(t,null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.scope)){var b=e.data.id;if(b&&"string"==typeof b&&0!==b.length&&(b=b.replace(/-/g,""),!this.appliedInjections.has(b))){var w,S=e.data.js;S&&(w=this.globalScope.document.createElement("script"))&&(w.innerHTML="function ".concat(b,"(html, utils, id){").concat(S,"};"),w.id="js-".concat(b),this.globalScope.document.head.appendChild(w));var x,k=e.data.css;k&&(x=cr(this.globalScope.document,k));var E,_=e.data.html;_&&(E=null!==(c=(new DOMParser).parseFromString(_,"text/html").body.firstElementChild)&&void 0!==c?c:void 0);var A={cancelled:!1},T=function(e){return{waitForElement:function(t){return n(this,void 0,void 0,function(){var n,i,o;return r(this,function(r){return n=void 0,(o=(i=function(){if(!e.cancelled)return document.querySelector(t);null==n||n.disconnect()})())?[2,o]:[2,new Promise(function(e){n=new MutationObserver(function(){var t=i();t&&(null==n||n.disconnect(),e(t))}),n.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})})]})})},insertElement:function(t,n,r){return new Promise(function(i){var o=0,a=void 0,s=function(){if(e.cancelled)null==a||a.disconnect();else if(!(t.isConnected&&t.ownerDocument===document||o>=10)){o++,setTimeout(function(){return o--},1e3);var s=document.querySelector(n.parentSelector);if(s){var l=n.insertBeforeSelector?s.querySelector(n.insertBeforeSelector):null;n.insertBeforeSelector&&!l||(Jn(),s.insertBefore(t,l),Gn(),null==r||r(),i())}}};s(),(a=new MutationObserver(s)).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})})}}}(A);this.appliedInjections.add(b);try{var O=this.globalScope[b];O&&"function"==typeof O&&O(E,T,b)}catch(e){null==w||w.remove(),console.error("Experiment inject failed for ".concat(t," variant ").concat(i.key,". Reason:"),e)}null!==(d=(h=this.appliedMutations)[t])&&void 0!==d||(h[t]={}),null!==(f=(p=this.appliedMutations[t])[y])&&void 0!==f||(p[y]={}),null!==(v=(g=this.appliedMutations[t][y])[Ii])&&void 0!==v||(g[Ii]={}),this.appliedMutations[t][y][Ii][b]={revert:function(){var e;A.cancelled=!0,null===(e=T.remove)||void 0===e||e.call(T),null==x||x.revert(),null==w||w.remove(),m.appliedInjections.delete(b)}},this.exposureWithDedupe(t,i)}}else null===(u=null===(l=null===(s=null===(a=this.appliedMutations[t])||void 0===a?void 0:a[y])||void 0===s?void 0:s[Ii])||void 0===l?void 0:l[0])||void 0===u||u.revert()},e.prototype.exposureWithDedupe=function(e,t,n){var r,i,o,a,s=Ti(this.globalScope.location.href);if(!((null===(i=null===(r=this.urlExposureCache)||void 0===r?void 0:r[s])||void 0===i?void 0:i[e])===t.key)){if(n||this.previewFlags[e]){var l={variant:t,source:"local-evaluation",hasDefaultVariant:!1};this.experimentClient.exposureInternal(e,l)}else this.experimentClient.exposure(e);(null!==(o=(a=this.urlExposureCache)[s])&&void 0!==o?o:a[s]={})[e]=t.key}},e.prototype.updateActivePages=function(e,t,n){this.activePages[e]||(this.activePages[e]={}),n?this.activePages[e][t.id]=t:(delete this.activePages[e][t.id],0===Object.keys(this.activePages[e]).length&&delete this.activePages[e])},e.prototype.isActionActiveOnPage=function(e,t){var n=this.activePages[e];return t?t.some(function(e){var t;return null!==(t=null==n?void 0:n[e])&&void 0!==t&&t}):!!n&&Object.values(n).some(Boolean)},e.prototype.storeRedirectImpressions=function(e,t,n){var r="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),i=li("sessionStorage",r)||{};i[e]={redirectUrl:n,variant:t},ui("sessionStorage",r,i)},e.prototype.fireStoredRedirectImpressions=function(){var e=this,t="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),n=li("sessionStorage",t)||{};if(Object.keys(n).length>0)for(var r in n){var i=n[r],o=i.redirectUrl,a=i.variant,s=Ti(this.globalScope.location.href),l=Ti(o);Ci([s],l)&&(this.exposureWithDedupe(r,a,!0),delete n[r])}Object.keys(n).length>0?this.globalScope.setTimeout(function(){var n=li("sessionStorage",t)||{};for(var r in n)e.exposureWithDedupe(r,n[r].variant,!0);ci("sessionStorage",t)},500):ci("sessionStorage",t)},e.prototype.setupPreviewMode=function(e){var t=this;if("true"===e[Ni]){Object.keys(e).forEach(function(n){n!==Ni&&e[n]&&(t.previewFlags[n]=e[n])}),ui("sessionStorage",ji,{previewFlags:this.previewFlags});var n=a(a([],o(Object.keys(this.previewFlags)),!1),[Ni],!1);this.globalScope.history.replaceState({},"",Oi(this.globalScope.location.href,n)),wi.setup()}else{var r=li("sessionStorage",ji);r&&(this.previewFlags=r.previewFlags)}Object.keys(this.previewFlags).length>0&&(this.isPreviewMode=!0)},e}();var Ui=ye.fetch||function(e,t){return t=t||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n}),n(l())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)})},Ri={request:function(e,t,i,o,a){return n(void 0,void 0,void 0,function(){var s;return r(this,function(l){return s=function(){return n(void 0,void 0,void 0,function(){var n,a;return r(this,function(r){switch(r.label){case 0:return[4,Ui(e,{method:t,headers:i,body:o})];case 1:return n=r.sent(),a={status:n.status},[4,n.text()];case 2:return[2,(a.body=r.sent(),a)]}})})},[2,(u=s(),c=a,!c||c<=0?u:Promise.race([u,new Promise(function(e,t){return setTimeout(function(){return t(new pe("Timeout after ".concat(c,"ms")))},c)})]))];var u,c})})}},Di=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getPreviewFlagsAndPageViewObjects=function(){return n(this,void 0,void 0,function(){var e,t,n,i,o,a;return r(this,function(r){switch(r.label){case 0:return(e={Authorization:"Api-Key ".concat(this.deploymentKey)})["X-Amp-Exp-Library"]="experiment-tag/".concat("0.24.0"),[4,this.httpClient.request("".concat(this.serverUrl,"/web/v1/configs"),"GET",e,null,1e4)];case 1:if(200!=(t=r.sent()).status)throw Error("Preview error response: status=".concat(t.status));return n=JSON.parse(t.body),i=n.flags,o=n.pageObjects,a=n.behavioralTargetingRules,[2,{flags:i,pageViewObjects:o,behavioralTargetingRules:a}]}})})},e}(),Bi=[],Fi=function(e,t,n){Li.getInstance(e,t,n).start().finally(function(){Br()})},Ki=function(e,t){return n(void 0,void 0,void 0,function(){return r(this,function(n){return[2,new Di(e,"EU"===t?"https://api.lab.eu.amplitude.com":"https://api.lab.amplitude.com",Ri).getPreviewFlagsAndPageViewObjects()]})})},qi=function(){return{name:"@amplitude/experiment-tag",type:"enrichment",execute:function(e){return n(void 0,void 0,void 0,function(){var t,n;return r(this,function(r){return t=be(),(n=null==t?void 0:t.webExperiment)&&"function"==typeof n.trackEvent&&n.isRunning?n.trackEvent(e.event_type,e.event_properties):Bi.push({event_type:e.event_type,event_properties:e.event_properties}),[2,e]})})}}},Wi=function(e){Bi.length>0&&(Bi.forEach(function(t){var n=t.event_type,r=t.event_properties;e.trackEvent(n,r)}),Bi.length=0)};e.createPlugin=qi,e.flushEventBuffer=Wi,e.initialize=function(e,t,n){var r,i=be();if(!i)throw new Error("Global scope not available");i.webExperiment||(i.webExperiment={plugin:qi,isStub:!0}),function(){if("true"===Ai()[Ni])return!0;var e=li("sessionStorage",ji);return!!((null==e?void 0:e.previewFlags)&&Object.keys(e.previewFlags).length>0)}()||(null===(r=i.WebExperiment)||void 0===r?void 0:r.injectedByExtension)?(Dr(),Ki(e,n.serverZone).then(function(t){var r=JSON.stringify(t.flags),i=JSON.stringify(t.pageViewObjects),o=JSON.stringify(t.behavioralTargetingRules);Fi(e,{initialFlags:r,pageObjects:i,behavioralTargetingRules:o},n)}).catch(function(r){console.warn("Failed to fetch latest configs for preview:",r),Fi(e,t,n)}).finally(function(){Br()})):Fi(e,t,n)},Object.defineProperty(e,"__esModule",{value:!0})}(this.WebExperiment=this.WebExperiment||{});
|
|
1
|
+
/* @amplitude/experiment-tag v0.25.0 - For license info see https://unpkg.com/@amplitude/experiment-tag@0.25.0/files/LICENSE */
|
|
2
|
+
!function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function n(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function r(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)};function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var c=function(){return c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)};function u(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function d(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function v(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var p="is",g="is not",m="contains",y="does not contain",b="less",w="less or equal",S="greater",x="greater or equal",k="version less",E="version less or equal",_="version greater",A="version greater or equal",O="set is",T="set is not",C="set contains",P="set does not contain",M="set contains any",I="set does not contain any",N="regex match",j="regex does not match",R=-862048943,V=461845907,U=function(e,t){void 0===t&&(t=0);for(var n=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return Uint8Array.from(t)}(e),r=n.length,i=r>>2,o=t,a=0;a<i;a++){var s=B(n,a<<2);o=L(s,o)}var l=i<<2,c=0;switch(r-l){case 3:c^=n[l+2]<<16,c^=n[l+1]<<8,c^=n[l],c=Math.imul(c,R),c=F(c,15),o^=c=Math.imul(c,V);break;case 2:c^=n[l+1]<<8,c^=n[l],c=Math.imul(c,R),c=F(c,15),o^=c=Math.imul(c,V);break;case 1:c^=n[l],c=Math.imul(c,R),c=F(c,15),o^=c=Math.imul(c,V)}return D(o^=r)>>>0},L=function(e,t){var n=e,r=t;return n=Math.imul(n,R),n=F(n,15),n=Math.imul(n,V),r=F(r^=n,13),(r=Math.imul(r,5))+-430675100|0},D=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},F=function(e,t,n){return void 0===n&&(n=32),t>n&&(t%=n),(e<<t|(e&4294967295<<n-t>>>0)>>>0>>>n-t>>>0)>>>0},B=function(e,t){void 0===t&&(t=0);var n=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return K(n)},K=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},q=function(e,t){var n,r;if(t&&0!==t.length){try{for(var i=f(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!a||!e||"object"!=typeof e)return;e=e[a]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null==e?void 0:e}},z="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),W=function(){function e(e,t,n,r){void 0===r&&(r=void 0),this.major=e,this.minor=t,this.patch=n,this.preRelease=r}return e.parse=function(t){if(t){var n=new RegExp(z).exec(t);if(n){var r=Number(n[1]),i=Number(n[2]);if(!isNaN(r)&&!isNaN(i))return new e(r,i,Number(n[4])||0,n[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),H=function(){function e(){}return e.prototype.evaluate=function(e,t){var n,r,i={},o={context:e,result:i};try{for(var a=f(t),s=a.next();!s.done;s=a.next()){var l=s.value,c=this.evaluateFlag(o,l);c&&(i[l.key]=c)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.evaluateWithTraces=function(e,t){var n,r,i={},o={},a={context:e,result:i};try{for(var s=f(t),l=s.next();!l.done;l=s.next()){var c=l.value,u=this.evaluateFlagWithTrace(a,c),d=u.variant,h=u.trace;d&&(i[c.key]=d),o[c.key]=h}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return{results:i,traces:o}},e.prototype.evaluateFlag=function(e,t){var n,r,i;try{for(var o=f(t.segments),a=o.next();!a.done;a=o.next()){var s=a.value;if(i=this.evaluateSegment(e,t,s)){var l=c(c(c({},t.metadata),s.metadata),i.metadata);i=c(c({},i),{metadata:l});break}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.prototype.evaluateFlagWithTrace=function(e,t){var n,r,i,o,a,s,l,u,d,h,v,p=[];try{for(var g=f(t.segments),m=g.next();!m.done;m=g.next()){var y=m.value;if(y.conditions){var b=[],w=!1;try{for(var S=(i=void 0,f(y.conditions)),x=S.next();!x.done;x=S.next()){var k=x.value,E=!0,_=[];try{for(var A=(a=void 0,f(k)),O=A.next();!O.done;O=A.next()){var T=O.value,C=q(e,T.selector),P=this.matchCondition(e,T);if(_.push({propValue:C,condition:T,matched:P}),!P){E=!1;break}}}catch(e){a={error:e}}finally{try{O&&!O.done&&(s=A.return)&&s.call(A)}finally{if(a)throw a.error}}if(b.push(_),E){w=!0;break}}}catch(e){i={error:e}}finally{try{x&&!x.done&&(o=S.return)&&o.call(S)}finally{if(i)throw i.error}}var M=!1,I=void 0;w&&(M=void 0!==(I=this.bucket(e,y))),p.push({segmentMetadata:y.metadata,conditionsPassed:w,bucketed:M,bucketVariant:I,conditionResult:b,matched:w&&M}),w&&void 0!==I&&!d&&(d=t.variants[I],h=y,v=null===(u=y.metadata)||void 0===u?void 0:u.segmentName)}else{var N=this.bucket(e,y),j=void 0!==N;p.push({segmentMetadata:y.metadata,conditionsPassed:!0,bucketed:j,bucketVariant:N,conditionResult:void 0,matched:j}),d||void 0===N||(d=t.variants[N],h=y,v=null===(l=y.metadata)||void 0===l?void 0:l.segmentName)}}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}if(d&&h){var R=c(c(c({},t.metadata),h.metadata),d.metadata);d=c(c({},d),{metadata:R})}return{variant:d,trace:{flagKey:t.key,matched:void 0!==d,matchedSegment:v,steps:p}}},e.prototype.evaluateSegment=function(e,t,n){var r;return n.conditions?this.evaluateConditions(e,n.conditions)&&void 0!==(r=this.bucket(e,n))?t.variants[r]:void 0:void 0!==(r=this.bucket(e,n))?t.variants[r]:void 0},e.prototype.evaluateConditions=function(e,t){var n,r,i,o;try{for(var a=f(t),s=a.next();!s.done;s=a.next()){var l=s.value,c=!0;try{for(var u=(i=void 0,f(l)),d=u.next();!d.done;d=u.next()){var h=d.value;if(!(c=this.matchCondition(e,h)))break}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}if(c)return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return!1},e.prototype.matchCondition=function(e,t){var n=q(e,t.selector);if(null==n)return this.matchNull(t.op,t.values);var r=this.coerceStringArray(n);if(this.isSetOperator(t.op))return!!r&&this.matchSet(r,t.op,t.values);if(r)return this.matchStringsNonSet(r,t.op,t.values);var i=this.coerceString(n);return void 0!==i&&this.matchString(i,t.op,t.values)},e.prototype.getHash=function(e){return U(e)},e.prototype.bucket=function(e,t){var n,r,i,o;if(!t.bucket)return t.variant;var a=this.coerceString(q(e,t.bucket.selector));if(!a||0===a.length)return t.variant;var s="".concat(t.bucket.salt,"/").concat(a),l=this.getHash(s),c=l%100,u=Math.floor(l/100);try{for(var d=f(t.bucket.allocations),h=d.next();!h.done;h=d.next()){var v=h.value,p=v.range[0],g=v.range[1];if(c>=p&&c<g)try{for(var m=(i=void 0,f(v.distributions)),y=m.next();!y.done;y=m.next()){var b=y.value,w=b.range[0],S=b.range[1];if(u>=w&&u<S)return b.variant}}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return t.variant},e.prototype.matchNull=function(e,t){var n=this.containsNone(t);switch(e){case p:case m:case b:case w:case S:case x:case k:case E:case _:case A:case O:case C:case M:return n;case g:case y:case P:case I:return!n;default:return!1}},e.prototype.matchSet=function(e,t,n){switch(t){case O:return this.setEquals(e,n);case T:return!this.setEquals(e,n);case C:return this.matchesSetContainsAll(e,n);case P:return!this.matchesSetContainsAll(e,n);case M:return this.matchesSetContainsAny(e,n);case I:return!this.matchesSetContainsAny(e,n);default:return!1}},e.prototype.matchString=function(e,t,n){var r=this;switch(t){case p:return this.matchesIs(e,n);case g:return!this.matchesIs(e,n);case m:return this.matchesContains(e,n);case y:return!this.matchesContains(e,n);case b:case w:case S:case x:return this.matchesComparable(e,t,n,function(e){return r.parseNumber(e)},this.comparator);case k:case E:case _:case A:return this.matchesComparable(e,t,n,function(e){return W.parse(e)},this.versionComparator);case N:return this.matchesRegex(e,n);case j:return!this.matchesRegex(e,n);default:return!1}},e.prototype.matchStringsNonSet=function(e,t,n){var r=this;return e.some(function(e){return r.matchString(e,t,n)})},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var n=e.toLowerCase();if("true"===n||"false"===n)return t.some(function(e){return e.toLowerCase()===n})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var n,r;try{for(var i=f(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.toLowerCase().includes(a.toLowerCase()))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.prototype.matchesComparable=function(e,t,n,r,i){var o=this,a=r(e),s=n.map(function(e){return r(e)}).filter(function(e){return void 0!==e});return void 0===a||0===s.length?n.some(function(n){return o.comparator(e,t,n)}):s.some(function(e){return i(a,t,e)})},e.prototype.comparator=function(e,t,n){switch(t){case b:case k:return e<n;case w:case E:return e<=n;case S:case _:return e>n;case x:case A:return e>=n;default:return!1}},e.prototype.versionComparator=function(e,t,n){var r=e.compareTo(n);switch(t){case b:case k:return r<0;case w:case E:return r<=0;case S:case _:return r>0;case x:case A:return r>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return Boolean(new RegExp(t).exec(e))})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map(function(e){return t.coerceString(e)}).filter(Boolean);var n=String(e);if(n.startsWith("["))try{var r=JSON.parse(n);return Array.isArray(r)?r.map(function(e){return t.coerceString(e)}).filter(Boolean):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case O:case T:case C:case P:case M:case I:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var n=new Set(e),r=new Set(t);return n.size===r.size&&v([],h(r),!1).every(function(e){return n.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var n,r;if(e.length<t.length)return!1;try{for(var i=f(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!this.matchesIs(a,e))return!1}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var n,r;try{for(var i=f(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(this.matchesIs(a,e))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e}(),J=function(e,t){var n,r,i=c({},e),o=[],a=t||Object.keys(i);try{for(var s=f(a),l=s.next();!l.done;l=s.next()){var u=l.value,d=G(u,i);d&&o.push.apply(o,v([],h(d),!1))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},G=function(e,t,n){var r,i;void 0===n&&(n=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];n.push(o.key);var a=[],s=function(e){if(n.some(function(t){return t===e}))throw Error("Detected a cycle between flags ".concat(n));var r=G(e,t,n);r&&a.push.apply(a,v([],h(r),!1))};try{for(var l=f(o.dependencies),c=l.next();!c.done;c=l.next()){s(c.value)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return a.push(o),n.pop(),delete t[o.key],a}};const X="function"==typeof Buffer,Q=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),$=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Z=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})($),Y=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ee=String.fromCharCode.bind(String),te=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_")),ne=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),re=e=>{let t,n,r,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((n=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|i,o+=$[t>>18&63]+$[t>>12&63]+$[t>>6&63]+$[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},ie="function"==typeof btoa?e=>btoa(e):X?e=>Buffer.from(e,"binary").toString("base64"):re,oe=X?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(ee.apply(null,e.subarray(n,n+4096)));return ie(t.join(""))},ae=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?ee(192|t>>>6)+ee(128|63&t):ee(224|t>>>12&15)+ee(128|t>>>6&63)+ee(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return ee(240|t>>>18&7)+ee(128|t>>>12&63)+ee(128|t>>>6&63)+ee(128|63&t)},se=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,le=e=>e.replace(se,ae),ce=X?e=>Buffer.from(e,"utf8").toString("base64"):Q?e=>oe(Q.encode(e)):e=>ie(le(e)),ue=(e,t=!1)=>t?te(ce(e)):ce(e),de=e=>ue(e,!0),fe=e=>{if(e=e.replace(/\s+/g,""),!Y.test(e))throw new TypeError("malformed base64.");let t,n,r;e+="==".slice(2-(3&e.length));let i=[];for(let o=0;o<e.length;)t=Z[e.charAt(o++)]<<18|Z[e.charAt(o++)]<<12|(n=Z[e.charAt(o++)])<<6|(r=Z[e.charAt(o++)]),64===n?i.push(ee(t>>16&255)):64===r?i.push(ee(t>>16&255,t>>8&255)):i.push(ee(t>>16&255,t>>8&255,255&t));return i.join("")},he=de;var ve=function(e){function t(n,r){var i=e.call(this,r)||this;return i.statusCode=n,Object.setPrototypeOf(i,t.prototype),i}return l(t,e),t}(Error),pe=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return l(t,e),t}(Error),ge=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getVariants=function(e,t){return u(this,void 0,void 0,function(){var n,r,i,o;return d(this,function(a){switch(a.label){case 0:return n=he(JSON.stringify(e)),r={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":n},(null==t?void 0:t.flagKeys)&&(r["X-Amp-Exp-Flag-Keys"]=he(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(r["X-Amp-Exp-Track"]=t.trackingOption),(null==t?void 0:t.exposureTrackingOption)&&(r["X-Amp-Exp-Exposure-Track"]=t.exposureTrackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:r,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=a.sent()).status)throw new ve(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),me=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getFlags=function(e){return u(this,void 0,void 0,function(){var t,n;return d(this,function(r){switch(r.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=he(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(n=r.sent()).status)throw Error("Flags error response: status=".concat(n.status));return[2,JSON.parse(n.body).reduce(function(e,t){return e[t.key]=t,e},{})]}})})},e}(),ye="undefined"!=typeof globalThis?globalThis:global||self,be=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},we=function(){var e=be();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1},Se=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=ye.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(ye.clearInterval(this.poller),this.poller=void 0)},e}(),xe=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ke(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ke=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ee=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),_e=function(){return _e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_e.apply(this,arguments)};function Ae(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Oe(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var Te=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Ae(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next()){if(a.value===i)return e===t}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var s=Array.isArray(e),l=Array.isArray(t);if(s!==l)return!1;if(!s||!l){var c=Object.keys(e).sort(),u=Object.keys(t).sort();if(!Te(c,u))return!1;var d=!0;return Object.keys(e).forEach(function(n){Te(e[n],t[n])||(d=!1)}),d}for(var f=0;f<e.length;f++)if(!Te(e[f],t[f]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var Ce=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=_e({},this.identity.userProperties),n=_e(_e({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,a,s,l=n.userProperties||{};try{for(var c=Ae(Object.entries(e)),u=c.next();!u.done;u=c.next()){var d=Oe(u.value,2),f=d[0],h=d[1];switch(f){case"$set":try{for(var v=(i=void 0,Ae(Object.entries(h))),p=v.next();!p.done;p=v.next()){var g=Oe(p.value,2),m=g[0],y=g[1];l[m]=y}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(a=void 0,Ae(Object.keys(h))),w=b.next();!w.done;w=b.next()){delete l[m=w.value]}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}return n.userProperties=l,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return _e({},this.identity)},e.prototype.setIdentity=function(e){var t=_e({},this.identity);this.identity=_e({},e),Te(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),Pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,Me=function(){function e(){this.identityStore=new Ce,this.eventBridge=new Ee,this.applicationContextProvider=new xe}return e.getInstance=function(t){return Pe.analyticsConnectorInstances||(Pe.analyticsConnectorInstances={}),Pe.analyticsConnectorInstances[t]||(Pe.analyticsConnectorInstances[t]=new e),Pe.analyticsConnectorInstances[t]},e}(),Ie="AMP",Ne="dclid",je="fbclid",Re="gbraid",Ve="gclid",Ue="ko_click_id",Le="li_fat_id",De="msclkid",Fe="rdt_cid",Be="ttclid",Ke="twclid",qe="wbraid",ze={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},We="MKTG",He=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},Je=function(){var e,t=He();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=Ge(n[0]),i=Ge(n[1]);return i?(e[r]=i,e):e},{}):{}},Ge=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Xe=function(){function e(e,n){void 0===n&&(n={}),this.options=t({},e),this.config=n}return e.prototype.isEnabled=function(){return n(this,void 0,void 0,function(){var n,i,o,a,s=this;return r(this,function(r){switch(r.label){case 0:return n="AMP_TEST",i=t({},this.options),o=new e(i),a=String(Date.now()),[4,o.transaction(n,function(e){var t,r;try{e.set(a);var i=e.get()===a;return!i&&s.config.diagnosticsClient&&(null===(t=s.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:n,testValue:a,sync:!0})),i}catch(e){if(s.config.diagnosticsClient){var o=e instanceof Error?e.message:String(e);null===(r=s.config.diagnosticsClient)||void 0===r||r.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:n,testValue:a,error:o,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,r.sent()]}})})},e.prototype.get=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return t=n.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var n=Qe(t);return void 0===n?void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)):JSON.parse(n)}catch(n){return void console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t))}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,o;return n(this,void 0,void 0,function(){var n,a,s,l,c,u,d,f,h;return r(this,function(r){switch(r.label){case 0:n=He(),a=n,r.label=1;case 1:return r.trys.push([1,4,,5]),(s=null==a?void 0:a.cookieStore)?[4,s.getAll(e)]:[3,3];case 2:if(l=r.sent()){l.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:l.map(function(e){return e.domain})}),null===(o=this.config.diagnosticsClient)||void 0===o||o.increment("cookies.duplicate.occurrence.cookieStore"));try{for(c=i(l),u=c.next();!u.done;u=c.next())if(d=u.value,$e(d.domain,this.options.domain))return[2,d.value]}catch(e){f={error:e}}finally{try{u&&!u.done&&(h=c.return)&&h.call(c)}finally{if(f)throw f.error}}}r.label=3;case 3:return[3,5];case 4:return r.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,n,r=this,i=He(),o=(null!==(n=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[]).filter(function(t){return 0===t.indexOf(e+"=")}),a=void 0,s=this.config.duplicateResolverFn;if("function"==typeof s&&o.length>1&&(a=o.find(function(t){var n;try{var i=s(t.substring(e.length+1));return i||null===(n=r.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),a||(a=o[0]),a)return a.substring(e.length+1)},e.prototype.set=function(e,t){return n(this,void 0,void 0,function(){return r(this,function(n){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var n;try{var r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,i=null!==t?r:-1,o=void 0;if(i){var a=new Date;a.setTime(a.getTime()+24*i*60*60*1e3),o=a}var s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));o&&(s+="; expires=".concat(o.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite));var l=He();(null==l?void 0:l.document)&&(l.document.cookie=s)}catch(t){var c=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}},e.prototype.remove=function(e){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return n(this,void 0,void 0,function(){return r(this,function(e){return[2]})})},e.isDomainWritable=function(t){return n(this,void 0,void 0,function(){var n,i;return r(this,function(r){switch(r.label){case 0:if(e.cachedTlds[t])return[2,!0];n="AMP_TLDTEST",i=new e({domain:"."+t}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i.transaction(n,function(n){if(e.cachedTlds[t])return!0;try{n.set(1);var r=!!n.get();return r&&(e.cachedTlds[t]=!0),r}finally{n.set(null)}})];case 2:return[2,!!r.sent()];case 3:return r.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return n(this,void 0,void 0,function(){var n,i,o=this;return r(this,function(r){switch(r.label){case 0:if(n=function(){var e,t=He();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks}(),i=function(){return t({get:function(){return o.getSync(e)},set:function(t){return o.setSync(e,t)}})},!n)return[2,i()];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),i)];case 2:return[2,r.sent()];case 3:return r.sent(),[2,i()];case 4:return[2]}})})},e.cachedTlds={},e}(),Qe=function(e){var t;return null!==(t=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}}(e))&&void 0!==t?t:function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}}(e)},$e=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},Ze=function(){function e(){}return e.prototype.parse=function(){return n(this,void 0,void 0,function(){return r(this,function(e){return[2,t(t(t(t({},ze),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=Je();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=Je();return(e={})[Ne]=t[Ne],e[je]=t[je],e[Re]=t[Re],e[Ve]=t[Ve],e[Ue]=t[Ue],e[Le]=t[Le],e[De]=t[De],e[Fe]=t[Fe],e[Be]=t[Be],e[Ke]=t[Ke],e[qe]=t[qe],e},e}(),Ye="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var et,tt,nt,rt=(et=function(e,t){!function(n,r){var i="function",o="undefined",a="object",s="string",l="model",c="name",u="type",d="vendor",f="version",h="architecture",v="console",p="mobile",g="tablet",m="smarttv",y="wearable",b="embedded",w="Amazon",S="Apple",x="ASUS",k="BlackBerry",E="Browser",_="Chrome",A="Firefox",O="Google",T="Huawei",C="LG",P="Microsoft",M="Motorola",I="Opera",N="Samsung",j="Sharp",R="Sony",V="Xiaomi",U="Zebra",L="Facebook",D=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},F=function(e,t){return typeof e===s&&-1!==B(t).indexOf(B(e))},B=function(e){return e.toLowerCase()},K=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},q=function(e,t){for(var n,o,s,l,c,u,d=0;d<t.length&&!c;){var f=t[d],h=t[d+1];for(n=o=0;n<f.length&&!c;)if(c=f[n++].exec(e))for(s=0;s<h.length;s++)u=c[++o],typeof(l=h[s])===a&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,u):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=u?u.replace(l[1],l[2]):r:this[l[0]]=u?l[1].call(this,u,l[2]):r:4===l.length&&(this[l[0]]=u?l[3].call(this,u.replace(l[1],l[2])):r):this[l]=u||r;d+=2}},z=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(F(t[n][i],e))return"?"===n?r:n}else if(F(t[n],e))return"?"===n?r:n;return e},W={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},H={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,I+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,I]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+E],f],[/\bfocus\/([\w\.]+)/i],[f,[c,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[f,[c,A]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+E],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,L],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,_+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,_+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,f],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,B]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",B]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,B]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,N],[u,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,N],[u,p]],[/((ipod|iphone)\d+,\d+)/i],[l,[d,S],[u,p]],[/(ipad\d+,\d+)/i],[l,[d,S],[u,g]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[d,S],[u,p]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,S],[u,g]],[/(macintosh);/i],[l,[d,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,T],[u,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,T],[u,p]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,V],[u,p]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,V],[u,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[u,p]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[u,p]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[u,p]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,M],[u,p]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,M],[u,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,C],[u,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,C],[u,p]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[u,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[u,p]],[/(pixel c)\b/i],[l,[d,O],[u,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,O],[u,p]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,R],[u,p]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,R],[u,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[u,p]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,w],[u,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,w],[u,p]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[u,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,k],[u,p]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,x],[u,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,x],[u,p]],[/(nexus 9)/i],[l,[d,"HTC"],[u,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[u,p]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[u,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[u,p]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,j],[u,p]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[u,p]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[u,g]],[/(surface duo)/i],[l,[d,P],[u,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[u,p]],[/(u304aa)/i],[l,[d,"AT&T"],[u,p]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[u,p]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[u,g]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[u,g]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[u,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[u,g]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[u,g]],[/\b(k88) b/i],[l,[d,"ZTE"],[u,g]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[u,p]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[u,p]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[u,g]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[u,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[u,g]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[u,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[u,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[u,p]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[u,p]],[/\b(ph-1) /i],[l,[d,"Essential"],[u,p]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[u,g]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[u,g]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[u,g]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[u,g]],[/(sprint) (\w+)/i],[d,l,[u,p]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,P],[u,p]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,U],[u,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,U],[u,p]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[u,v]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[u,v]],[/(playstation [345portablevi]+)/i],[l,[d,R],[u,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,P],[u,v]],[/smart-tv.+(samsung)/i],[d,[u,m]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,N],[u,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,C],[u,m]],[/(apple) ?tv/i],[d,[l,S+" TV"],[u,m]],[/crkey/i],[[l,_+"cast"],[d,O],[u,m]],[/droid.+aft(\w)( bui|\))/i],[l,[d,w],[u,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,j],[u,m]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,R],[u,m]],[/(mitv-\w{5}) bui/i],[l,[d,V],[u,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,K],[l,K],[u,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,m]],[/((pebble))app/i],[d,l,[u,y]],[/droid.+; (glass) \d/i],[l,[d,O],[u,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,U],[u,y]],[/(quest( 2)?)/i],[l,[d,L],[u,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[u,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[u,p]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[u,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[u,p]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,z,W]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,z,W]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[c,_+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,f]]},J=function(e,t){if(typeof e===a&&(t=e,e=r),!(this instanceof J))return new J(e,t).getResult();var i=e||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),v=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(H,t):H;return this.getBrowser=function(){var e={};return e[c]=r,e[f]=r,q.call(e,i,v.browser),e.major=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r}(e.version),e},this.getCPU=function(){var e={};return e[h]=r,q.call(e,i,v.cpu),e},this.getDevice=function(){var e={};return e[d]=r,e[l]=r,e[u]=r,q.call(e,i,v.device),e},this.getEngine=function(){var e={};return e[c]=r,e[f]=r,q.call(e,i,v.engine),e},this.getOS=function(){var e={};return e[c]=r,e[f]=r,q.call(e,i,v.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===s&&e.length>350?K(e,350):e,this},this.setUA(i),this};J.VERSION="0.7.33",J.BROWSER=D([c,f,"major"]),J.CPU=D([h]),J.DEVICE=D([l,d,u,v,p,m,g,y,b]),J.ENGINE=J.OS=D([c,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var G=typeof n!==o&&(n.jQuery||n.Zepto);if(G&&!G.ua){var X=new J;G.ua=X.getResult(),G.ua.get=function(){return X.getUA()},G.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var n in t)G.ua[n]=t[n]}}}("object"==typeof window?window:Ye)},et(nt={path:tt,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&nt.path)}},nt.exports),nt.exports),it=function(){function e(e){this.amplitudeInstance=e}return e.prototype.getUser=function(){var e,t,n,r,i,o,a,s,l,c;return{device_id:null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e.options)||void 0===t?void 0:t.deviceId,user_id:null===(r=null===(n=this.amplitudeInstance)||void 0===n?void 0:n.options)||void 0===r?void 0:r.userId,version:null===(o=null===(i=this.amplitudeInstance)||void 0===i?void 0:i.options)||void 0===o?void 0:o.versionName,language:null===(s=null===(a=this.amplitudeInstance)||void 0===a?void 0:a.options)||void 0===s?void 0:s.language,platform:null===(c=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===c?void 0:c.platform,os:this.getOs(),device_model:this.getDeviceModel()}},e.prototype.getOs=function(){var e,t,n,r,i,o;return[null===(n=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.browser)||void 0===n?void 0:n.name,null===(o=null===(i=null===(r=this.amplitudeInstance)||void 0===r?void 0:r._ua)||void 0===i?void 0:i.browser)||void 0===o?void 0:o.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(){var e,t,n;return null===(n=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.os)||void 0===n?void 0:n.name},e}(),ot=function(){function e(e){this.amplitudeInstance=e}return e.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},e.prototype.setUserProperty=function(e){var t,n;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null===(n=e.variant)||void 0===n?void 0:n.value,t))},e.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:(t={},t[e.userProperty]="-",t)})},e}(),at=function(){return at=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},at.apply(this,arguments)};
|
|
3
|
+
/* @amplitude/experiment-js-client v1.21.1 - For license info see https://app.unpkg.com/@amplitude/experiment-js-client@1.21.1/files/LICENSE */function st(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function lt(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function ct(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ut(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function dt(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var ft=function(e,t){var n,r;void 0===t&&(t=!1);var i=ht(e,t),o=void 0,a=ye.document.cookie.split("; ");try{for(var s=ct(a),l=s.next();!l.done;l=s.next()){var c=ut(l.value.split("=",2),2),u=c[0],d=c[1];u===i&&(o=decodeURIComponent(d))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}if(o)try{if(t){var f=atob(o);return JSON.parse(decodeURIComponent(f))}var h=o.split("."),v=void 0;return h.length>=2&&h[1]&&(v=atob(h[1])),{deviceId:h[0],userId:v}}catch(e){return}},ht=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},vt=function(){function e(e,t,n){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=n,this.loadPersistedState(),n<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return st(this,void 0,void 0,function(){return lt(this,function(n){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener(function(){null==t||t.fetch()}),[2,this.waitForConnectorIdentity(this.timeoutMillis)]})})},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=ft(this.apiKey,!0);return(e||(e=ft(this.apiKey,!1))||(e=function(e){var t=ht(e,!0);try{var n=ye.localStorage.getItem(t);if(!n)return;var r=JSON.parse(n);if("object"!=typeof r)return;return r}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=ht(e,!0);try{var n=ye.sessionStorage.getItem(t);if(!n)return;var r=JSON.parse(n);if("object"!=typeof r)return;return r}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return st(this,void 0,void 0,function(){var t,n=this;return lt(this,function(r){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise(function(e){var t=function(){e(),n.identityStore.removeIdentityListener(t)};n.identityStore.addIdentityListener(t)}),new Promise(function(t,n){ye.setTimeout(n,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}();var pt,gt,mt,yt=ye.fetch||function(e,t){return t=t||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var c in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n}),n(l())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)})},bt=function(){function e(e){this.client=e}return e.prototype.request=function(e){return st(this,void 0,void 0,function(){return lt(this,function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}})})},e}(),wt={request:function(e,t,n,r,i){return function(e,t){return null==t||t<=0?e:new Promise(function(n,r){ye.setTimeout(function(){r(new pe("Request timeout after "+t+" milliseconds"))},t),e.then(n,r)})}(st(void 0,void 0,void 0,function(){var i,o;return lt(this,function(a){switch(a.label){case 0:return[4,yt(e,{method:t,headers:n,body:r})];case 1:return i=a.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=a.sent(),[2,o]}})}),i)}};!function(e){e[e.Disable=0]="Disable",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose"}(pt||(pt={})),function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(gt||(gt={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(mt||(mt={}));var St=function(e){return!e||e===mt.FallbackInline||e===mt.FallbackConfig||e===mt.SecondaryInitialVariants},xt={debug:!1,logLevel:pt.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:gt.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:wt},kt="1.21.1",Et=function(){function e(e,t){var n,r=this;this.isReady=new Promise(function(e){r.resolve=e}),this.config=e,this.client=t;var i=null!==(n=e.instanceName)&&void 0!==n?n:xt.instanceName;this.queue=new At(i),this.cache=new _t(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()},function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e,t){if(this.cache.shouldTrack(e,t)){var n=this.getExposureEvent(e);this.queue.push(n)}},e.prototype.getExposureEvent=function(e){var t,n,r,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(n=e.metadata)||void 0===n?void 0:n.exposureEvent,eventProperties:e}:"web"===(null===(r=e.metadata)||void 0===r?void 0:r.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),_t=function(){function e(e){this.isSessionStorageAvailable=Ot(),this.inMemoryCache={},this.identity={},this.storageKey="EXP_sent_v3_".concat(e),this.isSessionStorageAvailable&&(ye.sessionStorage.removeItem("EXP_sent_".concat(e)),ye.sessionStorage.removeItem("EXP_sent_v2_".concat(e)))}return e.prototype.shouldTrack=function(e,t){var n,r;if("web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod))return!0;var i={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,i)||this.clearCache(),this.identity=i,this.loadCache();var o=e.flag_key in this.inMemoryCache,a=this.inMemoryCache[e.flag_key],s=null!==(r=e.variant)&&void 0!==r?r:null,l=!1;return o&&(null!=a?a:null)===s||(l=!0,this.inMemoryCache[e.flag_key]=s),this.storeCache(),l},e.prototype.clearCache=function(){this.inMemoryCache={},this.isSessionStorageAvailable&&ye.sessionStorage.removeItem(this.storageKey)},e.prototype.identityEquals=function(e,t){return e.userId&&t.userId?e.userId===t.userId:!e.userId&&!t.userId&&e.deviceId===t.deviceId},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=ye.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){if(this.isSessionStorageAvailable)try{ye.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))}catch(e){}},e}(),At=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=we(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=ye.setInterval(function(){t.loadFlushStore()},1e3),this.loadFlushStore()},e.prototype.flush=function(){if(this.tracker&&0!==this.inMemoryQueue.length){for(var e=0;e<this.inMemoryQueue.length;e++)try{if(!this.tracker(this.inMemoryQueue[e]))break}catch(e){break}this.inMemoryQueue=this.inMemoryQueue.slice(e),0===this.inMemoryQueue.length&&this.poller&&(ye.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=ye.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),ye.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),Ot=function(){var e=be();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},Tt=function(){function e(e,t){void 0===t&&(t=pt.Error),this.logger=e,this.logLevel=t}return e.prototype.error=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=pt.Error&&(t=this.logger).error.apply(t,dt([e],ut(n),!1))},e.prototype.warn=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=pt.Warn&&(t=this.logger).warn.apply(t,dt([e],ut(n),!1))},e.prototype.info=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=pt.Info&&(t=this.logger).info.apply(t,dt([e],ut(n),!1))},e.prototype.debug=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=pt.Debug&&(t=this.logger).debug.apply(t,dt([e],ut(n),!1))},e.prototype.verbose=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=pt.Verbose&&(t=this.logger).verbose.apply(t,dt([e],ut(n),!1))},e}(),Ct=function(){function e(){}return e.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.error.apply(console,dt([e],ut(t),!1))},e.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.warn.apply(console,dt([e],ut(t),!1))},e.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.info.apply(console,dt([e],ut(t),!1))},e.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.debug.apply(console,dt([e],ut(t),!1))},e.prototype.verbose=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.debug.apply(console,dt([e],ut(t),!1))},e}(),Pt=function(){function e(){this.globalScope=be()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var n;null===(n=this.globalScope)||void 0===n||n.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),Mt=function(){function e(e,t){this.namespace=e,this.storage=t}return e.prototype.get=function(){return this.value},e.prototype.put=function(e){this.value=e},e.prototype.load=function(){var e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))},e.prototype.store=function(){void 0===this.value?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e}(),It=function(){function e(e,t,n){this.cache={},this.namespace=e,this.storage=t,this.transformer=n}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return at({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,n;try{for(var r=ct(Object.keys(e)),i=r.next();!i.done;i=r.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,n,r=this.storage.get(this.namespace);try{n=JSON.parse(r)||{}}catch(e){return}var i={};try{for(var o=ct(Object.keys(n)),a=o.next();!a.done;a=o.next()){var s=a.value;try{var l=void 0;(l=this.transformer?this.transformer(n[s]):n[s])&&(i[s]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),Nt=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,n=e.value,r=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var a={};return t?a.key=t:n&&(a.key=n),n&&(a.value=n),i&&(a.metadata=i),r&&(a.payload=r),o&&(a.expKey=o),a}},jt=function(){function e(){this.globalScope=be()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var n;null===(n=this.globalScope)||void 0===n||n.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),Rt=function(e){return null==e},Vt=function(e){return!!Rt(e)||e&&0===Object.keys(e).length},Ut=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},Lt=function(){function e(e,t,n,r){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=n,this.scalar=r}return e.prototype.start=function(e){return st(this,void 0,void 0,function(){return lt(this,function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}})})},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,n){return st(this,void 0,void 0,function(){var r=this;return lt(this,function(i){return this.done||(this.timeoutHandle=ye.setTimeout(function(){return st(r,void 0,void 0,function(){var r,i;return lt(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(r=t+1)<this.attempts&&(i=Math.min(n*this.scalar,this.max),this.backoff(e,r,i)),[3,3];case 3:return[2]}})})},n)),[2]})})},e}(),Dt=function(e){var t,n,r,i;if(!e)return{};var o={user:e},a=be();a&&(o.page={url:a.location.href});var s={};if(!e.groups)return o;try{for(var l=ct(Object.keys(e.groups)),c=l.next();!c.done;c=l.next()){var u=c.value,d=e.groups[u];if(d.length>0&&d[0]){var f=d[0],h={group_name:f},v=null===(i=null===(r=e.group_properties)||void 0===r?void 0:r[u])||void 0===i?void 0:i[f];v&&Object.keys(v).length>0&&(h.group_properties=v),s[u]=h}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return Object.keys(s).length>0&&(o.groups=s),delete o.user.groups,delete o.user.group_properties,o},Ft=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},Bt=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var n={};return e.key&&(n.key=e.key),e.value&&(n.value=e.value),e.payload&&(n.payload=e.payload),t&&(n.expKey=t),e.metadata&&(n.metadata=e.metadata),n},Kt=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),qt=function(){function e(e){this.tracked={},this.identity={},this.exposureTrackingProvider=e}return e.prototype.track=function(e,t){var n={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,n)||(this.tracked={}),this.identity=n;var r=e.flag_key in this.tracked,i=this.tracked[e.flag_key];r&&i===e.variant||(this.tracked[e.flag_key]=e.variant,this.exposureTrackingProvider.track(e))},e.prototype.identityEquals=function(e,t){return e.userId===t.userId&&e.deviceId===t.deviceId},e}(),zt=function(){function e(t,n){var r,i,o,a,s=this;this.engine=new H,this.isRunning=!1,this.apiKey=t,n=function(e){var t,n;if(!e||"object"!=typeof e)return{};var r={};try{for(var i=ct(Object.entries(e)),o=i.next();!o.done;o=i.next()){var a=ut(o.value,2),s=a[0],l=a[1];Rt(l)||(r[s]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(n),this.config=at(at(at({},xt),n),{serverUrl:(null==n?void 0:n.serverUrl)||("eu"===(null===(r=null==n?void 0:n.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":xt.serverUrl),flagsServerUrl:(null==n?void 0:n.flagsServerUrl)||("eu"===(null===(i=null==n?void 0:n.serverZone)||void 0===i?void 0:i.toLowerCase())?"https://flag.lab.eu.amplitude.com":xt.flagsServerUrl),flagConfigPollingIntervalMillis:n.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=n.flagConfigPollingIntervalMillis)&&void 0!==o?o:xt.flagConfigPollingIntervalMillis}),this.logger=new Tt(this.config.loggerProvider||new Ct,e.getLogLevel(n));var l=null===(a=this.config)||void 0===a?void 0:a.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new Se(function(){return st(s,void 0,void 0,function(){var e;return lt(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this.logger.info(e),[3,3];case 3:return[2]}})})},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var c in this.config.initialVariants)this.config.initialVariants[c]=Nt(this.config.initialVariants[c]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new Kt(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new qt(this.config.exposureTrackingProvider)),this.integrationManager=new Et(this.config,this);var u,d=new bt(this.config.httpClient||wt);this.flagApi=new me(this.apiKey,this.config.flagsServerUrl,d),this.evaluationApi=new ge(this.apiKey,this.config.serverUrl,d);var f=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;u=this.isWebExperiment?new jt:new Pt,this.variants=function(e,t,n){var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r);return new It(i,n,Nt)}(this.apiKey,f,u),this.flags=function(e,t,n){void 0===n&&(n=new Pt);var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r,"-flags");return new It(i,n)}(this.apiKey,f,u),this.fetchVariantsOptions=function(e,t,n){void 0===n&&(n=new Pt);var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r,"-variants-options");return new Mt(i,n)}(this.apiKey,f,u);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return st(this,void 0,void 0,function(){var t,n,r;return lt(this,function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:return i.trys.push([1,6,,7]),t=this.doFlags(),null===(r=this.config.fetchOnStart)||void 0===r||r?[4,Promise.all([this.fetch(e),t])]:[3,3];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(n=i.sent(),this.config.throwOnError)throw n;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}})})},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return st(this,arguments,void 0,function(e,t){var n;return void 0===e&&(e=this.user),lt(this,function(r){switch(r.label){case 0:this.setUser(e||{}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return r.sent(),[3,4];case 3:if(n=r.sent(),this.config.throwOnError)throw n;return n instanceof pe?this.logger.debug(n):this.logger.error(n),[3,4];case 4:return[2,this]}})})},e.prototype.variant=function(e,t){var n,r;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.logger.debug("[Experiment] variant for ".concat(e," is ").concat((null===(n=i.variant)||void 0===n?void 0:n.key)||(null===(r=i.variant)||void 0===r?void 0:r.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var n=this.flags.get(t);Ut(n)||delete e[t]}return at(at(at({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=at({},this.user.user_properties);return at(at({},this.user),{user_properties:t})}return at({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var n=at({},e.user_properties);this.user=at(at({},e),{user_properties:n})}else this.user=at({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach(function(t){e.flags.get(t.key)||e.flags.put(t.key,t)})},e.prototype.evaluate=function(e){var t,n,r=this.addContext(this.user),i=J(this.flags.getAll(),e),o=Dt(r),a=this.engine.evaluate(o,i),s={};try{for(var l=ct(Object.keys(a)),c=l.next();!c.done;c=l.next()){var u=c.value;s[u]=Bt(a[u])}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return s},e.prototype.getEvaluationTraces=function(e){var t=this.addContext(this.user),n=J(this.flags.getAll(),e),r=Dt(t);return this.engine.evaluateWithTraces(r,n).traces},e.prototype.variantAndSource=function(e,t){var n={};this.config.source===gt.LocalStorage?n=this.localStorageVariantAndSource(e,t):this.config.source===gt.InitialVariants&&(n=this.initialVariantsVariantAndSource(e,t));var r=this.flags.get(e);return(Ut(r)||!n.variant&&r)&&(n=this.localEvaluationVariantAndSource(e,r,t)),n},e.prototype.localEvaluationVariantAndSource=function(e,t,n){var r,i={},o=this.evaluate([t.key])[e],a=mt.LocalEvaluation,s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!Rt(o)&&!s)return{variant:Ft(o),source:a,hasDefaultVariant:!1};if(s&&(i={variant:Ft(o),source:a,hasDefaultVariant:!0}),!Rt(n))return{variant:Ft(n),source:mt.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!Rt(l))return{variant:Ft(l),source:mt.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var c=Ft(this.config.fallbackVariant),u={variant:c,source:mt.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Vt(c)?i:u},e.prototype.localStorageVariantAndSource=function(e,t){var n,r={},i=this.variants.get(e),o=null===(n=null==i?void 0:i.metadata)||void 0===n?void 0:n.default;if(!Rt(i)&&!o)return{variant:Ft(i),source:mt.LocalStorage,hasDefaultVariant:!1};if(o&&(r={variant:Ft(i),source:mt.LocalStorage,hasDefaultVariant:!0}),!Rt(t))return{variant:Ft(t),source:mt.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var a=this.config.initialVariants[e];if(!Rt(a))return{variant:Ft(a),source:mt.SecondaryInitialVariants,hasDefaultVariant:r.hasDefaultVariant};var s=Ft(this.config.fallbackVariant),l={variant:s,source:mt.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return Vt(s)?r:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var n,r={},i=this.config.initialVariants[e];if(!Rt(i))return{variant:Ft(i),source:mt.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!Rt(o)&&!a)return{variant:Ft(o),source:mt.LocalStorage,hasDefaultVariant:!1};if(a&&(r={variant:Ft(o),source:mt.LocalStorage,hasDefaultVariant:!0}),!Rt(t))return{variant:Ft(t),source:mt.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var s=Ft(this.config.fallbackVariant),l={variant:s,source:mt.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return Vt(s)?r:l},e.prototype.fetchInternal=function(e,t,n,r){return st(this,void 0,void 0,function(){var i,o,a;return lt(this,function(s){switch(s.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(n)),n&&this.stopRetries(),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,this.doFetch(e,t,at({trackingOption:null===(a=this.fetchVariantsOptions.get())||void 0===a?void 0:a.trackingOption},r))];case 2:return i=s.sent(),[4,this.storeVariants(i,r)];case 3:return s.sent(),[2,i];case 4:throw o=s.sent(),n&&this.shouldRetryFetch(o)&&this.startRetries(e,r),o;case 5:return[2]}})})},e.prototype.setTracksAssignment=function(e){return st(this,void 0,void 0,function(){return lt(this,function(t){return this.fetchVariantsOptions.put(at(at({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(e){var t=at({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,n){return st(this,void 0,void 0,function(){var r,i,o,a,s,l,c;return lt(this,function(u){switch(u.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=u.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,at({timeoutMillis:t},n))];case 2:r=u.sent(),i={};try{for(o=ct(Object.keys(r)),a=o.next();!a.done;a=o.next())s=a.value,i[s]=Bt(r[s])}catch(e){l={error:e}}finally{try{a&&!a.done&&(c=o.return)&&c.call(o)}finally{if(l)throw l.error}}return this.logger.debug("[Experiment] Received variants: ",i),[2,i]}})})},e.prototype.doFlags=function(){return st(this,void 0,void 0,function(){var e,t,n;return lt(this,function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=r.sent(),r.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:kt,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=r.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((n=r.sent())instanceof pe))throw n;if(this.logger.debug(n),this.config.throwOnError)throw n;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}})})},e.prototype.storeVariants=function(e,t){return st(this,void 0,void 0,function(){var n,r,i,o;return lt(this,function(a){for(o in 0===(n=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),r=function(t){n=n.filter(function(e){return e!==t}),i.variants.put(t,e[t])},i=this,e)r(o);for(o in n)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.logger.debug("[Experiment] Stored variants: ",e),[2]})})},e.prototype.startRetries=function(e,t){return st(this,void 0,void 0,function(){var n=this;return lt(this,function(r){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new Lt(8,500,1e4,1.5),this.retriesBackoff.start(function(){return st(n,void 0,void 0,function(){return lt(this,function(n){switch(n.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return n.sent(),[2]}})})}),[2]})})},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,n=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),r=this.integrationManager.getUser(),i=at(at(at({},null==n?void 0:n.user_properties),r.user_properties),null==e?void 0:e.user_properties);return at(at(at(at({library:"experiment-js-client/".concat(kt)},n),r),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return st(this,void 0,void 0,function(){return lt(this,function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}})})},e.prototype.sourceVariants=function(){return this.config.source==gt.LocalStorage?this.variants.getAll():this.config.source==gt.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==gt.LocalStorage?this.config.initialVariants:this.config.source==gt.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var n,r,i,o,a,s,l,c,u;if(null===(i=null===(r=null===(n=t.variant)||void 0===n?void 0:n.metadata)||void 0===r?void 0:r.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var d={flag_key:e},f=St(t.source);if(!f||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(d.experiment_key=null===(a=t.variant)||void 0===a?void 0:a.expKey);var h=null===(s=t.variant)||void 0===s?void 0:s.metadata;if(f||(null==h?void 0:h.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(c=t.variant)||void 0===c?void 0:c.value)&&(d.variant=t.variant.value)),h&&(d.metadata=h),this.isWebExperiment&&(d.time=Date.now()),this.isWebExperiment){var v=be();if(null==v?void 0:v.location)try{var p=v.location.href;d.metadata.url=p.split("?")[0]||""}catch(e){}}var g=this.addContext(this.getUser());null===(u=this.userSessionExposureTracker)||void 0===u||u.track(d,g),this.integrationManager.track(d,g)}}},e.prototype.legacyExposureInternal=function(e,t,n){var r,i,o,a,s;if(this.analyticsProvider){var l=function(e,t,n,r){var i,o=null==n?void 0:n.value,a="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:n,userProperty:a,properties:{key:t,variant:o,source:r},userProperties:(i={},i[a]=o,i)}}(this.addContext(this.getUser()),e,t,n);St(n)||!(null==t?void 0:t.value)?null===(i=null===(r=this.analyticsProvider)||void 0===r?void 0:r.unsetUserProperty)||void 0===i||i.call(r,l):(null==t?void 0:t.value)&&(null===(a=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===a||a.call(o,l),null===(s=this.analyticsProvider)||void 0===s||s.track(l))}},e.getLogLevel=function(e){var t;return!0===e.debug?pt.Debug:null!==(t=e.logLevel)&&void 0!==t?t:pt.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof ve)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),Wt=function(){function e(e,t){var n,r,i;this.globalScope=be(),this.userAgent=void 0!==(null===(n=this.globalScope)||void 0===n?void 0:n.navigator)?null===(r=this.globalScope)||void 0===r?void 0:r.navigator.userAgent:void 0,this.ua=new rt.UAParser(this.userAgent).getResult(),this.localStorage=new Pt,this.sessionStorage=new jt,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,n,r,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return at({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(n=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==n?n:"desktop",referring_url:null===(i=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,n;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(n=e.browser)||void 0===n?void 0:n.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,n=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==n?void 0:n.includes("Chrom"))&&(n="Chrome"),(null==n?void 0:n.includes("Firefox"))&&(n="Firefox"),(null==n?void 0:n.includes("Safari"))&&(n="Safari"),(null==n?void 0:n.includes("Edge"))&&(n="Edge"),(null==n?void 0:n.includes("Opera"))&&(n="Opera"),n},e.prototype.getCookie=function(){var e,t,n,r,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(r=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===r?void 0:r.cookie)||void 0===i?void 0:i.split("; ").map(function(e){return e.split("=")}))},e.prototype.getLandingUrl=function(){var e,t;try{var n=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return n.landing_url||(n.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(n))),n.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,n;if(this.globalScope){var r={};try{var i=new URL(this.globalScope.location.href);try{for(var o=ct(i.searchParams),a=o.next();!a.done;a=o.next()){var s=ut(a.value,2),l=s[0],c=s[1];r[l]=dt(dt([],ut(null!==(n=r[l])&&void 0!==n?n:[]),!1),ut(c.split(",")),!1)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(r).reduce(function(e,t){var n=ut(t,2),r=n[0],i=n[1];return e[r]=1==i.length?i[0]:i,e},{})}},e}();ye.experimentInstances={};var Ht,Jt=ye.experimentInstances,Gt=function(e,t){return $t(e,t)},Xt=function(e,t){return $t(e,t,function(){return new vt(e,Me.getInstance(Qt(t)),1e4)})},Qt=function(e){return(null==e?void 0:e.instanceName)||xt.instanceName},$t=function(e,t,n){var r=function(e,t){var n=Qt(t),r=null==t?void 0:t.internalInstanceNameSuffix;return r?"".concat(n,".").concat(e,".").concat(r):"".concat(n,".").concat(e)}(e,t),i=Jt[r];return i||(i=function(e,t){return new zt(e,at(at({},t),{userProvider:new Wt(null==t?void 0:t.userProvider,e)}))}(e,t),n&&i.addPlugin(n()),Jt[r]=i,i)},Zt={initialize:Gt,initializeWithAmplitudeAnalytics:Xt},Yt=function(){function e(){}return e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return st(this,void 0,void 0,function(){return lt(this,function(e){return[2]})})},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return st(this,void 0,void 0,function(){return lt(this,function(e){return[2,this]})})},e.prototype.getUserProvider=function(){return null},e.prototype.setUserProvider=function(e){return this},e.prototype.variant=function(e,t){return xt.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){},e}(),en=Object.freeze({__proto__:null,AmplitudeAnalyticsProvider:ot,AmplitudeIntegrationPlugin:vt,AmplitudeUserProvider:it,ConsoleLogger:Ct,Experiment:Zt,ExperimentClient:zt,get LogLevel(){return pt},get Source(){return gt},StubExperimentClient:Yt,initialize:Gt,initializeWithAmplitudeAnalytics:Xt});var tn="undefined"==typeof document?void 0:document,nn=!!tn&&"content"in tn.createElement("template"),rn=!!tn&&tn.createRange&&"createContextualFragment"in tn.createRange();function on(e){return e=e.trim(),nn?function(e){var t=tn.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(e):rn?function(e){return Ht||(Ht=tn.createRange()).selectNode(tn.body),Ht.createContextualFragment(e).childNodes[0]}(e):function(e){var t=tn.createElement("body");return t.innerHTML=e,t.childNodes[0]}(e)}function an(e,t){var n,r,i=e.nodeName,o=t.nodeName;return i===o||(n=i.charCodeAt(0),r=o.charCodeAt(0),n<=90&&r>=97?i===o.toUpperCase():r<=90&&n>=97&&o===i.toUpperCase())}function sn(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var ln={OPTION:function(e,t){var n=e.parentNode;if(n){var r=n.nodeName.toUpperCase();"OPTGROUP"===r&&(r=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==r||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}sn(e,t,"selected")},INPUT:function(e,t){sn(e,t,"checked"),sn(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var r=e.firstChild;if(r){var i=r.nodeValue;if(i==n||!n&&i==e.placeholder)return;r.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,r,i=-1,o=0,a=e.firstChild;a;)if("OPTGROUP"===(r=a.nodeName&&a.nodeName.toUpperCase()))(a=(n=a).firstChild)||(a=n.nextSibling,n=null);else{if("OPTION"===r){if(a.hasAttribute("selected")){i=o;break}o++}!(a=a.nextSibling)&&n&&(a=n.nextSibling,n=null)}e.selectedIndex=i}}};function cn(){}function un(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var dn=function(e){return function(t,n,r){if(r||(r={}),"string"==typeof n)if("#document"===t.nodeName||"HTML"===t.nodeName){var i=n;(n=tn.createElement("html")).innerHTML=i}else if("BODY"===t.nodeName){var o=n;(n=tn.createElement("html")).innerHTML=o;var a=n.querySelector("body");a&&(n=a)}else n=on(n);else 11===n.nodeType&&(n=n.firstElementChild);var s=r.getNodeKey||un,l=r.onBeforeNodeAdded||cn,c=r.onNodeAdded||cn,u=r.onBeforeElUpdated||cn,d=r.onElUpdated||cn,f=r.onBeforeNodeDiscarded||cn,h=r.onNodeDiscarded||cn,v=r.onBeforeElChildrenUpdated||cn,p=r.skipFromChildren||cn,g=r.addChild||function(e,t){return e.appendChild(t)},m=!0===r.childrenOnly,y=Object.create(null),b=[];function w(e){b.push(e)}function S(e,t){if(1===e.nodeType)for(var n=e.firstChild;n;){var r=void 0;t&&(r=s(n))?w(r):(h(n),n.firstChild&&S(n,t)),n=n.nextSibling}}function x(e,t,n){!1!==f(e)&&(t&&t.removeChild(e),h(e),S(e,n))}function k(e){if(1===e.nodeType||11===e.nodeType)for(var t=e.firstChild;t;){var n=s(t);n&&(y[n]=t),k(t),t=t.nextSibling}}function E(e){c(e);for(var t=e.firstChild;t;){var n=t.nextSibling,r=s(t);if(r){var i=y[r];i&&an(t,i)?(t.parentNode.replaceChild(i,t),_(i,t)):E(t)}else E(t);t=n}}function _(t,n,r){var i=s(n);if(i&&delete y[i],!r){var o=u(t,n);if(!1===o)return;if(o instanceof HTMLElement&&k(t=o),e(t,n),d(t),!1===v(t,n))return}"TEXTAREA"!==t.nodeName?function(e,t){var n,r,i,o,a,c=p(e,t),u=t.firstChild,d=e.firstChild;e:for(;u;){for(o=u.nextSibling,n=s(u);!c&&d;){if(i=d.nextSibling,u.isSameNode&&u.isSameNode(d)){u=o,d=i;continue e}r=s(d);var f=d.nodeType,h=void 0;if(f===u.nodeType&&(1===f?(n?n!==r&&((a=y[n])?i===a?h=!1:(e.insertBefore(a,d),r?w(r):x(d,e,!0),r=s(d=a)):h=!1):r&&(h=!1),(h=!1!==h&&an(d,u))&&_(d,u)):3!==f&&8!=f||(h=!0,d.nodeValue!==u.nodeValue&&(d.nodeValue=u.nodeValue))),h){u=o,d=i;continue e}r?w(r):x(d,e,!0),d=i}if(n&&(a=y[n])&&an(a,u))c||g(e,a),_(a,u);else{var v=l(u);!1!==v&&(v&&(u=v),u.actualize&&(u=u.actualize(e.ownerDocument||tn)),g(e,u),E(u))}u=o,d=i}!function(e,t,n){for(;t;){var r=t.nextSibling;(n=s(t))?w(n):x(t,e,!0),t=r}}(e,d,r);var m=ln[e.nodeName];m&&m(e,t)}(t,n):ln.TEXTAREA(t,n)}k(t);var A,O,T=t,C=T.nodeType,P=n.nodeType;if(!m)if(1===C)1===P?an(t,n)||(h(t),T=function(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}(t,(A=n.nodeName,(O=n.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==O?tn.createElementNS(O,A):tn.createElement(A)))):T=n;else if(3===C||8===C){if(P===C)return T.nodeValue!==n.nodeValue&&(T.nodeValue=n.nodeValue),T;T=n}if(T===n)h(t);else{if(n.isSameNode&&n.isSameNode(T))return;if(_(T,n,m),b)for(var M=0,I=b.length;M<I;M++){var N=y[b[M]];N&&x(N,N.parentNode,!1)}}return!m&&T!==t&&t.parentNode&&(T.actualize&&(T=T.actualize(t.ownerDocument||tn)),t.parentNode.replaceChild(T,t)),T}}(function(e,t){var n,r,i,o,a=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var s=a.length-1;s>=0;s--)r=(n=a[s]).name,i=n.namespaceURI,o=n.value,i?(r=n.localName||r,e.getAttributeNS(i,r)!==o&&("xmlns"===n.prefix&&(r=n.name),e.setAttributeNS(i,r,o))):e.getAttribute(r)!==o&&e.setAttribute(r,o);for(var l=e.attributes,c=l.length-1;c>=0;c--)r=(n=l[c]).name,(i=n.namespaceURI)?(r=n.localName||r,t.hasAttributeNS(i,r)||e.removeAttributeNS(i,r)):t.hasAttribute(r)||e.removeAttribute(r)}});function fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vn(){return vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vn.apply(null,arguments)}var pn=["selector","action","value","attribute","shadowHosts"],gn=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,mn={revert:function(){}},yn=new Map,bn=[],wn=new Set,Sn=new Set,xn=!1,kn=1;function En(e){for(var t,n=document,r=hn(null!=e?e:[]);!(t=r()).done;){var i=t.value,o=n.querySelector(i);if(null==o||!o.shadowRoot)return null;n=o.shadowRoot}return n}function _n(e){var t=En(e.shadowHosts);return t?{root:t,elements:Array.from(t.querySelectorAll(e.selector))}:{root:document,elements:[]}}function An(e){return _n(e).elements}function On(e,t,n,r){void 0===n&&(n={childList:!0,subtree:!0,attributes:!0,characterData:!0});var i=[],o=new WeakSet,a=!1,s=!1,l=function(e){var o=e instanceof ShadowRoot,l=new MutationObserver(function(n,i){if(s)for(var a=Sn.size>0?Array.from(Sn).join(","):"",l=0;l<n.length;l++)for(var u=n[l].addedNodes,d=0;d<u.length;d++){var f=u[d];f.nodeType===Node.ELEMENT_NODE&&c(f,a)}o&&r?r(e):t(n,i)});l.__params=[e,n],i.push(l),a||l.observe(e,n)},c=function(e,t){if(t){e instanceof Element&&e.matches(t)&&e.shadowRoot&&!o.has(e.shadowRoot)&&(o.add(e.shadowRoot),l(e.shadowRoot),c(e.shadowRoot,t));for(var n=e.querySelectorAll(t),r=0;r<n.length;r++){var i=n[r];i.shadowRoot&&!o.has(i.shadowRoot)&&(o.add(i.shadowRoot),l(i.shadowRoot),c(i.shadowRoot,t))}}};return l(e),{disconnect:function(){for(var e=0,t=i;e<t.length;e++){t[e].disconnect()}i.length=0},pause:function(){if(!a){a=!0;for(var e=0,t=i;e<t.length;e++){t[e].disconnect()}}},resume:function(){if(a){a=!1;for(var e=0,t=i;e<t.length;e++){var n=t[e];n.__params&&n.observe.apply(n,n.__params)}}},enableShadowAwareness:function(){s=!0;var t=Sn.size>0?Array.from(Sn).join(","):"";t&&(e.nodeType===Node.ELEMENT_NODE?c(e,t):e===document&&c(document.documentElement,t))}}}function Tn(e){return"html"===e?{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[e]}}function Cn(e){var t=yn.get(e);return t||(t={element:e,attributes:{}},yn.set(e,t)),t}function Pn(e,t){return e.parentNode===t.parentNode&&e.insertBeforeNode===t.insertBeforeNode}function Mn(e,t){wn.add(e),e.__params=t,xn||e.observe.apply(e,e.__params)}function In(e,t,n,r,i){var o,a=n(e),s=function(e,t){vr(),i(e,t),pr()},l={isDirty:!1,originalValue:a,virtualValue:a,mutations:[],el:e,rateLimitCount:0,observer:new MutationObserver(function(r){if(!(l.rateLimitCount>=10))if(l.rateLimitCount++,setTimeout(function(){l.rateLimitCount=l.rateLimitCount-1,l.rateLimitCount<=0&&(l.rateLimitCount=0)},1e3),"html"!==t){var i=n(e);if("position"===t||"insert"===t){if(Pn(i,l.virtualValue))return;var o=l.mutations.at(-1);if(!o)return;if(ar(l.virtualValue.parentNode,o))return}i!==l.virtualValue&&("position"!==t&&"insert"!==t&&(l.originalValue=i),s(l))}else{var a=l.modifiedNodes;vr();for(var c=function(){var t=r[u],n=t.target,i=t.type,o=t.oldValue;if("childList"===i)return null!=a&&a.has(n)?(t.removedNodes.forEach(function(e){n.insertBefore(e,t.nextSibling)}),t.addedNodes.forEach(function(e){e.remove()}),0):0;if("characterData"===i){var s=n.parentNode;return null!==s&&null!=a&&a.has(s)?(n.nodeValue=o,0):0}if("attributes"===i&&n instanceof Element){if(n===e)return 0;if(null==a||!a.has(n))return 0;var l=t.attributeName;if(!l)return 0;null===o?n.removeAttribute(l):n.setAttribute(l,o)}},u=r.length-1;u>=0;u--)c();pr()}}),mutationRunner:s,setValue:r,getCurrentValue:n};return"html"===t&&(l.originalValue=e.cloneNode(!0),l.discardStacks=[]),o="position"===t||"insert"===t?[e.parentNode||document,{childList:!0,subtree:!0,attributes:!1,characterData:!1}]:[e,Tn(t)],Mn(l.observer,o),l}function Nn(e,t){var n=t.getCurrentValue(t.el);t.virtualValue=e,!e||"string"==typeof e||"string"==typeof n||n instanceof Element||e instanceof Element?e!==n&&(t.isDirty=!0,ir()):n&&Pn(n,e)||(t.isDirty=!0,ir())}var jn=new DOMParser;function Rn(e,t){if(t){var n=t.originalClones.get(e.el);if(!n)return;Nn(n,e)}else{var r=e.originalValue.cloneNode(!0),i=r.innerHTML,o=i;if(e.mutations.forEach(function(e){o=e.mutate(o)}),o!==i){var a=jn.parseFromString(o,"text/html").body.childNodes;r.innerHTML="",r.append.apply(r,Array.from(a))}Nn(r,e)}}function Vn(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach(function(e){return e.mutate(t)}),Nn(Array.from(t).filter(Boolean).join(" "),e)}function Un(e){var t=e.originalValue;e.mutations.forEach(function(e){t=e.mutate(t)}),Nn(t,e)}function Ln(e,t){if("insertSelector"in e){var n,r=e.insertSelector,i=e.direction,o=t.querySelector(r);if(!o)return null;switch(i){case"prepend":n={parentNode:o,insertBeforeNode:o.firstChild};break;case"append":n={parentNode:o,insertBeforeNode:null};break;case"before":n={parentNode:o.parentNode,insertBeforeNode:o};break;case"after":n={parentNode:o.parentNode,insertBeforeNode:o.nextSibling}}return vn({},n,{insertNode:o,direction:i})}var a=e.parentSelector,s=e.insertBeforeSelector,l=t.querySelector(a);if(!l)return null;var c=s?t.querySelector(s):null;return s&&!c?null:{parentNode:l,insertBeforeNode:c}}function Dn(e){for(var t=e.originalValue,n=e.mutations.length-1;n>=0;n--){var r,i=e.mutations[n];if(!i.newPosition||!i.newPosition.parentNode.isConnected||!1===(null==(r=i.newPosition.insertBeforeNode)?void 0:r.isConnected)){var o=En(i.shadowHosts);i.newPosition=o?Ln(i.mutate(),o):null}if(i.newPosition){t=i.newPosition;break}}Nn(t,e)}function Fn(e,t){var n=t.get(e);if(void 0!==n)return n;if(e.id)return e.id;for(var r=e.parentElement,i=Fn(r,t),o=new Map,a=r.firstElementChild;a;){var s=o.get(a.tagName)||0;o.set(a.tagName,s+1),a.id||t.set(a,i+" "+a.tagName+":"+s),a=a.nextElementSibling}return t.get(e)||""}var Bn=function(e){return e},Kn=function(e,t,n){var r,i,o,a,s,l,c=(null!=(r=null==(i=n.discardStacks)?void 0:i.length)?r:0)>(null!=(o=n.mutations.length)?o:0);c?a=(null==(s=n.discardStacks)?void 0:s.pop())||new Map:(a=new Map,null==(l=n.discardStacks)||l.push(a));n.modifiedNodes=new WeakSet([e]);var u=new WeakMap([[e,""],[t,""]]);!function(e,t){var n=e.querySelector("svg");if(n)for(var r=n.getAttributeNode("xmlns"),i=null==r?void 0:r.namespaceURI,o=t.querySelectorAll("svg"),a=0;a<o.length;a++){var s=o[a].getAttributeNode("xmlns");(null==s?void 0:s.namespaceURI)!==i&&(s&&o[a].removeAttributeNode(s),r&&(i?o[a].setAttributeNS(i,"xmlns",r.value):o[a].setAttribute("xmlns",r.value)))}}(e,t),dn(e,t,{childrenOnly:!0,getNodeKey:function(e){return e.nodeType!==Node.ELEMENT_NODE?"":Fn(e,u)},onBeforeElUpdated:function(e,t){var r;return!e.isEqualNode(t)&&(null==(r=n.modifiedNodes)||r.add(e),!0)},onNodeAdded:function(e){var t,r;e.parentNode&&(null==(t=n.modifiedNodes)||t.add(e.parentNode),null==(r=n.modifiedNodes)||r.add(e));return e},addChild:function(e,t){var n,r;c&&t.nodeType===Node.ELEMENT_NODE&&null!=(n=a.get(e))&&n.length?(e.appendChild(null==(r=a.get(e))?void 0:r.shift()),t.remove()):e.appendChild(t)},onBeforeNodeDiscarded:function(e){var t,r,i=e.parentNode;i&&(null==(t=n.modifiedNodes)||t.add(i),e.nodeType===Node.ELEMENT_NODE&&(e.__removedByDomMutator__=!0,c||(a.has(i)||a.set(i,[]),null==(r=a.get(i))||r.push(e))));return!0}})};function qn(e){var t=Cn(e);return t.html||(t.html=In(e,"html",Bn,Kn,Rn)),t.html}var zn=function(e){return{parentNode:e.parentNode,insertBeforeNode:e.nextSibling}},Wn=function(e,t,n){if("insertNode"in t){t.insertNode[t.direction](e),t.insertBeforeNode=e.nextSibling||null}else{if(t.insertBeforeNode&&!t.parentNode.contains(t.insertBeforeNode))return;t.parentNode.insertBefore(e,t.insertBeforeNode)}null!=n&&n.__params&&(n.disconnect(),Mn(n,[e.parentNode,n.__params[1]]))};function Hn(e){var t=Cn(e);return t.position||(t.position=In(e,"position",zn,Jn,Dn)),t.position}var Jn=function(e,t){var n;Wn(e,t,null==(n=Cn(e).position)?void 0:n.observer)},Gn=function(e,t){var n;Wn(e,t,null==(n=Cn(e).insert)?void 0:n.observer)};function Xn(e){var t=Cn(e);return t.insert||(t.insert=In(e,"insert",zn,Gn,Dn)),t.insert}var Qn=function(e,t){t?e.className=t:e.removeAttribute("class")},$n=function(e){return e.className};function Zn(e){var t=Cn(e);return t.classes||(t.classes=In(e,"class",$n,Qn,Vn)),t.classes}var Yn=function(e){return function(t){var n;return"style"===e?t.style.cssText:null!=(n=t.getAttribute(e))?n:null}},er=function(e){return function(t,n){null!==n?"style"===e?n?t.style.cssText=n:t.removeAttribute("style"):t.setAttribute(e,n):t.removeAttribute(e)}};function tr(e,t){var n=Cn(e);return n.attributes[t]||(n.attributes[t]=In(e,t,Yn(t),er(t),Un)),n.attributes[t]}function nr(e,t,n){if(n.isDirty){n.isDirty=!1;var r=n.virtualValue;n.mutations.length||function(e,t){var n,r=yn.get(e);if(r){var i,o;if("html"===t)i=null==(o=r.html)?void 0:o.observer,delete r.html;else if("class"===t){var a;i=null==(a=r.classes)?void 0:a.observer,delete r.classes}else if("position"===t){var s;i=null==(s=r.position)?void 0:s.observer,delete r.position}else if("insert"===t){var l;i=null==(l=r.insert)?void 0:l.observer,delete r.insert}else{var c;i=null==(c=r.attributes)||null==(c=c[t])?void 0:c.observer,delete r.attributes[t]}null==(n=i)||n.disconnect(),wn.delete(i)}}(e,t),n.setValue(e,r,n)}}function rr(e,t){e.insert&&nr(t,"insert",e.insert),e.html&&nr(t,"html",e.html),e.classes&&nr(t,"class",e.classes),e.position&&nr(t,"position",e.position),Object.keys(e.attributes).forEach(function(n){nr(t,n,e.attributes[n])})}function ir(){yn.forEach(rr)}function or(e,t){var n=null;"html"===e.kind?(n=qn(t),e.originalClones.set(t,t.cloneNode(!0))):"class"===e.kind?n=Zn(t):"attribute"===e.kind?n=tr(t,e.attribute):"position"===e.kind?n=Hn(t):"insert"===e.kind&&(n=Xn(t)),n&&(n.mutations.push(e),n.mutationRunner(n),t.__mutationRecord__=Cn(t))}function ar(e,t){for(var n=t._priority||0,r=e;r;){var i;if(((null==(i=yn.get(r))||null==(i=i.html)||null==(i=i.mutations.at(-1))?void 0:i._priority)||0)>n)return!0;r=r.parentElement}return!1}function sr(e){var t=Array.from(e.elements);if(!t.some(function(e){return e.isConnected})){if(t.length>0){for(var n=t.at(-1);n.parentElement;)n=n.parentElement;if(n.__removedByDomMutator__)return}var r=new Set(e.elements),i="insert"===e.kind?function(e){if(!e.newPosition&&e.elements.size>0)return[];var t=jn.parseFromString(e.html(),"text/html").body.firstElementChild;return e.elements.clear(),t?[t]:[]}(e):An(e);i.forEach(function(t){r.has(t)||ar(t.parentElement,e)||(e.elements.add(t),or(e,t))})}}function lr(e){var t=bn.indexOf(e);if(-1!==t){for(var n=[],r=vr(!0),i=bn.length-1;i>t;i--){var o=bn[i];if("position"===o.kind||"insert"===o.kind){var a=o.newPosition;if(a){var s=!("direction"in a)||"before"===a.direction,l=cr(a.insertBeforeNode,e.elements,s);if(a.insertBeforeNode=l,"insertNode"in a)if("before"===a.direction)null===l?(a.insertNode=a.parentNode,a.direction="append"):a.insertNode=l;else if("after"===a.direction){var c,u=new Set(Array.from(e.elements).concat(Array.from(o.elements))),d=ur((null==(c=a.insertBeforeNode)?void 0:c.previousElementSibling)||a.parentNode.lastElementChild,u);null===d?(a.direction="prepend",a.insertNode=a.parentNode):a.insertNode=d}}}n.push(o),lr(o)}e.elements.forEach(function(t){return function(e,t){var n=null;if("html"===e.kind?n=qn(t):"class"===e.kind?n=Zn(t):"attribute"===e.kind?n=tr(t,e.attribute):"position"===e.kind?n=Hn(t):"insert"===e.kind&&(n=Xn(t)),n){var r=n.mutations.indexOf(e);-1!==r&&n.mutations.splice(r,1),e.rollback&&(n.originalValue=e.rollback(n.originalValue)),n.mutationRunner(n,e)}}(e,t)}),bn.splice(t,1),r();for(var f=function(){var e=n.pop();if(!e)return 1;yr(e),e.elements.forEach(function(t){return or(e,t)})};n.length>0;)f()}}function cr(e,t,n){for(var r=e;r instanceof Element&&t.has(r);)r=n?r.nextElementSibling:r.nextSibling;return r}function ur(e,t){for(var n=e;n instanceof Element&&t.has(n);)n=n.previousElementSibling;return n}function dr(){bn.forEach(sr)}function fr(e){for(var t=0;t<bn.length;t++){var n=bn[t];if(n.shadowHosts&&0!==n.shadowHosts.length){for(var r,i=document,o=!1,a=hn(n.shadowHosts);!(r=a()).done;){var s=r.value,l=i.querySelector(s);if(null==l||!l.shadowRoot)break;if((i=l.shadowRoot)===e){o=!0;break}}o&&sr(n)}}}var hr=!1;function vr(e){var t;return void 0===e&&(e=!1),xn=!0,wn.forEach(function(e){return e.disconnect()}),null==(t=gr)||t.pause(),e&&!hr?(hr=!0,function(){hr=!1,pr()}):function(){}}function pr(){var e;xn&&!hr&&(xn=!1,wn.forEach(function(e){return e.__params&&e.observe.apply(e,e.__params)}),null==(e=gr)||e.resume(),dr())}var gr=null;function mr(){"undefined"!=typeof document&&(dr(),gr||(gr=On(document.documentElement,function(){dr()},{childList:!0,subtree:!0,attributes:!1,characterData:!1},fr),bn.some(function(e){return e.shadowHosts&&e.shadowHosts.length>0})&&gr.enableShadowAwareness(),xn&&gr.pause()))}function yr(e){if("undefined"==typeof document)return mn;var t;e.shadowHosts&&e.shadowHosts.length>0&&(Sn.add(e.shadowHosts[0]),null==(t=gr)||t.enableShadowAwareness());return e._priority=kn++,bn.push(e),sr(e),{__mutation:e,revert:function(){lr(e)}}}function br(e,t,n){return yr({kind:"html",elements:new Set,mutate:t,selector:e,originalClones:new WeakMap,shadowHosts:n})}function wr(e,t,n){return yr({kind:"position",elements:new Set,mutate:t,selector:e,shadowHosts:n})}function Sr(e,t,n){return yr({kind:"insert",elements:new Set,selector:"",mutate:e,html:t,shadowHosts:n})}function xr(e,t,n,r){return yr({kind:"class",elements:new Set,mutate:t,selector:e,shadowHosts:r,rollback:n})}function kr(e,t,n,r,i){return gn.test(t)?"class"===t||"className"===t?xr(e,function(e){var t=n(Array.from(e).join(" "));e.clear(),t&&t.split(/\s+/g).filter(Boolean).forEach(function(t){return e.add(t)})},r,i):yr({kind:"attribute",attribute:t,elements:new Set,mutate:n,selector:e,shadowHosts:i,rollback:r}):mn}mr();var Er={html:br,classes:xr,attribute:kr,position:wr,insert:Sr,declarative:function(e){if("insert"===e.action){var t,n=e.value,r=e.shadowHosts;if("insertSelector"in e){var i=e.insertSelector,o=e.direction;t={insertSelector:i,direction:o}}else{if(!("parentSelector"in e))return mn;var a=e.parentSelector,s=e.insertBeforeSelector;t={parentSelector:a,insertBeforeSelector:s}}return Sr(function(){return t},function(){return null!=n?n:""},r)}var l=e.selector,c=e.action,u=e.value,d=e.attribute,f=e.shadowHosts,h=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,pn);if("html"===d){if("append"===c)return br(l,function(e){return e+(null!=u?u:"")},f);if("set"===c)return br(l,function(){return null!=u?u:""},f)}else if("class"===d){if("append"===c)return xr(l,function(e){u&&e.add(u)},function(e){if(u&&e){var t=new Set(e.split(/\s+/).filter(Boolean));return t.delete(u),Array.from(t).join(" ")}return e},f);if("remove"===c)return xr(l,function(e){u&&e.delete(u)},void 0,f);if("set"===c)return xr(l,function(e){e.clear(),u&&e.add(u)},void 0,f)}else if("position"===d){if("set"===c){if("insertSelector"in h)return wr(l,function(){return{insertSelector:h.insertSelector,direction:h.direction}},f);if("parentSelector"in h)return wr(l,function(){return{insertBeforeSelector:h.insertBeforeSelector,parentSelector:h.parentSelector}},f)}}else{var v=u||"";if("append"===c)return"style"===d?kr(l,d,function(e){return e?e+v:v},function(e){if(null===e)return null;var t=e.lastIndexOf(v);return-1!==t?e.substring(0,t)+e.substring(t+v.length):e},f):kr(l,d,function(e){return null!==e?e+v:v},void 0,f);if("set"===c)return kr(l,d,function(){return v},void 0,f);if("remove"===c)return kr(l,d,function(){return null},void 0,f)}return mn}},_r={observeShadowAwareMutations:On,outermostShadowHostSelectors:Sn},Ar=Object.freeze({__proto__:null,default:Er,_testing:_r,connectGlobalObserver:mr,disconnectGlobalObserver:function(){var e;null==(e=gr)||e.disconnect(),gr=null},isGlobalObserverPaused:function(){return xn},pauseGlobalObserver:vr,resolveScope:_n,resolveTargets:An,resumeGlobalObserver:pr,validAttributeName:gn}),Or=function(){function e(e){this.eventStorage=e,this.evaluationEngine=new H}return e.prototype.evaluate=function(e){var t,n;try{for(var r=i(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(this.evaluateAndGroup(a))return!0}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!1},e.prototype.evaluateAndGroup=function(e){var t,n;try{for(var r=i(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(!this.evaluateConditionSet(a))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},e.prototype.evaluateConditionSet=function(e){var t=this.evaluateCondition(e.condition);return e.negated?!t:t},e.prototype.evaluateCondition=function(e){var t=this,n=this.eventStorage.getEventsInTimeWindow(e.event_type,e.time_type,e.time_value,e.interval).filter(function(n){return t.evaluatePropertyFilters(n,e.event_props||[])}).length;return this.evaluateCountOperator(n,e.op,e.value)},e.prototype.evaluatePropertyFilters=function(e,t){if(!t||0===t.length)return!0;var n={context:e.properties,result:{}};return this.evaluationEngine.evaluateConditions(n,[t])},e.prototype.evaluateCountOperator=function(e,t,n){switch(t){case x:return e>=n;case S:return e>n;case p:return e===n;case b:return e<n;case w:return e<=n;case g:return e!==n;default:return!1}},e}(),Tr=function(){function e(e,t,n){var r=this;this.debouncedWriteTimeout=null,this.hasPendingWrites=!1,this.handleBeforeUnload=function(){r.flushToLocalStorage()},this.handleVisibilityChange=function(){"hidden"===document.visibilityState&&r.flushToLocalStorage()},this.storageKey="EXP_".concat(e.slice(0,10),"_rtbt_events"),this.sessionManager=t,this.persistedEvents=n,this.memoryCache=this.loadFromLocalStorage(),this.setupFlushHandlers()}return e.prototype.addEvent=function(t,n,r){if(void 0===n&&(n={}),!this.persistedEvents||this.persistedEvents.has(t)){var i=this.sessionManager.getOrCreateSessionId(),o={id:this.memoryCache.nextId++,event_type:t,timestamp:null!=r?r:Date.now(),session_id:i,properties:n};this.memoryCache.events.push(o),this.memoryCache.events.length>e.MAX_EVENTS&&(this.memoryCache.events=this.memoryCache.events.slice(-e.MAX_EVENTS)),this.scheduleDebouncedWrite()}},e.prototype.getAllEvents=function(){return this.memoryCache.events},e.prototype.getEventsByType=function(e){return this.memoryCache.events.filter(function(t){return t.event_type===e})},e.prototype.getEventsInTimeWindow=function(e,t,n,r){var i=this.memoryCache.events.filter(function(t){return t.event_type===e});if("current_session"===t){var o=this.sessionManager.getOrCreateSessionId();i=i.filter(function(e){return e.session_id===o})}else{var a=Date.now()-("day"===r?24*n*60*60*1e3:60*n*60*1e3);i=i.filter(function(e){return e.timestamp>=a})}return i},e.prototype.clearEvents=function(){this.memoryCache={events:[],nextId:1},this.hasPendingWrites=!0,this.flushToLocalStorage()},e.prototype.flush=function(){this.flushToLocalStorage()},e.prototype.getEventCount=function(e){return this.getEventsByType(e).length},e.prototype.getEventCountInTimeWindow=function(e,t,n,r){return this.getEventsInTimeWindow(e,t,n,r).length},e.prototype.loadFromLocalStorage=function(){var e=localStorage.getItem(this.storageKey);if(e)try{var t=JSON.parse(e);return t&&"object"==typeof t&&Array.isArray(t.events)&&"number"==typeof t.nextId?t:{events:[],nextId:1}}catch(e){return{events:[],nextId:1}}return{events:[],nextId:1}},e.prototype.scheduleDebouncedWrite=function(){var t=this;this.hasPendingWrites=!0,this.debouncedWriteTimeout&&clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=setTimeout(function(){t.flushToLocalStorage()},e.DEBOUNCE_MS)},e.prototype.flushToLocalStorage=function(){if(this.hasPendingWrites)try{localStorage.setItem(this.storageKey,JSON.stringify(this.memoryCache)),this.hasPendingWrites=!1,this.debouncedWriteTimeout&&(clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=null)}catch(e){}},e.prototype.setupFlushHandlers=function(){window.addEventListener("beforeunload",this.handleBeforeUnload),document.addEventListener("visibilitychange",this.handleVisibilityChange)},e.prototype.cleanup=function(){this.flushToLocalStorage(),this.debouncedWriteTimeout&&(clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=null),window.removeEventListener("beforeunload",this.handleBeforeUnload),document.removeEventListener("visibilitychange",this.handleVisibilityChange)},e.MAX_EVENTS=500,e.DEBOUNCE_MS=500,e}(),Cr=function(){function e(e){this.storageKey="EXP_".concat(e.slice(0,10),"_rtbt_session")}return e.prototype.getOrCreateSessionId=function(){if(this.sessionId)return this.sessionId;var e=sessionStorage.getItem(this.storageKey);if(e)try{var t=JSON.parse(e);if(t.sessionId&&"string"==typeof t.sessionId)return this.sessionId=t.sessionId,this.sessionStartTime=t.sessionStartTime,t.sessionId}catch(e){}return this.sessionId=this.generateSessionId(),this.sessionStartTime=Date.now(),sessionStorage.setItem(this.storageKey,JSON.stringify({sessionId:this.sessionId,sessionStartTime:this.sessionStartTime})),this.sessionId},e.prototype.getSessionStartTime=function(){return this.sessionStartTime||this.getOrCreateSessionId(),this.sessionStartTime},e.prototype.generateSessionId=function(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))},e.prototype.clearSession=function(){this.sessionId=void 0,this.sessionStartTime=void 0,sessionStorage.removeItem(this.storageKey)},e}(),Pr=function(){function e(e,t){void 0===t&&(t={}),this.matchedBehaviors=new Map,this.eventToBehaviors=new Map,this.rules=t,this.sessionManager=new Cr(e),this.buildEventToBehaviorsMap(),this.eventStorage=new Tr(e,this.sessionManager,new Set(this.eventToBehaviors.keys())),this.evaluator=new Or(this.eventStorage),this.evaluateAll()}return e.prototype.trackEvent=function(e,t){this.eventStorage.addEvent(e,t),this.evaluateEvent(e)},e.prototype.hasRules=function(e){return!!this.rules[e]},e.prototype.getMatchedBehaviors=function(){return this.matchedBehaviors},e.prototype.cleanup=function(){this.eventStorage.cleanup()},e.prototype.buildEventToBehaviorsMap=function(){var e,t,n,r;for(var a in this.rules){var s=this.rules[a];try{for(var l=(e=void 0,i(Object.entries(s))),c=l.next();!c.done;c=l.next()){var u=o(c.value,2),d=u[0],f=u[1],h=this.extractEventTypes(f);try{for(var v=(n=void 0,i(h)),p=v.next();!p.done;p=v.next()){var g=p.value,m=this.eventToBehaviors.get(g);m||(m=[],this.eventToBehaviors.set(g,m)),m.push({id:d,flagKey:a})}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}}},e.prototype.extractEventTypes=function(e){var t,n,r,o,a=new Set;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var c=l.value;try{for(var u=(r=void 0,i(c)),d=u.next();!d.done;d=u.next()){var f=d.value;"behavior"===f.condition.type&&a.add(f.condition.event_type)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a},e.prototype.evaluateAll=function(){for(var e in this.rules)this.evaluateFlag(e)},e.prototype.evaluateEvent=function(e){var t,n,r=this.eventToBehaviors.get(e);if(r)try{for(var o=i(r),a=o.next();!a.done;a=o.next()){var s=a.value,l=s.id,c=s.flagKey;this.evaluateBehaviorId(c,l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},e.prototype.evaluateFlag=function(e){var t,n,r=this.rules[e];if(r){var a=new Set;try{for(var s=i(Object.entries(r)),l=s.next();!l.done;l=s.next()){var c=o(l.value,2),u=c[0],d=c[1];this.evaluator.evaluate(d)&&a.add(u)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}a.size>0?this.matchedBehaviors.set(e,a):this.matchedBehaviors.delete(e)}else this.matchedBehaviors.delete(e)},e.prototype.evaluateBehaviorId=function(e,t){var n=this.rules[e];if(n&&n[t]){var r=this.matchedBehaviors.get(e)||new Set,i=n[t];this.evaluator.evaluate(i)?r.add(t):r.delete(t),r.size>0?this.matchedBehaviors.set(e,r):this.matchedBehaviors.delete(e)}},e}();function Mr(e,t){var n,r,i,s=new(null!==(i=null===(r=(e.nodeType===Node.DOCUMENT_NODE?e:null!==(n=e.ownerDocument)&&void 0!==n?n:document).defaultView)||void 0===r?void 0:r.CSSStyleSheet)&&void 0!==i?i:CSSStyleSheet);s.replaceSync(t);var l=!1,c=function(){l||(e.adoptedStyleSheets=a(a([],o(e.adoptedStyleSheets),!1),[s],!1),l=!0)};return c(),{revert:function(){l&&(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(function(e){return e!==s}),l=!1)},reapply:c}}var Ir,Nr=function(e){if(document.body)e();else{var t=be();if(null==t?void 0:t.requestAnimationFrame){var n=function(){document.body?e():t.requestAnimationFrame(n)};t.requestAnimationFrame(n)}else e()}},jr=function(){function e(e){this.modal=null,this.options=e}return e.prototype.show=function(){document.getElementById("amp-preview-modal")||(this.createModal(),this.attachEventListeners())},e.prototype.hide=function(){var e,t;this.modal&&(this.modal.remove(),this.modal=null),null===(t=(e=this.options).onDismiss)||void 0===t||t.call(e)},e.prototype.createModal=function(){var e=this;if(document.body){this.modal=document.createElement("div"),this.modal.id="amp-preview-modal",this.modal.className="amp-preview-modal";var t=document.createElement("div");t.className="amp-preview-modal-container",Object.entries(this.options.flags).forEach(function(e){var n=o(e,2),r=n[0],i=n[1],a=document.createElement("div");a.className="amp-preview-modal-row";var s=document.createElement("div");s.className="amp-preview-modal-icon",s.innerHTML='\n <svg class="amp-preview-modal-icon-img" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.1389 11.4324L18.2087 18.1956H6.04109L11.1109 11.4324V6.02794H13.1389V11.4324ZM16.1402 4H8.10959C7.68372 4 7.45051 4.4867 7.71414 4.82131L9.083 6.53492V10.7632L3.20198 18.6011C2.70514 19.2704 3.1817 20.2235 4.01316 20.2235H20.2366C21.0681 20.2235 21.5447 19.2704 21.0478 18.6011L15.1668 10.7632V6.53492L16.5357 4.82131C16.7993 4.4867 16.5661 4 16.1402 4Z" fill="currentColor"/>\n </svg>\n ';var l=document.createElement("span");l.className="amp-preview-modal-title",l.textContent=r;var c=document.createElement("div");c.className="amp-preview-modal-badge amp-preview-modal-preview-badge",c.innerHTML='\n <svg class="amp-preview-modal-preview-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 6C15.79 6 19.17 8.13 20.82 11.5C19.17 14.87 15.79 17 12 17C8.21 17 4.83 14.87 3.18 11.5C4.83 8.13 8.21 6 12 6ZM12 4C7 4 2.73 7.11 1 11.5C2.73 15.89 7 19 12 19C17 19 21.27 15.89 23 11.5C21.27 7.11 17 4 12 4ZM12 9C13.38 9 14.5 10.12 14.5 11.5C14.5 12.88 13.38 14 12 14C10.62 14 9.5 12.88 9.5 11.5C9.5 10.12 10.62 9 12 9ZM12 7C9.52 7 7.5 9.02 7.5 11.5C7.5 13.98 9.52 16 12 16C14.48 16 16.5 13.98 16.5 11.5C16.5 9.02 14.48 7 12 7Z" fill="currentColor"/>\n </svg>\n Preview Mode\n ';var u=document.createElement("span");u.className="amp-preview-modal-badge amp-preview-modal-variant-badge amp-preview-modal-variant-".concat(i.toLowerCase());var d=document.createElement("span");d.className="amp-preview-modal-variant-dot",u.appendChild(d),u.appendChild(document.createTextNode(i)),a.appendChild(s),a.appendChild(l),a.appendChild(c),a.appendChild(u),t.appendChild(a)});var n=document.createElement("button");n.className="amp-preview-modal-close",n.setAttribute("aria-label","Dismiss preview mode notification"),n.innerHTML="×",this.modal.appendChild(t),this.modal.appendChild(n),this.injectStyles(),requestAnimationFrame(function(){e.modal&&document.body&&document.body.appendChild(e.modal)})}},e.prototype.attachEventListeners=function(){var e=this;if(this.modal){var t=this.modal.querySelector(".amp-preview-modal-close");t&&t.addEventListener("click",function(){return e.hide()})}},e.prototype.injectStyles=function(){if(!Ir){Ir=Mr(document,"\n .amp-preview-modal {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 10000;\n background-color: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.4;\n color: #2d3748;\n animation: amp-preview-modal-slide-in 0.3s ease-out;\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 12px 16px;\n max-width: 600px;\n }\n\n @keyframes amp-preview-modal-slide-in {\n from {\n transform: translateX(100%);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n\n .amp-preview-modal-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n\n .amp-preview-modal-row {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .amp-preview-modal-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .amp-preview-modal-icon-img {\n width: 16px;\n height: 16px;\n color: #718096;\n }\n\n .amp-preview-modal-title {\n font-weight: 600;\n color: #1a202c;\n font-size: 14px;\n white-space: nowrap;\n max-width: 300px;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /* Base badge styles */\n .amp-preview-modal-badge {\n background-color: #ffffff;\n color: #4a5568;\n padding: 4px 8px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n display: flex;\n align-items: center;\n gap: 6px;\n border: 1px solid #e2e8f0;\n }\n\n .amp-preview-modal-preview-badge {\n color: #718096;\n }\n\n .amp-preview-modal-preview-icon {\n width: 14px;\n height: 14px;\n color: currentColor;\n }\n\n .amp-preview-modal-variant-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: #68d391;\n flex-shrink: 0;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n\n .amp-preview-modal-close {\n background: none;\n border: none;\n cursor: pointer;\n padding: 4px;\n border-radius: 6px;\n color: #a0aec0;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 18px;\n line-height: 1;\n width: 24px;\n height: 24px;\n transition: all 0.2s ease;\n align-self: flex-start;\n }\n\n .amp-preview-modal-close:hover {\n background-color: #f7fafc;\n color: #718096;\n }\n\n .amp-preview-modal-close:focus {\n outline: 2px solid #3182ce;\n outline-offset: 1px;\n }\n\n /* Dark mode support */\n @media (prefers-color-scheme: dark) {\n .amp-preview-modal {\n background-color: #2d3748;\n border-color: #4a5568;\n color: #e2e8f0;\n }\n\n .amp-preview-modal-title {\n color: #f7fafc;\n }\n\n .amp-preview-modal-badge {\n background-color: #2d3748;\n color: #e2e8f0;\n border-color: #4a5568;\n }\n\n .amp-preview-modal-preview-badge {\n color: #a0aec0;\n }\n\n .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n\n .amp-preview-modal-close {\n color: #718096;\n }\n\n .amp-preview-modal-close:hover {\n background-color: #4a5568;\n color: #e2e8f0;\n }\n }\n ")}},e}();var Rr=function(){function e(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map}return e.prototype.subscribe=function(e,t,n){void 0===n&&(n=void 0);var r=this.messageToSubscriberGroup.get(e);r||(r={subscribers:[]},this.messageToSubscriberGroup.set(e,r));var i={identifier:n,callback:t};r.subscribers.push(i)},e.prototype.groupSubscribe=function(e,t){this.subscriberGroupCallback.set(e,t),this.messageToSubscriberGroup.has(e)||this.messageToSubscriberGroup.set(e,{subscribers:[]})},e.prototype.publish=function(e,t){var n,r=this.messageToSubscriberGroup.get(e);r&&(t=t||{},r.subscribers.forEach(function(e){e.callback(t)}),null===(n=this.subscriberGroupCallback.get(e))||void 0===n||n(t))},e.prototype.unsubscribeAll=function(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map},e}();var Vr=[],Ur=!1,Lr="not_started",Dr=null,Fr=function(e){var t;if(!0!==e.__AMP_DEBUG)try{Ur="true"===(null===(t=e.localStorage)||void 0===t?void 0:t.getItem("amp-ve-debug"))}catch(e){Ur=!1}else Ur=!0},Br=function(){return Ur},Kr=function(e,t){Ur&&Vr.push({timestamp:Date.now(),event:e,detail:t})},qr=function(e){Lr=e},zr=function(e){Dr=e},Wr=function(){var e,n=null!==(e=null==Dr?void 0:Dr())&&void 0!==e?e:{flags:{},visualEditor:{isActive:!1},currentUrl:""};return{flags:n.flags,visualEditor:t(t({},n.visualEditor),{messengerState:Lr}),events:Vr,currentUrl:n.currentUrl,timestamp:Date.now()}};function Hr(e,t){var n,r,o,a,s=[];try{for(var l=i(Object.values(e)),c=l.next();!c.done;c=l.next()){var u=c.value;try{for(var d=(o=void 0,i(Object.values(u))),f=d.next();!f.done;f=d.next()){var h=f.value;t.includes(h.trigger_type)&&s.push(h)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return s}var Jr="amp-device-iframe",Gr="amp-overlay-device-iframe-container";function Xr(){try{return"true"===sessionStorage.getItem("amp-visual-editor-mobile-mode")}catch(e){return!1}}function Qr(){return document.getElementById(Jr)}function $r(e,t){var n=t.location.href;n&&n!==e.location.href&&e.history.replaceState(e.history.state,"",n)}function Zr(e){var t=e.document,n=function(){for(Mr(t,"body > *:not(#".concat(Gr,"):not(#").concat("overlay-shadow-host",") { display: none !important; }"));t.body.firstChild;)t.body.removeChild(t.body.firstChild);t.body.style.cssText='\n margin: 0;\n padding: 0;\n overflow: auto;\n min-height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fff;\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABZSURBVHgB7dG7DYBADANQJxexAiXSTXw9uyExBih34SOxQhr83Li2ASIiIiIiIpo7QbLW1tms1zijq9puSDaGLxhhuBPaqyKZTFK+/r6AZOJlg8shqv5ccAGZWRnaKiSy9QAAAABJRU5ErkJggg==");\n ';var n=t.createElement("div");n.id=Gr,n.style.cssText="\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n ";var r=t.createElement("iframe");r.id=Jr,r.src=e.location.href,r.style.cssText="\n width: ".concat(402,"px;\n height: ").concat(874,"px;\n border: 1px solid #dedfe2;\n border-radius: 20px;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);\n background: #fff;\n transition: all 0.1s ease;\n "),r.addEventListener("load",function(){var t=r.contentWindow;if(t)try{$r(e,t),function(e,t){var n=t.history,r=function(n){return function(r,i,o){n.call(this,r,i,o),$r(e,t)}};n.pushState=r(n.pushState.bind(n)),n.replaceState=r(n.replaceState.bind(n)),t.addEventListener("popstate",function(){$r(e,t)})}(e,t)}catch(e){}}),n.appendChild(r),t.body.appendChild(n)};return new Promise(function(r){if("complete"===t.readyState&&t.body)n(),r();else{var i=function(){"complete"===t.readyState&&t.body?(n(),r()):e.requestAnimationFrame(i)};e.requestAnimationFrame(i)}})}var Yr,ei={observerOptions:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]},debounceMs:100},ti=function(){function e(n,r,i,s){void 0===i&&(i=[]),void 0===s&&(s={});var l=this;this.mutationObserver=null,this.pendingMutations=[],this.processMutationsImmediately=function(){if(l.mutationObserver)try{l.pendingMutations.length>0&&l.onMutations(l.pendingMutations)}catch(e){}finally{l.pendingMutations=[]}},this.handleMutations=function(t){var n,r;try{var i=t.filter(function(e){return l.shouldProcessMutation(e)});if(0===i.length)return;if(l.pendingMutations.length+i.length>e.MAX_PENDING_MUTATIONS)return(n=l.pendingMutations).push.apply(n,a([],o(i),!1)),l.processMutationsDebounced.cancel(),void l.processMutationsImmediately();(r=l.pendingMutations).push.apply(r,a([],o(i),!1)),l.processMutationsDebounced()}catch(e){}},this.target=n,this.onMutations=r,this.filters=i,this.options=t(t({},ei),s),this.processMutationsDebounced=function(e,t,n){void 0===n&&(n={});var r=null,i=null,s=function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];n.maxWait&&!i&&(i=setTimeout(function(){r&&(clearTimeout(r),r=null),i=null,e.apply(void 0,a([],o(s),!1))},n.maxWait)),r&&clearTimeout(r),r=setTimeout(function(){i&&(clearTimeout(i),i=null),e.apply(void 0,a([],o(s),!1))},t)};return s.cancel=function(){r&&clearTimeout(r),i&&clearTimeout(i),r=null,i=null},s}(this.processMutationsImmediately,this.options.debounceMs,{maxWait:2*this.options.debounceMs})}return e.prototype.shouldProcessMutation=function(e){if(0===this.filters.length)return!0;try{return this.filters.every(function(t){return t(e)})}catch(e){return!1}},e.prototype.cleanup=function(){var e;this.processMutationsDebounced.cancel(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.pendingMutations=[],this.mutationObserver=null},e.prototype.observe=function(){var e=this;return this.mutationObserver&&this.cleanup(),this.mutationObserver=new MutationObserver(this.handleMutations),this.mutationObserver.observe(this.target,this.options.observerOptions),function(){e.cleanup()}},e.MAX_PENDING_MUTATIONS=1e3,e}(),ni=new H,ri=function(){function e(e,s,l,c,u,d){var f=this;this.pageChangeSubscribers=new Set,this.lastNotifiedActivePages={},this.lastNotifiedActiveBehavioralFlags=new Map,this.intersectionObservers=new Map,this.elementVisibilityState=new Map,this.elementAppearedState=new Set,this.manuallyActivatedPageObjects=new Set,this.targetedElementSelectors=new Set,this.scrolledToObservers=new Map,this.scrolledToElementState=new Map,this.analyticsEventState=new Set,this.maxScrollPercentage=0,this.timeOnPageTimeouts={},this.firedUserInteractions=new Set,this.clickTimeouts=new Map,this.hoverTimeouts=new WeakMap,this.focusTimeouts=new WeakMap,this.userInteractionAbortController=null,this.pageLoadTime=Number.POSITIVE_INFINITY,this.lastPublishedUrl=null,this.debugStateSubscribers=new Set,this.debugDebounceTimer=null,this.setPageObjects=function(e){f.pageObjects=e},this.markUrlAsPublished=function(e){f.lastPublishedUrl=e},this.initSubscriptions=function(){f.setupPageObjectSubscriptions(),f.options.useDefaultNavigationHandler&&f.setupLocationChangePublisher(),f.setupMutationObserverPublisher(),f.setupVisibilityPublisher(),f.setupUserInteractionPublisher(),f.setupExitIntentPublisher(),f.setupScrolledToPublisher(),f.setupTimeOnPagePublisher(),f.setupVisibilityChangeHandler(),f.checkInitialElements()},this.addPageChangeSubscriber=function(e){return f.pageChangeSubscribers.add(e),function(){f.pageChangeSubscribers.delete(e)}},this.addDebugStateSubscriber=function(e){return f.debugStateSubscribers.add(e),function(){f.debugStateSubscribers.delete(e)}},this.scheduleDebugNotification=function(){f.options.isDebugActive&&0!==f.debugStateSubscribers.size&&(null!==f.debugDebounceTimer&&f.globalScope.clearTimeout(f.debugDebounceTimer),f.debugDebounceTimer=f.globalScope.setTimeout(function(){var e,t;f.debugDebounceTimer=null;var n=f.webExperimentClient.getDebugState();try{for(var r=i(f.debugStateSubscribers),o=r.next();!o.done;o=r.next()){(0,o.value)(n)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},100))},this.setupPageObjectSubscriptions=function(){var e,s,l,c,u,d,h,v,p={url_change:new Set};f.behavioralTargetingManager&&(p.analytics_event=new Set);try{for(var g=i(Object.entries(f.pageObjects)),m=g.next();!m.done;m=g.next()){var y=o(m.value,2),b=y[0],w=y[1];try{for(var S=(l=void 0,i(Object.values(w))),x=S.next();!x.done;x=S.next()){var k=x.value;p[k.trigger_type]||(p[k.trigger_type]=new Set),p[k.trigger_type].add(b)}}catch(e){l={error:e}}finally{try{x&&!x.done&&(c=S.return)&&c.call(S)}finally{if(l)throw l.error}}}}catch(t){e={error:t}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(e)throw e.error}}var E=function(e,t){var n,r,o=function(t){f.messageBus.subscribe(t.trigger_type,function(n){var r,i=!!(null===(r=f.webExperimentClient.getActivePages()[e])||void 0===r?void 0:r[t.id]),o=f.isPageObjectActive(t,n);f.webExperimentClient.updateActivePages(e,t,o),o&&!i&&Kr("trigger_fired","flag=".concat(e,", page=").concat(t.name||t.id,", ")+"type=".concat(t.trigger_type))})};try{for(var a=(n=void 0,i(Object.values(t))),s=a.next();!s.done;s=a.next()){o(s.value)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}};try{for(var _=i(Object.entries(f.pageObjects)),A=_.next();!A.done;A=_.next()){var O=o(A.value,2);E(b=O[0],w=O[1])}}catch(e){u={error:e}}finally{try{A&&!A.done&&(d=_.return)&&d.call(_)}finally{if(u)throw u.error}}var T=function(e){f.messageBus.groupSubscribe(e,function(s){return n(f,void 0,void 0,function(){var n,l,c,u,d,f,h,v,g,m,y,b,w,S,x,k,E,_=this;return r(this,function(r){switch(r.label){case 0:return l="analytics_event"===e,(n="url_change"===e)&&(Kr("url_change","navigated to ".concat(this.globalScope.location.href)),this.resetTriggerStates(),this.revertInjections()),c=this.webExperimentClient.getActivePages(),u=!function(e,t){var n,r,o,a,s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;try{for(var c=i(s),u=c.next();!u.done;u=c.next()){var d=u.value,f=e[d],h=t[d];if(!h)return!1;var v=Object.keys(f),p=Object.keys(h);if(v.length!==p.length)return!1;try{for(var g=(o=void 0,i(v)),m=g.next();!m.done;m=g.next()){var y=m.value,b=f[y],w=h[y];if(!w||b.id!==w.id)return!1}}catch(e){o={error:e}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return!0}(c,this.lastNotifiedActivePages),d=null===(k=this.webExperimentClient.behavioralTargetingManager)||void 0===k?void 0:k.getMatchedBehaviors(),f=l&&!function(e,t){var n,r,a,s;if(!e&&t.size>0)return!1;if(e&&e.size!==t.size)return!1;if(!e)return!0;try{for(var l=i(e),c=l.next();!c.done;c=l.next()){var u=o(c.value,2),d=u[0],f=u[1],h=t.get(d);if(!h)return!1;if(f.size!==h.size)return!1;try{for(var v=(a=void 0,i(f)),p=v.next();!p.done;p=v.next()){var g=p.value;if(!h.has(g))return!1}}catch(e){a={error:e}}finally{try{p&&!p.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return!0}(d,this.lastNotifiedActiveBehavioralFlags),f&&this.webExperimentClient.updateUserWithBehaviors(),h="updateActivePages"in s&&s.updateActivePages,!h&&!this.options.isVisualEditorMode&&(u||f||n)?(n?v=void 0:(g=Array.from(p[e]||[]),m=f?Array.from(new Set(a(a([],o(Array.from((null==d?void 0:d.keys())||[])),!1),o(Array.from((null===(E=this.lastNotifiedActiveBehavioralFlags)||void 0===E?void 0:E.keys())||[])),!1))):[],v=Array.from(new Set(a(a([],o(g),!1),o(m),!1)))),[4,this.webExperimentClient.applyVariants({flagKeys:null==v?void 0:v.filter(function(e){return!_.webExperimentClient.previewFlags[e]})})]):[3,3];case 1:return r.sent(),this.webExperimentClient.isPreviewMode?(y=v?Object.fromEntries(Object.entries(this.webExperimentClient.previewFlags).filter(function(e){var t=o(e,1)[0];return v.includes(t)})):this.webExperimentClient.previewFlags,[4,this.webExperimentClient.previewVariants({keyToVariant:y})]):[3,3];case 2:r.sent(),r.label=3;case 3:if(u){this.lastNotifiedActivePages=function(e){var n={};for(var r in e)for(var i in n[r]={},e[r])n[r][i]=t({},e[r][i]);return n}(c);try{for(b=i(this.pageChangeSubscribers),w=b.next();!w.done;w=b.next())(0,w.value)({activePages:c})}catch(e){S={error:e}}finally{try{w&&!w.done&&(x=b.return)&&x.call(b)}finally{if(S)throw S.error}}}return(u||n)&&this.scheduleDebugNotification(),f&&d&&(this.lastNotifiedActiveBehavioralFlags=new Map(Array.from(d.entries()).map(function(e){var t=o(e,2),n=t[0],r=t[1];return[n,new Set(r)]}))),[2]}})})})};try{for(var C=i(Object.keys(p)),P=C.next();!P.done;P=C.next()){T(P.value)}}catch(e){h={error:e}}finally{try{P&&!P.done&&(v=C.return)&&v.call(C)}finally{if(h)throw h.error}}},this.toggleManualPageObject=function(e,t){t?f.manuallyActivatedPageObjects.add(e):f.manuallyActivatedPageObjects.delete(e),f.messageBus.publish("manual")},this.resetTriggerStates=function(){var e,t,n,r,a,s;Kr("trigger_reset","all non-url_change triggers cleared"),f.elementAppearedState.clear(),f.elementVisibilityState.clear(),f.firedUserInteractions.clear(),f.scrolledToElementState.clear(),f.manuallyActivatedPageObjects.clear(),f.maxScrollPercentage=0,f.pageLoadTime=Date.now(),f.analyticsEventState.clear(),f.lastNotifiedActiveBehavioralFlags=new Map;try{for(var l=i(f.clickTimeouts.values()),c=l.next();!c.done;c=l.next()){var u=c.value;f.globalScope.clearTimeout(u)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}f.clickTimeouts.clear();try{for(var d=i(Object.entries(f.pageObjects)),h=d.next();!h.done;h=d.next()){var v=o(h.value,2),p=v[0],g=v[1];try{for(var m=(a=void 0,i(Object.values(g))),y=m.next();!y.done;y=m.next()){var b=y.value;"url_change"!==b.trigger_type&&f.webExperimentClient.updateActivePages(p,b,!1)}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}f.setupTimeOnPagePublisher(),f.checkInitialElements()},this.revertInjections=function(){Object.values(f.webExperimentClient.appliedMutations).forEach(function(e){Object.values(e).forEach(function(e){e[Ri]&&Object.values(e[Ri]).forEach(function(e){var t;null===(t=e.revert)||void 0===t||t.call(e)})})});var e=f.webExperimentClient.appliedMutations;Object.keys(e).forEach(function(t){var n=e[t];Object.keys(n).forEach(function(e){n[e][Ri]&&(delete n[e][Ri],0===Object.keys(n[e]).length&&delete n[e])}),0===Object.keys(n).length&&delete e[t]})},this.updateElementAppearedState=function(e,t){var n,r,o,a;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var c=l.value;if(0===t.length||f.isMutationRelevantToSelector(t,c))try{var u=f.contentDocument.querySelectorAll(c);try{for(var d=(o=void 0,i(Array.from(u))),h=d.next();!h.done;h=d.next()){var v=h.value,p=f.contentWindow.getComputedStyle(v);if("none"!==p.display&&"hidden"!==p.visibility){f.elementAppearedState.add(c);break}}}catch(e){o={error:e}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},this.checkInitialElements=function(){f.updateElementAppearedState(f.targetedElementSelectors,[]),f.messageBus.publish("element_appeared",{mutationList:[]})},this.setupMutationObserverPublisher=function(){if(f.targetedElementSelectors=function(e){var t,n,r,o,a=new Set;try{for(var s=i(Object.values(e)),l=s.next();!l.done;l=s.next()){var c=l.value;try{for(var u=(r=void 0,i(Object.values(c))),d=u.next();!d.done;d=u.next()){var f=d.value;if("element_appeared"===f.trigger_type||"element_visible"===f.trigger_type){var h=(v=f.trigger_value).selector;h&&a.add(h)}else if("scrolled_to"===f.trigger_type){var v;"element"===(v=f.trigger_value).mode&&v.selector&&a.add(v.selector)}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}(f.pageObjects),0!==f.targetedElementSelectors.size){var e=[function(e){return Array.from(f.targetedElementSelectors).some(function(t){return f.isMutationRelevantToSelector([e],t)})}];return new ti(f.contentDocument.documentElement,function(e){f.updateElementAppearedState(f.targetedElementSelectors,e),f.messageBus.publish("element_appeared",{mutationList:e})},e).observe()}},this.setupVisibilityPublisher=function(){var e,t,n,r,a;if(0!==Hr(f.pageObjects,["element_visible"]).length){try{for(var s=i(Object.values(f.pageObjects)),l=s.next();!l.done;l=s.next()){var c=l.value,u=function(e){if("element_visible"===e.trigger_type){var t=e.trigger_value,n=t.selector,r=null!==(a=t.visibilityRatio)&&void 0!==a?a:0,i="".concat(n,"\0").concat(r);if(f.intersectionObservers.has(i))return"continue";var o=new IntersectionObserver(function(e){e.forEach(function(e){var t=e.intersectionRatio>=r;f.elementVisibilityState.set(i,t),t&&f.messageBus.publish("element_visible")})},{threshold:r});f.intersectionObservers.set(i,o);try{f.contentDocument.querySelectorAll(n).forEach(function(e){o.observe(e)})}catch(e){}}};try{for(var d=(n=void 0,i(Object.values(c))),h=d.next();!h.done;h=d.next()){u(h.value)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}f.messageBus.subscribe("element_appeared",function(e){var t,n,r=e.mutationList,a=function(e,t){var n=o(e.split("\0"),1)[0];if(0===r.length||f.isMutationRelevantToSelector(r,n))try{f.contentDocument.querySelectorAll(n).forEach(function(e){t.observe(e)})}catch(e){}};try{for(var s=i(f.intersectionObservers.entries()),l=s.next();!l.done;l=s.next()){var c=o(l.value,2);a(c[0],c[1])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}})}},this.setupExitIntentPublisher=function(){var e,t,n;f.pageLoadTime=Date.now();var r=Object.values(f.pageObjects).flatMap(function(e){return Object.values(e).filter(function(e){return"exit_intent"===e.trigger_type})});if(0!==r.length){var o=1/0;try{for(var a=i(r),s=a.next();!s.done;s=a.next()){var l=s.value.trigger_value;o=Math.min(o,null!==(n=l.minTimeOnPageMs)&&void 0!==n?n:0)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}var c=function(e){e.clientY<=50&&null===e.relatedTarget&&f.messageBus.publish("exit_intent",{durationMs:Date.now()-f.pageLoadTime})};o>0?f.globalScope.setTimeout(function(){f.contentDocument.addEventListener("mouseleave",c)},o):f.contentDocument.addEventListener("mouseleave",c)}},this.setupLocationChangePublisher=function(){f.globalScope.addEventListener("popstate",function(){var e=f.globalScope.location.href;e!==f.lastPublishedUrl&&(f.lastPublishedUrl=e,f.messageBus.publish("url_change"))});var e,t,n=function(){var e=f.globalScope.location.href;e!==f.lastPublishedUrl&&(f.lastPublishedUrl=e,f.messageBus.publish("url_change"),f.globalScope.webExperiment.previousUrl=e)};e=history.pushState,t=history.replaceState,history.pushState=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=e.apply(this,t);return n(),i},history.replaceState=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=t.apply(this,e);return n(),i}},this.setupUserInteractionPublisher=function(){var e,t,n,r,o,a,s,l;null===(o=f.userInteractionAbortController)||void 0===o||o.abort(),f.userInteractionAbortController=new AbortController;var c=f.userInteractionAbortController.signal,u=new Map,d=new Map,h=new Map;try{for(var v=i(Object.values(f.pageObjects)),p=v.next();!p.done;p=v.next()){var g=p.value;try{for(var m=(n=void 0,i(Object.values(g))),y=m.next();!y.done;y=m.next()){var b=y.value;if("user_interaction"===b.trigger_type){var w=b.trigger_value,S=w.selector,x=w.interactionType,k=w.minThresholdMs;"click"===x?(u.has(S)||u.set(S,new Set),null===(a=u.get(S))||void 0===a||a.add(k||0)):"hover"===x?(d.has(S)||d.set(S,new Set),null===(s=d.get(S))||void 0===s||s.add(k||0)):"focus"===x&&(h.has(S)||h.set(S,new Set),null===(l=h.get(S))||void 0===l||l.add(k||0))}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=v.return)&&t.call(v)}finally{if(e)throw e.error}}0===u.size&&0===d.size&&0===h.size||(u.size>0&&f.setupClickDelegation(u,c),d.size>0&&f.setupHoverDelegation(d,c),h.size>0&&f.setupFocusDelegation(h,c))},this.setupClickDelegation=function(e,t){f.contentDocument.addEventListener("click",function(t){var n,r,a,s,l=t.target;if(l)try{for(var c=i(e),u=c.next();!u.done;u=c.next()){var d=o(u.value,2),h=d[0],v=d[1];try{if(l.closest(h)){var p=function(e){var t="".concat(h,"\0click\0").concat(e);if(f.firedUserInteractions.has(t))return"continue";if(f.clickTimeouts.has(t))return"continue";var n=function(){f.firedUserInteractions.add(t),f.messageBus.publish("user_interaction"),f.clickTimeouts.delete(t)};if(e>0){var r=f.globalScope.setTimeout(n,e);f.clickTimeouts.set(t,r)}else n()};try{for(var g=(a=void 0,i(v)),m=g.next();!m.done;m=g.next()){p(m.value)}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}break}}catch(e){}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}},{signal:t})},this.setupThresholdBasedDelegation=function(e,t,n){f.contentDocument.addEventListener(n.startEvent,function(t){var r,a,s,l,c=t.target;if(c)try{for(var u=i(e),d=u.next();!d.done;d=u.next()){var h=o(d.value,2),v=h[0],p=h[1];try{var g=c.closest(v);if(g){var m=function(e){var t="".concat(v,"\0").concat(n.interactionType,"\0").concat(e);if(f.firedUserInteractions.has(t))return"continue";var r=n.timeoutStorage.get(g);r||(r=new Map,n.timeoutStorage.set(g,r));var i="".concat(v,"\0").concat(e);if(!r.get(i)){var o=function(){f.firedUserInteractions.add(t),f.messageBus.publish("user_interaction"),null==r||r.delete(i)};if(e){var a=f.globalScope.setTimeout(o,e);r.set(i,a)}else o()}};try{for(var y=(s=void 0,i(p)),b=y.next();!b.done;b=y.next()){m(b.value)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(l=y.return)&&l.call(y)}finally{if(s)throw s.error}}break}}catch(e){}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(r)throw r.error}}},{signal:t}),f.contentDocument.addEventListener(n.endEvent,function(t){var r,a,s,l,c=t.target;if(c){var u=t.relatedTarget;try{for(var d=i(e),h=d.next();!h.done;h=d.next()){var v=o(h.value,1)[0];try{var p=c.closest(v);if(p){if(!u||!p.contains(u)){var g=n.timeoutStorage.get(p);if(g){try{for(var m=(s=void 0,i(g.values())),y=m.next();!y.done;y=m.next()){var b=y.value;f.globalScope.clearTimeout(b)}}catch(e){s={error:e}}finally{try{y&&!y.done&&(l=m.return)&&l.call(m)}finally{if(s)throw s.error}}n.timeoutStorage.delete(p)}}break}}catch(e){}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}}},{signal:t})},this.setupHoverDelegation=function(e,t){f.setupThresholdBasedDelegation(e,t,{interactionType:"hover",startEvent:"mouseover",endEvent:"mouseout",timeoutStorage:f.hoverTimeouts})},this.setupFocusDelegation=function(e,t){f.setupThresholdBasedDelegation(e,t,{interactionType:"focus",startEvent:"focusin",endEvent:"focusout",timeoutStorage:f.focusTimeouts})},this.setupTimeOnPagePublisher=function(){var e,t,n,r;Object.values(f.timeOnPageTimeouts).forEach(clearTimeout),f.timeOnPageTimeouts={};var o=new Set;try{for(var a=i(Object.values(f.pageObjects)),s=a.next();!s.done;s=a.next()){var l=s.value;try{for(var c=(n=void 0,i(Object.values(l))),u=c.next();!u.done;u=c.next()){var d=u.value;if("time_on_page"===d.trigger_type){var h=d.trigger_value;o.add(h.durationMs)}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}0!==o.size&&f.setUpTimeouts(o)},this.setUpTimeouts=function(e){e.forEach(function(e){f.timeOnPageTimeouts[e]=f.globalScope.setTimeout(function(){f.messageBus.publish("time_on_page",{durationMs:e}),delete f.timeOnPageTimeouts[e]},e)})},this.setupVisibilityChangeHandler=function(){if(0!==Hr(f.pageObjects,["time_on_page"]).length){f.globalScope.document.addEventListener("visibilitychange",function(){if(f.globalScope.document.hidden)Object.values(f.timeOnPageTimeouts).forEach(clearTimeout);else{var e=new Set(Object.keys(f.timeOnPageTimeouts).map(Number));f.setUpTimeouts(e)}})}},this.setupScrolledToPublisher=function(){var e,t,n,r,a=Hr(f.pageObjects,["scrolled_to"]);if(0!==a.length){var s=!1,l=!1;try{for(var c=i(a),u=c.next();!u.done;u=c.next()){var d=u.value.trigger_value;"percent"===d.mode?s=!0:"element"===d.mode&&(l=!0)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}if(s){var h=null,v=function(){var e=f.calculateScrollPercentage();e>f.maxScrollPercentage&&(f.maxScrollPercentage=e,f.messageBus.publish("scrolled_to",{}))};f.contentWindow.addEventListener("scroll",function(){null===h&&(h=f.globalScope.requestAnimationFrame(function(){v(),h=null}))},{passive:!0}),v()}if(l){var p=function(e){if("scrolled_to"===e.trigger_type){var t=e.trigger_value;if("element"===t.mode){var n=t.selector,r=t.offsetPx||0,i="".concat(n,"\0").concat(r);if(f.scrolledToObservers.has(i))return"continue";var o="0px 0px ".concat(r,"px 0px"),a=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(f.scrolledToElementState.set(i,!0),f.messageBus.publish("scrolled_to",{}))})},{rootMargin:o,threshold:0});f.scrolledToObservers.set(i,a);try{f.contentDocument.querySelectorAll(n).forEach(function(e){a.observe(e)})}catch(e){}}}};try{for(var g=i(a),m=g.next();!m.done;m=g.next()){p(m.value)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}f.messageBus.subscribe("element_appeared",function(e){var t,n,r=e.mutationList,a=function(e,t){var n=o(e.split("\0"),1)[0];if(0===r.length||f.isMutationRelevantToSelector(r,n))try{f.contentDocument.querySelectorAll(n).forEach(function(e){t.observe(e)})}catch(e){}};try{for(var s=i(f.scrolledToObservers.entries()),l=s.next();!l.done;l=s.next()){var c=o(l.value,2);a(c[0],c[1])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}})}}},this.isPageObjectActive=function(e,t){var n,r,i,o={page:{url:f.globalScope.location.href}};if(e.conditions&&e.conditions.length>0&&!ni.evaluateConditions({context:o,result:{}},e.conditions))return!1;switch(e.trigger_type){case"url_change":return!0;case"manual":var a=e.trigger_value;return f.manuallyActivatedPageObjects.has(a.name);case"analytics_event":var s=e.id;if(f.analyticsEventState.has(s))return!0;a=e.trigger_value;var l=t,c={type:"analytics_event",data:{event:l.event,properties:l.properties}},u=ni.evaluateConditions({context:c,result:{}},a);return u&&f.analyticsEventState.add(s),u;case"element_appeared":var d=(a=e.trigger_value).selector;return f.elementAppearedState.has(d);case"element_visible":d=(a=e.trigger_value).selector;var h=null!==(n=a.visibilityRatio)&&void 0!==n?n:0,v="".concat(d,"\0").concat(h);return null!==(r=f.elementVisibilityState.get(v))&&void 0!==r&&r;case"exit_intent":var p=t.durationMs;return void 0===(a=e.trigger_value).minTimeOnPageMs||p>=a.minTimeOnPageMs;case"user_interaction":a=e.trigger_value;var g="".concat(a.selector,"\0").concat(a.interactionType,"\0").concat(a.minThresholdMs||0);return f.firedUserInteractions.has(g);case"time_on_page":var m=t;a=e.trigger_value;return m.durationMs>=a.durationMs;case"scrolled_to":if("percent"===(a=e.trigger_value).mode)return f.maxScrollPercentage>=a.percentage;if("element"===a.mode){var y=a.offsetPx||0;v="".concat(a.selector,"\0").concat(y);return null!==(i=f.scrolledToElementState.get(v))&&void 0!==i&&i}return!1;default:return!1}},this.webExperimentClient=e,this.messageBus=s,this.pageObjects=l,this.behavioralTargetingManager=c,this.options=u,this.globalScope=d}return Object.defineProperty(e.prototype,"contentDocument",{get:function(){return e=this.globalScope,Xr()&&null!==(n=null===(t=Qr())||void 0===t?void 0:t.contentDocument)&&void 0!==n?n:e.document;var e,t,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentWindow",{get:function(){return e=this.globalScope,Xr()&&null!==(n=null===(t=Qr())||void 0===t?void 0:t.contentWindow)&&void 0!==n?n:e;var e,t,n},enumerable:!1,configurable:!0}),e.prototype.getDebugPageObjects=function(){var e,t,n=this,r={},a=this.webExperimentClient.getActivePages(),s=function(e,t){r[e]=Object.values(t).map(function(t){var r=n.evaluateUrlConditions(t),i=n.buildTriggerDebugInfo(t,e,a);return{id:t.id,name:t.name,urlConditionsPassed:r,triggerPassed:i.passed,trigger:i,overallStatus:r&&i.passed?"pass":"fail"}})};try{for(var l=i(Object.entries(this.pageObjects)),c=l.next();!c.done;c=l.next()){var u=o(c.value,2);s(u[0],u[1])}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}return r},e.prototype.evaluateUrlConditions=function(e){return!e.conditions||0===e.conditions.length||ni.evaluateConditions({context:{page:{url:this.globalScope.location.href}},result:{}},e.conditions)},e.prototype.buildTriggerDebugInfo=function(e,t,n){var r,i,o;switch(e.trigger_type){case"url_change":return{type:"url_change",passed:!0};case"element_appeared":var a=e.trigger_value.selector;return{type:"element_appeared",passed:this.elementAppearedState.has(a),config:{selector:a}};case"element_visible":var s=e.trigger_value,l=(a=s.selector,s.visibilityRatio),c=null!=l?l:0,u="".concat(a,"\0").concat(c);return{type:"element_visible",passed:null!==(r=this.elementVisibilityState.get(u))&&void 0!==r&&r,config:{selector:a,visibilityRatio:c}};case"manual":var d=e.trigger_value.name;return{type:"manual",passed:this.manuallyActivatedPageObjects.has(d),config:{name:d}};case"analytics_event":return{type:"analytics_event",passed:this.analyticsEventState.has(e.id),config:{conditions:e.trigger_value}};case"user_interaction":var f=e.trigger_value,h=(a=f.selector,f.interactionType),v=f.minThresholdMs||0;u="".concat(a,"\0").concat(h,"\0").concat(v);return{type:"user_interaction",passed:this.firedUserInteractions.has(u),config:{selector:a,interactionType:h,minThresholdMs:v}};case"exit_intent":var p=e.trigger_value.minTimeOnPageMs;return{type:"exit_intent",passed:!!(null===(i=n[t])||void 0===i?void 0:i[e.id]),config:{minTimeOnPageMs:p}};case"time_on_page":var g=e.trigger_value.durationMs,m=Math.max(0,Date.now()-this.pageLoadTime);return{type:"time_on_page",passed:!(g in this.timeOnPageTimeouts),config:{durationMs:g},elapsedMs:m};case"scrolled_to":var y=e.trigger_value;if("percent"===y.mode){var b=y.percentage;return{type:"scrolled_to",passed:this.maxScrollPercentage>=b,config:{mode:"percent",percentage:b},currentPercentage:Math.round(this.maxScrollPercentage)}}a=y.selector;var w=y.offsetPx,S=w||0;u="".concat(a,"\0").concat(S);return{type:"scrolled_to",passed:null!==(o=this.scrolledToElementState.get(u))&&void 0!==o&&o,config:{mode:"element",selector:a,offsetPx:w}};default:return{type:"url_change",passed:!1}}},e.prototype.isMutationRelevantToSelector=function(e,t){var n,r,o,a;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var c=l.value;if(c.addedNodes.length>0)try{for(var u=(o=void 0,i(Array.from(c.addedNodes))),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.nodeType===Node.ELEMENT_NODE)try{var h=f;if(h.matches(t))return!0;if(h.querySelector(t))return!0}catch(e){}}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}if(c.target.nodeType===Node.ELEMENT_NODE)try{var v=c.target;if(v.matches(t))return!0;if(v.querySelector(t))return!0}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!1},e.prototype.calculateScrollPercentage=function(){var e=this.contentWindow.innerHeight,t=this.contentDocument.documentElement.scrollHeight,n=this.contentWindow.scrollY,r=t-e;return r<=0?0:n/r*100},e}(),ii={useDefaultNavigationHandler:!0,redirectConfig:{encodeRedirectInUrl:!1,encodeRedirectInCookie:!0}},oi=function(){var e;if(!Yr){var t=be(),n=Mr(null!==(e=null==t?void 0:t.document)&&void 0!==e?e:document,"* { visibility: hidden !important; background-image: none !important; }");Yr=n,null==t||t.window.setTimeout(function(){Yr===n&&ai()},1e3)}},ai=function(){var e;null==Yr||Yr.revert(),Yr=void 0;var t=be();null===(e=null==t?void 0:t.document.getElementById("amp-exp-css"))||void 0===e||e.remove()},si=function(e,t){var n;try{var r=null===(n=ci(e))||void 0===n?void 0:n.getItem(t);return r?JSON.parse(r):null}catch(t){return console.warn("Failed to get and parse JSON from ".concat(e,":"),t),null}},li=function(e,t,n){var r;try{var i=JSON.stringify(n);null===(r=ci(e))||void 0===r||r.setItem(t,i)}catch(t){console.warn("Failed to stringify and set JSON in ".concat(e,":"),t)}},ci=function(e){var t=be();return t?t[e]:null};function ui(e,a){return n(this,void 0,void 0,function(){var n,s,l,c,u,d,f,h,v,p,g,m,y,b,w,S,x,k,E;return r(this,function(r){switch(r.label){case 0:return n="EXP_".concat(We,"_").concat(e.substring(0,10)),[4,di(e)];case 1:s=o.apply(void 0,[r.sent(),2]),l=s[0],c=s[1],u=si("localStorage",n),d={},f=[c,u,l];try{for(h=i(f),v=h.next();!v.done;v=h.next())if(p=v.value)try{for(k=void 0,g=i(Object.entries(p)),m=g.next();!m.done;m=g.next())y=o(m.value,2),b=y[0],w=y[1],b.startsWith("utm_")&&void 0!==w&&(d[b]=w)}catch(e){k={error:e}}finally{try{m&&!m.done&&(E=g.return)&&E.call(g)}finally{if(k)throw k.error}}}catch(e){S={error:e}}finally{try{v&&!v.done&&(x=h.return)&&x.call(h)}finally{if(S)throw S.error}}return Object.keys(d).length>0?(function(e,t){var n="EXP_".concat(We,"_").concat(e.substring(0,10));li("localStorage",n,t)}(e,d),[2,t(t({},a),{persisted_url_param:d})]):[2,a]}})})}function di(e){return n(this,void 0,void 0,function(){var t,n,i,o;return r(this,function(r){switch(r.label){case 0:return t=new Xe,n=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[Ie,t,e.substring(0,n)].filter(Boolean).join("_")}(e,We),[4,(new Ze).parse()];case 1:return i=r.sent(),[4,t.get(n)];case 2:return o=r.sent(),[2,[i,o]]}})})}var fi,hi=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","blogspot.com","cloudfront.net","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","myshopify.com","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","netlify.app","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","workers.dev"];function vi(e){return n(this,void 0,void 0,function(){var t,n,o,a,s,l,c,u,d,f,h;return r(this,function(r){switch(r.label){case 0:if(void 0!==fi)return[2,fi];if(!e)return[2,fi=""];if(t=e.toLowerCase(),1===(n=t.split(".")).length)return[2,fi=""];for(o=hi.some(function(e){return t.endsWith(".".concat(e))})?2:1,a=[],s=n.length-o-1;s>=0;--s)a.push(n.slice(s).join("."));r.label=1;case 1:r.trys.push([1,6,7,8]),l=i(a),c=l.next(),r.label=2;case 2:return c.done?[3,5]:(u=c.value,[4,Xe.isDomainWritable(u)]);case 3:if(r.sent())return[2,fi="."+u];r.label=4;case 4:return c=l.next(),[3,2];case 5:return[3,8];case 6:return d=r.sent(),f={error:d},[3,8];case 7:try{c&&!c.done&&(h=l.return)&&h.call(l)}finally{if(f)throw f.error}return[7];case 8:return[2,fi=""]}})})}function pi(e,t,i,o){return n(this,void 0,void 0,function(){var n,a;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e.get(t)];case 1:return(n=r.sent())?[2,n]:[3,3];case 2:return r.sent(),[3,3];case 3:a=null!=i?i:o(),r.label=4;case 4:return r.trys.push([4,6,,7]),[4,e.set(t,a)];case 5:case 6:return r.sent(),[3,7];case 7:return[2,a]}})})}function gi(e,i){return n(this,void 0,void 0,function(){var n,o,a,s,l;return r(this,function(r){switch(r.label){case 0:return[4,vi(i)];case 1:return n=r.sent(),o=new Xe(t({sameSite:"Lax"},n&&{domain:n})),a=new Ze,s="AMP_".concat(We,"_ORIGINAL_").concat(e.substring(0,10)),[4,a.parse()];case 2:return l=r.sent(),[4,o.set(s,l)];case 3:return r.sent(),[2]}})})}var mi,yi="amp-exp-loading",bi=function(){if(!document.getElementById(yi)){var e=document.createElement("div");e.id=yi,mi=setTimeout(function(){wi()},1e4),e.innerHTML="\n <style>\n #".concat(yi," {\n position: fixed;\n inset: 0;\n background: rgba(33, 33, 36, 0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 2147483647;\n }\n\n #").concat(yi," .modal {\n background: white;\n border-radius: 8px;\n padding: 32px 48px;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n }\n\n #").concat(yi," .spinner {\n width: 32px;\n height: 32px;\n border: 3px solid #e5e7eb;\n border-top-color: ").concat("#1e61f0",";\n border-radius: 50%;\n animation: amp-spin 1s linear infinite;\n }\n\n @keyframes amp-spin {\n to { transform: rotate(360deg); }\n }\n\n #").concat(yi,' .text {\n color: #212124;\n font-size: 16px;\n font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n }\n </style>\n\n <div class="modal">\n <div class="spinner"></div>\n <div class="text">Loading Visual Editor</div>\n </div>\n '),Nr(function(){document.body&&!document.getElementById(yi)&&void 0!==mi&&document.body.appendChild(e)})}},wi=function(){var e;mi&&(clearTimeout(mi),mi=void 0),null===(e=document.getElementById(yi))||void 0===e||e.remove()},Si=function(){try{var e=be();if(!e)return!0;var t=e.opener;return!t||t.closed}catch(e){return!0}},xi="visual-editor-state",ki=function(){function e(){}return e.setup=function(){var t,n="closed";Kr("opener_check",Si()?"FAIL: window.opener is null, closed, or inaccessible":"PASS");var r=e.getStoredSession();if(r)return Kr("setup","stored session found, loading ".concat(r.injectSrc)),qr("loading"),n="opening",bi(),void Ei(r.injectSrc).then(function(){n="open",qr("loaded"),Kr("script_load_success","from stored session")}).catch(function(e){console.warn("Failed to load overlay from stored session:",e),n="closed",qr("error"),Kr("script_load_error","from stored session: ".concat((null==e?void 0:e.message)||e)),wi()});Kr("setup","no stored session, registering message listener"),qr("waiting"),null===(t=be())||void 0===t||t.addEventListener("message",function(e){var t=/^.*\.amplitude\.com$/;try{if(!e.origin||!t.test(new URL(e.origin).hostname))return void Kr("origin_validation","FAIL: ".concat(e.origin||"(empty)"))}catch(t){return void Kr("origin_validation","FAIL: exception parsing origin ".concat(e.origin))}if("OpenOverlay"===e.data.type){Kr("message_received","origin=".concat(e.origin,", type=OpenOverlay")),Kr("origin_validation","PASS");var r=new URL(e.data.context.injectSrc);if("closed"!==n)return void Kr("state_guard","rejected: state=".concat(n));if("https:"!==r.protocol||!t.test(r.hostname))return void Kr("injectSrc_validation","FAIL: ".concat(r.href));Kr("injectSrc_validation","PASS (".concat(r.hostname,")")),qr("loading"),n="opening",bi(),Ei(e.data.context.injectSrc).then(function(){n="open",qr("loaded"),Kr("script_load_success")}).catch(function(){n="closed",qr("error"),Kr("script_load_error","Failed to load ".concat(e.data.context.injectSrc)),wi()})}})},e.getStoredSession=function(){var e=si("sessionStorage",xi);if(!e)return null;try{var t=new URL(e.injectSrc);if("https:"!==t.protocol||!/^.*\.amplitude\.com$/.test(t.hostname))return null}catch(e){return null}return e},e}(),Ei=function(e){return new Promise(function(t,n){Kr("script_load_start","loading ".concat(e));Kr("readyState",document.readyState),Nr(function(){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e;var o=document.querySelector("[nonce]");if(o){var a=o.nonce||o.nonce||o.getAttribute("nonce");i.setAttribute("nonce",a),Kr("nonce_check","found: ".concat(a))}else Kr("nonce_check","not found, skipping");i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(e)})}),null===(r=document.head)||void 0===r||r.appendChild(i)}catch(e){n(e)}})})},_i="amp-exp-opener-severed",Ai=function(){var e=document.getElementById(_i);e&&("function"==typeof e.close&&e.open&&e.close(),e.remove())};var Oi=Symbol.for("@amplitude/spa-link-interceptor-initiated");function Ti(){if(!window[Oi]){window[Oi]=!0;document.addEventListener("click",function(e){var t,n,r=e.target.closest("a");if(r){var i=r.__mutationRecord__;if(null===(n=null===(t=null==i?void 0:i.attributes)||void 0===t?void 0:t.href)||void 0===n?void 0:n.mutations.length){var o=r.getAttribute("href"),a=r.getAttribute("target");o&&function(e,t,n){var r=n&&"_self"!==n||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button>0,i=new URL(t,window.location.href),o=i.href.split("#")[0]===window.location.href.split("#")[0],a=i.origin===window.location.origin;return!r&&a&&!o}(e,o,a)&&function(e){var t,n,r=Object.keys(e).find(function(e){return e.startsWith("__reactFiber")});return!!r&&String(null===(n=null===(t=e[r])||void 0===t?void 0:t.memoizedProps)||void 0===n?void 0:n.onClick).includes(".defaultPrevented")}(r)&&(e.preventDefault(),function(e){var t,n;if(null===(n=null===(t=window.next)||void 0===t?void 0:t.router)||void 0===n?void 0:n.push)return void window.next.router.push(e);history.pushState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate",{state:history.state}))}(o))}}},!0)}}var Ci=function(){var e,t,n=be(),r=new URLSearchParams(null==n?void 0:n.location.search),a={};try{for(var s=i(r),l=s.next();!l.done;l=s.next()){var c=o(l.value,2),u=c[0],d=c[1];a[u]=d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return a},Pi=function(e){if(!e)return"";var t=new URL(e);return t.search="",t.hash="",t.toString()},Mi=function(e,t){var n,r,o=new URL(e);try{for(var a=i(t),s=a.next();!s.done;s=a.next()){var l=s.value;o.searchParams.delete(l)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o.toString()},Ii=function(e,t){return t=t.replace(/\/$/,""),e.some(function(e){e=(e=(e=e.replace(/\/$/,"")).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).replace(/\\\*/,".*");var n=new RegExp("^".concat(e,"$"));return n.test(t)||n.test(t+"/")})},Ni=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Ni)},ji="mutate",Ri="inject",Vi="PREVIEW",Ui="amp-preview-mode",Li="VISUAL_EDITOR",Di="AMP_REDIRECT";ye.Experiment=en;var Fi=function(){function e(e,n,r){void 0===r&&(r={});var i,o=this;this.appliedInjections=new Set,this.appliedMutations={},this.previousUrl=void 0,this.urlExposureCache={},this.flagVariantMap={},this.localFlagKeys=[],this.remoteFlagKeys=[],this.isRemoteBlocking=!1,this.isRunning=!1,this.activePages={},this.behavioralTargetingRules={},this.isVisualEditorMode=!1,this.isDebugActive=!1,this.isPreviewMode=!1,this.previewFlags={};var a=be();if(!a||!we())throw new Error("Amplitude Web Experiment Client could not be initialized.");this.globalScope=a,this.apiKey=e,this.initialFlags=JSON.parse(n.initialFlags),this.pageObjects=JSON.parse(n.pageObjects),this.behavioralTargetingRules=n.behavioralTargetingRules?JSON.parse(n.behavioralTargetingRules):{},Object.keys(this.behavioralTargetingRules).length>0&&(this.behavioralTargetingManager=new Pr(this.apiKey,this.behavioralTargetingRules)),this.config=t(t(t({},ii),r),null!==(i=this.globalScope.experimentConfig)&&void 0!==i?i:{}),this.initialFlags.forEach(function(e){var t=e.key,n=e.variants,r=e.metadata,i=void 0===r?{}:r;o.flagVariantMap[t]={},Object.keys(n).forEach(function(e){o.flagVariantMap[t][e]=function(e){if(!e)return{};var t=void 0;e.metadata&&(t="string"==typeof e.metadata.experimentKey?e.metadata.experimentKey:void 0);var n={};return e.key&&(n.key=e.key),e.value&&(n.value=e.value),e.payload&&(n.payload=e.payload),t&&(n.expKey=t),e.metadata&&(n.metadata=e.metadata),n}(n[e]),o.flagVariantMap[t][e].metadata={deliveryMethod:"web"}}),"local"!==i.evaluationMode&&o.remoteFlagKeys.push(t)});for(var s=new Set,l=!0;l;)l=!1,this.initialFlags.forEach(function(e){var t;!o.remoteFlagKeys.includes(e.key)&&(null===(t=e.dependencies)||void 0===t?void 0:t.some(function(e){return o.remoteFlagKeys.includes(e)}))&&(o.remoteFlagKeys.push(e.key),s.add(e.key),l=!0)});var c=JSON.stringify(this.initialFlags);this.experimentClient=Zt.initialize(this.apiKey,t({internalInstanceNameSuffix:"web",initialFlags:c,fetchTimeoutMillis:1e3,pollOnStart:!1,fetchOnStart:!1,automaticExposureTracking:!1},this.config));var u=this.experimentClient.all();this.localFlagKeys=Object.keys(u).filter(function(e){var t,n;return"local"===(null===(n=null===(t=u[e])||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.evaluationMode)&&!s.has(e)}),this.messageBus=new Rr}return e.prototype.start=function(){return n(this,void 0,void 0,function(){var e,n,a,s,l,c,u,d,f,h,v,p,g,m,y,b,w,S,x,k,E,_,A,O,T,C=this;return r(this,function(r){switch(r.label){case 0:if(this.isRunning)return[2];HTMLElement.prototype.removeChild=function(e){return e&&e.parentNode!==this?e:Node.prototype.removeChild.call(this,e)},Ti(),e=Ci(),n=!1;try{n=(null===(A=this.globalScope.frameElement)||void 0===A?void 0:A.id)===Jr}catch(e){n=!1}return n&&Xr()?(this.globalScope.ampDomMutator=Ar,this.isRunning=!0,[2]):(this.isVisualEditorMode="true"===e[Li]||null!==si("sessionStorage",xi),Fr(this.globalScope),this.isDebugActive=Br(),this.subscriptionManager=new ri(this,this.messageBus,this.pageObjects,this.behavioralTargetingManager,t(t({},this.config),{isVisualEditorMode:this.isVisualEditorMode,isDebugActive:this.isDebugActive}),this.globalScope),this.setupPreviewMode(e),this.subscriptionManager.initSubscriptions(),zr(function(){return{flags:C.buildFlagDebugInfo(),visualEditor:{isActive:C.isVisualEditorMode,source:C.isVisualEditorMode?null!==si("sessionStorage",xi)?"session_storage":"url_param":null},currentUrl:C.globalScope.location.href}}),this.isVisualEditorMode?(a="true"===e[Li]?"url_param":"session_storage",Kr("ve_mode_detected","source=".concat(a)),Si()?(Kr("opener_check","FAIL: window.opener is null, closed, or inaccessible"),qr("error"),function(){if(!document.getElementById(_i)){var e=document.createElement("dialog");e.id=_i,e.setAttribute("role","alertdialog"),e.setAttribute("aria-labelledby","".concat(_i,"-title")),e.innerHTML="\n <style>\n @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600&display=swap');\n\n #".concat(_i,",\n #").concat(_i," * {\n font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;\n }\n #").concat(_i," code {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;\n }\n\n /* Defensive resets — host pages often style h2/h3/p with\n * text-transform, letter-spacing, etc. that would otherwise leak in. */\n #").concat(_i," h2,\n #").concat(_i," h3,\n #").concat(_i," p,\n #").concat(_i," button,\n #").concat(_i," code,\n #").concat(_i," hr {\n text-transform: none !important;\n letter-spacing: normal !important;\n text-decoration: none !important;\n font-style: normal !important;\n }\n\n #").concat(_i," {\n border: none;\n padding: 0;\n background: white;\n border-radius: 8px;\n max-width: 480px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n color: #212124;\n }\n\n #").concat(_i,"::backdrop {\n background: rgba(33, 33, 36, 0.4);\n }\n\n #").concat(_i," .modal {\n position: relative;\n padding: 32px;\n }\n\n #").concat(_i," .close-icon {\n position: absolute;\n top: 16px;\n right: 16px;\n width: 28px;\n height: 28px;\n padding: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n border-radius: 6px;\n color: #5a5e68;\n cursor: pointer;\n }\n\n #").concat(_i," .close-icon:hover {\n background: #f3f4f6;\n color: #212124;\n }\n\n #").concat(_i," .close-icon svg {\n width: 16px;\n height: 16px;\n }\n\n #").concat(_i," .title {\n font-size: 18px;\n font-weight: 600;\n margin: 0 0 12px 0;\n padding-right: 24px;\n }\n\n #").concat(_i," .body {\n font-size: 14px;\n line-height: 1.5;\n margin: 0 0 12px 0;\n color: #5a5e68;\n }\n\n #").concat(_i," .divider {\n border: none;\n border-top: 1px solid #e5e7eb;\n margin: 20px 0;\n }\n\n #").concat(_i," .subtitle {\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 8px 0;\n color: #212124;\n }\n\n #").concat(_i," code {\n background: #f3f4f6;\n padding: 1px 6px;\n border-radius: 4px;\n font-size: 13px;\n }\n\n #").concat(_i," .actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 24px;\n }\n\n #").concat(_i," .secondary {\n font-size: 14px;\n padding: 8px 16px;\n border-radius: 6px;\n background: white;\n color: #212124;\n border: 1px solid #d1d5db;\n cursor: pointer;\n }\n\n #").concat(_i,' .secondary:hover {\n background: #f9fafb;\n }\n </style>\n\n <div class="modal">\n <button\n type="button"\n class="close-icon"\n data-action="close"\n aria-label="Close"\n >\n <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">\n <path d="M3 3 L13 13 M13 3 L3 13" />\n </svg>\n </button>\n <h2 id="').concat(_i,'-title" class="title">Can\'t connect to this page</h2>\n <p class="body">\n The Visual Editor lost its connection to this page and can\'t make\n edits here. This is usually a configuration issue on the site.\n </p>\n <hr class="divider" />\n <h3 class="subtitle">Technical Details</h3>\n <p class="body">\n This page sends a <code>Cross-Origin-Opener-Policy</code> header that\n isolates it from the editor window. To resolve this:\n </p>\n <p class="body">\n Remove the <code>Cross-Origin-Opener-Policy</code> header, or set its\n value to <code>unsafe-none</code> on pages you want to edit.\n </p>\n <div class="actions">\n <button type="button" class="secondary" data-action="close">Close</button>\n </div>\n </div>\n '),Nr(function(){document.body&&!document.getElementById(_i)&&(document.body.appendChild(e),"function"==typeof e.showModal?e.showModal():e.setAttribute("open",""),e.querySelectorAll('button[data-action="close"]').forEach(function(e){e.addEventListener("click",function(){Ai()})}))})}}(),this.globalScope.history.replaceState({},"",Mi(this.globalScope.location.href,[Li])),this.isRunning=!0,[2]):(Kr("opener_check","PASS"),Xr()?[4,Zr(this.globalScope)]:[3,2])):[3,3]);case 1:r.sent(),r.label=2;case 2:return ki.setup(),this.globalScope.history.replaceState({},"",Mi(this.globalScope.location.href,[Li])),Kr("url_param_removed","cleaned URL: ".concat(this.globalScope.location.href)),this.subscriptionManager.markUrlAsPublished(this.globalScope.location.href),this.messageBus.publish("url_change",{updateActivePages:!0}),this.isRunning=!0,Gi(this),[2];case 3:return this.subscriptionManager.markUrlAsPublished(this.globalScope.location.href),this.messageBus.publish("url_change",{updateActivePages:!0}),s="EXP_".concat(this.apiKey.slice(0,10)),(l=si("localStorage",s)||{}).web_exp_id?l.web_exp_id&&l.device_id&&(delete l.device_id,li("localStorage",s,l)):(l.web_exp_id=l.device_id||Ni(),delete l.device_id,li("localStorage",s,l)),[4,vi(this.globalScope.location.hostname)];case 4:return c=r.sent(),u=new Xe(t(t({},c&&{domain:c}),{sameSite:"Lax",expirationDays:365})),d="".concat(s,"_web_exp_id_v2"),f=l,[4,pi(u,d,null!==(O=l.web_exp_id_v2)&&void 0!==O?O:l.web_exp_id,Ni)];case 5:return f.web_exp_id_v2=r.sent(),li("localStorage",s,l),h="".concat(s,"_DEFAULT_USER_PROVIDER"),v=si("localStorage",h)||{},[4,pi(u,"".concat(s,"_first_seen"),v.first_seen,function(){return(Date.now()/1e3).toString()})];case 6:(p=r.sent())!==v.first_seen&&(v.first_seen=p,li("localStorage",h,v)),l.first_seen=p,this.experimentClient.setUser(l),g=this.getVariants();try{for(m=i(Object.entries(g)),y=m.next();!y.done;y=m.next())b=o(y.value,2),w=b[0],S=b[1],this.remoteFlagKeys.includes(w)&&(null===(T=S.metadata)||void 0===T?void 0:T.blockingEvaluation)&&Object.keys(this.activePages).includes(w)&&!this.remoteFlagKeys.every(function(e){return Object.keys(C.previewFlags).includes(e)})&&(this.isRemoteBlocking=!0,oi())}catch(e){E={error:e}}finally{try{y&&!y.done&&(_=m.return)&&_.call(m)}finally{if(E)throw E.error}}return[4,ui(this.apiKey,l)];case 7:return x=r.sent(),this.globalScope.experimentIntegration||(k=Me.getInstance("$default_instance"),this.globalScope.experimentIntegration=new vt(this.apiKey,k,1e3)),this.globalScope.experimentIntegration.type="integration",this.experimentClient.addPlugin(this.globalScope.experimentIntegration),this.experimentClient.setUser(x),this.updateUserWithBehaviors(),this.fireStoredRedirectImpressions().catch(function(){}),this.messageBus.subscribe("url_change",function(){C.fireStoredRedirectImpressions().catch(function(){})}),this.initialFlags.some(function(e){return e.key.startsWith("holdout-")||e.key.startsWith("mutex-")})?[4,this.experimentClient.integrationManager.ready()]:[3,9];case 8:r.sent(),r.label=9;case 9:return[4,this.applyVariants({flagKeys:this.localFlagKeys})];case 10:return r.sent(),[4,this.previewVariants({keyToVariant:this.previewFlags})];case 11:return r.sent(),this.isRemoteBlocking||ai(),this.remoteFlagKeys.every(function(e){return Object.keys(C.previewFlags).includes(e)})?(this.isRunning=!0,Gi(this),[2]):[4,this.fetchRemoteFlags()];case 12:return r.sent(),[4,this.applyVariants({flagKeys:this.remoteFlagKeys})];case 13:return r.sent(),this.isRunning=!0,Gi(this),[2]}})})},e.getInstance=function(t,n,r){void 0===r&&(r={});var i=be();if(!i)throw new Error("Amplitude Web Experiment Client could not be initialized.");if(i.webExperiment&&!i.webExperiment.isStub){var o=i.webExperiment;return o.isRunning&&Gi(o),o}var a=new e(t,n,r);return i.webExperiment=a,a},e.prototype.getExperimentClient=function(){return this.experimentClient},e.prototype.hideLoadingIndicator=function(){wi()},e.prototype.applyVariants=function(e){return n(this,void 0,void 0,function(){var t,n,i,o,a,s,l,c,u,d,f,h,v,p;return r(this,function(r){switch(r.label){case 0:return t=(e||{}).flagKeys,n=this.getVariants(),0===Object.keys(n).length?[2]:(i=Pi(this.globalScope.location.href),(null===(v=this.urlExposureCache)||void 0===v?void 0:v[i])||(this.urlExposureCache={},this.urlExposureCache[i]={}),[4,this.fireStoredRedirectImpressions().catch(function(){})]);case 1:for(s in r.sent(),a=[],o=n)a.push(s);l=0,r.label=2;case 2:return l<a.length?(s=a[l])in o?(c=s,t&&!t.includes(c)||this.previewFlags[c]?[3,4]:(u=n[c],d=u.key||"",this.appliedMutations[c]&&(f=Object.keys(this.appliedMutations[c])).length>0&&!f.includes(d)&&(this.revertVariants({flagKeys:[c]}),delete this.appliedMutations[c]),"web"===(null===(p=u.metadata)||void 0===p?void 0:p.deliveryMethod)?(h=Array.isArray(u.payload),"off"!==u.key&&"control"!==u.key||(this.isActionActiveOnPage(c,void 0)&&this.exposureWithDedupe(c,u),"off"!==u.key)?h?[4,this.handleVariantAction(c,u)]:[3,4]:(this.revertVariants({flagKeys:[c]}),[3,4])):[3,4])):[3,4]:[3,5];case 3:r.sent(),r.label=4;case 4:return l++,[3,2];case 5:return[2]}})})},e.prototype.revertVariants=function(e){var t,n,r,o;if(this.appliedMutations){var a=(e||{}).flagKeys;a||(a=Object.keys(this.appliedMutations));try{for(var s=i(a),l=s.next();!l.done;l=s.next()){var c=l.value,u=this.appliedMutations[c];if(u){for(var d in u){var f=u[d];if(f)for(var h in f)for(var v in f[h])null===(o=null===(r=f[h][v])||void 0===r?void 0:r.revert)||void 0===o||o.call(r)}delete this.appliedMutations[c]}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},e.prototype.previewVariants=function(e){return n(this,void 0,void 0,function(){var t,n,i,o,a,s,l,c,u,d;return r(this,function(r){switch(r.label){case 0:if(!(t=e.keyToVariant))return[2];for(o in this.revertVariants({flagKeys:Object.keys(t)}),i=[],n=t)i.push(o);a=0,r.label=1;case 1:return a<i.length?(o=i[a])in n?(l=t[s=o],(c=this.flagVariantMap[s])&&(u=c[l])?(this.isPreviewMode&&function(e){var t=new jr(e),n=!1,r=!1,i=function(){n&&r&&t.show()};Nr(function(){n=!0,i()}),setTimeout(function(){r=!0,i()},500)}({flags:this.previewFlags}),(d=u.payload)&&Array.isArray(d)?[4,this.handleVariantAction(s,u)]:(this.isActionActiveOnPage(s,void 0)&&this.exposureWithDedupe(s,u),[2])):[2]):[3,3]:[3,4];case 2:r.sent(),r.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},e.prototype.getVariants=function(){var e,t,n={};try{for(var r=i(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),s=r.next();!s.done;s=r.next()){var l=s.value;n[l]=this.experimentClient.variant(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n},e.prototype.getActiveExperiments=function(){return Object.keys(this.appliedMutations)},e.prototype.getActivePages=function(){return this.activePages},e.prototype.addPageChangeSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addPageChangeSubscriber(e)},e.prototype.updateUserWithBehaviors=function(){var e,n;if(this.behavioralTargetingManager){var r=[];try{for(var s=i(this.behavioralTargetingManager.getMatchedBehaviors().values()),l=s.next();!l.done;l=s.next()){var c=l.value;r.push.apply(r,a([],o(c),!1))}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}var u=this.experimentClient.getUser(),d=t(t({},u),{behavioral_targeting:r});this.experimentClient.setUser(d)}},e.prototype.setPageObjects=function(e){var t,n;this.isVisualEditorMode&&(this.pageObjects=e,null===(t=this.subscriptionManager)||void 0===t||t.setPageObjects(e),this.activePages={},this.messageBus.unsubscribeAll(),null===(n=this.subscriptionManager)||void 0===n||n.initSubscriptions(),this.messageBus.publish("url_change",{updateActivePages:!0}))},e.prototype.setRedirectHandler=function(e){this.customRedirectHandler=e},e.prototype.toggleManualPageObject=function(e,t){var n;void 0===t&&(t=!0),null===(n=this.subscriptionManager)||void 0===n||n.toggleManualPageObject(e,t)},e.prototype.getDebugState=function(){return Wr()},e.prototype.buildFlagDebugInfo=function(){var e,t,n,r,s,l,c={},u=this.getVariants(),d=null!==(r=null===(n=this.subscriptionManager)||void 0===n?void 0:n.getDebugPageObjects())&&void 0!==r?r:{},f=this.localFlagKeys.length>0?this.experimentClient.getEvaluationTraces(this.localFlagKeys):void 0;try{for(var h=i(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),v=h.next();!v.done;v=h.next()){var p=v.value,g=u[p],m=this.activePages[p],y=void 0,b=null==f?void 0:f[p];b?y={matched:b.matched,matchedSegment:b.matchedSegment,steps:b.steps}:(null===(s=null==g?void 0:g.metadata)||void 0===s?void 0:s.segmentName)&&(y={matched:!0,matchedSegment:g.metadata.segmentName,steps:[]}),c[p]={flagKey:p,variant:(null==g?void 0:g.key)?{key:g.key,value:g.value,metadata:g.metadata}:null,isActive:!!m&&Object.keys(m).length>0,audienceEvaluation:y,pageObjects:null!==(l=d[p])&&void 0!==l?l:[]}}}catch(t){e={error:t}}finally{try{v&&!v.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}return c},e.prototype.addDebugStateSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addDebugStateSubscriber(e)},e.prototype.plugin=function(){var e=this;return{name:"@amplitude/experiment-tag",type:"enrichment",setup:function(){return n(e,void 0,void 0,function(){return r(this,function(e){return[2]})})},execute:function(t){return n(e,void 0,void 0,function(){return r(this,function(e){return this.trackEvent(t.event_type,t.event_properties),[2,t]})})}}},e.prototype.trackEvent=function(e,t){var n;null===(n=this.behavioralTargetingManager)||void 0===n||n.trackEvent(e,t||{}),this.messageBus.publish("analytics_event",{event:e,properties:t||{}})},e.prototype.fetchRemoteFlags=function(){return n(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.experimentClient.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn("Error fetching remote flags:",e),[3,3];case 3:return[2]}})})},e.prototype.handleVariantAction=function(e,t){return n(this,void 0,void 0,function(){var n,o,a,s,l,c;return r(this,function(r){switch(r.label){case 0:r.trys.push([0,6,7,8]),n=i(t.payload),o=n.next(),r.label=1;case 1:return o.done?[3,5]:"redirect"!==(a=o.value).action?[3,3]:[4,this.handleRedirect(a,e,t)];case 2:return r.sent(),[3,4];case 3:a.action===ji?this.handleMutate(a,e,t):a.action===Ri&&this.handleInject(a,e,t),r.label=4;case 4:return o=n.next(),[3,1];case 5:return[3,8];case 6:return s=r.sent(),l={error:s},[3,8];case 7:try{o&&!o.done&&(c=n.return)&&c.call(n)}finally{if(l)throw l.error}return[7];case 8:return[2]}})})},e.prototype.handleRedirect=function(e,i,o){return n(this,void 0,void 0,function(){var n,a,s,l,c,u,d,f,h,v,p,g=this;return r(this,function(r){switch(r.label){case 0:return this.isActionActiveOnPage(i,null===(h=null===(f=null==e?void 0:e.data)||void 0===f?void 0:f.metadata)||void 0===h?void 0:h.scope)?(n=Pi(this.previousUrl||this.globalScope.document.referrer),a=null===(v=null==e?void 0:e.data)||void 0===v?void 0:v.url,Pi(this.globalScope.location.href)===n?[2]:(s=function(e,t){var n=new URL(e),r=new URL(t),i=new URL(t);return n.searchParams.forEach(function(e,t){r.searchParams.has(t)||i.searchParams.append(t,e)}),i.toString()}(this.globalScope.location.href,a),this.globalScope.location.href===s?[2]:(l=function(){try{return new URL(s).hostname!==g.globalScope.location.hostname}catch(e){return!1}}(),[4,this.storeRedirectImpressions(i,o,a,l)]))):[2];case 1:if(r.sent(),(null===(p=this.config.redirectConfig)||void 0===p?void 0:p.encodeRedirectInUrl)&&l){if(c=new URL(s),u={},d=c.searchParams.get(Di))try{u=JSON.parse(atob(d))}catch(e){console.error("Failed to decode existing AMP_REDIRECT param:",e)}u[i]=t(t({redirectUrl:a,variantKey:o.key||""},void 0!==o.expKey?{expKey:o.expKey}:{}),void 0!==o.metadata?{metadata:o.metadata}:{}),c.searchParams.set(Di,btoa(JSON.stringify(u))),s=c.toString()}return this.previousUrl=this.globalScope.location.href,[4,gi(this.apiKey,this.globalScope.location.hostname)];case 2:return r.sent(),this.customRedirectHandler?(this.customRedirectHandler(s),[2]):(this.globalScope.location.replace(s),[2])}})})},e.prototype.handleMutate=function(e,n,r){var i,o,a,s,l,c=this,u=(null===(i=e.data)||void 0===i?void 0:i.mutations)||[],d=r.key||"";if(0!==u.length){var f={};u.forEach(function(e,t){var i,o,a,s,l,u,h,v,p,g,m;c.isActionActiveOnPage(n,null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.scope)?(c.exposureWithDedupe(n,r),(null===(m=null===(g=null===(p=c.appliedMutations[n])||void 0===p?void 0:p[d])||void 0===g?void 0:g[ji])||void 0===m?void 0:m[t])||(f[t]=Er.declarative(e))):(null===(s=null===(a=null===(o=c.appliedMutations[n])||void 0===o?void 0:o[d])||void 0===a?void 0:a[ji])||void 0===s?void 0:s[t])&&(null===(v=null===(h=null===(u=null===(l=c.appliedMutations[n])||void 0===l?void 0:l[d])||void 0===u?void 0:u[ji])||void 0===h?void 0:h[t])||void 0===v||v.revert(),delete c.appliedMutations[n][d][ji][t])}),null!==(o=(s=this.appliedMutations)[n])&&void 0!==o||(s[n]={}),null!==(a=(l=this.appliedMutations[n])[d])&&void 0!==a||(l[d]={}),this.appliedMutations[n][d][ji]=t(t({},this.appliedMutations[n][d][ji]),f),0===Object.keys(this.appliedMutations[n][d][ji]||{}).length&&delete this.appliedMutations[n][d][ji],0===Object.keys(this.appliedMutations[n][d]||{}).length&&delete this.appliedMutations[n]}},e.prototype.handleInject=function(e,t,i){var o,a,s,l,c,u,d,f,h,v,p,g,m=this,y=i.key||"";if(this.isActionActiveOnPage(t,null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.scope)){var b=e.data.id;if(b&&"string"==typeof b&&0!==b.length&&(b=b.replace(/-/g,""),!this.appliedInjections.has(b))){var w,S=e.data.js;S&&(w=this.globalScope.document.createElement("script"))&&(w.innerHTML="function ".concat(b,"(html, utils, id){").concat(S,"};"),w.id="js-".concat(b),this.globalScope.document.head.appendChild(w));var x,k=e.data.css;k&&(x=Mr(this.globalScope.document,k));var E,_=e.data.html;_&&(E=null!==(u=(new DOMParser).parseFromString(_,"text/html").body.firstElementChild)&&void 0!==u?u:void 0);var A={cancelled:!1},O=function(e){return{waitForElement:function(t){return n(this,void 0,void 0,function(){var n,i,o;return r(this,function(r){return n=void 0,(o=(i=function(){if(!e.cancelled)return document.querySelector(t);null==n||n.disconnect()})())?[2,o]:[2,new Promise(function(e){n=new MutationObserver(function(){var t=i();t&&(null==n||n.disconnect(),e(t))}),n.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})})]})})},insertElement:function(t,n,r){return new Promise(function(i){var o=0,a=void 0,s=function(){if(e.cancelled)null==a||a.disconnect();else if(!(t.isConnected&&t.ownerDocument===document||o>=10)){o++,setTimeout(function(){return o--},1e3);var s=document.querySelector(n.parentSelector);if(s){var l=n.insertBeforeSelector?s.querySelector(n.insertBeforeSelector):null;n.insertBeforeSelector&&!l||(vr(),s.insertBefore(t,l),pr(),null==r||r(),i())}}};s(),(a=new MutationObserver(s)).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})})}}}(A);this.appliedInjections.add(b);try{var T=this.globalScope[b];T&&"function"==typeof T&&T(E,O,b)}catch(e){null==w||w.remove(),console.error("Experiment inject failed for ".concat(t," variant ").concat(i.key,". Reason:"),e)}null!==(d=(v=this.appliedMutations)[t])&&void 0!==d||(v[t]={}),null!==(f=(p=this.appliedMutations[t])[y])&&void 0!==f||(p[y]={}),null!==(h=(g=this.appliedMutations[t][y])[Ri])&&void 0!==h||(g[Ri]={}),this.appliedMutations[t][y][Ri][b]={revert:function(){var e;A.cancelled=!0,null===(e=O.remove)||void 0===e||e.call(O),null==x||x.revert(),null==w||w.remove(),m.appliedInjections.delete(b)}},this.exposureWithDedupe(t,i)}}else null===(c=null===(l=null===(s=null===(a=this.appliedMutations[t])||void 0===a?void 0:a[y])||void 0===s?void 0:s[Ri])||void 0===l?void 0:l[0])||void 0===c||c.revert()},e.prototype.exposureWithDedupe=function(e,t,n){var r,i,o,a,s=Pi(this.globalScope.location.href);if(!((null===(i=null===(r=this.urlExposureCache)||void 0===r?void 0:r[s])||void 0===i?void 0:i[e])===t.key)){if(n||this.previewFlags[e]){var l={variant:t,source:"local-evaluation",hasDefaultVariant:!1};this.experimentClient.exposureInternal(e,l)}else this.experimentClient.exposure(e);(null!==(o=(a=this.urlExposureCache)[s])&&void 0!==o?o:a[s]={})[e]=t.key}},e.prototype.updateActivePages=function(e,t,n){this.activePages[e]||(this.activePages[e]={}),n?this.activePages[e][t.id]=t:(delete this.activePages[e][t.id],0===Object.keys(this.activePages[e]).length&&delete this.activePages[e])},e.prototype.isActionActiveOnPage=function(e,t){var n=this.activePages[e];return t?t.some(function(e){var t;return null!==(t=null==n?void 0:n[e])&&void 0!==t&&t}):!!n&&Object.values(n).some(Boolean)},e.prototype.storeRedirectImpressions=function(e,i,o,a){return n(this,void 0,void 0,function(){var n,s,l,c,u,d,f,h,v;return r(this,function(r){switch(r.label){case 0:return n="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),s=t(t({redirectUrl:o,variantKey:i.key||""},void 0!==i.expKey?{expKey:i.expKey}:{}),void 0!==i.metadata?{metadata:i.metadata}:{}),(l=si("sessionStorage",n)||{})[e]=s,li("sessionStorage",n,l),(null===(v=this.config.redirectConfig)||void 0===v?void 0:v.encodeRedirectInCookie)&&a?[4,vi(this.globalScope.location.hostname)]:[3,6];case 1:c=r.sent(),u=new Xe(t(t({},c&&{domain:c}),{sameSite:"Lax",expirationDays:1/1440})),r.label=2;case 2:return r.trys.push([2,5,,6]),[4,u.get(n)];case 3:return d=r.sent(),(f=d||{})[e]=s,[4,u.set(n,f)];case 4:return r.sent(),[3,6];case 5:return h=r.sent(),console.error("Failed to store redirect impression in cookie for ".concat(e,":"),h),[3,6];case 6:return[2]}})})},e.prototype.fireStoredRedirectImpressions=function(){return n(this,void 0,void 0,function(){var e,i,o,a,s,l,c,u,d,f,h,v,p,g,m,y,b,w,S,x,k,E,_=this;return r(this,function(A){switch(A.label){case 0:if(e="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),i={},(null===(x=this.config.redirectConfig)||void 0===x?void 0:x.encodeRedirectInUrl)&&(o=Ci(),a=o[Di])){try{i=JSON.parse(atob(a))}catch(e){}s=Mi(this.globalScope.location.href,[Di]),null===(k=this.subscriptionManager)||void 0===k||k.markUrlAsPublished(s),this.globalScope.history.replaceState({},"",s)}return l=si("sessionStorage",e)||{},c={},(null===(E=this.config.redirectConfig)||void 0===E?void 0:E.encodeRedirectInCookie)?[4,vi(this.globalScope.location.hostname)]:[3,5];case 1:d=A.sent(),u=new Xe(t(t({},d&&{domain:d}),{sameSite:"Lax"})),A.label=2;case 2:return A.trys.push([2,4,,5]),[4,u.get(e)];case 3:return c=A.sent()||{},[3,5];case 4:return f=A.sent(),console.error("Failed to retrieve redirect impressions from cookie ".concat(e,":"),f),[3,5];case 5:if(h=t(t(t({},c),l),i),0===Object.keys(h).length)return[2];for(p in v=Pi(this.globalScope.location.href),h)g=h[p],m=g.redirectUrl,y=g.variantKey,b=g.expKey,w=g.metadata,Ii([v],Pi(m))&&(this.exposureWithDedupe(p,{key:y,expKey:b,metadata:w},!0),delete h[p]);return S=function(){return n(_,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return function(e,t){var n;try{null===(n=ci(e))||void 0===n||n.removeItem(t)}catch(t){console.warn("Failed to remove item from ".concat(e,":"),t)}}("sessionStorage",e),u?[4,u.remove(e).catch(function(t){console.error("Failed to remove redirect impressions from cookie ".concat(e,":"),t)})]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},Object.keys(h).length>0?(this.globalScope.setTimeout(function(){return n(_,void 0,void 0,function(){var e,t,n,i,o;return r(this,function(r){switch(r.label){case 0:for(e in h)t=h[e],n=t.variantKey,i=t.expKey,o=t.metadata,this.exposureWithDedupe(e,{key:n,expKey:i,metadata:o},!0);return[4,S()];case 1:return r.sent(),[2]}})})},500),[3,8]):[3,6];case 6:return[4,S()];case 7:A.sent(),A.label=8;case 8:return[2]}})})},e.prototype.setupPreviewMode=function(e){var t=this;if("true"===e[Vi]){Object.keys(e).forEach(function(n){n!==Vi&&e[n]&&(t.previewFlags[n]=e[n])}),li("sessionStorage",Ui,{previewFlags:this.previewFlags});var n=a(a([],o(Object.keys(this.previewFlags)),!1),[Vi],!1);this.globalScope.history.replaceState({},"",Mi(this.globalScope.location.href,n)),ki.setup()}else{var r=si("sessionStorage",Ui);r&&(this.previewFlags=r.previewFlags)}Object.keys(this.previewFlags).length>0&&(this.isPreviewMode=!0)},e}();var Bi=ye.fetch||function(e,t){return t=t||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var c in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n}),n(l())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)})},Ki={request:function(e,t,i,o,a){return n(void 0,void 0,void 0,function(){var s;return r(this,function(l){return s=function(){return n(void 0,void 0,void 0,function(){var n,a;return r(this,function(r){switch(r.label){case 0:return[4,Bi(e,{method:t,headers:i,body:o})];case 1:return n=r.sent(),a={status:n.status},[4,n.text()];case 2:return[2,(a.body=r.sent(),a)]}})})},[2,(c=s(),u=a,!u||u<=0?c:Promise.race([c,new Promise(function(e,t){return setTimeout(function(){return t(new pe("Timeout after ".concat(u,"ms")))},u)})]))];var c,u})})}},qi=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getPreviewFlagsAndPageViewObjects=function(){return n(this,void 0,void 0,function(){var e,t,n,i,o,a;return r(this,function(r){switch(r.label){case 0:return(e={Authorization:"Api-Key ".concat(this.deploymentKey)})["X-Amp-Exp-Library"]="experiment-tag/".concat("0.25.0"),[4,this.httpClient.request("".concat(this.serverUrl,"/web/v1/configs"),"GET",e,null,1e4)];case 1:if(200!=(t=r.sent()).status)throw Error("Preview error response: status=".concat(t.status));return n=JSON.parse(t.body),i=n.flags,o=n.pageObjects,a=n.behavioralTargetingRules,[2,{flags:i,pageViewObjects:o,behavioralTargetingRules:a}]}})})},e}(),zi=[],Wi=function(e,t,n){Fi.getInstance(e,t,n).start().finally(function(){ai()})},Hi=function(e,t){return n(void 0,void 0,void 0,function(){return r(this,function(n){return[2,new qi(e,"EU"===t?"https://api.lab.eu.amplitude.com":"https://api.lab.amplitude.com",Ki).getPreviewFlagsAndPageViewObjects()]})})},Ji=function(){return{name:"@amplitude/experiment-tag",type:"enrichment",execute:function(e){return n(void 0,void 0,void 0,function(){var t,n;return r(this,function(r){return t=be(),(n=null==t?void 0:t.webExperiment)&&"function"==typeof n.trackEvent&&n.isRunning?n.trackEvent(e.event_type,e.event_properties):zi.push({event_type:e.event_type,event_properties:e.event_properties}),[2,e]})})}}},Gi=function(e){zi.length>0&&(zi.forEach(function(t){var n=t.event_type,r=t.event_properties;e.trackEvent(n,r)}),zi.length=0)};e.createPlugin=Ji,e.flushEventBuffer=Gi,e.initialize=function(e,t,n){var r,i=be();if(!i)throw new Error("Global scope not available");i.webExperiment||(i.webExperiment={plugin:Ji,isStub:!0}),function(){if("true"===Ci()[Vi])return!0;var e=si("sessionStorage",Ui);return!!((null==e?void 0:e.previewFlags)&&Object.keys(e.previewFlags).length>0)}()||(null===(r=i.WebExperiment)||void 0===r?void 0:r.injectedByExtension)?(oi(),Hi(e,n.serverZone).then(function(t){var r=JSON.stringify(t.flags),i=JSON.stringify(t.pageViewObjects),o=JSON.stringify(t.behavioralTargetingRules);Wi(e,{initialFlags:r,pageObjects:i,behavioralTargetingRules:o},n)}).catch(function(r){console.warn("Failed to fetch latest configs for preview:",r),Wi(e,t,n)}).finally(function(){ai()})):Wi(e,t,n)},Object.defineProperty(e,"__esModule",{value:!0})}(this.WebExperiment=this.WebExperiment||{});
|