; (self.AMP=self.AMP||[]).push({m:1,v:"2501142147000",n:"amp-lightbox",ev:"0.1",l:!0,f:function(t,i){(()=>{var i,{isArray:s}=Array,{hasOwnProperty:n,toString:h}=Object.prototype;function e(t){const i=Object.create(null);return t&&Object.assign(i,t),i}function o(t,i){return n.call(t,i)}function r(t,i,s,n,h,e,o,r,l,a,c){return t}function l(t){return(t.ownerDocument||t).defaultView}function a(t){try{t.focus()}catch(t){}}function c(t){const i=Object.getOwnPropertyDescriptor(t,"message");if(null!=i&&i.writable)return t;const{message:s,stack:n}=t,h=new Error(s);for(const i in t)h[i]=t[i];return h.stack=n,h}function u(t){let i=null,s="";for(const t of arguments)t instanceof Error&&!i?i=c(t):(s&&(s+=" "),s+=t);return i?s&&(i.message=s+": "+i.message):i=new Error(s),i}function f(t){var i,s;null===(i=(s=self).__AMP_REPORT_ERROR)||void 0===i||i.call(s,t)}function d(t,...i){try{return t.apply(null,i)}catch(t){!function(t){const i=u.apply(null,arguments);setTimeout((()=>{throw f(i),i}))}(t)}}var m,p,_="i-amphtml-element",A=t=>t.unmount();function P(t,i,s,n){if(i&&t.classList.contains(_)){const i=t;if(d(n,i),!s){const t=i.getPlaceholder();return void(t&&P(t,!0,!1,n))}}const h=t.getElementsByClassName(_);let e=null;for(let t=0;t"","getPropertyValue":()=>""};function E(t){const i=t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()));return v.some((t=>i.startsWith(t+"-")))?`-${i}`:i}function M(t,i,s){if(i.startsWith("--"))return i;p||(p=e());let n=p[i];if(!n||s){if(n=i,void 0===t[i]){const s=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(i),h=function(t,i){for(let s=0;s$(t,"owners"),U=t=>F(t,"timer"),q=class{constructor(){this.St=null}add(t){return this.St||(this.St=[]),this.St.push(t),()=>{this.remove(t)}}remove(t){this.St&&function(t,i){const s=t.indexOf(i);-1!=s&&t.splice(s,1)}(this.St,t)}removeAll(){this.St&&(this.St.length=0)}fire(t){if(this.St)for(const i of this.St.slice())i(t)}getHandlerCount(){var t,i;return null!==(t=null===(i=this.St)||void 0===i?void 0:i.length)&&void 0!==t?t:0}},Z="__AMP_Gestures",J=class t{static get(i,s=!1,n=!1){let h=i[Z];return h||(h=new t(i,s,n),i[Z]=h),h}constructor(t,i=!1,s=!1){this.yf=t,this.PS=[],this.t_=[],this.Pi=[],this.bS=[],this.vS=null;const n=function(t){if(void 0!==W)return W;W=!1;try{const i={get passive(){return W=!0,!1}};t.addEventListener("test-options",null,i),t.removeEventListener("test-options",null,i)}catch(t){}return W}(t.ownerDocument.defaultView);this.TS=i||n,this.ES=s,this.xS=!1,this.tn=new class{constructor(t,i,s){this.We=U(t),this.Ke=i,this.Ye=s||0,this.Je=-1,this.Qe=0,this.Xe=!1,this.Ze=()=>{this.tn()}}isPending(){return-1!=this.Je}schedule(t){let i=t||this.Ye;this.Xe&&i<10&&(i=10);const s=Date.now()+i;return(!this.isPending()||s-this.Qe<-10)&&(this.cancel(),this.Qe=s,this.Je=this.We.delay(this.Ze,i),!0)}tn(){this.Je=-1,this.Qe=0,this.Xe=!0,this.Ke(),this.Xe=!1}cancel(){this.isPending()&&(this.We.cancel(this.Je),this.Je=-1)}}(l(t),this.wm.bind(this)),this.MS=new q,this.wS=Object.create(null),this.IS=this.yp.bind(this),this.RS=this.gp.bind(this),this.VS=this._p.bind(this),this.kS=this.h_.bind(this),this.yf.addEventListener("touchstart",this.IS,!!n&&{passive:!0}),this.yf.addEventListener("touchend",this.RS),this.yf.addEventListener("touchmove",this.VS,!!n&&{passive:!0}),this.yf.addEventListener("touchcancel",this.kS),this.SS=!1}cleanup(){this.yf.removeEventListener("touchstart",this.IS),this.yf.removeEventListener("touchend",this.RS),this.yf.removeEventListener("touchmove",this.VS),this.yf.removeEventListener("touchcancel",this.kS),delete this.yf[Z],this.tn.cancel()}onGesture(t,i){const s=new t(this),n=s.getType();let h=this.wS[n];return h||(this.PS.push(s),h=new q,this.wS[n]=h),h.add(i)}removeGesture(t){const i=new t(this).getType(),s=this.wS[i];if(s){s.removeAll();const t=function(t,s){for(let s=0;s=t){i=!0;break}}i?(t.stopPropagation(),this.TS||t.preventDefault()):this.ES&&t.stopPropagation(),this.SS&&(this.SS=!1,this.wm())}wm(){const t=Date.now();let i=-1;for(let s=0;sthis.Pi[i])&&(i=s):this.bS[s]&&this.bS[s]
Ad
'],it="amp-lightbox",st={"fade-in":{openStyle:{"opacity":1},closedStyle:{"opacity":0},durationSeconds:.1},"fly-in-bottom":{openStyle:{"transform":"translate(0, 0)"},closedStyle:{"transform":"translate(0, 100%)"},durationSeconds:.2},"fly-in-top":{openStyle:{"transform":"translate(0, 0)"},closedStyle:{"transform":"translate(0, -100%)"},durationSeconds:.2}},nt=class extends t.BaseElement{constructor(t){super(t),this.hh=null,this.d_=null,this.yo=this.win.document,this.Ic=null,this.yZ=null,this.IZ=!1,this.CZ=null,this.SZ=null,this.OZ=null,this.lX=null,this.DZ=!1,this.zZ=0,this.BZ=0,this.HZ=null,this.jZ=(t.getAttribute("animate-in")||"fade-in").toLowerCase(),this.YZ=null,this.aX=null,this.$Z=null;const i=Y(this.win,"platform");this.hX=i.isIos(),this.XZ=function(t,i,s){let n=0,h=0,e=null;function o(){n=0;const s=500-(t.Date.now()-h);var r;s>0?n=t.setTimeout(o,s):(r=e,e=null,i.apply(null,r))}return function(...i){h=t.Date.now(),e=i,n||(n=t.setTimeout(o,500))}}(this.win,(()=>{const t=(z.user||(z.user=H()),function(t,i){return i}(z.user.win,undefined)?z.userForEmbed||(z.userForEmbed=H()):z.user).assertElement(this.d_,"E#19457 this.container_"),i=N(this.element);i.scheduleLayout(this.element,t),i.scheduleResume(this.element,t)}))}buildCallback(){this.user().assert(o(st,this.jZ),"Invalid `animate-in` value %s",this.jZ),this.element.classList.add("i-amphtml-overlay"),this.Ic=function(t,i){const s=L(X(t));return G(s,i)?F(s,i):null}(this.element,"action"),this.LZ(),this.registerDefaultAction((t=>this.HX(t.trust,t.caller)),"open"),this.registerAction("close",(t=>this.close(t.trust))),this.Ic.addToAllowlist("AMP-LIGHTBOX",["open","close"],["email"])}FZ(){j(this.DZ),this.GZ().forEach((t=>{N(this.element).setOwner(t,this.element)}))}GZ(){return(t=this.element.getElementsByClassName("i-amphtml-element"))?Array.prototype.slice.call(t):[];var t}Ue(){if(this.d_)return;const{element:t}=this;this.DZ=t.hasAttribute("scrollable");const i=function(t){return function(t,i){const s=[];for(let i=t.firstElementChild;i;i=i.nextElementSibling)!(function(t){let i;var s;return"string"==typeof t?i=t:1==(null==(s=t)?void 0:s.nodeType)&&(i=t.tagName),!!i&&i.toLowerCase().startsWith("i-")}(n=i)||n.nodeType===Node.ELEMENT_NODE&&(n.hasAttribute("placeholder")||n.hasAttribute("fallback")||n.hasAttribute("overflow")))&&s.push(i);var n;return s}(t)}(this.element);this.d_=t.ownerDocument.createElement("div"),this.DZ||function(t,i){t.classList.add("i-amphtml-fill-content")}(this.d_),t.appendChild(this.d_),i.forEach((t=>{this.d_.appendChild(t)})),this.DZ&&(this.FZ(),t.classList.add("i-amphtml-scrollable"),t.addEventListener("amp:dom-update",(()=>{this.FZ(),this.WZ(this.zZ)})),t.addEventListener("scroll",this.Rf.bind(this))),this.DZ||J.get(t).onGesture(class extends class extends class{constructor(t,i){this.sz=t,this.hP=i}getType(){return this.sz}signalReady(t){this.hP.up(this,t)}signalPending(t){this.hP.zS(this,t)}signalEnd(){this.hP.NS(this)}signalEmit(t,i){this.hP.LS(this,t,i)}acceptStart(){}acceptCancel(){}onTouchStart(t){return!1}onTouchMove(t){return!1}onTouchEnd(t){}}{constructor(t,i,s,n){super(t,i),this.nz=s,this.ez=n,this.vS=!1,this.oz=0,this.rz=0,this.az=0,this.hz=0,this.lz=0,this.pz=0,this._r=0,this.mz=0,this.cz=0,this.uz=0,this.dz=0}onTouchStart(t){const{touches:i}=t;return!!(this.vS&&i&&i.length>1)||!(!i||1!=i.length)&&(this._r=Date.now(),this.oz=i[0].clientX,this.rz=i[0].clientY,!0)}onTouchMove(t){const{touches:i}=t;if(i&&i.length>=1){const{clientX:s,clientY:n}=i[0];if(this.az=s,this.hz=n,this.vS)this.fz(!1,!1,t);else{const t=Math.abs(s-this.oz),i=Math.abs(n-this.rz);if(this.nz&&this.ez)(t>=8||i>=8)&&this.signalReady(-10);else if(this.nz){if(t>=8&&t>i)this.signalReady(-10);else if(i>=8)return!1}else{if(!this.ez)return!1;if(i>=8&&i>t)this.signalReady(-10);else if(t>=8)return!1}}return!0}return!1}onTouchEnd(t){const{touches:i}=t;i&&0==i.length&&this._z(t)}acceptStart(){this.vS=!0,this.lz=this.oz,this.pz=this.rz,this.cz=this._r,this.oz=this.az,this.rz=this.hz,this.fz(!0,!1,null)}acceptCancel(){this.vS=!1}fz(t,i,s){this.mz=Date.now();const n=this.mz-this.cz;if(!i&&n>4||i&&n>16){const t=K(this.az-this.lz,n,this.uz),s=K(this.hz-this.pz,n,this.dz);(!i||n>32||0!=t||0!=s)&&(this.uz=Math.abs(t)>1e-4?t:0,this.dz=Math.abs(s)>1e-4?s:0),this.lz=this.az,this.pz=this.hz,this.cz=this.mz}this.signalEmit({first:t,last:i,time:this.mz,deltaX:this.az-this.oz,deltaY:this.hz-this.rz,startX:this.oz,startY:this.rz,lastX:this.az,lastY:this.hz,velocityX:this.uz,velocityY:this.dz},s)}_z(t){this.vS&&(this.vS=!1,this.fz(!1,!0,t),this.signalEnd())}}{constructor(t){super("swipe-xy",t,!0,!0)}},(()=>{})),this.NZ()}layoutCallback(){return i||(i=Promise.resolve(void 0))}HX(t,i){if(this.IZ)return;this.Ue(),this.SZ=this.UZ.bind(this),this.yo.documentElement.addEventListener("focusin",this.SZ),i&&(this.lX=i);const{promise:s,resolve:n}=new class{constructor(){this.promise=new Promise(((t,i)=>{this.resolve=t,this.reject=i}))}};return this.getViewport().enterLightboxMode(this.element,s).then((()=>this.qZ(n,t)))}mutatedAttributesCallback(t){const i=t.open;void 0!==i&&(i?this.HX(2,document.activeElement):this.close(2))}ZZ(){const t=this.d_.querySelector("[autofocus]");t&&a(t)}qZ(t,i){const{element:s}=this,{closedStyle:n,durationSeconds:h,openStyle:e}=this.JZ(),o=Object.keys(e).map((t=>`${t} ${h}s ease-in`)).join(",");this.BZ++,this.DZ&&T(s,"webkitOverflowScrolling","touch"),T(s,"transition",o),I(s,V(n)),function(t,i){void 0===i&&(i=t.hasAttribute("hidden")),i?t.removeAttribute("hidden"):t.setAttribute("hidden","")}(s,!0),this.mutateElement((()=>{s.scrollTop=0})),this.ZZ(),this.mutateElement((()=>{I(s,V(e))}));const r=this.d_;this.DZ&&(this.Rf(),this.WZ(this.zZ));const l=()=>{this.XZ(),t()};s.addEventListener("transitionend",l),s.addEventListener("animationend",l),this.setAsContainer();const a=N(this.element);a.scheduleLayout(this.element,r),a.scheduleResume(this.element,r),this.ob("lightboxOpen",i),this.yZ=new class{constructor(t,i){const{win:s}=t;if(this.i=s,this.Ke=i,this.KZ=null,this.zn=null,this.rX=-1,this.QZ=null,"function"==typeof s.CloseWatcher)try{this.KZ=new s.CloseWatcher}catch(t){(z.dev||(z.dev=B())).error("CloseWatcherImpl","CloseWatcher failed:",t)}this.KZ?this.KZ.onclose=()=>{i(),this.destroy()}:(this.zn=$(t,"history"),this.zn.push((()=>i())).then((t=>{this.rX=t})),this.QZ=this.YK.bind(this),s.document.documentElement.addEventListener("keydown",this.QZ))}requestClose(){this.KZ?this.KZ.requestClose():this.Ke&&((0,this.Ke)(),this.destroy())}destroy(){this.Ke=null,this.KZ?(this.KZ.destroy(),this.KZ=null):-1!=this.rX&&(j(this.zn).pop(this.rX),this.rX=-1,this.zn=null,this.i.document.documentElement.removeEventListener("keydown",this.QZ))}YK(t){"Escape"==t.key&&(t.preventDefault(),this.requestClose())}}(this.getAmpDoc(),(()=>this.close(3))),this.XK(),this.WK(),this.ZK(),this.IZ=!0}NZ(){const{element:t}=this;null!=t.getAttribute("close-button")&&(this.YZ=function(t){const i=t.ownerDocument||t;return m&&m.ownerDocument===i||(m=i.createElement("div")),g}(t)(tt),t.insertBefore(this.YZ,this.d_))}XK(){if(!this.YZ)return;let t;this.CZ=this.tQ.bind(this),this.YZ.addEventListener("keydown",this.CZ),this.measureMutateElement((()=>{t=this.YZ.getBoundingClientRect().height}),(()=>{this.iQ(),y(this.d_,{"margin-top":R(t),"min-height":`calc(100vh - ${R(t)})`})}))}iQ(){this.YZ.classList.add("amp-ad-close-header")}ZK(){(this.$Z||this.YZ)&&(this.OZ=this.sQ.bind(this),this.aX.addEventListener("click",this.OZ))}nQ(){(this.$Z||this.YZ)&&(this.aX.removeEventListener("click",this.OZ),this.OZ=null,this.YZ&&(this.YZ.removeEventListener("keydown",this.CZ),this.CZ=null))}JZ(){return st[this.jZ]}sQ(){this.close(3)}tQ(t){"Enter"==t.key&&(t.preventDefault(),this.close(3))}close(t){this.IZ&&(this.DZ&&T(this.element,"webkitOverflowScrolling",""),this.getViewport().leaveLightboxMode(this.element).then((()=>this.hQ(t))))}hQ(t){const{element:i}=this,n=++this.BZ,h=()=>{n==this.BZ&&(this.collapse(),this.XZ())};this.eQ()?(function(t,i){for(let s=0;s{Math.abs(t-this.zZ)<30?(this.HZ=null,this.if(this.zZ)):this.rQ(this.zZ)}),100)}if(t){this.WZ(t),this.zZ=t}WZ(t){const i=[];this.lQ(t,(t=>{i.push(t),N(this.element).scheduleLayout(this.element,t)}))}lQ(t,i){const s=this.aQ().height,n=this.GZ();for(let h=0;h=t-r&&o<=t+r&&i(e)}}aQ(){return this.hh||(this.hh={width:this.element.clientWidth,height:this.element.clientHeight}),this.hh}LZ(){const{element:t,win:i}=this;Q(t)&&ht(i,i.document.body)}ob(t,i){const s=function(t,i,s,n){const h={detail:{}};return Object.assign(h,void 0),new t.CustomEvent(i,h)}(this.win,`${it}.${t}`);this.Ic.trigger(this.element,t,s,i)}};function ht(t,i){const s={},n=(t=>Y(t,"ampdoc"))(t).getAmpDoc(i);var h;(h=n,$(h,"mutator")).measureMutateElement(i,(function(){s.alreadyTransparent="rgba(0, 0, 0, 0)"==function(t,i){return t.getComputedStyle(i)||b}(t,i)["background-color"]}),(function(){s.alreadyTransparent,y(i,{background:"transparent"})}))}"inabox"==S().runtime&&ht(window,j(document.body)),t.registerElement(it,nt,'amp-lightbox{display:none;position:fixed!important;z-index:1000;top:0!important;left:0!important;bottom:0!important;right:0!important}amp-lightbox[scrollable]{overflow-y:auto!important;overflow-x:hidden!important}amp-lightbox i-amphtml-ad-close-header{height:60px!important;display:block!important;visibility:visible!important;opacity:0;position:fixed!important;top:0!important;left:0!important;right:0!important;z-index:1000!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-align:center!important;align-items:center!important;-ms-flex-pack:right!important;justify-content:right!important;transition:opacity 0.1s ease-in}[animate-in=fly-in-bottom]>i-amphtml-ad-close-header,[animate-in=fly-in-top]>i-amphtml-ad-close-header{transition-delay:0.2s}amp-lightbox .amp-ad-close-header{opacity:1!important;box-sizing:border-box;padding:5px;line-height:40px;background-color:#000;color:#fff;font-family:Helvetica,sans-serif;font-size:12px;cursor:pointer}amp-lightbox .amp-ad-close-header>:first-child{margin-left:auto!important;pointer-events:none!important}amp-lightbox .amp-ad-close-button{display:block!important;background:url(\'data:image/svg+xml;charset=utf-8,\') no-repeat;background-position:50%;width:40px;height:40px;pointer-events:none!important;border-radius:40px;margin-left:5px}amp-lightbox .amp-ad-close-header:active>.amp-ad-close-button{background-color:hsla(0,0%,100%,.3)}\n/*# sourceURL=/extensions/amp-lightbox/0.1/amp-lightbox.css*/')})(); /*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}}); //# sourceMappingURL=amp-lightbox-0.1.mjs.map