;
(self.AMP=self.AMP||[]).push({m:1,v:"2601162341000",n:"amp-bind",ev:"0.1",l:!0,f:function(t,e){(()=>{function e(t){return t?Array.prototype.slice.call(t):[]}var{isArray:n}=Array;function r(t,e){const n=[];let r=0;for(let s=0;s<t.length;s++){const i=t[s];e(i,s,t)?n.push(i):(r<s&&(t[r]=i),r++)}return r<t.length&&(t.length=r),n}function s(t,e){for(let n=0;n<t.length;n++)if(e(t[n],n,t))return n;return-1}var{hasOwnProperty:i,toString:o}=Object.prototype;function l(t){return"[object Object]"===o.call(t)}function u(t){const e=Object.create(null);return t&&Object.assign(e,t),e}function c(t,e){return i.call(t,e)}function a(t,e){return c(t,e)?t[e]:void 0}function h(t,e){if("."==e)return t;const n=e.split(".");let r=t;for(const t of n){if(!(t&&r&&void 0!==r[t]&&"object"==typeof r&&c(r,t))){r=void 0;break}r=r[t]}return r}function f(t){return"number"==typeof t&&isFinite(t)}var d="​​​";function p(t){return 1==(null==(e=t)?void 0:e.nodeType)?t.tagName.toLowerCase()+(t.id?`#${t.id}`:""):t;var e}function P(t){return t.indexOf(d)>=0}function m(t,e,n,r,s,i,o,l,u,c,a){return t}function A(t,e,n,s,i,o,l,u,c,a,h){return function(t,e,n="Assertion failed",s){var i,o;if(e)return e;t&&-1==n.indexOf(t)&&(n+=t);let l=3;const u=n.split("%s");let c=u.shift();const a=[c];for(;u.length;){const t=arguments[l++],e=u.shift();c+=p(t)+e,a.push(t,e.trim())}const h=new Error(c);throw h.messageArray=r(a,(t=>""!==t)),null===(i=(o=self).__AMP_REPORT_ERROR)||void 0===i||i.call(o,h),h}(d,t,e,n,s,i,o,l,u,c,a,h)}var _,v=class extends t.BaseElement{getLayoutPriority(){return 1}isAlwaysFixed(){return!0}isLayoutSupported(t){return!0}renderOutsideViewport(){return!0}cs(){return"<amp-bind-macro> "+(this.element.getAttribute("id")||"<unknown id>")}};function b(){return _||(_=Promise.resolve(void 0))}var E,T=class{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}};function g(t){return JSON.parse(t)}function w(t,e){return t.closest(e)}var M=["Webkit","webkit","Moz","moz","ms","O","o"];function R(t,e,n,r,s){const i=function(t,e,n){if(e.startsWith("--"))return e;E||(E=u());let r=E[e];if(!r||n){if(r=e,void 0===t[e]){const n=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(e),s=function(t,e){for(let n=0;n<M.length;n++){const r=M[n]+e;if(void 0!==t[r])return r}return""}(t,n);void 0!==t[s]&&(r=s)}n||(E[e]=r)}return r}(t.style,e,s);if(!i)return;const o=r?n+r:n;t.style.setProperty(function(t){const e=t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()));return M.some((t=>e.startsWith(t+"-")))?`-${e}`:e}(i),o)}var I=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function y(t,e=""){try{return decodeURIComponent(t)}catch(t){return e}}function S(t){const e=u();if(!t)return e;let n;for(;n=I.exec(t);){const t=y(n[1],n[1]),r=n[2]?y(n[2].replace(/\+/g," "),n[2]):"";e[t]=r}return e}function V(t){const{location:e}=t||self;return S(e.originalHash||e.hash)}var O="";function x(t){const e=t||self;return e.__AMP_MODE?e.__AMP_MODE:e.__AMP_MODE=function(t){return{localDev:!1,development:N(t,V(t)),esm:!0,test:!1,rtvVersion:k(t),ssrReady:!1}}(e)}function k(t){var e;return O||(O=(null===(e=t.AMP_CONFIG)||void 0===e?void 0:e.v)||"012601162341000"),O}function N(t,e){const n=e||V(t);return["1","actions","amp","amp4ads","amp4email"].includes(n.development)||!!t.AMP_DEV_MODE}var j=(()=>self.AMP.config.urls)();self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var U=self.__AMP_LOG;function L(t,e){throw new Error("failed to call initLogConstructor")}function C(t){return U.user||(U.user=F()),function(t,e){return e&&e.ownerDocument.defaultView!=t}(U.user.win,t)?U.userForEmbed||(U.userForEmbed=F()):U.user}function F(t){return L()}function $(){return U.dev||(U.dev=L())}function D(t,e,n,r,s,i,o,l,u,c,a){return t}function B(t,e,n,r,s,i,o,l,u,c,a){return C().assert(t,e,n,r,s,i,o,l,u,c,a)}function q(t,e){return Y(t=H(t),e)}function W(t,e){return Y(K(X(t)),e)}function J(t,e){const n=K(X(t));return et(n,e)?Y(n,e):null}function z(t,e){return function(t,e){const n=Q(t,e);if(n)return n;const r=tt(t);return r[e]=function(){const t=new T,{promise:e,reject:n,resolve:r}=t;return e.catch((()=>{})),{obj:null,promise:e,resolve:r,reject:n,context:null,ctor:null}}(),r[e].promise}(K(t),e)}function G(t,e){return Q(K(t),e)}function H(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}function X(t){return t.nodeType?(n=t,e=(n.ownerDocument||n).defaultView,q(e,"ampdoc")).getAmpDoc(t):t;var e,n}function K(t){const e=X(t);return e.isSingleDoc()?e.win:e}function Y(t,e){D(et(t,e));const n=tt(t)[e];return n.obj||(D(n.ctor),D(n.context),n.obj=new n.ctor(n.context),D(n.obj),n.context=null,n.resolve&&n.resolve(n.obj)),n.obj}function Z(t,e,n,r,s,i){const o=tt(t);let l=o[n];l||(l=o[n]={obj:null,promise:null,resolve:null,reject:null,context:null,ctor:null,sharedInstance:i||!1}),!s&&l.ctor||(l.ctor=r,l.context=e,l.sharedInstance=i||!1,l.resolve&&Y(t,n))}function Q(t,e){const n=tt(t)[e];return n?n.promise?n.promise:(Y(t,e),n.promise=Promise.resolve(n.obj)):null}function tt(t){let e=t.__AMP_SERVICES;return e||(e=t.__AMP_SERVICES={}),e}function et(t,e){const n=t.__AMP_SERVICES&&t.__AMP_SERVICES[e];return!(!n||!n.ctor)}var nt=t=>function(t,e,n){const r=J(t,e);return r?Promise.resolve(r):function(t,e,n,r){const s=G(t,e);if(s)return s;const i=X(t);return i.whenExtensionsKnown().then((()=>{const t=i.getExtensionVersion(n);return t?q(i.win,"extensions").waitForExtension(n,t):null})).then((n=>n?z(t,e):null))}(t,e,n)}(t,"bind","amp-bind"),rt=t=>W(t,"viewer"),st=t=>q(t,"xhr");function it(t,e,n,r){const s={detail:n};return Object.assign(s,r),new t.CustomEvent(e,s)}function ot(t){return t.detail}var lt,ut=(()=>self.AMP.config.urls)(),ct=new Set(["c","v","a","ad"]),at=t=>"string"==typeof t?ht(t):t;function ht(t,e){return lt||(lt=self.document.createElement("a")),function(t,e,n){return t.href="",new URL(e,t.href)}(lt,t)}function ft(t){return ut.cdnProxyRegex.test(at(t).origin)}function dt(t){if(!ft(t=at(t)))return t.href;const e=t.pathname.split("/"),n=e[1];B(ct.has(n),"Unknown path prefix in url %s",t.href);const r=e[2],s="s"==r?"https://"+decodeURIComponent(e[3]):"http://"+decodeURIComponent(r);return B(s.indexOf(".")>0,"Expected a . in origin %s",s),e.splice(1,"s"==r?3:2),s+e.join("/")+function(t,e){if(!t||"?"==t)return"";const n=new RegExp("[?&](amp_(js[^&=]*|gsa|r|kit)|usqp)\\b[^&]*","g"),r=t.replace(n,"").replace(/^[?&]/,"");return r?"?"+r:""}(t.search)+(t.hash||"")}function pt(t){return ht(dt(t)).origin}function Pt(t,e){return e=at(e),new URL(t,e.href).toString()}var mt={NONE:0,OPT_IN:1,ALL:2};var At=class extends t.BaseElement{constructor(t){super(t),this.qbt=void 0,this.Hbt=new T}getLayoutPriority(){return 1}isAlwaysFixed(){return!0}isLayoutSupported(t){return!0}buildCallback(){!function(t,e){void 0===e&&(e=t.hasAttribute("hidden")),e?t.removeAttribute("hidden"):t.setAttribute("hidden","")}(this.element,!1),this.element.setAttribute("aria-hidden","true");const{element:t}=this;t.hasAttribute("overridable")&&nt(t).then((e=>{D(e),e.addOverridableKey(t.getAttribute("id"))})),this.parseAndUpdate(),this.element.hasAttribute("src")&&this.Xbt(!0),this.registerAction("refresh",(()=>{B(this.element.hasAttribute("src"),'Can\'t refresh <amp-state> without "src" attribute.'),this.Xbt(!1,!0)}))}mutatedAttributesCallback(t){if(this.getAmpDoc().hasBeenVisible())void 0!==t.src&&this.element.hasAttribute("src")&&this.Xbt(!1);else{const t=this.cs();$().error(t,"ampdoc must be visible before mutation.")}}renderOutsideViewport(){return!0}parseAndUpdate(){return void 0===this.qbt&&(this.qbt=this.Qo(),null!==this.qbt)?this.Zbt(this.qbt,!0):b()}Qo(){const{children:t}=this.element;if(0==t.length)return null;const e=this.cs();if(1!=t.length)return this.user().error(e,"Should contain exactly one <script> child."),null;const n=t[0];return"SCRIPT"!=(r=n).tagName||"APPLICATION/JSON"!=(null===(s=r.getAttribute("type"))||void 0===s?void 0:s.toUpperCase())?(this.user().error(e,'State should be in a <script> tag with type="application/json".'),null):function(t,e){try{return g(t)}catch(t){return null==e||e(t),null}}(n.textContent,(t=>{this.user().error(e,"Failed to parse state. Is it valid JSON?",t)}));var r,s}En(t,e,n){return function(t,e,n={}){const{expr:r=".",refresh:s=!1,url:i=e.getAttribute("src"),urlReplacement:o=mt.NONE,xssiPrefix:l}=n;!function(t,e,n="source"){var r;B(null!=t,"%s %s must be available",e,n),B("https:"==(r=at(r=t)).protocol||"localhost"==r.hostname||"127.0.0.1"==r.hostname||function(t,e){const n=t.length-e.length;return n>=0&&t.indexOf(e,n)==n}(r.hostname,".localhost")||/^\/\//.test(t),'%s %s must start with "https://" or "//" or be relative and served from either https or from localhost. Invalid value: %s',e,n,t)}(i,e);const u=q(t.win,"batched-xhr");return function(t,e,n,r){const s=(t=>J(t,"url-replace"))(t);return(n>=mt.OPT_IN?s.expandUrlAsync(e):Promise.resolve(e)).then((e=>{if(n===mt.OPT_IN){const e=s.collectDisallowedVarsSync(t);if(e.length>0)throw C().createError(`URL variable substitutions in CORS fetches from dynamic URLs (e.g. via amp-bind) require opt-in. Please add data-amp-replace="${e.join(" ")}" to the <${t.tagName}> element. See https://bit.ly/amp-var-subs.`)}const i={};return t.hasAttribute("credentials")&&(i.credentials=t.getAttribute("credentials")),r&&(i.cache="reload"),{"xhrUrl":e,"fetchOpt":i}}))}(e,i,o,s).then((t=>u.fetchJson(t.xhrUrl,t.fetchOpt))).then((e=>st(t.win).xssiJson(e,l))).then((t=>{if(null==t)throw new Error("Response is undefined.");return h(t,r||".")})).catch((t=>{throw C().createError("failed fetching JSON data",t)}))}(t,this.element,{urlReplacement:e,refresh:n})}u6(t,e){const{element:n}=this,r=this.getAmpDoc(),s=pt(n.getAttribute("src"))===pt(r.win.location)||t?mt.ALL:mt.OPT_IN;return this.En(r,s,e).catch((t=>{const e=t?it(this.win,"amp-state.error",{"response":t.response}):null;(t=>J(t,"action"))(n).trigger(n,"fetch-error",e,1)}))}Xbt(t,e){t||(this.Hbt=new T);const n=this.Hbt;return this.getAmpDoc().whenFirstVisible().then((()=>this.u6(t,e))).then((e=>this.Zbt(e,t))).then((()=>n.resolve())).catch((t=>{throw n.resolve(),t}))}getFetchingPromise(){return this.element.hasAttribute("src")?this.Hbt.promise:b()}Zbt(t,e){if(null==t)return b();const n=B(this.element.id,"<amp-state> must have an id.");return nt(this.element).then((r=>{D(r);const s=u();s[n]=t,r.setState(s,{skipEval:e,skipAmpState:!e})}))}cs(){return"<amp-state> "+(this.element.getAttribute("id")||"<unknown id>")}};function _t(t){if(m(function(t){const e=t.tagName;return e.startsWith("AMP-")&&!("AMP-STICKY-AD-TOP-PADDING"==e||"AMP-BODY"==e)}(t)),t.createdCallback)return Promise.resolve(t);if(!t.__AMP_UPG_PRM){const e=new T;t.__AMP_UPG_PRM=e.promise,t.__AMP_UPG_RES=e.resolve}const e=t.__AMP_UPG_PRM;return m(e),e}var vt=/(\S+)(?:\s+(?:(-?\d+(?:\.\d+)?)([a-zA-Z]*)))?\s*(?:,|$)/g;function bt(t){const e=[];let n;for(;n=vt.exec(t);){const t=n[1];let r,s;if(n[2]){const t=n[3].toLowerCase();if("w"==t)r=parseInt(n[2],10);else{if("x"!=t)continue;s=parseFloat(n[2])}}else s=1;e.push({url:t,width:r,dpr:s})}return new Et(e)}var Et=class{constructor(t){A(t.length>0,"Srcset must have at least one source"),this.bg=t;let e=!1,n=!1;for(let r=0;r<t.length;r++){const s=t[r];e=e||!!s.width,n=n||!!s.dpr}A(!(e===n),"Srcset must have width or dpr sources, but not both"),t.sort(e?Tt:gt),this.yg=e}select(t,e){m(t),m(e);let n=0;return n=this.yg?this.vg(t*e):this.wg(e),this.bg[n].url}vg(t){const e=this.bg;let n=0,r=1/0,s=1/0;for(let o=0;o<e.length;o++){var i;const l=null!==(i=e[o].width)&&void 0!==i?i:0,u=Math.abs(l-t);if(!(u<=1.1*r||t/s>1.2))break;n=o,r=u,s=l}return n}wg(t){const e=this.bg;let n=0,r=1/0;for(let s=0;s<e.length;s++){const i=Math.abs(e[s].dpr-t);if(!(i<=r))break;n=s,r=i}return n}getUrls(){return this.bg.map((t=>t.url))}stringify(t){const e=[],n=this.bg;for(let r=0;r<n.length;r++){const s=n[r];let i=s.url;t&&(i=t(i)),this.yg?i+=` ${s.width}w`:i+=` ${s.dpr}x`,e.push(i)}return e.join(", ")}};function Tt(t,e){return A(t.width!=e.width,"Duplicate width: %s",t.width),t.width-e.width}function gt(t,e){return A(t.dpr!=e.dpr,"Duplicate dpr: %s",t.dpr),t.dpr-e.dpr}var wt={"class":{denylistedValueRegex:"(^|\\W)i-amphtml-"},"hidden":null,"text":null},Mt={"width":null,"height":null},Rt={"AMP-AUDIO":{"album":null,"artist":null,"artwork":null,"controlsList":null,"loop":null,"src":{"allowedProtocols":{"https":!0}},"title":null},"AMP-AUTOCOMPLETE":{"src":{"allowedProtocols":{"https":!0}}},"AMP-BASE-CAROUSEL":{"advance-count":null,"auto-advance-count":null,"auto-advance-interval":null,"auto-advance-loops":null,"auto-advance":null,"horizontal":null,"initial-index":null,"loop":null,"mixed-length":null,"side-slide-count":null,"slide":null,"snap-align":null,"snap-by":null,"snap":null,"visible-count":null},"AMP-BRIGHTCOVE":{"data-account":null,"data-embed":null,"data-player":null,"data-player-id":null,"data-playlist-id":null,"data-video-id":null},"AMP-CAROUSEL":{"slide":null},"AMP-DATE-PICKER":{"max":null,"min":null,"src":{"allowedProtocols":{"https":!0}}},"AMP-GOOGLE-DOCUMENT-EMBED":{"src":null,"title":null},"AMP-IFRAME":{"src":null,"title":null},"AMP-IMG":{"alt":null,"attribution":null,"src":{"allowedProtocols":{"data":!0,"http":!0,"https":!0}},"srcset":{"alternativeName":"src"}},"AMP-LIGHTBOX":{"open":null},"AMP-LIST":{"src":{"allowedProtocols":{"https":!0}},"state":null,"is-layout-container":null},"AMP-RENDER":{"src":{"allowedProtocols":{"https":!0}}},"AMP-SELECTOR":{"disabled":null,"selected":null},"AMP-STATE":{"src":{"allowedProtocols":{"https":!0}}},"AMP-TIMEAGO":{"datetime":null,"title":null},"AMP-TWITTER":{"data-tweetid":null},"AMP-VIDEO":{"album":null,"alt":null,"artist":null,"artwork":null,"attribution":null,"controls":null,"controlslist":null,"loop":null,"poster":null,"preload":null,"src":{"allowedProtocols":{"https":!0}},"title":null},"AMP-YOUTUBE":{"data-videoid":null},"A":{"href":{"allowedProtocols":{"ftp":!0,"geo":!0,"http":!0,"https":!0,"mailto":!0,"maps":!0,"bip":!0,"bbmi":!0,"chrome":!0,"itms-services":!0,"facetime":!0,"fb-me":!0,"fb-messenger":!0,"intent":!0,"line":!0,"microsoft-edge":!0,"skype":!0,"sms":!0,"snapchat":!0,"tel":!0,"tg":!0,"threema":!0,"twitter":!0,"viber":!0,"webcal":!0,"web+mastodon":!0,"wh":!0,"whatsapp":!0}}},"BUTTON":{"disabled":null,"type":null,"value":null},"DETAILS":{"open":null},"FIELDSET":{"disabled":null},"IMAGE":{"xlink:href":{"allowedProtocols":{"http":!0,"https":!0}}},"INPUT":{"accept":null,"accesskey":null,"autocomplete":null,"checked":null,"disabled":null,"height":null,"inputmode":null,"max":null,"maxlength":null,"min":null,"minlength":null,"multiple":null,"pattern":null,"placeholder":null,"readonly":null,"required":null,"selectiondirection":null,"size":null,"spellcheck":null,"step":null,"type":{denylistedValueRegex:"(^|\\s)(button|image|)(\\s|$)"},"value":null,"width":null},"OPTION":{"disabled":null,"label":null,"selected":null,"value":null},"OPTGROUP":{"disabled":null,"label":null},"SECTION":{"data-expand":null,"expanded":null},"SELECT":{"autofocus":null,"disabled":null,"multiple":null,"required":null,"size":null},"SOURCE":{"src":{"allowedProtocols":{"https":!0}},"type":null},"TRACK":{"label":null,"src":{"allowedProtocols":{"https":!0}},"srclang":null},"TEXTAREA":{"autocomplete":null,"autofocus":null,"cols":null,"disabled":null,"maxlength":null,"minlength":null,"pattern":null,"placeholder":null,"readonly":null,"required":null,"rows":null,"selectiondirection":null,"selectionend":null,"selectionstart":null,"spellcheck":null,"wrap":null,"defaulttext":null}},It={"src":!0,"srcset":!0,"href":!0,"xlink:href":!0},yt=!1;function St(t){D(t.defaultView),yt||(yt=!0,function(t){!function(t,e){for(const n in e)R(t,n,e[n])}(t.body,{opacity:1,visibility:"visible","animation":"none"})}(t))}var Vt=/nochunking=1/.test(self.location.hash),Ot=b();function xt(t,e,n){Vt?Ot.then(e):function(t){return function(t,e,n,r){const s=X(t);Z(K(s),s,"chunk",n)}(t,0,Ut),W(t,"chunk")}(t).run(e,n)}var kt="not_run",Nt=class{constructor(t){this.state=kt,this.os=t}us(t){if("run"!=this.state){this.state="run";try{this.os(t)}catch(t){throw this.ls(t),t}}}cs(){return this.os.displayName||this.os.name}ls(t){}ds(){return!1}fs(){return!1}},jt=class extends Nt{constructor(t,e,n){super(t),this.ps=n}ls(t){St(self.document)}ds(){return this._s()}fs(){return this.ps.As}_s(){return this.ps.ampdoc.isVisible()}},Ut=class{constructor(t){var e;this.ampdoc=t,this.i=t.win,this.gs=new class{constructor(){this.ns=[]}peek(){const t=this.length;return t?this.ns[t-1].item:null}enqueue(t,e){if(isNaN(e))throw new Error("Priority must not be NaN.");const n=this.rs(e);this.ns.splice(n,0,{item:t,priority:e})}rs(t){let e=-1,n=0,r=this.length;for(;n<=r&&(e=Math.floor((n+r)/2),e!==this.length);)if(this.ns[e].priority<t)n=e+1;else{if(!(e>0&&this.ns[e-1].priority>=t))break;r=e-1}return e}forEach(t){let e=this.length;for(;e--;)t(this.ns[e].item)}dequeue(){const t=this.ns.pop();return t?t.item:null}get length(){return this.ns.length}},this.Ps=this.vs.bind(this),this.Es=0,this.Ts=!(!this.i.navigator.scheduling||!this.i.navigator.scheduling.isInputPending),this.Rs=!1,this.hs=this.i.document.documentElement.hasAttribute("i-amphtml-no-boilerplate"),this.i.addEventListener("message",(t=>{"amp-macro-task"==t.data&&this.vs(null)})),this.As=!1,(e=t,z(e,"viewer")).then((()=>{this.As=!0})),t.onVisibilityChanged((()=>{t.isVisible()&&this.Is()}))}run(t,e){const n=new Nt(t);this.Ms(n,e)}runForStartup(t){const e=new jt(t,this.i,this);this.Ms(e,Number.POSITIVE_INFINITY)}Ms(t,e){this.gs.enqueue(t,e),this.Is()}ys(t){let e=this.gs.peek();for(;e&&e.state!==kt;)this.gs.dequeue(),e=this.gs.peek();return e&&t&&this.gs.dequeue(),e}vs(t){const e=this.ys(!0);if(!e)return this.Rs=!1,this.Es=0,!1;let n;try{n=Date.now(),e.us(t)}finally{Ot.then().then().then().then().then().then().then().then().then((()=>{this.Rs=!1,this.Es+=Date.now()-n,this.Is()}))}return!0}ws(t){if(this.hs&&(this.Ts?this.i.navigator.scheduling.isInputPending():this.Es>5))return this.Es=0,void this.bs();Ot.then((()=>{this.Ps(t)}))}Is(){if(this.Rs)return;const t=this.ys();return t?t.ds()?(this.Rs=!0,void this.ws(null)):void(t.fs()&&this.i.requestIdleCallback?function(t,e,n,r){const s=Date.now();t.requestIdleCallback((function e(n){if(n.timeRemaining()<15){const i=2e3-(Date.now()-s);i<=0||n.didTimeout?r(n):t.requestIdleCallback(e,{timeout:i})}else r(n)}),{timeout:2e3})}(this.i,0,0,this.Ps):this.bs()):void 0}bs(){this.i.postMessage("amp-macro-task","*")}},Lt=(()=>self.AMP.config.urls)(),Ct=self.__AMP_ERRORS||[];self.__AMP_ERRORS=Ct;var Ft=function(t){return(Ft=function(t){const e=function(t){let e=0;return()=>{let t=Math.pow(1.5,e++);return t+=function(t,e){let n=t*(e=e||.3)*Math.random();return Math.random()>.5&&(n*=-1),n}(t),1e3*t}}();return t=>setTimeout(t,e())}())(t)};function $t(t,e){try{let n;if(t)if(void 0!==t.message)t=function(t){const e=Object.getOwnPropertyDescriptor(t,"message");if(null!=e&&e.writable)return t;const{message:n,stack:r}=t,s=new Error(n);for(const e in t)s[e]=t[e];return s.stack=r,s}(t),n=!0;else{const e=t;(t=new Error(function(t){try{return JSON.stringify(t)}catch(e){return String(t)}}(e))).origError=e}else t=new Error("Unknown error");if(t.reported)return t;if(t.reported=!0,t.messageArray){const e=s(t.messageArray,(t=>null==t?void 0:t.tagName));e>-1&&(t.associatedElement=t.messageArray[e])}const r=e||t.associatedElement;if(r&&r.classList&&r.classList.add("i-amphtml-error"),self.console&&(P(t.message)||!t.expected)){const e=console.error||console.log;t.messageArray?e.apply(console,t.messageArray):r?e.call(console,t.message,r):e.call(console,t.message)}r&&r.dispatchCustomEventForTesting&&r.dispatchCustomEventForTesting("amp:error",t.message),Dt.call(self,void 0,void 0,void 0,void 0,t)}catch(t){setTimeout((function(){throw t}))}return t}function Dt(t,e,n,r,s){!this||!this.document||s&&s.expected||St(this.document);let i=!1;try{i=function(t){if(!t.document)return!1;const e=t.document.querySelectorAll("script[src]");for(let t=0;t<e.length;t++)if(!ft(e[t].src.toLowerCase()))return!0;return!1}(self)}catch(t){}if(i&&Math.random()<.99)return;const o=function(t,e,n,r,s,i){t=function(t,e){return e&&(t=e.message?e.message:String(e)),t||(t="Unknown error"),t}(t,s);let o=!(!s||!s.expected);if(/_reported_/.test(t))return;if("CANCELLED"==t)return;const l=!(self&&self.window),u=Math.random();if((function(t){return-1!=t.indexOf("Failed to load:")}(t)||"Script error."==t||l)&&(o=!0,u<.9999))return;const c=P(t);if(c&&u<.99)return;const a=Object.create(null);a.v=x().rtvVersion,a.noAmp=i?"1":"0",a.m=t.replace(d,""),a.a=c?"1":"0",a.ex=o?"1":"0",a.dw=l?"1":"0";let h="1p";var f,p;if(h="esm",a.esm="1",a.rt="esm",a.cdn=Lt.cdn,a.ca=null!==(p=self.AMP_CONFIG)&&void 0!==p&&p.canary?"1":"0",a.bt=(null===(f=self.AMP_CONFIG)||void 0===f?void 0:f.type)||"unknown",self.location.ancestorOrigins&&self.location.ancestorOrigins[0]&&(a.or=self.location.ancestorOrigins[0]),self.viewerState&&(a.vs=self.viewerState),self.parent&&self.parent!=self&&(a.iem="1"),self.AMP&&self.AMP.viewer){const t=self.AMP.viewer.getResolvedViewerUrl(),e=self.AMP.viewer.maybeGetMessagingOrigin();t&&(a.rvu=t),e&&(a.mso=e)}const m=[],A=self.__AMP__EXPERIMENT_TOGGLES||null;var _,v,b;for(const t in A){const e=A[t];m.push(`${t}=${e?"1":"0"}`)}return a.exps=m.join(","),s?(a.el=(null===(_=s.associatedElement)||void 0===_?void 0:_.tagName)||"u",s.args&&(a.args=JSON.stringify(s.args)),c||s.ignoreStack||!s.stack||(a.s=s.stack),s.message&&(s.message+=" _reported_")):(a.f=e||"",a.l=n||"",a.c=r||""),a.r=self.document?self.document.referrer:"",a.ae=Ct.join(","),a.fr=self.location.originalHash||self.location.hash,"production"===a.bt&&(a.pt="1"),b=t,(v=Ct).length>=25&&v.splice(0,v.length-25+1),v.push(b),a}(t,e,n,r,s,i);o&&Ft((()=>{try{return function(t,e){return e.pt&&Math.random()<.9?b():function(t,e){const n=(t=>q(t,"ampdoc"))(t);if(!n.isSingleDoc())return Promise.resolve(!1);const r=n.getSingleDoc();if(!r.getRootNode().documentElement.hasAttribute("report-errors-to-viewer"))return Promise.resolve(!1);const s=rt(r);return s.hasCapability("errorReporter")?s.isTrustedViewer().then((t=>{return!!t&&(s.sendMessage("error",{"m":(n=e).m,"a":n.a,"s":n.s,"el":n.el,"ex":n.ex,"v":n.v,"pt":n.pt}),!0);var n})):Promise.resolve(!1)}(t,e).then((t=>{if(!t){const t=new XMLHttpRequest;t.open("POST",Math.random()<.1?Lt.betaErrorReporting:Lt.errorReporting,!0),t.send(JSON.stringify(e))}}))}(this,o).catch((()=>{}))}catch(t){}}))}var Bt=(()=>self.AMP.config.urls)(),qt="__AMP_ORIGINAL_TARGET_VALUE_";function Wt(t,e,n){const r=ht(Pt(t,e));return"data:"==r.protocol||ft(r)||!n?r.href:`${Bt.cdn}/i/`+("https:"==r.protocol?"s/":"")+encodeURIComponent(r.host)+r.pathname+(r.search||"")+(r.hash||"")}var Jt="amp-bind",zt=/^(i?-)?amp(html)?-/,Gt={"INPUT":{"checked":!0,"value":!0},"OPTION":{"selected":!0},"TEXTAREA":{"text":!0,"disabled":!0}},Ht=u({"AMP-CAROUSEL":["slide"],"AMP-LIST":["is-layout-container"],"AMP-SELECTOR":["selected"]}),Xt=["AMP-LIST","AMP-RENDER"];t.registerServiceForDoc("bind",class{constructor(t){this.ampdoc=t,this.i=t.win,this.Qbt=t.win,this.twt=[],this.ewt=function(t,e,n){let r=0,s=0,i=null;function o(){r=0;const n=5e3-(t.Date.now()-s);var l;n>0?r=t.setTimeout(o,n):(l=i,i=null,e.apply(null,l))}return function(...e){s=t.Date.now(),i=e,r||(r=t.setTimeout(o,5e3))}}(this.i,(()=>{this.twt.length=0})),this.nwt=[],this.rwt=u(),this.rr=W(t,"history"),this.swt=[],this.iwt=1e3,this.qc=W(t,"mutator"),this.yi=u(),this.ln=Y(this.i,"timer"),this.xN=null,this.yn=rt(this.ampdoc),this.yn.onMessageRespond("premutate",this.owt.bind(this)),this.lwt=t.whenFirstVisible().then((()=>t.whenReady().then((()=>t.getRootNode())))),this.uwt=this.lwt.then((t=>this.Ze(t))),this.cwt=new T,this.awt=null,this.ni=new class{constructor(){this.ti=u(),this.ii=null}get(t){const e=this.ti[t];return null==e?null:e}whenSignal(t){var e;let n=null===(e=this.ii)||void 0===e?void 0:e[t];if(!n){const e=this.ti[t];n=null!=e?{promise:"number"==typeof e?Promise.resolve(e):Promise.reject(e)}:new T,this.ii||(this.ii=u()),this.ii[t]=n}return n.promise}signal(t,e){var n;if(null!=this.ti[t])return;const r=null!=e?e:Date.now();this.ti[t]=r;const s=null===(n=this.ii)||void 0===n?void 0:n[t];null!=s&&s.resolve&&(s.resolve(r),s.resolve=void 0,s.reject=void 0)}rejectSignal(t,e){var n;if(null!=this.ti[t])return;this.ti[t]=e;const r=null===(n=this.ii)||void 0===n?void 0:n[t];null!=r&&r.reject&&(r.reject(e),r.promise.catch((()=>{})),r.resolve=void 0,r.reject=void 0)}reset(t){var e;this.ti[t]&&delete this.ti[t];const n=null===(e=this.ii)||void 0===e?void 0:e[t];n&&!n.resolve&&delete this.ii[t]}};const e=self.AMP;e.printState=e.printState||this.hwt.bind(this),e.setState=e.setState||(t=>this.setState(t)),e.eval=e.eval||this.fwt.bind(this)}signals(){return this.ni}setState(t,e={}){try{!function(t,e,n=10){const r=[],s=[];for(s.push({t:t,s:e,d:0});s.length>0;){const{d:t,s:e,t:i}=s.shift();if(r.includes(e))throw new Error("Source object has a circular reference.");if(r.push(e),i!==e)if(t>n)Object.assign(i,e);else for(const n of Object.keys(e)){const r=e[n];if(c(i,n)){const e=i[n];if(l(r)&&l(e)){s.push({t:e,s:r,d:t+1});continue}}i[n]=r}}}(this.yi,t,10)}catch(t){C().error(Jt,"Failed to merge result from AMP.setState().",t)}if(e.skipEval)return b();const n=this.uwt.then((()=>this.UN())).then((t=>this.dwt(t,{skipAmpState:e.skipAmpState,constrain:e.constrain})));return this.awt=n}invoke(t){const{args:e,event:n,method:r,sequenceId:s,tagOrTarget:i}=t;if(this.twt.includes(s))return C().error(Jt,"One state action allowed per event."),b();this.twt.push(s),this.ewt();const o=e.__AMP_OBJECT_STRING__;if(o){this.iwt=Math.min(2e3,Math.max(1e3,this.iwt+500)),this.ni.signal("FIRST_MUTATE");const t={};switch(n&&ot(n)&&(t.event=ot(n)),r){case"setState":return this.setStateWithExpression(o,t);case"pushState":return this.pushStateWithExpression(o,t);default:return Promise.reject($().createError("Unrecognized method: %s.%s",i,r))}}else C().error("AMP-BIND","Please use the object-literal syntax, e.g. \"AMP.setState({foo: 'bar'})\" instead of \"AMP.setState(foo='bar')\".");return b()}setStateWithExpression(t,e){return this.pwt(t,e).then((t=>this.Pwt(t)))}setStateWithObject(t){const e=this.mwt(t);return e?this.Pwt(e):Promise.reject("Invalid state")}Pwt(t){return this.awt=this.setState(t).then((()=>this.Awt())).then((t=>{t&&this.rr.replace(t)})),this.awt}pushStateWithExpression(t,e){return this.pwt(t,e).then((t=>{const e=u();Object.keys(t).forEach((t=>{const n=this.yi[t];e[t]=this.mwt(n)}));const n=()=>this.setState(e);return this.setState(t).then((()=>this.Awt())).then((t=>{this.rr.push(n,t)}))}))}Awt(){const t={"data":{"amp-bind":this.yi},"title":this.Qbt.document.title};return this.yn.isEmbedded()?this.yn.isTrustedViewer().then((e=>e?t:null)):Promise.resolve(t)}rescan(t,e,n={}){return(n.fast?this.cwt.promise:this.uwt).then((()=>this.ln.timeoutPromise(n.timeout||2e3,this._wt(t,e,n),"Timed out waiting for amp-bind to rescan.")))}_wt(t,e,n){return(n.fast?this.vwt(t,e):this.bwt(t,e)).then((()=>{if(n.update)return this.UN().then((e=>this.dwt(e,{constrain:t,evaluateOnly:"evaluate"===n.update})))}))}vwt(t,e){const n=this.Ewt(e),r=[],s=t.filter((t=>t.hasAttribute("i-amphtml-binding")));t.forEach((t=>{const e=t.querySelectorAll("[i-amphtml-binding]");Array.prototype.push.apply(s,e)}));const i=this.iwt-this.numberOfBindings();for(let t=0;t<s.length;t++){const e=s[t];if(this.Twt(e,i-r.length,r))break}return n.then((t=>{})),r.length>0?this.gwt(r):b()}getState(t){const e=t?h(this.yi,t):void 0;return l(e)||n(e)?this.mwt(e):e}getStateAsync(t){const e=/^[^.]*/.exec(t)[0];return this.lwt.then((n=>{const r=n.querySelector(`#${s=e,CSS.escape(s)}`);var s;if(!r)throw C().createError(Jt,`#${e} does not exist.`);return _t(r).then((t=>t.getImpl(!0))).then((t=>t.getFetchingPromise())).catch((()=>{})).then((()=>this.getState(t)))}))}getStateValue(t){const e=h(this.yi,t);return null==e?null:l(e)||n(e)?JSON.stringify(e):String(e)}Ze(t){const n=!function(t,e){const n=e.documentElement;return["⚡4email","amp4email"].some((t=>n.hasAttribute(t)))}(0,this.Qbt.document);return this.xN=new class{constructor(t){this.IN=t}canBind(t,e){return void 0!==this.ON(t,e)}isResultValid(t,e,n){let r=this.ON(t,e);if(r&&r.alternativeName&&(r=this.ON(t,r.alternativeName)),void 0===r)return!1;if(null===r)return!0;if(n&&a(It,e)){let t;if("srcset"===e){let e;try{e=bt(n)}catch(t){return C().error("amp-bind","Failed to parse srcset: ",t),!1}t=e.getUrls()}else t=[n];for(let e=0;e<t.length;e++)if(!this.RN(t[e],r))return!1}const{denylistedValueRegex:s}=r;return!(n&&s&&new RegExp(s,"i").test(n))}RN(t,e){if(t){if(/__amp_source_origin/.test(t))return!1;const{allowedProtocols:n}=e;if(n){const e=/^([^:\/?#.]+):[\s\S]*$/.exec(t);if(null!==e&&!c(n,e[1].toLowerCase().trim()))return!1}}return!0}ON(t,e){if(e.startsWith("aria-"))return null;if(a(It,e)&&!this.IN)return;const n=a(wt,e);if(void 0!==n)return n;const r=a(Mt,e);if(t.startsWith("AMP-")&&void 0!==r)return r;const s=a(Rt,t);return s?s[e]:void 0}}(n),this.wwt("bind.init",[n]).then((()=>Promise.all([this.Mwt().then((()=>this.cwt.resolve())),this.Rwt([t])]))).then((()=>{t.addEventListener("amp:dom-update",(t=>this.U_t(t)))})).then((()=>{const n=e(t.querySelectorAll("AMP-STATE")).map((t=>_t(t).then((()=>t.getImpl(!1))).then((t=>t.parseAndUpdate()))));return Promise.all(n)})).then((()=>{this.yn.sendMessage("bindReady",void 0),this.Iwt("amp:bind:initialize")}))}numberOfBindings(){return this.nwt.reduce(((t,e)=>t+e.boundProperties.length),0)}setMaxNumberOfBindingsForTesting(t){this.iwt=t}historyForTesting(){return this.rr}owt(t){const e=[];return this.uwt.then((()=>(Object.keys(t.state).forEach((n=>{this.swt.includes(n)||(delete t.state[n],e.push(n))})),e.length,this.setState(t.state))))}addOverridableKey(t){this.swt.push(t)}Mwt(){const t=this.ampdoc.getBody().querySelectorAll("AMP-BIND-MACRO"),e=[];return t.forEach((t=>{const n=(t.getAttribute("arguments")||"").split(",").map((t=>t.trim()));e.push({id:t.getAttribute("id"),argumentNames:n,expressionString:t.getAttribute("expression")})})),0==e.length?Promise.resolve(0):this.wwt("bind.addMacros",[e]).then((n=>(n.forEach(((e,n)=>{this.ywt(e,`${Jt}: Parsing amp-bind-macro failed.`,t[n])})),e.length)))}Rwt(t){if(!t.length)return Promise.resolve(0);const e=t.map((t=>{const e=this.iwt-this.numberOfBindings();return this.vE(t,e).then((t=>{const{bindings:e,limitExceeded:n}=t;return n&&this.Swt(),e}))}));return Promise.all(e).then((t=>{const e=Array.prototype.concat.apply([],t);return e.length>0?this.gwt(e):0}))}Swt(){$().expectedError(Jt,"Maximum number of bindings reached (%s). Additional elements with bindings will be ignored.",this.iwt)}gwt(t){return this.wwt("bind.addBindings",[t]).then((e=>(Object.keys(e).forEach((t=>{const n=this.rwt[t];n.length>0&&this.ywt(e[t],`${Jt}: Expression compile error in "${t}".`,n[0])})),t.length)))}Ewt(t){if(!t.length)return Promise.resolve(0);r(this.nwt,(e=>{for(let n=0;n<t.length;n++)if(t[n].contains(e.element))return!0;return!1}));const e=[];for(const n in this.rwt){const s=this.rwt[n];r(s,(e=>{for(let n=0;n<t.length;n++)if(t[n].contains(e))return!0;return!1})),0==s.length&&(e.push(n),delete this.rwt[n])}const n=e.length;return n>0?this.wwt("bind.removeBindingsWithExpressionStrings",[e]).then((()=>n)):Promise.resolve(0)}vE(t,n){const r=[],s=new class{constructor(t){const n=D(t.nodeType==Node.DOCUMENT_NODE?t:t.ownerDocument),r=n.documentElement.hasAttribute("i-amphtml-binding");this.Vwt=r,this.currentNode=t,this.gn=0,this.Owt=r?e(t.querySelectorAll("[i-amphtml-binding]")):[],r&&t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute("i-amphtml-binding")&&this.Owt.unshift(t),this.xwt=r?null:n.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null,!1)}nextNode(){if(this.Vwt){if(this.gn==this.Owt.length)return null;const t=this.Owt[this.gn++];return this.currentNode=t,t}const t=this.xwt.nextNode();return null!==t&&(this.currentNode=t),t}skipSubtree(){if(this.Vwt){const{currentNode:t}=this;let e=null;do{e=this.nextNode()}while(null!==e&&t.contains(e));return e}const t=this.xwt;for(let e=t.currentNode;e;e=t.parentNode()){const e=t.nextSibling();if(null!==e)return this.currentNode=e,e}return null}}(t);let i=!1;const o=()=>{const t=s.currentNode;if(t.nodeType!==Node.ELEMENT_NODE)return!s.nextNode();const e=t,o=n-r.length;return this.Twt(e,o,r)&&(i=!0),!(Xt.includes(t.nodeName)?s.skipSubtree():s.nextNode())||i};return new Promise((t=>{const e=n=>{let s=!1;if(n&&!n.didTimeout)for(;n.timeRemaining()>1&&!s;)s=o();else{const t=250;for(let e=0;e<t&&!s;e++)s=o()}s?t({bindings:r,limitExceeded:i}):xt(this.ampdoc,e,10)};xt(this.ampdoc,e,10)}))}Twt(t,e,n){let r=!1;const s=this.kwt(t);s.length>e&&(s.length=e,r=!0),s.length>0&&this.nwt.push({element:t,boundProperties:s});const{tagName:i}=t;return s.forEach((e=>{const{expressionString:r,property:s}=e;n.push({tagName:i,property:s,expressionString:r}),this.rwt[r]||(this.rwt[r]=[]),this.rwt[r].push(t)})),r}kwt(t){const e=[],n=t.attributes;for(let r=0,s=n.length;r<s;r++){const s=n[r],i=this.Nwt(s,t);i&&e.push(i)}return e}Nwt(t,e){const n=e.tagName,r=t.name;let s;if(r.length>2&&"["===r[0]&&"]"===r[r.length-1])s=r.substr(1,r.length-2);else if(r.startsWith("data-amp-bind-")&&(s=r.substr(14),e.hasAttribute(`[${s}]`)))return null;if(s){if(this.xN.canBind(n,s))return{property:s,expressionString:t.value};{const t=C().createError("%s: Binding to [%s] on <%s> is not allowed.",Jt,s,n);this.jwt(t,e)}}return null}pwt(t,e){return this.uwt.then((()=>(Object.assign(e,this.yi),this.wwt("bind.evaluateExpression",[t,e])))).then((t=>{const{error:e,result:n}=t;if(e)throw this.ywt(e,`${Jt}: Expression eval failed.`);return n}))}UN(){return this.wwt("bind.evaluateBindings",[this.yi]).then((t=>{const{errors:e,results:n}=t;return Object.keys(e).forEach((t=>{const n=this.rwt[t];if(n.length>0){const r=e[t],s=C().createError('%s: Expression evaluation error in "%s". %s',Jt,t,r.message);s.stack=r.stack,this.jwt(s,n[0])}})),n}))}oN(t,e=null,n=!0){const r={};return this.nwt.forEach((n=>{const{boundProperties:s,element:i}=n;e&&!this.Uwt(e,i)||s.forEach((e=>{const n=t[e.expressionString];if(void 0===n)return;const s=this.Lwt(e,i,n);if(!s)return;const{tagName:o}=i,{expressionString:l,property:u}=e,{actual:c,expected:a}=s;r[`${o}[${u}]${a}:${c}`]=!0}))})),Object.keys(r)}Uwt(t,e){for(let n=0;n<t.length;n++)if(t[n].contains(e))return!0;return!1}Cwt(t,e){const r=[];return t.forEach((t=>{const{expressionString:s,previousResult:i}=t,o=e[s];void 0===o||function(t,e,r=5){if(!isFinite(r)||r<0)throw new Error("Invalid depth: "+r);if(t===e)return!0;const s=[{a:t,b:e,depth:r}];for(;s.length>0;){const{a:t,b:e,depth:r}=s.shift();if(r>0){if(typeof t!=typeof e)return!1;if(n(t)&&n(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)s.push({a:t[n],b:e[n],depth:r-1});continue}if(t&&e&&"object"==typeof t&&"object"==typeof e){const n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(const i of n)s.push({a:t[i],b:e[i],depth:r-1});continue}}if(t!==e)return!1}return!0}(o,i,20)||(t.previousResult=o,r.push({boundProperty:t,newValue:o}))})),r}dwt(t,e){const n=[];return this.nwt.forEach((r=>{if(e.skipAmpState&&"AMP-STATE"===r.element.tagName)return;if(e.constrain&&!e.constrain.some((t=>t.contains(r.element))))return;const{boundProperties:s,element:i}=r,o=this.Cwt(s,t);e.evaluateOnly||n.push(this.Fwt(i,o))})),Promise.all(n)}Fwt(t,e){return 0===e.length?b():this.qc.mutateElement(t,(()=>{const n=u();let r,s;if(e.forEach((e=>{const{boundProperty:i,newValue:o}=e,{property:l}=i,u=this.$wt(i,t,o);u&&(n[u.name]=u.value,"width"==l?r=f(o)?Number(o):r:"height"==l&&(s=f(o)?Number(o):s)),this.Dwt(t,l)})),void 0===r&&void 0===s||this.qc.forceChangeSize(t,s,r),"function"==typeof t.mutatedAttributesCallback)try{t.mutatedAttributesCallback(n)}catch(e){const r=C().createError("%s: Applying expression results (%s) failed with error,",Jt,JSON.stringify(n),e);this.jwt(r,t)}}))}Dwt(t,e){const n=Gt[t.tagName];if(!n||!n[e])return;const r="OPTION"===t.tagName?w(t,"SELECT"):t;if(r){const t=it(this.Qbt,"amp:form-value-change",null,{bubbles:!0});r.dispatchEvent(t)}}$wt(t,e,n){const{property:r}=t,s=e.tagName;switch(r){case"defaulttext":e.textContent=String(n);break;case"text":const t=String(n);"TITLE"===s&&e.parentNode===this.Qbt.document.head&&(this.Qbt.document.title=t),"TEXTAREA"===s?e.value=t:e.textContent=t;break;case"class":const i=[];for(let t=0;t<e.classList.length;t++){const n=e.classList[t];zt.test(n)&&i.push(n)}if(Array.isArray(n)||"string"==typeof n)e.setAttribute("class",i.concat(n).join(" "));else if(null===n)e.setAttribute("class",i.join(" "));else{const t=C().createError('%s: "%s" is not a valid result for [class].',Jt,n);this.jwt(t,e)}break;default:const o="INPUT"===s&&r in e,l=e.getAttribute(r);let u=!1;if("boolean"==typeof n?(o&&e[r]!==n&&(e[r]=n,u=!0),n&&""!==l?(e.setAttribute(r,""),u=!0):n||null===l||(e.removeAttribute(r),u=!0),u&&this.Bwt(e,r,n)):"object"==typeof n&&null!==n?u=!0:n!==l&&(u=this.qwt(e,r,String(n),o)),u)return{name:r,value:n}}return null}Bwt(t,n,r){if("OPTION"!==t.tagName||"selected"!==n)return;if(!r)return;if(!(s=this.i,q(s,"platform")).isSafari())return;var s;const i=w(t,"select");if(!i)return;const o=e(i.options).indexOf(t);o>=0&&(i.selectedIndex=o)}qwt(t,e,n,r){try{return function(t,e,n,r,s){const i=t.tagName.toLowerCase(),o=e.toLowerCase(),l=function(t,e,n){return function(t){return"src"==t||"href"==t||"xlink:href"==t||"srcset"==t}(e)?function(t,e,n,r){var s;B(!("__amp_source_origin"in S(ht(s=n).search)),"Source origin is not allowed in %s",s);const i=ft(r),o=ht(dt(r));if("href"==e&&!n.startsWith("#"))return Pt(n,o);if("src"==e)return"amp-img"==t?Wt(n,o,i):Pt(n,o);if("srcset"==e){let t;try{t=bt(n)}catch(t){return C().error("URL-REWRITE","Failed to parse srcset: ",t),n}return t.stringify((t=>Wt(t,o,i)))}return n}(t,e,n,self.location):n}(i,o,n);if(ft(self.location)&&"a"===i&&"href"===o){const e=t.getAttribute(o),n="#"===l[0],r=e&&"#"===e[0];n&&!r?(t[qt]||(t[qt]=t.getAttribute("target")),t.removeAttribute("target")):r&&!n&&t.setAttribute("target",t[qt]||"_top")}s&&(t[o]=l),t.setAttribute(o,l)}(t,e,n,0,r),!0}catch(r){const s=C().createError('%s: "%s" is not a valid result for [%]',Jt,n,e,r);this.jwt(s,t)}return!1}Lwt(t,e,n){const{property:r}=t,{tagName:s}=e,i=Ht[s];if(i&&i.includes(r))return null;let o,l;switch(r){case"text":o=e.textContent,n=String(n),l=o.trim()===n.trim();break;case"class":o=[];for(let t=0;t<e.classList.length;t++){const n=e.classList[t];zt.test(n)||o.push(n)}let t=[];if(Array.isArray(n))t=n;else if("string"==typeof n){const e=n.trim();e.length>0&&(t=e.split(" "))}else{const t=C().createError('%s: "%s" is not a valid result for [class].',Jt,n);this.jwt(t,e)}l=this.Wwt(o,t);break;default:o=e.getAttribute(r),l=!0===n?""===o:!1===n?null===o:"number"==typeof n?Number(o)===n:o===n}return l?null:{expected:n,actual:o}}U_t(t){const e=t.target,n=e.parentNode;n&&Xt.includes(n.nodeName)||this.bwt([e],[e],"dom_update.end").then((()=>{this.Iwt("amp:bind:rescan-template")}))}bwt(t,e,n="rescan.slow"){let r=0;return this.Ewt(e).then((e=>(r=e,this.Rwt(t)))).then((t=>{}))}wwt(t,e){return function(t,e,n,r){return t.Worker?(function(t,e,n,r){Z(t=H(t),t,"amp-worker",n)}(t,0,class{constructor(t){this.i=t,this.s$=st(t),t.location;let e="",n={createScriptURL:function(t){return/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org(\/.*)?$/.test(t)&&(t.endsWith("ww.js")||t.endsWith("ww.min.js")||t.endsWith("ww.mjs")||t.endsWith("ww.min.mjs"))?t:""}};self.trustedTypes&&self.trustedTypes.createPolicy&&(n=self.trustedTypes.createPolicy("amp-worker#fetchUrl",n)),e=n.createScriptURL(`${j.cdn}/rtv/${x().rtvVersion}/ww.mjs`).toString(),this.Jwt=null,this.zwt=this.s$.fetchText(e,{ampCors:!1,bypassInterceptorForDev:!1}).then((t=>t.text())).then((n=>{const r=`${e}.map`;n=n.replace(/^\/\/# sourceMappingURL=.*/,`//# sourceMappingURL=${r}`);const s=new t.Blob([n+"\n//# sourceurl="+e],{type:"text/javascript"}),i=t.URL.createObjectURL(s);if(self.trustedTypes&&self.trustedTypes.createPolicy){const e=self.trustedTypes.createPolicy("amp-worker#constructor",{createScriptURL:function(t){return t}});this.Jwt=new t.Worker(e.createScriptURL(i))}else this.Jwt=new t.Worker(i);this.Jwt.onmessage=this.Gwt.bind(this)})),this.L={},this.PE=0,this.Hwt=[t]}I(t,e,n){return this.zwt.then((()=>new Promise(((r,s)=>{const i=this.PE++;this.L[i]={method:t,resolve:r,reject:s};const o=this.Xwt(n||this.i),l={method:t,args:e,scope:o,id:i};this.Jwt.postMessage(l)}))))}Gwt(t){const{id:e,method:n,returnValue:r}=t.data,s=this.L[e];s?(m(n==s.method),s.resolve(r),delete this.L[e]):$().error("web-worker",`Received unexpected message (${n}, ${e}) from worker.`)}hasPendingMessages(){return Object.keys(this.L).length>0}Xwt(t){const e=this.Hwt.indexOf(t);return e>=0?e:this.Hwt.push(t)-1}fetchPromiseForTesting(){return this.zwt}}),q(t,"amp-worker").I(e,n||[],r)):Promise.reject("Worker not supported in window.")}(this.i,t,e,this.Qbt)}ywt(t,e,n){const r=C().createError("%s %s",e,t.message);return r.stack=t.stack,this.jwt(r,n),r}jwt(t,e){$t(t,e)}Wwt(t,r){if(t.length!==r.length)return!1;const s=(n(t)?t:e(t)).sort(),i=(n(r)?r:e(r)).sort();for(let e=0;e<t.length;e++)if(s[e]!==i[e])return!1;return!0}mwt(t){if(void 0===t)return null;try{return g(JSON.stringify(t))}catch(e){$().error(Jt,"Failed to copy JSON ("+t+") with error: "+e)}return null}hwt(t){if(t)if("string"==typeof t)h(this.yi,t);else if(t.nodeType==Node.ELEMENT_NODE){const e=C().assertElement(t);this.Kwt(e)}}Kwt(t){const e=s(this.nwt,(e=>e.element==t));if(e<0)return;const n=[],{boundProperties:r}=this.nwt[e];r.forEach((t=>{const{expressionString:e}=t;n.push(this.pwt(e,this.yi))})),Promise.all(n).then((t=>{const e=u();r.forEach(((n,r)=>{const{property:s}=n;e[s]=t[r]}))}))}fwt(t){this.pwt(t,this.yi).then((t=>{}))}initializePromiseForTesting(){return this.uwt}setStatePromiseForTesting(){return this.awt}Iwt(t){}}),t.registerElement("amp-state",At),t.registerElement("amp-bind-macro",v)})();
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}});
//# sourceMappingURL=amp-bind-0.1.mjs.map