1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00
Files
locomotive-boilerplate/www/assets/scripts/app.js
Chauncey McAskill f400ca9622 Add Modal.js
Add accessible modal dialog component.

Features:
- Dialog supports being shown on page load via `data-modal-autoshow` attribute.
- Dialog supports being shown at most once via the `data-modal-show-once` attribute.
- Dialog persists dismissal via `localStorage`, by default. This can be switched to `sessionStoage` via `data-modal-show-once="session"` attribute value.
- When Load handles "loading" event, executes `Modal.hide` on all shown modals.

Required:
- NPM dependency a11y-dialog v7.3.0

Added:
- JS class `Modal` that uses and enhances a11y-dialog.
- CSS component `.c-dialog` via partial '_modal.scss' with basic styles.
- Basic HTML example of `data-module-modal`.

Note:
- Dialog styles adapted from https://codesandbox.io/s/a11y-dialog-pnwqu?file=/src/styles.css
2021-11-01 16:51:33 -04:00

14 lines
75 KiB
JavaScript

(()=>{var oe=Object.create;var F=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames,bt=Object.getOwnPropertySymbols,he=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable;var st=(t,i,e)=>i in t?F(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,St=(t,i)=>{for(var e in i||(i={}))wt.call(i,e)&&st(t,e,i[e]);if(bt)for(var e of bt(i))ce.call(i,e)&&st(t,e,i[e]);return t};var Et=t=>F(t,"__esModule",{value:!0});var ue=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports),de=(t,i)=>{Et(t);for(var e in i)F(t,e,{get:i[e],enumerable:!0})},fe=(t,i,e)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of le(i))!wt.call(t,n)&&n!=="default"&&F(t,n,{get:()=>i[n],enumerable:!(e=ae(i,n))||e.enumerable});return t},me=t=>fe(Et(F(t!=null?oe(he(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var P=(t,i,e)=>(st(t,typeof i!="symbol"?i+"":i,e),e);var kt=(t,i,e)=>new Promise((n,s)=>{var r=l=>{try{a(e.next(l))}catch(h){s(h)}},o=l=>{try{a(e.throw(l))}catch(h){s(h)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,o);a((e=e.apply(t,i)).next())});var te=ue((Qt,tt)=>{(function(t,i){typeof define=="function"&&define.amd?define([],function(){return t.svg4everybody=i()}):typeof tt=="object"&&tt.exports?tt.exports=i():t.svg4everybody=i()})(Qt,function(){function t(s,r,o){if(o){var a=document.createDocumentFragment(),l=!r.hasAttribute("viewBox")&&o.getAttribute("viewBox");l&&r.setAttribute("viewBox",l);for(var h=o.cloneNode(!0);h.childNodes.length;)a.appendChild(h.firstChild);s.appendChild(a)}}function i(s){s.onreadystatechange=function(){if(s.readyState===4){var r=s._cachedDocument;r||(r=s._cachedDocument=document.implementation.createHTMLDocument(""),r.body.innerHTML=s.responseText,s._cachedTarget={}),s._embeds.splice(0).map(function(o){var a=s._cachedTarget[o.id];a||(a=s._cachedTarget[o.id]=r.getElementById(o.id)),t(o.parent,o.svg,a)})}},s.onreadystatechange()}function e(s){function r(){for(var A=0;A<T.length;){var k=T[A],w=k.parentNode,f=n(w),v=k.getAttribute("xlink:href")||k.getAttribute("href");if(!v&&a.attributeName&&(v=k.getAttribute(a.attributeName)),f&&v){if(o)if(!a.validate||a.validate(v,f,k)){w.removeChild(k);var b=v.split("#"),y=b.shift(),_=b.join("#");if(y.length){var g=c[y];g||(g=c[y]=new XMLHttpRequest,g.open("GET",y),g.send(),g._embeds=[]),g._embeds.push({parent:w,svg:f,id:_}),i(g)}else t(w,f,document.getElementById(_))}else++A,++L}else++A}(!T.length||T.length-L>0)&&p(r,67)}var o,a=Object(s),l=/\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/,h=/\bAppleWebKit\/(\d+)\b/,d=/\bEdge\/12\.(\d+)\b/,u=/\bEdge\/.(\d+)\b/,m=window.top!==window.self;o="polyfill"in a?a.polyfill:l.test(navigator.userAgent)||(navigator.userAgent.match(d)||[])[1]<10547||(navigator.userAgent.match(h)||[])[1]<537||u.test(navigator.userAgent)&&m;var c={},p=window.requestAnimationFrame||setTimeout,T=document.getElementsByTagName("use"),L=0;o&&r()}function n(s){for(var r=s;r.nodeName.toLowerCase()!=="svg"&&(r=r.parentNode););return r}return e})});function q(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?q=function(i){return typeof i}:q=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},q(t)}function _t(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function At(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Tt(t,i,e){return i&&At(t.prototype,i),e&&At(t,e),t}function xt(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}function X(t,i){return ye(t)||be(t,i)||Ct(t,i)||Se()}function ve(t){return pe(t)||ge(t)||Ct(t)||we()}function pe(t){if(Array.isArray(t))return nt(t)}function ye(t){if(Array.isArray(t))return t}function ge(t){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(t))return Array.from(t)}function be(t,i){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(t)))){var e=[],n=!0,s=!1,r=void 0;try{for(var o=t[Symbol.iterator](),a;!(n=(a=o.next()).done)&&(e.push(a.value),!(i&&e.length===i));n=!0);}catch(l){s=!0,r=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(s)throw r}}return e}}function Ct(t,i){if(!!t){if(typeof t=="string")return nt(t,i);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return nt(t,i)}}function nt(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,n=new Array(i);e<i;e++)n[e]=t[e];return n}function we(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Se(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var z=function(){function t(i){_t(this,t),this.mAttr="data-"+i.dataName,this.mCaptureEvents=["mouseenter","mouseleave"],this.el=i.el}return Tt(t,[{key:"mInit",value:function(e){var n=this;this.modules=e,this.mCheckEventTarget=this.mCheckEventTarget.bind(this),this.events&&Object.keys(this.events).forEach(function(s){return n.mAddEvent(s)})}},{key:"mUpdate",value:function(e){this.modules=e}},{key:"mDestroy",value:function(){var e=this;this.events&&Object.keys(this.events).forEach(function(n){return e.mRemoveEvent(n)})}},{key:"mAddEvent",value:function(e){var n=!!this.mCaptureEvents.includes(e);this.el.addEventListener(e,this.mCheckEventTarget,n)}},{key:"mRemoveEvent",value:function(e){var n=!!this.mCaptureEvents.includes(e);this.el.removeEventListener(e,this.mCheckEventTarget,n)}},{key:"mCheckEventTarget",value:function(e){var n=this.events[e.type];if(typeof n=="string")this[n](e);else{var s="["+this.mAttr+"]",r=e.target;if(this.mCaptureEvents.includes(e.type))r.matches(s)&&this.mCallEventMethod(e,n,r);else for(;r&&r!==document&&!(r.matches(s)&&this.mCallEventMethod(e,n,r)!="undefined");)r=r.parentNode}}},{key:"mCallEventMethod",value:function(e,n,s){var r=s.getAttribute(this.mAttr);if(n.hasOwnProperty(r)){var o=n[r];e.hasOwnProperty("currentTarget")||Object.defineProperty(e,"currentTarget",{value:s}),e.hasOwnProperty("curTarget")||Object.defineProperty(e,"curTarget",{value:s}),this[o](e)}}},{key:"$",value:function(e,n){var s=e.indexOf("."),r=e.indexOf("#"),o=e.indexOf("["),a=[s,r,o].filter(function(m){return m!=-1}),l=!1,h=e,d="",u=this.el;return a.length&&(l=Math.min.apply(Math,ve(a)),h=e.slice(0,l),d=e.slice(l)),q(n)=="object"&&(u=n),u.querySelectorAll("["+this.mAttr+"="+h+"]"+d)}},{key:"parent",value:function(e,n){for(var s="["+this.mAttr+"="+e+"]",r=n.parentNode;r&&r!==document;){if(r.matches(s))return r;r=r.parentNode}}},{key:"getData",value:function(e,n){var s=n||this.el;return s.getAttribute(this.mAttr+"-"+e)}},{key:"setData",value:function(e,n,s){var r=s||this.el;return r.setAttribute(this.mAttr+"-"+e,n)}},{key:"call",value:function(e,n,s,r){var o=this;n&&!s&&(s=n,n=!1),this.modules[s]&&(r?this.modules[s][r]&&this.modules[s][r][e](n):Object.keys(this.modules[s]).forEach(function(a){o.modules[s][a][e](n)}))}},{key:"on",value:function(e,n,s,r){var o=this;this.modules[n]&&(r?this.modules[n][r].el.addEventListener(e,function(a){return s(a)}):Object.keys(this.modules[n]).forEach(function(a){o.modules[n][a].el.addEventListener(e,function(l){return s(l)})}))}},{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),t}(),Ee=function(){function t(i){_t(this,t),this.app,this.modules=i.modules,this.currentModules={},this.activeModules={},this.newModules={},this.moduleId=0}return Tt(t,[{key:"init",value:function(e,n){var s=this,r=n||document,o=r.querySelectorAll("*");e&&!this.app&&(this.app=e),this.activeModules.app={app:this.app},o.forEach(function(a){Array.from(a.attributes).forEach(function(l){if(l.name.startsWith("data-module")){var h=!1,d=l.name.split("-").splice(2),u=s.toCamel(d);if(s.modules[u]?h=!0:s.modules[s.toUpper(u)]&&(u=s.toUpper(u),h=!0),h){var m={el:a,name:u,dataName:d.join("-")},c=new s.modules[u](m),p=l.value;p||(s.moduleId++,p="m"+s.moduleId,a.setAttribute(l.name,p)),s.addActiveModule(u,p,c);var T=u+"-"+p;n?s.newModules[T]=c:s.currentModules[T]=c}}})}),Object.entries(this.currentModules).forEach(function(a){var l=X(a,2),h=l[0],d=l[1];if(n){var u=h.split("-"),m=u.shift(),c=u.pop();s.addActiveModule(m,c,d)}else s.initModule(d)})}},{key:"initModule",value:function(e){e.mInit(this.activeModules),e.init()}},{key:"addActiveModule",value:function(e,n,s){this.activeModules[e]?Object.assign(this.activeModules[e],xt({},n,s)):this.activeModules[e]=xt({},n,s)}},{key:"update",value:function(e){var n=this;this.init(this.app,e),Object.entries(this.currentModules).forEach(function(s){var r=X(s,2),o=r[0],a=r[1];a.mUpdate(n.activeModules)}),Object.entries(this.newModules).forEach(function(s){var r=X(s,2),o=r[0],a=r[1];n.initModule(a)}),Object.assign(this.currentModules,this.newModules)}},{key:"destroy",value:function(e){e?this.destroyScope(e):this.destroyModules()}},{key:"destroyScope",value:function(e){var n=this,s=e.querySelectorAll("*");s.forEach(function(r){Array.from(r.attributes).forEach(function(o){if(o.name.startsWith("data-module")){var a=o.value,l=o.name.split("-").splice(2),h=n.toCamel(l)+"-"+a,d=!1;n.currentModules[h]?d=!0:n.currentModules[n.toUpper(h)]&&(h=n.toUpper(h),d=!0),d&&(n.destroyModule(n.currentModules[h]),delete n.currentModules[h])}})}),this.activeModules={},this.newModules={}}},{key:"destroyModules",value:function(){var e=this;Object.entries(this.currentModules).forEach(function(n){var s=X(n,2),r=s[0],o=s[1];e.destroyModule(o)}),this.currentModules=[]}},{key:"destroyModule",value:function(e){e.mDestroy(),e.destroy()}},{key:"toCamel",value:function(e){var n=this;return e.reduce(function(s,r){return s+n.toUpper(r)})}},{key:"toUpper",value:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}}]),t}(),Ot=Ee;var mt={};de(mt,{Load:()=>rt,Modal:()=>at,Scroll:()=>ft});function ke(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function Dt(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _e(t,i,e){return i&&Dt(t.prototype,i),e&&Dt(t,e),t}function Ae(t,i){return Te(t)||xe(t,i)||Ce(t,i)||Oe()}function Te(t){if(Array.isArray(t))return t}function xe(t,i){var e=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var n=[],s=!0,r=!1,o,a;try{for(e=e.call(t);!(s=(o=e.next()).done)&&(n.push(o.value),!(i&&n.length===i));s=!0);}catch(l){r=!0,a=l}finally{try{!s&&e.return!=null&&e.return()}finally{if(r)throw a}}return n}}function Ce(t,i){if(!!t){if(typeof t=="string")return Lt(t,i);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Lt(t,i)}}function Lt(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,n=new Array(i);e<i;e++)n[e]=t[e];return n}function Oe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var De=function(){function t(i){ke(this,t),this.defaults={name:"load",loadingClass:"is-loading",loadedClass:"is-loaded",readyClass:"is-ready",transitionsPrefix:"is-",transitionsHistory:!0,enterDelay:0,exitDelay:0,loadedDelay:0,isLoaded:!1,isEntered:!1,isUrl:!1,transitionContainer:null,popstateIgnore:!1},Object.assign(this,this.defaults,i),this.options=i,this.namespace="modular",this.html=document.documentElement,this.href=window.location.href,this.container="data-"+this.name+"-container",this.subContainer=!1,this.prevTransition=null,this.loadAttributes=["src","srcset","style","href"],this.isInserted=!1,this.isLoading=!1,this.enterTimeout=!1,this.controller=new AbortController,this.classContainer=this.html,this.isChrome=navigator.userAgent.indexOf("Chrome")!=-1,this.init()}return _e(t,[{key:"init",value:function(){var e=this;window.addEventListener("popstate",function(n){return e.checkState(n)},!1),this.html.addEventListener("click",function(n){return e.checkClick(n)},!1),this.loadEls(document)}},{key:"checkClick",value:function(e){if(!e.ctrlKey&&!e.metaKey)for(var n=e.target;n&&n!==document;){if(n.matches("a")&&n.getAttribute("download")==null){var s=n.getAttribute("href");!s.startsWith("#")&&!s.startsWith("mailto:")&&!s.startsWith("tel:")&&(e.preventDefault(),this.reset(),this.getClickOptions(n));break}n=n.parentNode}}},{key:"checkState",value:function(){typeof this.popstateIgnore=="string"&&window.location.href.indexOf(this.popstateIgnore)>-1||(this.reset(),this.getStateOptions())}},{key:"reset",value:function(){this.isLoading&&(this.controller.abort(),this.isLoading=!1,this.controller=new AbortController),window.clearTimeout(this.enterTimeout),this.isInserted&&this.removeContainer(),this.classContainer=this.html,Object.assign(this,this.defaults,this.options)}},{key:"getClickOptions",value:function(e){this.transition=e.getAttribute("data-"+this.name),this.isUrl=e.getAttribute("data-"+this.name+"-url");var n=e.getAttribute("href"),s=e.getAttribute("target");if(s=="_blank"){window.open(n,"_blank");return}if(this.transition=="false"){window.location=n;return}this.setOptions(n,!0)}},{key:"getStateOptions",value:function(){this.transitionsHistory?this.transition=history.state:this.transition=!1;var e=window.location.href;this.setOptions(e)}},{key:"goTo",value:function(e,n,s){this.reset(),this.transition=n,this.isUrl=s,this.setOptions(e,!0)}},{key:"setOptions",value:function(e,n){var s="["+this.container+"]",r;this.transition&&this.transition!="true"&&(this.transitionContainer="["+this.container+'="'+this.transition+'"]',this.loadingClass=this.transitions[this.transition].loadingClass||this.loadingClass,this.loadedClass=this.transitions[this.transition].loadedClass||this.loadedClass,this.readyClass=this.transitions[this.transition].readyClass||this.readyClass,this.transitionsPrefix=this.transitions[this.transition].transitionsPrefix||this.transitionsPrefix,this.enterDelay=this.transitions[this.transition].enterDelay||this.enterDelay,this.exitDelay=this.transitions[this.transition].exitDelay||this.exitDelay,this.loadedDelay=this.transitions[this.transition].loadedDelay||this.loadedDelay,r=document.querySelector(this.transitionContainer)),r?(s=this.transitionContainer,this.oldContainer=r,this.classContainer=this.oldContainer.parentNode,this.subContainer||history.replaceState(this.transition,null,this.href),this.subContainer=!0):(this.oldContainer=document.querySelector(s),this.subContainer&&history.replaceState(this.prevTransition,null,this.href),this.subContainer=!1),this.href=e,this.parentContainer=this.oldContainer.parentNode,this.isUrl===""||this.isUrl!=null&&this.isUrl!="false"&&this.isUrl!=!1?history.pushState(this.transition,null,e):(this.oldContainer.classList.add("is-old"),this.setLoading(),this.startEnterDelay(),this.loadHref(e,s,n))}},{key:"setLoading",value:function(){this.classContainer.classList.remove(this.loadedClass,this.readyClass),this.classContainer.classList.add(this.loadingClass),this.classContainer.classList.remove(this.transitionsPrefix+this.prevTransition),this.transition&&this.classContainer.classList.add(this.transitionsPrefix+this.transition),this.subContainer||(this.prevTransition=this.transition);var e=new Event(this.namespace+"loading");window.dispatchEvent(e)}},{key:"startEnterDelay",value:function(){var e=this;this.enterTimeout=window.setTimeout(function(){e.isEntered=!0,e.isLoaded&&e.transitionContainers()},this.enterDelay)}},{key:"loadHref",value:function(e,n,s){var r=this;this.isLoading=!0;var o=this.controller.signal;fetch(e,{signal:o}).then(function(a){return a.text()}).then(function(a){s&&history.pushState(r.transition,null,e);var l=new DOMParser;r.data=l.parseFromString(a,"text/html"),r.newContainer=r.data.querySelector(n),r.newContainer.classList.add("is-new"),r.parentNewContainer=r.newContainer.parentNode,r.hideContainer(),r.parentContainer.insertBefore(r.newContainer,r.oldContainer),r.isInserted=!0,r.setSvgs(),r.isLoaded=!0,r.isEntered&&r.transitionContainers(),r.loadEls(r.newContainer),r.isLoading=!1}).catch(function(a){window.location=e})}},{key:"transitionContainers",value:function(){var e=this;this.setAttributes(),this.showContainer(),this.setLoaded(),setTimeout(function(){e.removeContainer(),e.setReady()},this.exitDelay)}},{key:"setSvgs",value:function(){if(this.isChrome){var e=this.newContainer.querySelectorAll("use");e.length&&e.forEach(function(n){var s=n.getAttribute("xlink:href");if(s)n.parentNode.innerHTML='<use xlink:href="'+s+'"></use>';else{var r=n.getAttribute("href");r&&(n.parentNode.innerHTML='<use href="'+r+'"></use>')}})}}},{key:"setAttributes",value:function(){var e=this,n=this.data.getElementsByTagName("title")[0],s=this.data.head.querySelector('meta[name="description"]'),r=document.head.querySelector('meta[name="description"]'),o,a;this.subContainer?(a=this.parentNewContainer,o=document.querySelector(this.transitionContainer).parentNode):(a=this.data.querySelector("html"),o=document.querySelector("html"));var l=Object.assign({},a.dataset);n&&(document.title=n.innerText),r&&s&&r.setAttribute("content",s.getAttribute("content")),l&&Object.entries(l).forEach(function(h){var d=Ae(h,2),u=d[0],m=d[1];o.setAttribute("data-"+e.toDash(u),m)})}},{key:"toDash",value:function(e){return e.split(/(?=[A-Z])/).join("-").toLowerCase()}},{key:"hideContainer",value:function(){this.newContainer.style.visibility="hidden",this.newContainer.style.height=0,this.newContainer.style.overflow="hidden"}},{key:"showContainer",value:function(){this.newContainer.style.visibility="",this.newContainer.style.height="",this.newContainer.style.overflow=""}},{key:"loadEls",value:function(e){var n=this,s=[];this.loadAttributes.forEach(function(r){var o="data-"+n.name+"-"+r,a=e.querySelectorAll("["+o+"]");a.length&&a.forEach(function(l){var h=l.getAttribute(o);if(l.setAttribute(r,h),r=="src"||r=="srcset"){var d=new Promise(function(u){l.onload=function(){return u(l)}});s.push(d)}})}),Promise.all(s).then(function(r){var o=new Event(n.namespace+"images");window.dispatchEvent(o)})}},{key:"setLoaded",value:function(){var e=this;this.classContainer.classList.remove(this.loadingClass),setTimeout(function(){e.classContainer.classList.add(e.loadedClass)},this.loadedDelay);var n=new Event(this.namespace+"loaded");window.dispatchEvent(n)}},{key:"removeContainer",value:function(){this.parentContainer.removeChild(this.oldContainer),this.newContainer.classList.remove("is-new"),this.isInserted=!1}},{key:"setReady",value:function(){this.classContainer.classList.add(this.readyClass);var e=new Event(this.namespace+"ready");window.dispatchEvent(e)}},{key:"on",value:function(e,n){var s=this;window.addEventListener(this.namespace+e,function(){switch(e){case"loading":return n(s.transition,s.oldContainer);case"loaded":return n(s.transition,s.oldContainer,s.newContainer);case"ready":return n(s.transition,s.newContainer);default:return n()}},!1)}}]),t}(),Mt=De;var rt=class extends z{constructor(t){super(t)}init(){let t=new Mt({enterDelay:0,transitions:{customTransition:{}}});this.load.on("loading",(i,e)=>{this.call("hide",null,"Modal")}),t.on("loaded",(i,e,n)=>{this.call("destroy",e,"app"),this.call("update",n,"app")})}};var Le=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'],Me=9,Ie=27;function O(t){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=t,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}O.prototype.create=function(){return this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=U('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this)),this._closers=U("[data-a11y-dialog-hide]",this.$el).concat(U('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this};O.prototype.show=function(t){return this.shown?this:(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,It(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",t),this)};O.prototype.hide=function(t){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",t),this):this};O.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(t){t.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(t){t.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this};O.prototype.on=function(t,i){return typeof this._listeners[t]=="undefined"&&(this._listeners[t]=[]),this._listeners[t].push(i),this};O.prototype.off=function(t,i){var e=(this._listeners[t]||[]).indexOf(i);return e>-1&&this._listeners[t].splice(e,1),this};O.prototype._fire=function(t,i){var e=this._listeners[t]||[],n=new CustomEvent(t,{detail:i});this.$el.dispatchEvent(n),e.forEach(function(s){s(this.$el,i)}.bind(this))};O.prototype._bindKeypress=function(t){!this.$el.contains(document.activeElement)||(this.shown&&t.which===Ie&&this.$el.getAttribute("role")!=="alertdialog"&&(t.preventDefault(),this.hide(t)),this.shown&&t.which===Me&&je(this.$el,t))};O.prototype._maintainFocus=function(t){this.shown&&!t.target.closest('[aria-modal="true"]')&&!t.target.closest("[data-a11y-dialog-ignore-focus-trap]")&&It(this.$el)};function Pe(t){return Array.prototype.slice.call(t)}function U(t,i){return Pe((i||document).querySelectorAll(t))}function It(t){var i=t.querySelector("[autofocus]")||t;i.focus()}function Be(t){return U(Le.join(","),t).filter(function(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)})}function je(t,i){var e=Be(t),n=e.indexOf(document.activeElement);i.shiftKey&&n===0?(e[e.length-1].focus(),i.preventDefault()):!i.shiftKey&&n===e.length-1&&(e[0].focus(),i.preventDefault())}function ot(){U("[data-a11y-dialog]").forEach(function(t){new O(t)})}typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ot):window.requestAnimationFrame?window.requestAnimationFrame(ot):window.setTimeout(ot,16));var H=document.documentElement,Di=document.body,Pt=H.hasAttribute("data-debug");var at=class extends z{constructor(t){super(t);P(this,"autoShow",!1);P(this,"contextElement",H);P(this,"contextShowClass","has-modal-open");P(this,"debug",Pt);P(this,"dismissedStoreKey");P(this,"showOnce",!1);P(this,"showOnceStore",window.localStorage);P(this,"wasShown",!1);this.events={click:{dismiss:"hide",hide:"hide",show:"show",toggle:"toggle"},submit:"onSubmit",submitend:"hide"};let i=`data-module-${t.dataName}`;if(this.moduleName=t.name,this.moduleID=this.el.getAttribute(i),!this.moduleID)throw new TypeError(`${this.moduleName} must have an ID on attribute ${i}`);this.el.hasAttribute("id")||this.el.setAttribute("id",this.moduleID),this._onHide=this.onHide.bind(this),this._onShow=this.onShow.bind(this),this._onSubmit=this.onSubmit.bind(this),this.resolveShowOnce()}init(){if(this.el.hasAttribute("data-a11y-dialog")){let t=this.el.getAttribute("data-a11y-dialog")||this.moduleID;this.debug&&console.warn(`${this.moduleName} [${t}] not initialized because of automatic instantiation through HTML`);return}if(this.showOnce&&this.wasShown){this.debug&&console.log(`${this.moduleName} [${this.moduleID}] not initialized because the dialog was previously dismissed`);return}this.dialog=this.createDialog(),this.el.appModal=this,this.el.a11yDialog=this.dialog,this.addDialogEventListeners(),this.el.hasAttribute(`${this.mAttr}-autoshow`)&&this.dialog.show()}mUpdate(t){super.mUpdate(t),this.refreshDialogOpeners()}createDialog(){return new O(this.el)}destroy(){this.destroyDialog(),delete this.el.appModal}destroyDialog(){this.dialog&&this.dialog.destroy(),delete this.el.a11yDialog}dismissDialog(t=!1){this.wasShown=!0,this.showOnceStore&&this.dismissedStoreKey?this.showOnceStore.setItem(this.dismissedStoreKey,this.getDismissedStoreValue()):this.debug&&console.warn(`${this.moduleName} [${dialogID}] does not have a 'showOnceStore' or a 'dismissedStoreKey' for persisting dismissal`),t&&this.destroyDialog()}addDialogEventListeners(){this.dialog&&(this.dialog.on("hide",this._onHide),this.dialog.on("show",this._onShow))}removeDialogEventListeners(){this.dialog&&(this.dialog.off("hide",this._onHide),this.dialog.off("show",this._onShow))}hide(){return this.dialog&&this.dialog.hide(),this}show(){return this.dialog&&this.dialog.show(),this}toggle(){return this.dialog&&(this.dialog.shown?this.dialog.hide():this.dialog.show()),this}getDismissedStoreKey(){return`${this.moduleName}.${this.moduleID}.dismissed`}getDismissedStoreValue(){return new Date().toISOString()}getFormModuleNames(){return["form"]}onHide(t,i){this.showOnce&&!this.wasShown&&this.dismissDialog(!0),this.contextElement&&this.contextShowClass&&this.contextElement.classList.remove(this.contextShowClass)}onShow(t,i){this.contextElement&&this.contextShowClass&&this.contextElement.classList.add(this.contextShowClass)}onSubmit(t){let i=this.getFormModuleNames().map(e=>`:not([data-module-${e}])`).join("");if(t.target.matches(i)){this.debug&&console.log("Modal.onSubmit");let e=new CustomEvent("submitend",{bubbles:!0});t.target.dispatchEvent(e)}}refreshDialogOpeners(){this.dialog&&(this.dialog._openers.forEach(t=>{t.removeEventListener("click",this.dialog._show)}),this.dialog._openers=document.querySelectorAll('[data-a11y-dialog-show="'+this.dialog._id+'"]'),this.dialog._openers.forEach(t=>{t.addEventListener("click",this.dialog._show)}))}resolveShowOnce(){let t=`${this.mAttr}-show-once`;if(this.showOnce=this.el.hasAttribute(t),!!this.showOnce){switch(this.el.getAttribute(t)){case"session":this.showOnceStore=window.sessionStorage;break;case"local":this.showOnceStore=window.localStorage;break}this.dismissedStoreKey=this.getDismissedStoreKey(),this.showOnceStore&&(this.wasShown=this.showOnceStore.getItem(this.dismissedStoreKey))}}};var Bt=[];function Re(t,i={}){return new Promise((e,n)=>{let s=new Image;i.crossOrigin&&(s.crossOrigin=i.crossOrigin);let r=()=>{e(St({element:s},He(s)))};s.decode?(s.src=t,s.decode().then(r).catch(o=>{n(o)})):(s.onload=r,s.onerror=o=>{n(o)},s.src=t)})}function He(t){return{url:t.src,width:t.naturalWidth,height:t.naturalHeight,ratio:t.naturalWidth/t.naturalHeight}}function jt(t,i,e){return kt(this,null,function*(){let n=i||t.dataset.src,s=Bt.find(r=>r.url===n);if(!s){if(s=yield Re(n),!s.url)return;Bt.push(s)}t.src!==n&&(t.tagName==="IMG"?t.src=s.url:t.style.backgroundImage=`url(${s.url})`,requestAnimationFrame(()=>{let r=t.closest(".c-lazy");r&&(r.classList.add("-lazy-loaded"),r.style.backgroundImage=""),t.classList.add("-lazy-loaded"),e==null||e()}))})}function G(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function Rt(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Z(t,i,e){return i&&Rt(t.prototype,i),e&&Rt(t,e),t}function We(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}function Ht(t,i){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),e.push.apply(e,n)}return e}function lt(t){for(var i=1;i<arguments.length;i++){var e=arguments[i]!=null?arguments[i]:{};i%2?Ht(Object(e),!0).forEach(function(n){We(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ht(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Wt(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&ht(t,i)}function M(t){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},M(t)}function ht(t,i){return ht=Object.setPrototypeOf||function(n,s){return n.__proto__=s,n},ht(t,i)}function ze(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function zt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ne(t,i){return i&&(typeof i=="object"||typeof i=="function")?i:zt(t)}function Nt(t){var i=ze();return function(){var n=M(t),s;if(i){var r=M(this).constructor;s=Reflect.construct(n,arguments,r)}else s=n.apply(this,arguments);return Ne(this,s)}}function Ye(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=M(t),t!==null););return t}function B(t,i,e){return typeof Reflect!="undefined"&&Reflect.get?B=Reflect.get:B=function(s,r,o){var a=Ye(s,r);if(!!a){var l=Object.getOwnPropertyDescriptor(a,r);return l.get?l.get.call(o):l.value}},B(t,i,e||t)}function N(t,i){return Ve(t)||$e(t,i)||Yt(t,i)||Xe()}function Fe(t){return Ue(t)||Ke(t)||Yt(t)||qe()}function Ue(t){if(Array.isArray(t))return ct(t)}function Ve(t){if(Array.isArray(t))return t}function Ke(t){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(t))return Array.from(t)}function $e(t,i){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(t)))){var e=[],n=!0,s=!1,r=void 0;try{for(var o=t[Symbol.iterator](),a;!(n=(a=o.next()).done)&&(e.push(a.value),!(i&&e.length===i));n=!0);}catch(l){s=!0,r=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(s)throw r}}return e}}function Yt(t,i){if(!!t){if(typeof t=="string")return ct(t,i);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ct(t,i)}}function ct(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,n=new Array(i);e<i;e++)n[e]=t[e];return n}function qe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Y={el:document,name:"scroll",offset:[0,0],repeat:!1,smooth:!1,initPosition:{x:0,y:0},direction:"vertical",gestureDirection:"vertical",reloadOnContextChange:!1,lerp:.1,class:"is-inview",scrollbarContainer:!1,scrollbarClass:"c-scrollbar",scrollingClass:"has-scroll-scrolling",draggingClass:"has-scroll-dragging",smoothClass:"has-scroll-smooth",initClass:"has-scroll-init",getSpeed:!1,getDirection:!1,scrollFromAnywhere:!1,multiplier:1,firefoxMultiplier:50,touchMultiplier:2,resetNativeScroll:!0,tablet:{smooth:!1,direction:"vertical",gestureDirection:"vertical",breakpoint:1024},smartphone:{smooth:!1,direction:"vertical",gestureDirection:"vertical"}},Ft=function(){function t(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};G(this,t),Object.assign(this,Y,i),this.smartphone=Y.smartphone,i.smartphone&&Object.assign(this.smartphone,i.smartphone),this.tablet=Y.tablet,i.tablet&&Object.assign(this.tablet,i.tablet),this.namespace="locomotive",this.html=document.documentElement,this.windowHeight=window.innerHeight,this.windowWidth=window.innerWidth,this.windowMiddle={x:this.windowWidth/2,y:this.windowHeight/2},this.els={},this.currentElements={},this.listeners={},this.hasScrollTicking=!1,this.hasCallEventSet=!1,this.checkScroll=this.checkScroll.bind(this),this.checkResize=this.checkResize.bind(this),this.checkEvent=this.checkEvent.bind(this),this.instance={scroll:{x:0,y:0},limit:{x:this.html.offsetWidth,y:this.html.offsetHeight},currentElements:this.currentElements},this.isMobile?this.isTablet?this.context="tablet":this.context="smartphone":this.context="desktop",this.isMobile&&(this.direction=this[this.context].direction),this.direction==="horizontal"?this.directionAxis="x":this.directionAxis="y",this.getDirection&&(this.instance.direction=null),this.getDirection&&(this.instance.speed=0),this.html.classList.add(this.initClass),window.addEventListener("resize",this.checkResize,!1)}return Z(t,[{key:"init",value:function(){this.initEvents()}},{key:"checkScroll",value:function(){this.dispatchScroll()}},{key:"checkResize",value:function(){var e=this;this.resizeTick||(this.resizeTick=!0,requestAnimationFrame(function(){e.resize(),e.resizeTick=!1}))}},{key:"resize",value:function(){}},{key:"checkContext",value:function(){if(!!this.reloadOnContextChange){this.isMobile=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1||this.windowWidth<this.tablet.breakpoint,this.isTablet=this.isMobile&&this.windowWidth>=this.tablet.breakpoint;var e=this.context;if(this.isMobile?this.isTablet?this.context="tablet":this.context="smartphone":this.context="desktop",e!=this.context){var n=e=="desktop"?this.smooth:this[e].smooth,s=this.context=="desktop"?this.smooth:this[this.context].smooth;n!=s&&window.location.reload()}}}},{key:"initEvents",value:function(){var e=this;this.scrollToEls=this.el.querySelectorAll("[data-".concat(this.name,"-to]")),this.setScrollTo=this.setScrollTo.bind(this),this.scrollToEls.forEach(function(n){n.addEventListener("click",e.setScrollTo,!1)})}},{key:"setScrollTo",value:function(e){e.preventDefault(),this.scrollTo(e.currentTarget.getAttribute("data-".concat(this.name,"-href"))||e.currentTarget.getAttribute("href"),{offset:e.currentTarget.getAttribute("data-".concat(this.name,"-offset"))})}},{key:"addElements",value:function(){}},{key:"detectElements",value:function(e){var n=this,s=this.instance.scroll.y,r=s+this.windowHeight,o=this.instance.scroll.x,a=o+this.windowWidth;Object.entries(this.els).forEach(function(l){var h=N(l,2),d=h[0],u=h[1];if(u&&(!u.inView||e)&&(n.direction==="horizontal"?a>=u.left&&o<u.right&&n.setInView(u,d):r>=u.top&&s<u.bottom&&n.setInView(u,d)),u&&u.inView)if(n.direction==="horizontal"){var m=u.right-u.left;u.progress=(n.instance.scroll.x-(u.left-n.windowWidth))/(m+n.windowWidth),(a<u.left||o>u.right)&&n.setOutOfView(u,d)}else{var c=u.bottom-u.top;u.progress=(n.instance.scroll.y-(u.top-n.windowHeight))/(c+n.windowHeight),(r<u.top||s>u.bottom)&&n.setOutOfView(u,d)}}),this.hasScrollTicking=!1}},{key:"setInView",value:function(e,n){this.els[n].inView=!0,e.el.classList.add(e.class),this.currentElements[n]=e,e.call&&this.hasCallEventSet&&(this.dispatchCall(e,"enter"),e.repeat||(this.els[n].call=!1))}},{key:"setOutOfView",value:function(e,n){var s=this;this.els[n].inView=!1,Object.keys(this.currentElements).forEach(function(r){r===n&&delete s.currentElements[r]}),e.call&&this.hasCallEventSet&&this.dispatchCall(e,"exit"),e.repeat&&e.el.classList.remove(e.class)}},{key:"dispatchCall",value:function(e,n){this.callWay=n,this.callValue=e.call.split(",").map(function(r){return r.trim()}),this.callObj=e,this.callValue.length==1&&(this.callValue=this.callValue[0]);var s=new Event(this.namespace+"call");this.el.dispatchEvent(s)}},{key:"dispatchScroll",value:function(){var e=new Event(this.namespace+"scroll");this.el.dispatchEvent(e)}},{key:"setEvents",value:function(e,n){this.listeners[e]||(this.listeners[e]=[]);var s=this.listeners[e];s.push(n),s.length===1&&this.el.addEventListener(this.namespace+e,this.checkEvent,!1),e==="call"&&(this.hasCallEventSet=!0,this.detectElements(!0))}},{key:"unsetEvents",value:function(e,n){if(!!this.listeners[e]){var s=this.listeners[e],r=s.indexOf(n);r<0||(s.splice(r,1),s.index===0&&this.el.removeEventListener(this.namespace+e,this.checkEvent,!1))}}},{key:"checkEvent",value:function(e){var n=this,s=e.type.replace(this.namespace,""),r=this.listeners[s];!r||r.length===0||r.forEach(function(o){switch(s){case"scroll":return o(n.instance);case"call":return o(n.callValue,n.callWay,n.callObj);default:return o()}})}},{key:"startScroll",value:function(){}},{key:"stopScroll",value:function(){}},{key:"setScroll",value:function(e,n){this.instance.scroll={x:0,y:0}}},{key:"destroy",value:function(){var e=this;window.removeEventListener("resize",this.checkResize,!1),Object.keys(this.listeners).forEach(function(n){e.el.removeEventListener(e.namespace+n,e.checkEvent,!1)}),this.listeners={},this.scrollToEls.forEach(function(n){n.removeEventListener("click",e.setScrollTo,!1)}),this.html.classList.remove(this.initClass)}}]),t}(),Ge=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ut(t,i){return i={exports:{}},t(i,i.exports),i.exports}var Vt=Ut(function(t,i){(function(){function e(){var n=window,s=document;if("scrollBehavior"in s.documentElement.style&&n.__forceSmoothScrollPolyfill__!==!0)return;var r=n.HTMLElement||n.Element,o=468,a={scroll:n.scroll||n.scrollTo,scrollBy:n.scrollBy,elementScroll:r.prototype.scroll||u,scrollIntoView:r.prototype.scrollIntoView},l=n.performance&&n.performance.now?n.performance.now.bind(n.performance):Date.now;function h(f){var v=["MSIE ","Trident/","Edge/"];return new RegExp(v.join("|")).test(f)}var d=h(n.navigator.userAgent)?1:0;function u(f,v){this.scrollLeft=f,this.scrollTop=v}function m(f){return .5*(1-Math.cos(Math.PI*f))}function c(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(f,v){if(v==="Y")return f.clientHeight+d<f.scrollHeight;if(v==="X")return f.clientWidth+d<f.scrollWidth}function T(f,v){var b=n.getComputedStyle(f,null)["overflow"+v];return b==="auto"||b==="scroll"}function L(f){var v=p(f,"Y")&&T(f,"Y"),b=p(f,"X")&&T(f,"X");return v||b}function A(f){for(;f!==s.body&&L(f)===!1;)f=f.parentNode||f.host;return f}function k(f){var v=l(),b,y,_,g=(v-f.startTime)/o;g=g>1?1:g,b=m(g),y=f.startX+(f.x-f.startX)*b,_=f.startY+(f.y-f.startY)*b,f.method.call(f.scrollable,y,_),(y!==f.x||_!==f.y)&&n.requestAnimationFrame(k.bind(n,f))}function w(f,v,b){var y,_,g,S,R=l();f===s.body?(y=n,_=n.scrollX||n.pageXOffset,g=n.scrollY||n.pageYOffset,S=a.scroll):(y=f,_=f.scrollLeft,g=f.scrollTop,S=u),k({scrollable:y,method:S,startTime:R,startX:_,startY:g,x:v,y:b})}n.scroll=n.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){a.scroll.call(n,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:n.scrollX||n.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:n.scrollY||n.pageYOffset);return}w.call(n,s.body,arguments[0].left!==void 0?~~arguments[0].left:n.scrollX||n.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:n.scrollY||n.pageYOffset)}},n.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){a.scrollBy.call(n,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}w.call(n,s.body,~~arguments[0].left+(n.scrollX||n.pageXOffset),~~arguments[0].top+(n.scrollY||n.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");a.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}var f=arguments[0].left,v=arguments[0].top;w.call(this,this,typeof f=="undefined"?this.scrollLeft:~~f,typeof v=="undefined"?this.scrollTop:~~v)}},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){a.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){a.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}var f=A(this),v=f.getBoundingClientRect(),b=this.getBoundingClientRect();f!==s.body?(w.call(this,f,f.scrollLeft+b.left-v.left,f.scrollTop+b.top-v.top),n.getComputedStyle(f).position!=="fixed"&&n.scrollBy({left:v.left,top:v.top,behavior:"smooth"})):n.scrollBy({left:b.left,top:b.top,behavior:"smooth"})}}t.exports={polyfill:e}})()}),Ri=Vt.polyfill,Ze=function(t){Wt(e,t);var i=Nt(e);function e(){var n,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return G(this,e),n=i.call(this,s),n.resetNativeScroll&&(history.scrollRestoration&&(history.scrollRestoration="manual"),window.scrollTo(0,0)),window.addEventListener("scroll",n.checkScroll,!1),window.smoothscrollPolyfill===void 0&&(window.smoothscrollPolyfill=Vt,window.smoothscrollPolyfill.polyfill()),n}return Z(e,[{key:"init",value:function(){this.instance.scroll.y=window.pageYOffset,this.addElements(),this.detectElements(),B(M(e.prototype),"init",this).call(this)}},{key:"checkScroll",value:function(){var s=this;B(M(e.prototype),"checkScroll",this).call(this),this.getDirection&&this.addDirection(),this.getSpeed&&(this.addSpeed(),this.speedTs=Date.now()),this.instance.scroll.y=window.pageYOffset,Object.entries(this.els).length&&(this.hasScrollTicking||(requestAnimationFrame(function(){s.detectElements()}),this.hasScrollTicking=!0))}},{key:"addDirection",value:function(){window.pageYOffset>this.instance.scroll.y?this.instance.direction!=="down"&&(this.instance.direction="down"):window.pageYOffset<this.instance.scroll.y&&this.instance.direction!=="up"&&(this.instance.direction="up")}},{key:"addSpeed",value:function(){window.pageYOffset!=this.instance.scroll.y?this.instance.speed=(window.pageYOffset-this.instance.scroll.y)/Math.max(1,Date.now()-this.speedTs):this.instance.speed=0}},{key:"resize",value:function(){Object.entries(this.els).length&&(this.windowHeight=window.innerHeight,this.updateElements())}},{key:"addElements",value:function(){var s=this;this.els={};var r=this.el.querySelectorAll("[data-"+this.name+"]");r.forEach(function(o,a){var l=o.getBoundingClientRect(),h=o.dataset[s.name+"Class"]||s.class,d=typeof o.dataset[s.name+"Id"]=="string"?o.dataset[s.name+"Id"]:a,u,m,c=typeof o.dataset[s.name+"Offset"]=="string"?o.dataset[s.name+"Offset"].split(","):s.offset,p=o.dataset[s.name+"Repeat"],T=o.dataset[s.name+"Call"],L=o.dataset[s.name+"Target"],A;L!==void 0?A=document.querySelector("".concat(L)):A=o;var k=A.getBoundingClientRect();u=k.top+s.instance.scroll.y,m=k.left+s.instance.scroll.x;var w=u+A.offsetHeight,f=m+A.offsetWidth;p=="false"?p=!1:p!=null?p=!0:p=s.repeat;var v=s.getRelativeOffset(c);u=u+v[0],w=w-v[1];var b={el:o,targetEl:A,id:d,class:h,top:u,bottom:w,left:m,right:f,offset:c,progress:0,repeat:p,inView:!1,call:T};s.els[d]=b,o.classList.contains(h)&&s.setInView(s.els[d],d)})}},{key:"updateElements",value:function(){var s=this;Object.entries(this.els).forEach(function(r){var o=N(r,2),a=o[0],l=o[1],h=l.targetEl.getBoundingClientRect().top+s.instance.scroll.y,d=h+l.targetEl.offsetHeight,u=s.getRelativeOffset(l.offset);s.els[a].top=h+u[0],s.els[a].bottom=d-u[1]}),this.hasScrollTicking=!1}},{key:"getRelativeOffset",value:function(s){var r=[0,0];if(s)for(var o=0;o<s.length;o++)typeof s[o]=="string"?s[o].includes("%")?r[o]=parseInt(s[o].replace("%","")*this.windowHeight/100):r[o]=parseInt(s[o]):r[o]=s[o];return r}},{key:"scrollTo",value:function(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=parseInt(r.offset)||0,a=r.callback?r.callback:!1;if(typeof s=="string"){if(s==="top")s=this.html;else if(s==="bottom")s=this.html.offsetHeight-window.innerHeight;else if(s=document.querySelector(s),!s)return}else if(typeof s=="number")s=parseInt(s);else if(!(s&&s.tagName)){console.warn("`target` parameter is not valid");return}typeof s!="number"?o=s.getBoundingClientRect().top+o+this.instance.scroll.y:o=s+o;var l=function(){return parseInt(window.pageYOffset)===parseInt(o)};if(a)if(l()){a();return}else{var h=function d(){l()&&(window.removeEventListener("scroll",d),a())};window.addEventListener("scroll",h)}window.scrollTo({top:o,behavior:r.duration===0?"auto":"smooth"})}},{key:"update",value:function(){this.addElements(),this.detectElements()}},{key:"destroy",value:function(){B(M(e.prototype),"destroy",this).call(this),window.removeEventListener("scroll",this.checkScroll,!1)}}]),e}(Ft);var Kt=Object.getOwnPropertySymbols,Je=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable;function ti(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function ei(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var i={},e=0;e<10;e++)i["_"+String.fromCharCode(e)]=e;var n=Object.getOwnPropertyNames(i).map(function(r){return i[r]});if(n.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(r){s[r]=r}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(r){return!1}}var ii=ei()?Object.assign:function(t,i){for(var e,n=ti(t),s,r=1;r<arguments.length;r++){e=Object(arguments[r]);for(var o in e)Je.call(e,o)&&(n[o]=e[o]);if(Kt){s=Kt(e);for(var a=0;a<s.length;a++)Qe.call(e,s[a])&&(n[s[a]]=e[s[a]])}}return n};function $t(){}$t.prototype={on:function(t,i,e){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:i,ctx:e}),this},once:function(t,i,e){var n=this;function s(){n.off(t,s),i.apply(e,arguments)}return s._=i,this.on(t,s,e)},emit:function(t){var i=[].slice.call(arguments,1),e=((this.e||(this.e={}))[t]||[]).slice(),n=0,s=e.length;for(n;n<s;n++)e[n].fn.apply(e[n].ctx,i);return this},off:function(t,i){var e=this.e||(this.e={}),n=e[t],s=[];if(n&&i)for(var r=0,o=n.length;r<o;r++)n[r].fn!==i&&n[r].fn._!==i&&s.push(n[r]);return s.length?e[t]=s:delete e[t],this}};var si=$t,ni=Ut(function(t,i){(function(){var e;e=i!==null?i:this,e.Lethargy=function(){function n(s,r,o,a){this.stability=s!=null?Math.abs(s):8,this.sensitivity=r!=null?1+Math.abs(r):100,this.tolerance=o!=null?1+Math.abs(o):1.1,this.delay=a!=null?a:150,this.lastUpDeltas=function(){var l,h,d;for(d=[],l=1,h=this.stability*2;1<=h?l<=h:l>=h;1<=h?l++:l--)d.push(null);return d}.call(this),this.lastDownDeltas=function(){var l,h,d;for(d=[],l=1,h=this.stability*2;1<=h?l<=h:l>=h;1<=h?l++:l--)d.push(null);return d}.call(this),this.deltasTimestamp=function(){var l,h,d;for(d=[],l=1,h=this.stability*2;1<=h?l<=h:l>=h;1<=h?l++:l--)d.push(null);return d}.call(this)}return n.prototype.check=function(s){var r;return s=s.originalEvent||s,s.wheelDelta!=null?r=s.wheelDelta:s.deltaY!=null?r=s.deltaY*-40:(s.detail!=null||s.detail===0)&&(r=s.detail*-40),this.deltasTimestamp.push(Date.now()),this.deltasTimestamp.shift(),r>0?(this.lastUpDeltas.push(r),this.lastUpDeltas.shift(),this.isInertia(1)):(this.lastDownDeltas.push(r),this.lastDownDeltas.shift(),this.isInertia(-1))},n.prototype.isInertia=function(s){var r,o,a,l,h,d,u;return r=s===-1?this.lastDownDeltas:this.lastUpDeltas,r[0]===null?s:this.deltasTimestamp[this.stability*2-2]+this.delay>Date.now()&&r[0]===r[this.stability*2-1]?!1:(a=r.slice(0,this.stability),o=r.slice(this.stability,this.stability*2),u=a.reduce(function(m,c){return m+c}),h=o.reduce(function(m,c){return m+c}),d=u/a.length,l=h/o.length,Math.abs(d)<Math.abs(l*this.tolerance)&&this.sensitivity<Math.abs(l)?s:!1)},n.prototype.showLastUpDeltas=function(){return this.lastUpDeltas},n.prototype.showLastDownDeltas=function(){return this.lastDownDeltas},n}()}).call(Ge)}),x=function(){return{hasWheelEvent:"onwheel"in document,hasMouseWheelEvent:"onmousewheel"in document,hasTouch:"ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,hasTouchWin:navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints>1,hasPointer:!!window.navigator.msPointerEnabled,hasKeyDown:"onkeydown"in document,isFirefox:navigator.userAgent.indexOf("Firefox")>-1}}(),ri=Object.prototype.toString,oi=Object.prototype.hasOwnProperty,ai=function(t){if(!t)return console.warn("bindAll requires at least one argument.");var i=Array.prototype.slice.call(arguments,1);if(i.length===0)for(var e in t)oi.call(t,e)&&typeof t[e]=="function"&&ri.call(t[e])=="[object Function]"&&i.push(e);for(var n=0;n<i.length;n++){var s=i[n];t[s]=li(t[s],t)}};function li(t,i){return function(){return t.apply(i,arguments)}}var hi=ni.Lethargy,W="virtualscroll",ci=C,V={LEFT:37,UP:38,RIGHT:39,DOWN:40,SPACE:32};function C(t){ai(this,"_onWheel","_onMouseWheel","_onTouchStart","_onTouchMove","_onKeyDown"),this.el=window,t&&t.el&&(this.el=t.el,delete t.el),this.options=ii({mouseMultiplier:1,touchMultiplier:2,firefoxMultiplier:15,keyStep:120,preventTouch:!1,unpreventTouchClass:"vs-touchmove-allowed",limitInertia:!1,useKeyboard:!0,useTouch:!0},t),this.options.limitInertia&&(this._lethargy=new hi),this._emitter=new si,this._event={y:0,x:0,deltaX:0,deltaY:0},this.touchStartX=null,this.touchStartY=null,this.bodyTouchAction=null,this.options.passive!==void 0&&(this.listenerOptions={passive:this.options.passive})}C.prototype._notify=function(t){var i=this._event;i.x+=i.deltaX,i.y+=i.deltaY,this._emitter.emit(W,{x:i.x,y:i.y,deltaX:i.deltaX,deltaY:i.deltaY,originalEvent:t})};C.prototype._onWheel=function(t){var i=this.options;if(!(this._lethargy&&this._lethargy.check(t)===!1)){var e=this._event;e.deltaX=t.wheelDeltaX||t.deltaX*-1,e.deltaY=t.wheelDeltaY||t.deltaY*-1,x.isFirefox&&t.deltaMode==1&&(e.deltaX*=i.firefoxMultiplier,e.deltaY*=i.firefoxMultiplier),e.deltaX*=i.mouseMultiplier,e.deltaY*=i.mouseMultiplier,this._notify(t)}};C.prototype._onMouseWheel=function(t){if(!(this.options.limitInertia&&this._lethargy.check(t)===!1)){var i=this._event;i.deltaX=t.wheelDeltaX?t.wheelDeltaX:0,i.deltaY=t.wheelDeltaY?t.wheelDeltaY:t.wheelDelta,this._notify(t)}};C.prototype._onTouchStart=function(t){var i=t.targetTouches?t.targetTouches[0]:t;this.touchStartX=i.pageX,this.touchStartY=i.pageY};C.prototype._onTouchMove=function(t){var i=this.options;i.preventTouch&&!t.target.classList.contains(i.unpreventTouchClass)&&t.preventDefault();var e=this._event,n=t.targetTouches?t.targetTouches[0]:t;e.deltaX=(n.pageX-this.touchStartX)*i.touchMultiplier,e.deltaY=(n.pageY-this.touchStartY)*i.touchMultiplier,this.touchStartX=n.pageX,this.touchStartY=n.pageY,this._notify(t)};C.prototype._onKeyDown=function(t){var i=this._event;i.deltaX=i.deltaY=0;var e=window.innerHeight-40;switch(t.keyCode){case V.LEFT:case V.UP:i.deltaY=this.options.keyStep;break;case V.RIGHT:case V.DOWN:i.deltaY=-this.options.keyStep;break;case t.shiftKey:i.deltaY=e;break;case V.SPACE:i.deltaY=-e;break;default:return}this._notify(t)};C.prototype._bind=function(){x.hasWheelEvent&&this.el.addEventListener("wheel",this._onWheel,this.listenerOptions),x.hasMouseWheelEvent&&this.el.addEventListener("mousewheel",this._onMouseWheel,this.listenerOptions),x.hasTouch&&this.options.useTouch&&(this.el.addEventListener("touchstart",this._onTouchStart,this.listenerOptions),this.el.addEventListener("touchmove",this._onTouchMove,this.listenerOptions)),x.hasPointer&&x.hasTouchWin&&(this.bodyTouchAction=document.body.style.msTouchAction,document.body.style.msTouchAction="none",this.el.addEventListener("MSPointerDown",this._onTouchStart,!0),this.el.addEventListener("MSPointerMove",this._onTouchMove,!0)),x.hasKeyDown&&this.options.useKeyboard&&document.addEventListener("keydown",this._onKeyDown)};C.prototype._unbind=function(){x.hasWheelEvent&&this.el.removeEventListener("wheel",this._onWheel),x.hasMouseWheelEvent&&this.el.removeEventListener("mousewheel",this._onMouseWheel),x.hasTouch&&(this.el.removeEventListener("touchstart",this._onTouchStart),this.el.removeEventListener("touchmove",this._onTouchMove)),x.hasPointer&&x.hasTouchWin&&(document.body.style.msTouchAction=this.bodyTouchAction,this.el.removeEventListener("MSPointerDown",this._onTouchStart,!0),this.el.removeEventListener("MSPointerMove",this._onTouchMove,!0)),x.hasKeyDown&&this.options.useKeyboard&&document.removeEventListener("keydown",this._onKeyDown)};C.prototype.on=function(t,i){this._emitter.on(W,t,i);var e=this._emitter.e;e&&e[W]&&e[W].length===1&&this._bind()};C.prototype.off=function(t,i){this._emitter.off(W,t,i);var e=this._emitter.e;(!e[W]||e[W].length<=0)&&this._unbind()};C.prototype.reset=function(){var t=this._event;t.x=0,t.y=0};C.prototype.destroy=function(){this._emitter.off(),this._unbind()};function ut(t,i,e){return(1-e)*t+e*i}function D(t){var i={};if(!!window.getComputedStyle){var e=getComputedStyle(t),n=e.transform||e.webkitTransform||e.mozTransform,s=n.match(/^matrix3d\((.+)\)$/);return s?(i.x=s?parseFloat(s[1].split(", ")[12]):0,i.y=s?parseFloat(s[1].split(", ")[13]):0):(s=n.match(/^matrix\((.+)\)$/),i.x=s?parseFloat(s[1].split(", ")[4]):0,i.y=s?parseFloat(s[1].split(", ")[5]):0),i}}function dt(t){for(var i=[];t&&t!==document;t=t.parentNode)i.push(t);return i}var ui=4,di=.001,fi=1e-7,mi=10,K=11,J=1/(K-1),vi=typeof Float32Array=="function";function qt(t,i){return 1-3*i+3*t}function Xt(t,i){return 3*i-6*t}function Gt(t){return 3*t}function Q(t,i,e){return((qt(i,e)*t+Xt(i,e))*t+Gt(i))*t}function Zt(t,i,e){return 3*qt(i,e)*t*t+2*Xt(i,e)*t+Gt(i)}function pi(t,i,e,n,s){var r,o,a=0;do o=i+(e-i)/2,r=Q(o,n,s)-t,r>0?e=o:i=o;while(Math.abs(r)>fi&&++a<mi);return o}function yi(t,i,e,n){for(var s=0;s<ui;++s){var r=Zt(i,e,n);if(r===0)return i;var o=Q(i,e,n)-t;i-=o/r}return i}function gi(t){return t}var bi=function(i,e,n,s){if(!(0<=i&&i<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(i===e&&n===s)return gi;for(var r=vi?new Float32Array(K):new Array(K),o=0;o<K;++o)r[o]=Q(o*J,i,n);function a(l){for(var h=0,d=1,u=K-1;d!==u&&r[d]<=l;++d)h+=J;--d;var m=(l-r[d])/(r[d+1]-r[d]),c=h+m*J,p=Zt(c,i,n);return p>=di?yi(l,c,i,n):p===0?c:pi(l,h,h+J,i,n)}return function(h){return h===0?0:h===1?1:Q(a(h),e,s)}},j={LEFT:37,UP:38,RIGHT:39,DOWN:40,SPACE:32,TAB:9,PAGEUP:33,PAGEDOWN:34,HOME:36,END:35},wi=function(t){Wt(e,t);var i=Nt(e);function e(){var n,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return G(this,e),history.scrollRestoration&&(history.scrollRestoration="manual"),window.scrollTo(0,0),n=i.call(this,s),n.inertia&&(n.lerp=n.inertia*.1),n.isScrolling=!1,n.isDraggingScrollbar=!1,n.isTicking=!1,n.hasScrollTicking=!1,n.parallaxElements={},n.stop=!1,n.scrollbarContainer=s.scrollbarContainer,n.checkKey=n.checkKey.bind(zt(n)),window.addEventListener("keydown",n.checkKey,!1),n}return Z(e,[{key:"init",value:function(){var s=this;this.html.classList.add(this.smoothClass),this.html.setAttribute("data-".concat(this.name,"-direction"),this.direction),this.instance=lt({delta:{x:this.initPosition.x,y:this.initPosition.y},scroll:{x:this.initPosition.x,y:this.initPosition.y}},this.instance),this.vs=new ci({el:this.scrollFromAnywhere?document:this.el,mouseMultiplier:navigator.platform.indexOf("Win")>-1?1:.4,firefoxMultiplier:this.firefoxMultiplier,touchMultiplier:this.touchMultiplier,useKeyboard:!1,passive:!0}),this.vs.on(function(r){s.stop||s.isDraggingScrollbar||requestAnimationFrame(function(){s.updateDelta(r),s.isScrolling||s.startScrolling()})}),this.setScrollLimit(),this.initScrollBar(),this.addSections(),this.addElements(),this.checkScroll(!0),this.transformElements(!0,!0),B(M(e.prototype),"init",this).call(this)}},{key:"setScrollLimit",value:function(){if(this.instance.limit.y=this.el.offsetHeight-this.windowHeight,this.direction==="horizontal"){for(var s=0,r=this.el.children,o=0;o<r.length;o++)s+=r[o].offsetWidth;this.instance.limit.x=s-this.windowWidth}}},{key:"startScrolling",value:function(){this.startScrollTs=Date.now(),this.isScrolling=!0,this.checkScroll(),this.html.classList.add(this.scrollingClass)}},{key:"stopScrolling",value:function(){cancelAnimationFrame(this.checkScrollRaf),this.startScrollTs=void 0,this.scrollToRaf&&(cancelAnimationFrame(this.scrollToRaf),this.scrollToRaf=null),this.isScrolling=!1,this.instance.scroll.y=Math.round(this.instance.scroll.y),this.html.classList.remove(this.scrollingClass)}},{key:"checkKey",value:function(s){var r=this;if(this.stop){s.keyCode==j.TAB&&requestAnimationFrame(function(){r.html.scrollTop=0,document.body.scrollTop=0,r.html.scrollLeft=0,document.body.scrollLeft=0});return}switch(s.keyCode){case j.TAB:requestAnimationFrame(function(){r.html.scrollTop=0,document.body.scrollTop=0,r.html.scrollLeft=0,document.body.scrollLeft=0,r.scrollTo(document.activeElement,{offset:-window.innerHeight/2})});break;case j.UP:this.instance.delta[this.directionAxis]-=240;break;case j.DOWN:this.instance.delta[this.directionAxis]+=240;break;case j.PAGEUP:this.instance.delta[this.directionAxis]-=window.innerHeight;break;case j.PAGEDOWN:this.instance.delta[this.directionAxis]+=window.innerHeight;break;case j.HOME:this.instance.delta[this.directionAxis]-=this.instance.limit[this.directionAxis];break;case j.END:this.instance.delta[this.directionAxis]+=this.instance.limit[this.directionAxis];break;case j.SPACE:!(document.activeElement instanceof HTMLInputElement)&&!(document.activeElement instanceof HTMLTextAreaElement)&&(s.shiftKey?this.instance.delta[this.directionAxis]-=window.innerHeight:this.instance.delta[this.directionAxis]+=window.innerHeight);break;default:return}this.instance.delta[this.directionAxis]<0&&(this.instance.delta[this.directionAxis]=0),this.instance.delta[this.directionAxis]>this.instance.limit[this.directionAxis]&&(this.instance.delta[this.directionAxis]=this.instance.limit[this.directionAxis]),this.stopScrolling(),this.isScrolling=!0,this.checkScroll(),this.html.classList.add(this.scrollingClass)}},{key:"checkScroll",value:function(){var s=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(r||this.isScrolling||this.isDraggingScrollbar){this.hasScrollTicking||(this.checkScrollRaf=requestAnimationFrame(function(){return s.checkScroll()}),this.hasScrollTicking=!0),this.updateScroll();var o=Math.abs(this.instance.delta[this.directionAxis]-this.instance.scroll[this.directionAxis]),a=Date.now()-this.startScrollTs;if(!this.animatingScroll&&a>100&&(o<.5&&this.instance.delta[this.directionAxis]!=0||o<.5&&this.instance.delta[this.directionAxis]==0)&&this.stopScrolling(),Object.entries(this.sections).forEach(function(h){var d=N(h,2),u=d[0],m=d[1];m.persistent||s.instance.scroll[s.directionAxis]>m.offset[s.directionAxis]&&s.instance.scroll[s.directionAxis]<m.limit[s.directionAxis]?(s.direction==="horizontal"?s.transform(m.el,-s.instance.scroll[s.directionAxis],0):s.transform(m.el,0,-s.instance.scroll[s.directionAxis]),m.inView||(m.inView=!0,m.el.style.opacity=1,m.el.style.pointerEvents="all",m.el.setAttribute("data-".concat(s.name,"-section-inview"),""))):((m.inView||r)&&(m.inView=!1,m.el.style.opacity=0,m.el.style.pointerEvents="none",m.el.removeAttribute("data-".concat(s.name,"-section-inview"))),s.transform(m.el,0,0))}),this.getDirection&&this.addDirection(),this.getSpeed&&(this.addSpeed(),this.speedTs=Date.now()),this.detectElements(),this.transformElements(),this.hasScrollbar){var l=this.instance.scroll[this.directionAxis]/this.instance.limit[this.directionAxis]*this.scrollBarLimit[this.directionAxis];this.direction==="horizontal"?this.transform(this.scrollbarThumb,l,0):this.transform(this.scrollbarThumb,0,l)}B(M(e.prototype),"checkScroll",this).call(this),this.hasScrollTicking=!1}}},{key:"resize",value:function(){this.windowHeight=window.innerHeight,this.windowWidth=window.innerWidth,this.checkContext(),this.windowMiddle={x:this.windowWidth/2,y:this.windowHeight/2},this.update()}},{key:"updateDelta",value:function(s){var r,o=this[this.context]&&this[this.context].gestureDirection?this[this.context].gestureDirection:this.gestureDirection;o==="both"?r=s.deltaX+s.deltaY:o==="vertical"?r=s.deltaY:o==="horizontal"?r=s.deltaX:r=s.deltaY,this.instance.delta[this.directionAxis]-=r*this.multiplier,this.instance.delta[this.directionAxis]<0&&(this.instance.delta[this.directionAxis]=0),this.instance.delta[this.directionAxis]>this.instance.limit[this.directionAxis]&&(this.instance.delta[this.directionAxis]=this.instance.limit[this.directionAxis])}},{key:"updateScroll",value:function(s){this.isScrolling||this.isDraggingScrollbar?this.instance.scroll[this.directionAxis]=ut(this.instance.scroll[this.directionAxis],this.instance.delta[this.directionAxis],this.lerp):this.instance.scroll[this.directionAxis]>this.instance.limit[this.directionAxis]?this.setScroll(this.instance.scroll[this.directionAxis],this.instance.limit[this.directionAxis]):this.instance.scroll.y<0?this.setScroll(this.instance.scroll[this.directionAxis],0):this.setScroll(this.instance.scroll[this.directionAxis],this.instance.delta[this.directionAxis])}},{key:"addDirection",value:function(){this.instance.delta.y>this.instance.scroll.y?this.instance.direction!=="down"&&(this.instance.direction="down"):this.instance.delta.y<this.instance.scroll.y&&this.instance.direction!=="up"&&(this.instance.direction="up"),this.instance.delta.x>this.instance.scroll.x?this.instance.direction!=="right"&&(this.instance.direction="right"):this.instance.delta.x<this.instance.scroll.x&&this.instance.direction!=="left"&&(this.instance.direction="left")}},{key:"addSpeed",value:function(){this.instance.delta[this.directionAxis]!=this.instance.scroll[this.directionAxis]?this.instance.speed=(this.instance.delta[this.directionAxis]-this.instance.scroll[this.directionAxis])/Math.max(1,Date.now()-this.speedTs):this.instance.speed=0}},{key:"initScrollBar",value:function(){if(this.scrollbar=document.createElement("span"),this.scrollbarThumb=document.createElement("span"),this.scrollbar.classList.add("".concat(this.scrollbarClass)),this.scrollbarThumb.classList.add("".concat(this.scrollbarClass,"_thumb")),this.scrollbar.append(this.scrollbarThumb),this.scrollbarContainer?this.scrollbarContainer.append(this.scrollbar):document.body.append(this.scrollbar),this.getScrollBar=this.getScrollBar.bind(this),this.releaseScrollBar=this.releaseScrollBar.bind(this),this.moveScrollBar=this.moveScrollBar.bind(this),this.scrollbarThumb.addEventListener("mousedown",this.getScrollBar),window.addEventListener("mouseup",this.releaseScrollBar),window.addEventListener("mousemove",this.moveScrollBar),this.hasScrollbar=!1,this.direction=="horizontal"){if(this.instance.limit.x+this.windowWidth<=this.windowWidth)return}else if(this.instance.limit.y+this.windowHeight<=this.windowHeight)return;this.hasScrollbar=!0,this.scrollbarBCR=this.scrollbar.getBoundingClientRect(),this.scrollbarHeight=this.scrollbarBCR.height,this.scrollbarWidth=this.scrollbarBCR.width,this.direction==="horizontal"?this.scrollbarThumb.style.width="".concat(this.scrollbarWidth*this.scrollbarWidth/(this.instance.limit.x+this.scrollbarWidth),"px"):this.scrollbarThumb.style.height="".concat(this.scrollbarHeight*this.scrollbarHeight/(this.instance.limit.y+this.scrollbarHeight),"px"),this.scrollbarThumbBCR=this.scrollbarThumb.getBoundingClientRect(),this.scrollBarLimit={x:this.scrollbarWidth-this.scrollbarThumbBCR.width,y:this.scrollbarHeight-this.scrollbarThumbBCR.height}}},{key:"reinitScrollBar",value:function(){if(this.hasScrollbar=!1,this.direction=="horizontal"){if(this.instance.limit.x+this.windowWidth<=this.windowWidth)return}else if(this.instance.limit.y+this.windowHeight<=this.windowHeight)return;this.hasScrollbar=!0,this.scrollbarBCR=this.scrollbar.getBoundingClientRect(),this.scrollbarHeight=this.scrollbarBCR.height,this.scrollbarWidth=this.scrollbarBCR.width,this.direction==="horizontal"?this.scrollbarThumb.style.width="".concat(this.scrollbarWidth*this.scrollbarWidth/(this.instance.limit.x+this.scrollbarWidth),"px"):this.scrollbarThumb.style.height="".concat(this.scrollbarHeight*this.scrollbarHeight/(this.instance.limit.y+this.scrollbarHeight),"px"),this.scrollbarThumbBCR=this.scrollbarThumb.getBoundingClientRect(),this.scrollBarLimit={x:this.scrollbarWidth-this.scrollbarThumbBCR.width,y:this.scrollbarHeight-this.scrollbarThumbBCR.height}}},{key:"destroyScrollBar",value:function(){this.scrollbarThumb.removeEventListener("mousedown",this.getScrollBar),window.removeEventListener("mouseup",this.releaseScrollBar),window.removeEventListener("mousemove",this.moveScrollBar),this.scrollbar.remove()}},{key:"getScrollBar",value:function(s){this.isDraggingScrollbar=!0,this.checkScroll(),this.html.classList.remove(this.scrollingClass),this.html.classList.add(this.draggingClass)}},{key:"releaseScrollBar",value:function(s){this.isDraggingScrollbar=!1,this.isScrolling&&this.html.classList.add(this.scrollingClass),this.html.classList.remove(this.draggingClass)}},{key:"moveScrollBar",value:function(s){var r=this;this.isDraggingScrollbar&&requestAnimationFrame(function(){var o=(s.clientX-r.scrollbarBCR.left)*100/r.scrollbarWidth*r.instance.limit.x/100,a=(s.clientY-r.scrollbarBCR.top)*100/r.scrollbarHeight*r.instance.limit.y/100;a>0&&a<r.instance.limit.y&&(r.instance.delta.y=a),o>0&&o<r.instance.limit.x&&(r.instance.delta.x=o)})}},{key:"addElements",value:function(){var s=this;this.els={},this.parallaxElements={};var r=this.el.querySelectorAll("[data-".concat(this.name,"]"));r.forEach(function(o,a){var l=dt(o),h=Object.entries(s.sections).map(function(it){var gt=N(it,2),Ei=gt[0],re=gt[1];return re}).find(function(it){return l.includes(it.el)}),d=o.dataset[s.name+"Class"]||s.class,u=typeof o.dataset[s.name+"Id"]=="string"?o.dataset[s.name+"Id"]:"el"+a,m,c,p=o.dataset[s.name+"Repeat"],T=o.dataset[s.name+"Call"],L=o.dataset[s.name+"Position"],A=o.dataset[s.name+"Delay"],k=o.dataset[s.name+"Direction"],w=typeof o.dataset[s.name+"Sticky"]=="string",f=o.dataset[s.name+"Speed"]?parseFloat(o.dataset[s.name+"Speed"])/10:!1,v=typeof o.dataset[s.name+"Offset"]=="string"?o.dataset[s.name+"Offset"].split(","):s.offset,b=o.dataset[s.name+"Target"],y;b!==void 0?y=document.querySelector("".concat(b)):y=o;var _=y.getBoundingClientRect();h===null||h.inView?(m=_.top+s.instance.scroll.y-D(y).y,c=_.left+s.instance.scroll.x-D(y).x):(m=_.top-D(h.el).y-D(y).y,c=_.left-D(h.el).x-D(y).x);var g=m+y.offsetHeight,S=c+y.offsetWidth,R={x:(S-c)/2+c,y:(g-m)/2+m};if(w){var et=o.getBoundingClientRect(),$=et.top,vt=et.left,pt={x:vt-c,y:$-m};m+=window.innerHeight,c+=window.innerWidth,g=$+y.offsetHeight-o.offsetHeight-pt[s.directionAxis],S=vt+y.offsetWidth-o.offsetWidth-pt[s.directionAxis],R={x:(S-c)/2+c,y:(g-m)/2+m}}p=="false"?p=!1:p!=null?p=!0:p=s.repeat;var I=[0,0];if(v)if(s.direction==="horizontal"){for(var E=0;E<v.length;E++)typeof v[E]=="string"?v[E].includes("%")?I[E]=parseInt(v[E].replace("%","")*s.windowWidth/100):I[E]=parseInt(v[E]):I[E]=v[E];c=c+I[0],S=S-I[1]}else{for(var E=0;E<v.length;E++)typeof v[E]=="string"?v[E].includes("%")?I[E]=parseInt(v[E].replace("%","")*s.windowHeight/100):I[E]=parseInt(v[E]):I[E]=v[E];m=m+I[0],g=g-I[1]}var yt={el:o,id:u,class:d,section:h,top:m,middle:R,bottom:g,left:c,right:S,offset:v,progress:0,repeat:p,inView:!1,call:T,speed:f,delay:A,position:L,target:y,direction:k,sticky:w};s.els[u]=yt,o.classList.contains(d)&&s.setInView(s.els[u],u),(f!==!1||w)&&(s.parallaxElements[u]=yt)})}},{key:"addSections",value:function(){var s=this;this.sections={};var r=this.el.querySelectorAll("[data-".concat(this.name,"-section]"));r.length===0&&(r=[this.el]),r.forEach(function(o,a){var l=typeof o.dataset[s.name+"Id"]=="string"?o.dataset[s.name+"Id"]:"section"+a,h=o.getBoundingClientRect(),d={x:h.left-window.innerWidth*1.5-D(o).x,y:h.top-window.innerHeight*1.5-D(o).y},u={x:d.x+h.width+window.innerWidth*2,y:d.y+h.height+window.innerHeight*2},m=typeof o.dataset[s.name+"Persistent"]=="string";o.setAttribute("data-scroll-section-id",l);var c={el:o,offset:d,limit:u,inView:!1,persistent:m,id:l};s.sections[l]=c})}},{key:"transform",value:function(s,r,o,a){var l;if(!a)l="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0,".concat(r,",").concat(o,",0,1)");else{var h=D(s),d=ut(h.x,r,a),u=ut(h.y,o,a);l="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0,".concat(d,",").concat(u,",0,1)")}s.style.webkitTransform=l,s.style.msTransform=l,s.style.transform=l}},{key:"transformElements",value:function(s){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.instance.scroll.x+this.windowWidth,l=this.instance.scroll.y+this.windowHeight,h={x:this.instance.scroll.x+this.windowMiddle.x,y:this.instance.scroll.y+this.windowMiddle.y};Object.entries(this.parallaxElements).forEach(function(d){var u=N(d,2),m=u[0],c=u[1],p=!1;if(s&&(p=0),c.inView||o)switch(c.position){case"top":p=r.instance.scroll[r.directionAxis]*-c.speed;break;case"elementTop":p=(l-c.top)*-c.speed;break;case"bottom":p=(r.instance.limit[r.directionAxis]-l+r.windowHeight)*c.speed;break;case"left":p=r.instance.scroll[r.directionAxis]*-c.speed;break;case"elementLeft":p=(a-c.left)*-c.speed;break;case"right":p=(r.instance.limit[r.directionAxis]-a+r.windowHeight)*c.speed;break;default:p=(h[r.directionAxis]-c.middle[r.directionAxis])*-c.speed;break}c.sticky&&(c.inView?r.direction==="horizontal"?p=r.instance.scroll.x-c.left+window.innerWidth:p=r.instance.scroll.y-c.top+window.innerHeight:r.direction==="horizontal"?r.instance.scroll.x<c.left-window.innerWidth&&r.instance.scroll.x<c.left-window.innerWidth/2?p=0:r.instance.scroll.x>c.right&&r.instance.scroll.x>c.right+100?p=c.right-c.left+window.innerWidth:p=!1:r.instance.scroll.y<c.top-window.innerHeight&&r.instance.scroll.y<c.top-window.innerHeight/2?p=0:r.instance.scroll.y>c.bottom&&r.instance.scroll.y>c.bottom+100?p=c.bottom-c.top+window.innerHeight:p=!1),p!==!1&&(c.direction==="horizontal"||r.direction==="horizontal"&&c.direction!=="vertical"?r.transform(c.el,p,0,s?!1:c.delay):r.transform(c.el,0,p,s?!1:c.delay))})}},{key:"scrollTo",value:function(s){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=parseInt(o.offset)||0,l=isNaN(parseInt(o.duration))?1e3:parseInt(o.duration),h=o.easing||[.25,0,.35,1],d=!!o.disableLerp,u=o.callback?o.callback:!1;if(h=bi.apply(void 0,Fe(h)),typeof s=="string"){if(s==="top")s=0;else if(s==="bottom")s=this.instance.limit.y;else if(s==="left")s=0;else if(s==="right")s=this.instance.limit.x;else if(s=document.querySelector(s),!s)return}else if(typeof s=="number")s=parseInt(s);else if(!(s&&s.tagName)){console.warn("`target` parameter is not valid");return}if(typeof s!="number"){var m=dt(s).includes(this.el);if(!m)return;var c=s.getBoundingClientRect(),p=c.top,T=c.left,L=dt(s),A=L.find(function(g){return Object.entries(r.sections).map(function(S){var R=N(S,2),et=R[0],$=R[1];return $}).find(function(S){return S.el==g})}),k=0;A?k=D(A)[this.directionAxis]:k=-this.instance.scroll[this.directionAxis],this.direction==="horizontal"?a=T+a-k:a=p+a-k}else a=s+a;var w=parseFloat(this.instance.delta[this.directionAxis]),f=Math.max(0,Math.min(a,this.instance.limit[this.directionAxis])),v=f-w,b=function(S){d?r.direction==="horizontal"?r.setScroll(w+v*S,r.instance.delta.y):r.setScroll(r.instance.delta.x,w+v*S):r.instance.delta[r.directionAxis]=w+v*S};this.animatingScroll=!0,this.stopScrolling(),this.startScrolling();var y=Date.now(),_=function g(){var S=(Date.now()-y)/l;S>1?(b(1),r.animatingScroll=!1,l==0&&r.update(),u&&u()):(r.scrollToRaf=requestAnimationFrame(g),b(h(S)))};_()}},{key:"update",value:function(){this.setScrollLimit(),this.addSections(),this.addElements(),this.detectElements(),this.updateScroll(),this.transformElements(!0),this.reinitScrollBar(),this.checkScroll(!0)}},{key:"startScroll",value:function(){this.stop=!1}},{key:"stopScroll",value:function(){this.stop=!0}},{key:"setScroll",value:function(s,r){this.instance=lt(lt({},this.instance),{},{scroll:{x:s,y:r},delta:{x:s,y:r},speed:0})}},{key:"destroy",value:function(){B(M(e.prototype),"destroy",this).call(this),this.stopScrolling(),this.html.classList.remove(this.smoothClass),this.vs.destroy(),this.destroyScrollBar(),window.removeEventListener("keydown",this.checkKey,!1)}}]),e}(Ft),Si=function(){function t(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};G(this,t),this.options=i,Object.assign(this,Y,i),this.smartphone=Y.smartphone,i.smartphone&&Object.assign(this.smartphone,i.smartphone),this.tablet=Y.tablet,i.tablet&&Object.assign(this.tablet,i.tablet),!this.smooth&&this.direction=="horizontal"&&console.warn("\u{1F6A8} `smooth:false` & `horizontal` direction are not yet compatible"),!this.tablet.smooth&&this.tablet.direction=="horizontal"&&console.warn("\u{1F6A8} `smooth:false` & `horizontal` direction are not yet compatible (tablet)"),!this.smartphone.smooth&&this.smartphone.direction=="horizontal"&&console.warn("\u{1F6A8} `smooth:false` & `horizontal` direction are not yet compatible (smartphone)"),this.init()}return Z(t,[{key:"init",value:function(){if(this.options.isMobile=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1||window.innerWidth<this.tablet.breakpoint,this.options.isTablet=this.options.isMobile&&window.innerWidth>=this.tablet.breakpoint,this.smooth&&!this.options.isMobile||this.tablet.smooth&&this.options.isTablet||this.smartphone.smooth&&this.options.isMobile&&!this.options.isTablet?this.scroll=new wi(this.options):this.scroll=new Ze(this.options),this.scroll.init(),window.location.hash){var e=window.location.hash.slice(1,window.location.hash.length),n=document.getElementById(e);n&&this.scroll.scrollTo(n)}}},{key:"update",value:function(){this.scroll.update()}},{key:"start",value:function(){this.scroll.startScroll()}},{key:"stop",value:function(){this.scroll.stopScroll()}},{key:"scrollTo",value:function(e,n){this.scroll.scrollTo(e,n)}},{key:"setScroll",value:function(e,n){this.scroll.setScroll(e,n)}},{key:"on",value:function(e,n){this.scroll.setEvents(e,n)}},{key:"off",value:function(e,n){this.scroll.unsetEvents(e,n)}},{key:"destroy",value:function(){this.scroll.destroy()}}]),t}();var Jt=Si;var ft=class extends z{constructor(t){super(t)}init(){this.scroll=new Jt({el:this.el,smooth:!0}),this.scroll.on("call",(t,i,e,n)=>{this.call(t[0],{way:i,obj:e},t[1],t[2])}),this.scroll.on("scroll",t=>{})}lazyLoad(t){jt(t.obj.el,null,()=>{})}destroy(){this.scroll.destroy()}};var ee=me(te());function ie(){(0,ee.default)()}var se=new Ot({modules:mt});window.onload=t=>{let i=document.getElementById("main-css");i?i.isLoaded?ne():i.addEventListener("load",e=>{ne()}):console.warn('The "main-css" stylesheet not found')};function ne(){ie(),se.init(se),H.classList.add("is-loaded"),H.classList.add("is-ready"),H.classList.remove("is-loading")}})();
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */
//# sourceMappingURL=app.js.map