; (self.AMP=self.AMP||[]).push({m:1,v:"2310061803000",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"),Z=class{constructor(){this.Et=null}add(t){return this.Et||(this.Et=[]),this.Et.push(t),()=>{this.remove(t)}}remove(t){this.Et&&function(t,i){const s=t.indexOf(i);-1!=s&&t.splice(s,1)}(this.Et,t)}removeAll(){this.Et&&(this.Et.length=0)}fire(t){if(this.Et)for(const i of this.Et.slice())i(t)}getHandlerCount(){var t,i;return null!==(t=null===(i=this.Et)||void 0===i?void 0:i.length)&&void 0!==t?t:0}},q="__AMP_Gestures",J=class t{static get(i,s=!1,n=!1){let h=i[q];return h||(h=new t(i,s,n),i[q]=h),h}constructor(t,i=!1,s=!1){this.za=t,this.EV=[],this.t_=[],this.Gt=[],this.xV=[],this.MV=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.wV=i||n,this.IV=s,this.RV=!1,this.ae=new class{constructor(t,i,s){this.ne=U(t),this.re=i,this.he=s||0,this.oe=-1,this.ue=0,this.le=!1,this.ce=()=>{this.ae()}}isPending(){return-1!=this.oe}schedule(t){let i=t||this.he;this.le&&i<10&&(i=10);const s=Date.now()+i;return(!this.isPending()||s-this.ue<-10)&&(this.cancel(),this.ue=s,this.oe=this.ne.delay(this.ce,i),!0)}ae(){this.oe=-1,this.ue=0,this.le=!0,this.re(),this.le=!1}cancel(){this.isPending()&&(this.ne.cancel(this.oe),this.oe=-1)}}(l(t),this.wm.bind(this)),this.VV=new Z,this.kV=Object.create(null),this.SV=this.gp.bind(this),this.OV=this.Pp.bind(this),this.CV=this.vp.bind(this),this.zV=this.h_.bind(this),this.za.addEventListener("touchstart",this.SV,!!n&&{passive:!0}),this.za.addEventListener("touchend",this.OV),this.za.addEventListener("touchmove",this.CV,!!n&&{passive:!0}),this.za.addEventListener("touchcancel",this.zV),this.NV=!1}cleanup(){this.za.removeEventListener("touchstart",this.SV),this.za.removeEventListener("touchend",this.OV),this.za.removeEventListener("touchmove",this.CV),this.za.removeEventListener("touchcancel",this.zV),delete this.za[q],this.ae.cancel()}onGesture(t,i){const s=new t(this),n=s.getType();let h=this.kV[n];return h||(this.EV.push(s),h=new Z,this.kV[n]=h),h.add(i)}removeGesture(t){const i=new t(this).getType(),s=this.kV[i];if(s){s.removeAll();const t=function(t,s){for(let s=0;s=t){i=!0;break}}i?(t.stopPropagation(),this.wV||t.preventDefault()):this.IV&&t.stopPropagation(),this.NV&&(this.NV=!1,this.wm())}wm(){const t=Date.now();let i=-1;for(let s=0;sthis.Gt[i])&&(i=s):this.xV[s]&&this.xV[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._r=null,this.X_=null,this.Nh=this.win.document,this.Dl=null,this.t4=null,this.gZ=!1,this.i4=null,this.s4=null,this.n4=null,this.sX=null,this.h4=!1,this.e4=0,this.o4=0,this.r4=null,this.l4=(t.getAttribute("animate-in")||"fade-in").toLowerCase(),this.a4=null,this.iX=null,this.c4=null;const i=Y(this.win,"platform");this.ZD=i.isIos(),this.u4=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.X_,"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.l4),"Invalid `animate-in` value %s",this.l4),this.element.classList.add("i-amphtml-overlay"),this.Dl=function(t,i){const s=L(X(t));return G(s,i)?F(s,i):null}(this.element,"action"),this.f4(),this.registerDefaultAction((t=>this.J$(t.trust,t.caller)),"open"),this.registerAction("close",(t=>this.close(t.trust))),this.Dl.addToAllowlist("AMP-LIGHTBOX",["open","close"],["email"])}d4(){j(this.h4),this.m4().forEach((t=>{N(this.element).setOwner(t,this.element)}))}m4(){return(t=this.element.getElementsByClassName("i-amphtml-element"))?Array.prototype.slice.call(t):[];var t}Ys(){if(this.X_)return;const{element:t}=this;this.h4=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.X_=t.ownerDocument.createElement("div"),this.h4||function(t,i){t.classList.add("i-amphtml-fill-content")}(this.X_),t.appendChild(this.X_),i.forEach((t=>{this.X_.appendChild(t)})),this.h4&&(this.d4(),t.classList.add("i-amphtml-scrollable"),t.addEventListener("amp:dom-update",(()=>{this.d4(),this._4(this.e4)})),t.addEventListener("scroll",this.Xa.bind(this))),this.h4||J.get(t).onGesture(class extends class extends class{constructor(t,i){this.aO=t,this.yg=i}getType(){return this.aO}signalReady(t){this.yg.pp(this,t)}signalPending(t){this.yg.UV(this,t)}signalEnd(){this.yg.$V(this)}signalEmit(t,i){this.yg.jV(this,t,i)}acceptStart(){}acceptCancel(){}onTouchStart(t){return!1}onTouchMove(t){return!1}onTouchEnd(t){}}{constructor(t,i,s,n){super(t,i),this.hO=s,this.lO=n,this.MV=!1,this.pO=0,this.mO=0,this.cO=0,this.uO=0,this.dO=0,this.fO=0,this.Mn=0,this._O=0,this.gO=0,this.yO=0,this.AO=0}onTouchStart(t){const{touches:i}=t;return!!(this.MV&&i&&i.length>1)||!(!i||1!=i.length)&&(this.Mn=Date.now(),this.pO=i[0].clientX,this.mO=i[0].clientY,!0)}onTouchMove(t){const{touches:i}=t;if(i&&i.length>=1){const{clientX:s,clientY:n}=i[0];if(this.cO=s,this.uO=n,this.MV)this.PO(!1,!1,t);else{const t=Math.abs(s-this.pO),i=Math.abs(n-this.mO);if(this.hO&&this.lO)(t>=8||i>=8)&&this.signalReady(-10);else if(this.hO){if(t>=8&&t>i)this.signalReady(-10);else if(i>=8)return!1}else{if(!this.lO)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.bO(t)}acceptStart(){this.MV=!0,this.dO=this.pO,this.fO=this.mO,this.gO=this.Mn,this.pO=this.cO,this.mO=this.uO,this.PO(!0,!1,null)}acceptCancel(){this.MV=!1}PO(t,i,s){this._O=Date.now();const n=this._O-this.gO;if(!i&&n>4||i&&n>16){const t=K(this.cO-this.dO,n,this.yO),s=K(this.uO-this.fO,n,this.AO);(!i||n>32||0!=t||0!=s)&&(this.yO=Math.abs(t)>1e-4?t:0,this.AO=Math.abs(s)>1e-4?s:0),this.dO=this.cO,this.fO=this.uO,this.gO=this._O}this.signalEmit({first:t,last:i,time:this._O,deltaX:this.cO-this.pO,deltaY:this.uO-this.mO,startX:this.pO,startY:this.mO,lastX:this.cO,lastY:this.uO,velocityX:this.yO,velocityY:this.AO},s)}bO(t){this.MV&&(this.MV=!1,this.PO(!1,!0,t),this.signalEnd())}}{constructor(t){super("swipe-xy",t,!0,!0)}},(()=>{})),this.A4()}layoutCallback(){return i||(i=Promise.resolve(void 0))}J$(t,i){if(this.gZ)return;this.Ys(),this.s4=this.P4.bind(this),this.Nh.documentElement.addEventListener("focusin",this.s4),i&&(this.sX=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.g4(n,t)))}mutatedAttributesCallback(t){const i=t.open;void 0!==i&&(i?this.J$(2,document.activeElement):this.close(2))}v4(){const t=this.X_.querySelector("[autofocus]");t&&a(t)}g4(t,i){const{element:s}=this,{closedStyle:n,durationSeconds:h,openStyle:e}=this.b4(),o=Object.keys(e).map((t=>`${t} ${h}s ease-in`)).join(",");this.o4++,this.h4&&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.v4(),this.mutateElement((()=>{I(s,V(e))}));const r=this.X_;this.h4&&(this.Xa(),this._4(this.e4));const l=()=>{this.u4(),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.ub("lightboxOpen",i),this.t4=new class{constructor(t,i){const{win:s}=t;if(this.i=s,this.re=i,this.E4=null,this.tn=null,this.QD=-1,this.wZ=null,"function"==typeof s.CloseWatcher)try{this.E4=new s.CloseWatcher}catch(t){(z.dev||(z.dev=B())).error("CloseWatcherImpl","CloseWatcher failed:",t)}this.E4?this.E4.onclose=()=>{i(),this.destroy()}:(this.tn=$(t,"history"),this.tn.push((()=>i())).then((t=>{this.QD=t})),this.wZ=this.yZ.bind(this),s.document.documentElement.addEventListener("keydown",this.wZ))}signalClosed(){this.E4?this.E4.signalClosed():this.re&&((0,this.re)(),this.destroy())}destroy(){this.re=null,this.E4?(this.E4.destroy(),this.E4=null):-1!=this.QD&&(j(this.tn).pop(this.QD),this.QD=-1,this.tn=null,this.i.document.documentElement.removeEventListener("keydown",this.wZ))}yZ(t){"Escape"==t.key&&(t.preventDefault(),this.signalClosed())}}(this.getAmpDoc(),(()=>this.close(3))),this.M4(),this.y4(),this.T4(),this.gZ=!0}A4(){const{element:t}=this;null!=t.getAttribute("close-button")&&(this.a4=function(t){const i=t.ownerDocument||t;return m&&m.ownerDocument===i||(m=i.createElement("div")),g}(t)(tt),t.insertBefore(this.a4,this.X_))}M4(){if(!this.a4)return;let t;this.i4=this.I4.bind(this),this.a4.addEventListener("keydown",this.i4),this.measureMutateElement((()=>{t=this.a4.getBoundingClientRect().height}),(()=>{this.R4(),y(this.X_,{"margin-top":R(t),"min-height":`calc(100vh - ${R(t)})`})}))}R4(){this.a4.classList.add("amp-ad-close-header")}T4(){(this.c4||this.a4)&&(this.n4=this.V4.bind(this),this.iX.addEventListener("click",this.n4))}w4(){(this.c4||this.a4)&&(this.iX.removeEventListener("click",this.n4),this.n4=null,this.a4&&(this.a4.removeEventListener("keydown",this.i4),this.i4=null))}b4(){return st[this.l4]}V4(){this.close(3)}I4(t){"Enter"==t.key&&(t.preventDefault(),this.close(3))}close(t){this.gZ&&(this.h4&&T(this.element,"webkitOverflowScrolling",""),this.getViewport().leaveLightboxMode(this.element).then((()=>this.x4(t))))}x4(t){const{element:i}=this,n=++this.o4,h=()=>{n==this.o4&&(this.collapse(),this.u4())};this.C4()?(function(t,i){for(let s=0;s{Math.abs(t-this.e4)<30?(this.r4=null,this.if(this.e4)):this.O4(this.e4)}),100)}if(t){this._4(t),this.e4=t}_4(t){const i=[];this.D4(t,(t=>{i.push(t),N(this.element).scheduleLayout(this.element,t)}))}D4(t,i){const s=this.z4().height,n=this.m4();for(let h=0;h=t-r&&o<=t+r&&i(e)}}z4(){return this._r||(this._r={width:this.element.clientWidth,height:this.element.clientHeight}),this._r}f4(){const{element:t,win:i}=this;Q(t)&&ht(i,i.document.body)}ub(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.Dl.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%,0.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