mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
Updated: - autoprefixer v10.4.13 → v10.4.17 - esbuild v0.17.6 → →0.20.0 - locomotive-scroll v5.0.0-beta.9 → v5.0.0-beta.11 - sass v1.69.5 → v1.70.0
11 lines
55 KiB
JavaScript
11 lines
55 KiB
JavaScript
(()=>{var Yt=Object.create;var D=Object.defineProperty;var Xt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames,P=Object.getOwnPropertySymbols,Kt=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var ut=(s,e,t)=>e in s?D(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,ft=(s,e)=>{for(var t in e||(e={}))Z.call(e,t)&&ut(s,t,e[t]);if(P)for(var t of P(e))dt.call(e,t)&&ut(s,t,e[t]);return s};var mt=(s,e)=>{var t={};for(var i in s)Z.call(s,i)&&e.indexOf(i)<0&&(t[i]=s[i]);if(s!=null&&P)for(var i of P(s))e.indexOf(i)<0&&dt.call(s,i)&&(t[i]=s[i]);return t};var Jt=(s,e)=>()=>(s&&(e=s(s=0)),e);var Qt=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),pt=(s,e)=>{for(var t in e)D(s,t,{get:e[t],enumerable:!0})},te=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Zt(e))!Z.call(s,n)&&n!==t&&D(s,n,{get:()=>e[n],enumerable:!(i=Xt(e,n))||i.enumerable});return s};var ee=(s,e,t)=>(t=s!=null?Yt(Kt(s)):{},te(e||!s||!s.__esModule?D(t,"default",{value:s,enumerable:!0}):t,s));var E=(s,e,t)=>new Promise((i,n)=>{var r=a=>{try{l(t.next(a))}catch(h){n(h)}},o=a=>{try{l(t.throw(a))}catch(h){n(h)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(r,o);l((t=t.apply(s,e)).next())});var $t=Qt((Ft,Y)=>{(function(s,e){typeof define=="function"&&define.amd?define([],function(){return s.svg4everybody=e()}):typeof Y=="object"&&Y.exports?Y.exports=e():s.svg4everybody=e()})(Ft,function(){function s(n,r,o){if(o){var l=document.createDocumentFragment(),a=!r.hasAttribute("viewBox")&&o.getAttribute("viewBox");a&&r.setAttribute("viewBox",a);for(var h=o.cloneNode(!0);h.childNodes.length;)l.appendChild(h.firstChild);n.appendChild(l)}}function e(n){n.onreadystatechange=function(){if(n.readyState===4){var r=n._cachedDocument;r||(r=n._cachedDocument=document.implementation.createHTMLDocument(""),r.body.innerHTML=n.responseText,n._cachedTarget={}),n._embeds.splice(0).map(function(o){var l=n._cachedTarget[o.id];l||(l=n._cachedTarget[o.id]=r.getElementById(o.id)),s(o.parent,o.svg,l)})}},n.onreadystatechange()}function t(n){function r(){for(var _=0;_<y.length;){var b=y[_],O=b.parentNode,I=i(O),m=b.getAttribute("xlink:href")||b.getAttribute("href");if(!m&&l.attributeName&&(m=b.getAttribute(l.attributeName)),I&&m){if(o)if(!l.validate||l.validate(m,I,b)){O.removeChild(b);var w=m.split("#"),v=w.shift(),C=w.join("#");if(v.length){var g=f[v];g||(g=f[v]=new XMLHttpRequest,g.open("GET",v),g.send(),g._embeds=[]),g._embeds.push({parent:O,svg:I,id:C}),e(g)}else s(O,I,document.getElementById(C))}else++_,++L}else++_}(!y.length||y.length-L>0)&&p(r,67)}var o,l=Object(n),a=/\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/,h=/\bAppleWebKit\/(\d+)\b/,c=/\bEdge\/12\.(\d+)\b/,u=/\bEdge\/.(\d+)\b/,d=window.top!==window.self;o="polyfill"in l?l.polyfill:a.test(navigator.userAgent)||(navigator.userAgent.match(c)||[])[1]<10547||(navigator.userAgent.match(h)||[])[1]<537||u.test(navigator.userAgent)&&d;var f={},p=window.requestAnimationFrame||setTimeout,y=document.getElementsByTagName("use"),L=0;o&&r()}function i(n){for(var r=n;r.nodeName.toLowerCase()!=="svg"&&(r=r.parentNode););return r}return t})});var Nt={};pt(Nt,{gridHelper:()=>Me});function Me({gutterCssVar:s=Ie,marginCssVar:e=Te,rgbaColor:t=Ae}={}){let i=document.createElement("div");document.body.append(i),Ut(i,t),Re(i,s,e),ke(i,t)}function Re(s,e,t){let i=s.style;i.zIndex="10000",i.position="fixed",i.top="0",i.left="0",i.display="flex",i.width="100%",i.height="100%",i.columnGap=`var(${e}, 0)`,i.paddingLeft=`var(${t}, 0)`,i.paddingRight=`var(${t}, 0)`,i.pointerEvents="none",i.visibility="hidden"}function Ut(s,e){s.innerHTML="";let t=Number(window.getComputedStyle(s).getPropertyValue("--grid-columns")),i;for(var n=0;n<t;n++)i=document.createElement("div"),i.style.flex="1 1 0",i.style.backgroundColor=e,s.appendChild(i)}function ke(s,e){window.addEventListener("resize",Ut(s,e));let t=!1,i=!1;document.addEventListener("keydown",n=>{n.key=="Control"?t=!0:t&&n.key=="g"&&(i?s.style.visibility="hidden":s.style.visibility="visible",i=!i)}),document.addEventListener("keyup",n=>{n.key=="Control"&&(t=!1)})}var Ie,Te,Ae,jt=Jt(()=>{Ie="--grid-gutter",Te="--grid-margin",Ae="rgba(255, 0, 0, .1)"});function F(s){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?F=function(e){return typeof e}:F=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(s)}function yt(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function vt(s,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(s,i.key,i)}}function bt(s,e,t){return e&&vt(s.prototype,e),t&&vt(s,t),s}function gt(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function x(s,e){return ne(s)||oe(s,e)||wt(s,e)||ae()}function ie(s){return se(s)||re(s)||wt(s)||le()}function se(s){if(Array.isArray(s))return K(s)}function ne(s){if(Array.isArray(s))return s}function re(s){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(s))return Array.from(s)}function oe(s,e){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(s)))){var t=[],i=!0,n=!1,r=void 0;try{for(var o=s[Symbol.iterator](),l;!(i=(l=o.next()).done)&&(t.push(l.value),!(e&&t.length===e));i=!0);}catch(a){n=!0,r=a}finally{try{!i&&o.return!=null&&o.return()}finally{if(n)throw r}}return t}}function wt(s,e){if(s){if(typeof s=="string")return K(s,e);var t=Object.prototype.toString.call(s).slice(8,-1);if(t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set")return Array.from(s);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return K(s,e)}}function K(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=s[t];return i}function le(){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 ae(){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 A=function(){function s(e){yt(this,s),this.mAttr="data-"+e.dataName,this.mCaptureEvents=["mouseenter","mouseleave"],this.el=e.el}return bt(s,[{key:"mInit",value:function(t){var i=this;this.modules=t,this.mCheckEventTarget=this.mCheckEventTarget.bind(this),this.events&&Object.keys(this.events).forEach(function(n){return i.mAddEvent(n)})}},{key:"mUpdate",value:function(t){this.modules=t}},{key:"mDestroy",value:function(){var t=this;this.events&&Object.keys(this.events).forEach(function(i){return t.mRemoveEvent(i)})}},{key:"mAddEvent",value:function(t){var i=!!this.mCaptureEvents.includes(t);this.el.addEventListener(t,this.mCheckEventTarget,i)}},{key:"mRemoveEvent",value:function(t){var i=!!this.mCaptureEvents.includes(t);this.el.removeEventListener(t,this.mCheckEventTarget,i)}},{key:"mCheckEventTarget",value:function(t){var i=this.events[t.type];if(typeof i=="string")this[i](t);else{var n="["+this.mAttr+"]",r=t.target;if(this.mCaptureEvents.includes(t.type))r.matches(n)&&this.mCallEventMethod(t,i,r);else for(;r&&r!==document&&!(r.matches(n)&&this.mCallEventMethod(t,i,r)!="undefined");)r=r.parentNode}}},{key:"mCallEventMethod",value:function(t,i,n){var r=n.getAttribute(this.mAttr);if(i.hasOwnProperty(r)){var o=i[r];t.hasOwnProperty("currentTarget")||Object.defineProperty(t,"currentTarget",{value:n}),t.hasOwnProperty("curTarget")||Object.defineProperty(t,"curTarget",{value:n}),this[o](t)}}},{key:"$",value:function(t,i){var n=t.indexOf("."),r=t.indexOf("#"),o=t.indexOf("["),l=[n,r,o].filter(function(d){return d!=-1}),a=!1,h=t,c="",u=this.el;return l.length&&(a=Math.min.apply(Math,ie(l)),h=t.slice(0,a),c=t.slice(a)),F(i)=="object"&&(u=i),u.querySelectorAll("["+this.mAttr+"="+h+"]"+c)}},{key:"parent",value:function(t,i){for(var n="["+this.mAttr+"="+t+"]",r=i.parentNode;r&&r!==document;){if(r.matches(n))return r;r=r.parentNode}}},{key:"getData",value:function(t,i){var n=i||this.el;return n.getAttribute(this.mAttr+"-"+t)}},{key:"setData",value:function(t,i,n){var r=n||this.el;return r.setAttribute(this.mAttr+"-"+t,i)}},{key:"call",value:function(t,i,n,r){var o=this;i&&!n&&(n=i,i=!1),this.modules[n]&&(r?this.modules[n][r]&&this.modules[n][r][t](i):Object.keys(this.modules[n]).forEach(function(l){o.modules[n][l][t](i)}))}},{key:"on",value:function(t,i,n,r){var o=this;this.modules[i]&&(r?this.modules[i][r].el.addEventListener(t,function(l){return n(l)}):Object.keys(this.modules[i]).forEach(function(l){o.modules[i][l].el.addEventListener(t,function(a){return n(a)})}))}},{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),s}(),he=function(){function s(e){yt(this,s),this.app,this.modules=e.modules,this.currentModules={},this.activeModules={},this.newModules={},this.moduleId=0}return bt(s,[{key:"init",value:function(t,i){var n=this,r=i||document,o=r.querySelectorAll("*");t&&!this.app&&(this.app=t),this.activeModules.app={app:this.app},o.forEach(function(l){Array.from(l.attributes).forEach(function(a){if(a.name.startsWith("data-module")){var h=!1,c=a.name.split("-").splice(2),u=n.toCamel(c);if(n.modules[u]?h=!0:n.modules[n.toUpper(u)]&&(u=n.toUpper(u),h=!0),h){var d={el:l,name:u,dataName:c.join("-")},f=new n.modules[u](d),p=a.value;p||(n.moduleId++,p="m"+n.moduleId,l.setAttribute(a.name,p)),n.addActiveModule(u,p,f);var y=u+"-"+p;i?n.newModules[y]=f:n.currentModules[y]=f}}})}),Object.entries(this.currentModules).forEach(function(l){var a=x(l,2),h=a[0],c=a[1];if(i){var u=h.split("-"),d=u.shift(),f=u.pop();n.addActiveModule(d,f,c)}else n.initModule(c)})}},{key:"initModule",value:function(t){t.mInit(this.activeModules),t.init()}},{key:"addActiveModule",value:function(t,i,n){this.activeModules[t]?Object.assign(this.activeModules[t],gt({},i,n)):this.activeModules[t]=gt({},i,n)}},{key:"update",value:function(t){var i=this;this.init(this.app,t),Object.entries(this.currentModules).forEach(function(n){var r=x(n,2),o=r[0],l=r[1];l.mUpdate(i.activeModules)}),Object.entries(this.newModules).forEach(function(n){var r=x(n,2),o=r[0],l=r[1];i.initModule(l)}),Object.assign(this.currentModules,this.newModules)}},{key:"destroy",value:function(t){t?this.destroyScope(t):this.destroyModules()}},{key:"destroyScope",value:function(t){var i=this,n=t.querySelectorAll("*");n.forEach(function(r){Array.from(r.attributes).forEach(function(o){if(o.name.startsWith("data-module")){var l=o.value,a=o.name.split("-").splice(2),h=i.toCamel(a)+"-"+l,c=!1;i.currentModules[h]?c=!0:i.currentModules[i.toUpper(h)]&&(h=i.toUpper(h),c=!0),c&&(i.destroyModule(i.currentModules[h]),delete i.currentModules[h])}})}),this.activeModules={},this.newModules={}}},{key:"destroyModules",value:function(){var t=this;Object.entries(this.currentModules).forEach(function(i){var n=x(i,2),r=n[0],o=n[1];t.destroyModule(o)}),this.currentModules=[]}},{key:"destroyModule",value:function(t){t.mDestroy(),t.destroy()}},{key:"toCamel",value:function(t){var i=this;return t.reduce(function(n,r){return n+i.toUpper(r)})}},{key:"toUpper",value:function(t){return t.charAt(0).toUpperCase()+t.slice(1)}}]),s}(),Et=he;var lt={};pt(lt,{Example:()=>N,Load:()=>j,Scroll:()=>G});var J="production",St=window.matchMedia("(any-pointer:coarse)").matches,M=Object.freeze({NAME:J,IS_PROD:J==="production",IS_DEV:J==="development",IS_MOBILE:St,IS_DESKTOP:!St,SUPPORTS_VH:"CSS"in window&&"supports"in window.CSS&&window.CSS.supports("height: 100svh")&&window.CSS.supports("height: 100dvh")&&window.CSS.supports("height: 100lvh")}),S=Object.freeze({LOADING:"is-loading",LOADED:"is-loaded",READY:"is-ready",FONTS_LOADED:"fonts-loaded",LAZY_CONTAINER:"c-lazy",LAZY_LOADED:"-lazy-loaded"}),Ct=Object.freeze({RESIZE_END:"loco.resizeEnd"}),$=Object.freeze({EAGER:[{family:"Source Sans",style:"normal",weight:400},{family:"Source Sans",style:"normal",weight:700}]});var Ot="fonts"in document;function ce(s,e){for(let[t,i]of Object.entries(e))switch(t){case"family":{if(U(s[t])!==i)return!1;break}case"weight":{if(s[t]!=i)return!1;break}default:{if(s[t]!==i)return!1;break}}return!0}function ue(s,e){let t=U(s.family);return U(t)===e||e.endsWith(U(t))&&(e.match(s.weight)||e.match(s.style)),!0}function de(s){let e=[];for(let t of document.fonts)ce(t,s)&&e.push(t);return e}function fe(s){let e=[];for(let t of document.fonts)ue(t,s)&&e.push(t);return e}function It(s){Array.isArray(s)||(s=[s]);let e=new Set;return s.forEach(t=>{if(t)switch(typeof t){case"string":e.add(...fe(t));return;case"object":e.add(...de(t));return}throw new TypeError("Expected font query to be font shorthand or font reference")}),[...e]}function Tt(s,e=!1){return E(this,null,function*(){var t;if(((t=s.size)!=null?t:s.length)===0)throw new TypeError("Expected at least one font");return yield me([...s],e)})}function _t(s){return E(this,null,function*(){return yield(s.status==="unloaded"?s.load():s.loaded).then(e=>e,e=>s)})}function me(s,e=!1){return E(this,null,function*(){e&&console.group("[loadFonts:API]",s.length,"/",document.fonts.size);let t=[];for(let i of s)i instanceof FontFace?(document.fonts.has(i)||document.fonts.add(i),t.push(_t(i))):t.push(...It(i).map(n=>_t(n)));return e&&console.groupEnd(),yield Promise.all(t)})}function U(s){return s.replace(/['"]+/g,"")}function At(s){return E(this,null,function*(){let e=It(s);return yield Promise.all(e.map(t=>t.loaded))})}var N=class extends A{constructor(s){super(s)}init(){At($.EAGER).then(s=>this.onFontsLoaded(s))}onFontsLoaded(s){console.log("Example: Eager Fonts Loaded!",s)}};function pe(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function Mt(s,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(s,i.key,i)}}function ve(s,e,t){return e&&Mt(s.prototype,e),t&&Mt(s,t),s}function ge(s,e){return ye(s)||be(s,e)||we(s,e)||Ee()}function ye(s){if(Array.isArray(s))return s}function be(s,e){var t=s==null?null:typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(t!=null){var i=[],n=!0,r=!1,o,l;try{for(t=t.call(s);!(n=(o=t.next()).done)&&(i.push(o.value),!(e&&i.length===e));n=!0);}catch(a){r=!0,l=a}finally{try{!n&&t.return!=null&&t.return()}finally{if(r)throw l}}return i}}function we(s,e){if(s){if(typeof s=="string")return Rt(s,e);var t=Object.prototype.toString.call(s).slice(8,-1);if(t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set")return Array.from(s);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rt(s,e)}}function Rt(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=s[t];return i}function Ee(){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 Se=function(){function s(e){pe(this,s),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,e),this.options=e,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 ve(s,[{key:"init",value:function(){var t=this;window.addEventListener("popstate",function(i){return t.checkState(i)},!1),this.html.addEventListener("click",function(i){return t.checkClick(i)},!1),this.loadEls(document)}},{key:"checkClick",value:function(t){if(!t.ctrlKey&&!t.metaKey)for(var i=t.target;i&&i!==document;){if(i.matches("a")&&i.getAttribute("download")==null){var n=i.getAttribute("href");!n.startsWith("#")&&!n.startsWith("mailto:")&&!n.startsWith("tel:")&&(t.preventDefault(),this.reset(),this.getClickOptions(i));break}i=i.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(t){this.transition=t.getAttribute("data-"+this.name),this.isUrl=t.getAttribute("data-"+this.name+"-url");var i=t.getAttribute("href"),n=t.getAttribute("target");if(n=="_blank"){window.open(i,"_blank");return}if(this.transition=="false"){window.location=i;return}this.setOptions(i,!0)}},{key:"getStateOptions",value:function(){this.transitionsHistory?this.transition=history.state:this.transition=!1;var t=window.location.href;this.setOptions(t)}},{key:"goTo",value:function(t,i,n){this.reset(),this.transition=i,this.isUrl=n,this.setOptions(t,!0)}},{key:"setOptions",value:function(t,i){var n="["+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?(n=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(n),this.subContainer&&history.replaceState(this.prevTransition,null,this.href),this.subContainer=!1),this.href=t,this.parentContainer=this.oldContainer.parentNode,this.isUrl===""||this.isUrl!=null&&this.isUrl!="false"&&this.isUrl!=!1?history.pushState(this.transition,null,t):(this.oldContainer.classList.add("is-old"),this.setLoading(),this.startEnterDelay(),this.loadHref(t,n,i))}},{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 t=new Event(this.namespace+"loading");window.dispatchEvent(t)}},{key:"startEnterDelay",value:function(){var t=this;this.enterTimeout=window.setTimeout(function(){t.isEntered=!0,t.isLoaded&&t.transitionContainers()},this.enterDelay)}},{key:"loadHref",value:function(t,i,n){var r=this;this.isLoading=!0;var o=this.controller.signal;fetch(t,{signal:o}).then(function(l){return l.text()}).then(function(l){n&&history.pushState(r.transition,null,t);var a=new DOMParser;r.data=a.parseFromString(l,"text/html"),r.newContainer=r.data.querySelector(i),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(l){window.location=t})}},{key:"transitionContainers",value:function(){var t=this;this.setAttributes(),this.showContainer(),this.setLoaded(),setTimeout(function(){t.removeContainer(),t.setReady()},this.exitDelay)}},{key:"setSvgs",value:function(){if(this.isChrome){var t=this.newContainer.querySelectorAll("use");t.length&&t.forEach(function(i){var n=i.getAttribute("xlink:href");if(n)i.parentNode.innerHTML='<use xlink:href="'+n+'"></use>';else{var r=i.getAttribute("href");r&&(i.parentNode.innerHTML='<use href="'+r+'"></use>')}})}}},{key:"setAttributes",value:function(){var t=this,i=this.data.getElementsByTagName("title")[0],n=this.data.head.querySelector('meta[name="description"]'),r=document.head.querySelector('meta[name="description"]'),o,l;this.subContainer?(l=this.parentNewContainer,o=document.querySelector(this.transitionContainer).parentNode):(l=this.data.querySelector("html"),o=document.querySelector("html"));var a=Object.assign({},l.dataset);i&&(document.title=i.innerText),r&&n&&r.setAttribute("content",n.getAttribute("content")),a&&Object.entries(a).forEach(function(h){var c=ge(h,2),u=c[0],d=c[1];o.setAttribute("data-"+t.toDash(u),d)})}},{key:"toDash",value:function(t){return t.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(t){var i=this,n=[];this.loadAttributes.forEach(function(r){var o="data-"+i.name+"-"+r,l=t.querySelectorAll("["+o+"]");l.length&&l.forEach(function(a){var h=a.getAttribute(o);if(a.setAttribute(r,h),r=="src"||r=="srcset"){var c=new Promise(function(u){a.onload=function(){return u(a)}});n.push(c)}})}),Promise.all(n).then(function(r){var o=new Event(i.namespace+"images");window.dispatchEvent(o)})}},{key:"setLoaded",value:function(){var t=this;this.classContainer.classList.remove(this.loadingClass),setTimeout(function(){t.classContainer.classList.add(t.loadedClass)},this.loadedDelay);var i=new Event(this.namespace+"loaded");window.dispatchEvent(i)}},{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 t=new Event(this.namespace+"ready");window.dispatchEvent(t)}},{key:"on",value:function(t,i){var n=this;window.addEventListener(this.namespace+t,function(){switch(t){case"loading":return i(n.transition,n.oldContainer);case"loaded":return i(n.transition,n.oldContainer,n.newContainer);case"ready":return i(n.transition,n.newContainer);default:return i()}},!1)}}]),s}(),kt=Se;var j=class extends A{constructor(s){super(s)}init(){new kt({enterDelay:0,transitions:{customTransition:{}}}).on("loaded",(e,t,i)=>{this.call("destroy",t,"app"),this.call("update",i,"app")})}};var Ce=s=>({url:s.src,width:s.naturalWidth,height:s.naturalHeight,ratio:s.naturalWidth/s.naturalHeight}),_e=(s,e={})=>new Promise((t,i)=>{let n=new Image;e.crossOrigin&&(n.crossOrigin=e.crossOrigin);let r=()=>{t(ft({element:n},Ce(n)))};n.decode?(n.src=s,n.decode().then(r).catch(o=>{i(o)})):(n.onload=r,n.onerror=o=>{i(o)},n.src=s)}),Lt=[],zt=(s,e,t)=>E(void 0,null,function*(){let i=e||s.dataset.src,n=Lt.find(r=>r.url===i);if(!n){if(n=yield _e(i),!n.url)return;Lt.push(n)}s.src!==i&&(s.tagName==="IMG"?s.src=n.url:s.style.backgroundImage=`url(${n.url})`,requestAnimationFrame(()=>{let r=s.closest(`.${S.LAZY_CONTAINER}`);r&&(r.classList.add(S.LAZY_LOADED),r.style.backgroundImage=""),s.classList.add(S.LAZY_LOADED),t==null||t()}))});function Q(){return Q=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},Q.apply(this,arguments)}function W(s,e,t){return Math.max(s,Math.min(e,t))}var tt=class{advance(e){var t;if(!this.isRunning)return;let i=!1;if(this.lerp)this.value=(n=this.value,r=this.to,(1-(o=1-Math.exp(-60*this.lerp*e)))*n+o*r),Math.round(this.value)===this.to&&(this.value=this.to,i=!0);else{this.currentTime+=e;let l=W(0,this.currentTime/this.duration,1);i=l>=1;let a=i?1:this.easing(l);this.value=this.from+(this.to-this.from)*a}var n,r,o;(t=this.onUpdate)==null||t.call(this,this.value,i),i&&this.stop()}stop(){this.isRunning=!1}fromTo(e,t,{lerp:i=.1,duration:n=1,easing:r=a=>a,onStart:o,onUpdate:l}){this.from=this.value=e,this.to=t,this.lerp=i,this.duration=n,this.easing=r,this.currentTime=0,this.isRunning=!0,o==null||o(),this.onUpdate=l}},et=class{constructor({wrapper:e,content:t,autoResize:i=!0}={}){if(this.resize=()=>{this.onWrapperResize(),this.onContentResize()},this.onWrapperResize=()=>{this.wrapper===window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)},this.onContentResize=()=>{this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth},this.wrapper=e,this.content=t,i){let n=function(r,o){let l;return function(){let a=arguments,h=this;clearTimeout(l),l=setTimeout(function(){r.apply(h,a)},250)}}(this.resize);this.wrapper!==window&&(this.wrapperResizeObserver=new ResizeObserver(n),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(n),this.contentResizeObserver.observe(this.content)}this.resize()}destroy(){var e,t;(e=this.wrapperResizeObserver)==null||e.disconnect(),(t=this.contentResizeObserver)==null||t.disconnect()}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},H=class{constructor(){this.events={}}emit(e,...t){let i=this.events[e]||[];for(let n=0,r=i.length;n<r;n++)i[n](...t)}on(e,t){var i;return(i=this.events[e])!=null&&i.push(t)||(this.events[e]=[t]),()=>{var n;this.events[e]=(n=this.events[e])==null?void 0:n.filter(r=>t!==r)}}off(e,t){var i;this.events[e]=(i=this.events[e])==null?void 0:i.filter(n=>t!==n)}destroy(){this.events={}}},it=class{constructor(e,{wheelMultiplier:t=1,touchMultiplier:i=2,normalizeWheel:n=!1}){this.onTouchStart=r=>{let{clientX:o,clientY:l}=r.targetTouches?r.targetTouches[0]:r;this.touchStart.x=o,this.touchStart.y=l,this.lastDelta={x:0,y:0}},this.onTouchMove=r=>{let{clientX:o,clientY:l}=r.targetTouches?r.targetTouches[0]:r,a=-(o-this.touchStart.x)*this.touchMultiplier,h=-(l-this.touchStart.y)*this.touchMultiplier;this.touchStart.x=o,this.touchStart.y=l,this.lastDelta={x:a,y:h},this.emitter.emit("scroll",{deltaX:a,deltaY:h,event:r})},this.onTouchEnd=r=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:r})},this.onWheel=r=>{let{deltaX:o,deltaY:l}=r;this.normalizeWheel&&(o=W(-100,o,100),l=W(-100,l,100)),o*=this.wheelMultiplier,l*=this.wheelMultiplier,this.emitter.emit("scroll",{deltaX:o,deltaY:l,event:r})},this.element=e,this.wheelMultiplier=t,this.touchMultiplier=i,this.normalizeWheel=n,this.touchStart={x:null,y:null},this.emitter=new H,this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(e,t){return this.emitter.on(e,t)}destroy(){this.emitter.destroy(),this.element.removeEventListener("wheel",this.onWheel,{passive:!1}),this.element.removeEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.removeEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.removeEventListener("touchend",this.onTouchEnd,{passive:!1})}},V=class{constructor({wrapper:e=window,content:t=document.documentElement,wheelEventsTarget:i=e,eventsTarget:n=i,smoothWheel:r=!0,smoothTouch:o=!1,syncTouch:l=!1,syncTouchLerp:a=.1,__iosNoInertiaSyncTouchLerp:h=.4,touchInertiaMultiplier:c=35,duration:u,easing:d=m=>Math.min(1,1.001-Math.pow(2,-10*m)),lerp:f=!u&&.1,infinite:p=!1,orientation:y="vertical",gestureOrientation:L="vertical",touchMultiplier:_=1,wheelMultiplier:b=1,normalizeWheel:O=!1,autoResize:I=!0}={}){this.onVirtualScroll=({deltaX:m,deltaY:w,event:v})=>{if(v.ctrlKey)return;let C=v.type.includes("touch"),g=v.type.includes("wheel");if(this.options.gestureOrientation==="both"&&m===0&&w===0||this.options.gestureOrientation==="vertical"&&w===0||this.options.gestureOrientation==="horizontal"&&m===0||C&&this.options.gestureOrientation==="vertical"&&this.scroll===0&&!this.options.infinite&&w<=0)return;let z=v.composedPath();if(z=z.slice(0,z.indexOf(this.rootElement)),z.find(T=>{var ct;return(T.hasAttribute==null?void 0:T.hasAttribute("data-lenis-prevent"))||C&&(T.hasAttribute==null?void 0:T.hasAttribute("data-lenis-prevent-touch"))||g&&(T.hasAttribute==null?void 0:T.hasAttribute("data-lenis-prevent-wheel"))||((ct=T.classList)==null?void 0:ct.contains("lenis"))}))return;if(this.isStopped||this.isLocked)return void v.preventDefault();if(this.isSmooth=(this.options.smoothTouch||this.options.syncTouch)&&C||this.options.smoothWheel&&g,!this.isSmooth)return this.isScrolling=!1,void this.animate.stop();v.preventDefault();let R=w;this.options.gestureOrientation==="both"?R=Math.abs(w)>Math.abs(m)?w:m:this.options.gestureOrientation==="horizontal"&&(R=m);let Gt=C&&this.options.syncTouch,ht=C&&v.type==="touchend"&&Math.abs(R)>1;ht&&(R=this.velocity*this.options.touchInertiaMultiplier),this.scrollTo(this.targetScroll+R,Q({programmatic:!1},Gt&&{lerp:ht?this.syncTouchLerp:this.options.__iosNoInertiaSyncTouchLerp}))},this.onNativeScroll=()=>{if(!this.__preventNextScrollEvent&&!this.isScrolling){let m=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.direction=Math.sign(this.animatedScroll-m),this.emit()}},window.lenisVersion="1.0.29",e!==document.documentElement&&e!==document.body||(e=window),this.options={wrapper:e,content:t,wheelEventsTarget:i,eventsTarget:n,smoothWheel:r,smoothTouch:o,syncTouch:l,syncTouchLerp:a,__iosNoInertiaSyncTouchLerp:h,touchInertiaMultiplier:c,duration:u,easing:d,lerp:f,infinite:p,gestureOrientation:L,orientation:y,touchMultiplier:_,wheelMultiplier:b,normalizeWheel:O,autoResize:I},this.animate=new tt,this.emitter=new H,this.dimensions=new et({wrapper:e,content:t,autoResize:I}),this.toggleClass("lenis",!0),this.velocity=0,this.isLocked=!1,this.isStopped=!1,this.isSmooth=l||r||o,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,{passive:!1}),this.virtualScroll=new it(n,{touchMultiplier:_,wheelMultiplier:b,normalizeWheel:O}),this.virtualScroll.on("scroll",this.onVirtualScroll)}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,{passive:!1}),this.virtualScroll.destroy(),this.dimensions.destroy(),this.toggleClass("lenis",!1),this.toggleClass("lenis-smooth",!1),this.toggleClass("lenis-scrolling",!1),this.toggleClass("lenis-stopped",!1),this.toggleClass("lenis-locked",!1)}on(e,t){return this.emitter.on(e,t)}off(e,t){return this.emitter.off(e,t)}setScroll(e){this.isHorizontal?this.rootElement.scrollLeft=e:this.rootElement.scrollTop=e}resize(){this.dimensions.resize()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.animate.stop()}start(){this.isStopped=!1,this.reset()}stop(){this.isStopped=!0,this.animate.stop(),this.reset()}raf(e){let t=e-(this.time||e);this.time=e,this.animate.advance(.001*t)}scrollTo(e,{offset:t=0,immediate:i=!1,lock:n=!1,duration:r=this.options.duration,easing:o=this.options.easing,lerp:l=!r&&this.options.lerp,onComplete:a=null,force:h=!1,programmatic:c=!0}={}){if(!this.isStopped&&!this.isLocked||h){if(["top","left","start"].includes(e))e=0;else if(["bottom","right","end"].includes(e))e=this.limit;else{var u;let d;if(typeof e=="string"?d=document.querySelector(e):(u=e)!=null&&u.nodeType&&(d=e),d){if(this.options.wrapper!==window){let p=this.options.wrapper.getBoundingClientRect();t-=this.isHorizontal?p.left:p.top}let f=d.getBoundingClientRect();e=(this.isHorizontal?f.left:f.top)+this.animatedScroll}}if(typeof e=="number"){if(e+=t,e=Math.round(e),this.options.infinite?c&&(this.targetScroll=this.animatedScroll=this.scroll):e=W(0,e,this.limit),i)return this.animatedScroll=this.targetScroll=e,this.setScroll(this.scroll),this.reset(),void(a==null||a(this));if(!c){if(e===this.targetScroll)return;this.targetScroll=e}this.animate.fromTo(this.animatedScroll,e,{duration:r,easing:o,lerp:l,onStart:()=>{n&&(this.isLocked=!0),this.isScrolling=!0},onUpdate:(d,f)=>{this.isScrolling=!0,this.velocity=d-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=d,this.setScroll(this.scroll),c&&(this.targetScroll=d),f||this.emit(),f&&(this.reset(),this.emit(),a==null||a(this),this.__preventNextScrollEvent=!0,requestAnimationFrame(()=>{delete this.__preventNextScrollEvent}))}})}}}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop}get scroll(){return this.options.infinite?(this.animatedScroll%(e=this.limit)+e)%e:this.animatedScroll;var e}get progress(){return this.limit===0?1:this.scroll/this.limit}get isSmooth(){return this.__isSmooth}set isSmooth(e){this.__isSmooth!==e&&(this.__isSmooth=e,this.toggleClass("lenis-smooth",e))}get isScrolling(){return this.__isScrolling}set isScrolling(e){this.__isScrolling!==e&&(this.__isScrolling=e,this.toggleClass("lenis-scrolling",e))}get isStopped(){return this.__isStopped}set isStopped(e){this.__isStopped!==e&&(this.__isStopped=e,this.toggleClass("lenis-stopped",e))}get isLocked(){return this.__isLocked}set isLocked(e){this.__isLocked!==e&&(this.__isLocked=e,this.toggleClass("lenis-locked",e))}get className(){let e="lenis";return this.isStopped&&(e+=" lenis-stopped"),this.isLocked&&(e+=" lenis-locked"),this.isScrolling&&(e+=" lenis-scrolling"),this.isSmooth&&(e+=" lenis-smooth"),e}toggleClass(e,t){this.rootElement.classList.toggle(e,t),this.emitter.emit("className change",this)}};function st(){return st=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},st.apply(this,arguments)}var B=class{constructor({scrollElements:e,rootMargin:t="-1px -1px -1px -1px",IORaf:i}){this.scrollElements=void 0,this.rootMargin=void 0,this.IORaf=void 0,this.observer=void 0,this.scrollElements=e,this.rootMargin=t,this.IORaf=i,this._init()}_init(){this.observer=new IntersectionObserver(e=>{e.forEach(t=>{let i=this.scrollElements.find(n=>n.$el===t.target);t.isIntersecting?(i&&(i.isAlreadyIntersected=!0),this._setInview(t)):i&&i.isAlreadyIntersected&&this._setOutOfView(t)})},{rootMargin:this.rootMargin});for(let e of this.scrollElements)this.observe(e.$el)}destroy(){this.observer.disconnect()}observe(e){e&&this.observer.observe(e)}unobserve(e){e&&this.observer.unobserve(e)}_setInview(e){let t=this.scrollElements.find(i=>i.$el===e.target);this.IORaf&&(t==null||t.setInteractivityOn()),!this.IORaf&&(t==null||t.setInview())}_setOutOfView(e){let t=this.scrollElements.find(i=>i.$el===e.target);this.IORaf&&(t==null||t.setInteractivityOff()),!this.IORaf&&(t==null||t.setOutOfView()),t!=null&&t.attributes.scrollRepeat||this.IORaf||this.unobserve(e.target)}};function Pt(s,e,t,i,n){return t+((n-s)/(e-s)*(i-t)||0)}function Dt(s,e){return s.reduce((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t)}var nt=class{constructor({$el:e,id:t,modularInstance:i,subscribeElementUpdateFn:n,unsubscribeElementUpdateFn:r,needRaf:o,scrollOrientation:l}){var a,h,c,u,d;this.$el=void 0,this.id=void 0,this.needRaf=void 0,this.attributes=void 0,this.scrollOrientation=void 0,this.isAlreadyIntersected=void 0,this.intersection=void 0,this.metrics=void 0,this.currentScroll=void 0,this.translateValue=void 0,this.progress=void 0,this.lastProgress=void 0,this.modularInstance=void 0,this.progressModularModules=void 0,this.isInview=void 0,this.isInteractive=void 0,this.isInFold=void 0,this.isFirstResize=void 0,this.subscribeElementUpdateFn=void 0,this.unsubscribeElementUpdateFn=void 0,this.$el=e,this.id=t,this.needRaf=o,this.scrollOrientation=l,this.modularInstance=i,this.subscribeElementUpdateFn=n,this.unsubscribeElementUpdateFn=r,this.attributes={scrollClass:(a=this.$el.dataset.scrollClass)!=null?a:"is-inview",scrollOffset:(h=this.$el.dataset.scrollOffset)!=null?h:"0,0",scrollPosition:(c=this.$el.dataset.scrollPosition)!=null?c:"start,end",scrollModuleProgress:this.$el.dataset.scrollModuleProgress!=null,scrollCssProgress:this.$el.dataset.scrollCssProgress!=null,scrollEventProgress:(u=this.$el.dataset.scrollEventProgress)!=null?u:null,scrollSpeed:this.$el.dataset.scrollSpeed!=null?parseFloat(this.$el.dataset.scrollSpeed):null,scrollRepeat:this.$el.dataset.scrollRepeat!=null,scrollCall:(d=this.$el.dataset.scrollCall)!=null?d:null,scrollCallSelf:this.$el.dataset.scrollCallSelf!=null,scrollIgnoreFold:this.$el.dataset.scrollIgnoreFold!=null,scrollEnableTouchSpeed:this.$el.dataset.scrollEnableTouchSpeed!=null},this.intersection={start:0,end:0},this.metrics={offsetStart:0,offsetEnd:0,bcr:{}},this.currentScroll=this.scrollOrientation==="vertical"?window.scrollY:window.scrollX,this.translateValue=0,this.progress=0,this.lastProgress=null,this.progressModularModules=[],this.isInview=!1,this.isInteractive=!1,this.isAlreadyIntersected=!1,this.isInFold=!1,this.isFirstResize=!0,this._init()}_init(){this.needRaf&&(this.modularInstance&&this.attributes.scrollModuleProgress&&this._getProgressModularModules(),this._resize())}onResize({currentScroll:e}){this.currentScroll=e,this._resize()}onRender({currentScroll:e,smooth:t}){let i=this.scrollOrientation==="vertical"?window.innerHeight:window.innerWidth;if(this.currentScroll=e,this._computeProgress(),this.attributes.scrollSpeed&&!isNaN(this.attributes.scrollSpeed))if(this.attributes.scrollEnableTouchSpeed||t){if(this.isInFold){let n=Math.max(0,this.progress);this.translateValue=n*i*this.attributes.scrollSpeed*-1}else{let n=Pt(0,1,-1,1,this.progress);this.translateValue=n*i*this.attributes.scrollSpeed*-1}this.$el.style.transform=this.scrollOrientation==="vertical"?`translate3d(0, ${this.translateValue}px, 0)`:`translate3d(${this.translateValue}px, 0, 0)`}else this.translateValue&&(this.$el.style.transform="translate3d(0, 0, 0)"),this.translateValue=0}setInview(){if(this.isInview)return;this.isInview=!0,this.$el.classList.add(this.attributes.scrollClass);let e=this._getScrollCallFrom();this.attributes.scrollCall&&this._dispatchCall("enter",e)}setOutOfView(){if(!this.isInview||!this.attributes.scrollRepeat)return;this.isInview=!1,this.$el.classList.remove(this.attributes.scrollClass);let e=this._getScrollCallFrom();this.attributes.scrollCall&&this._dispatchCall("leave",e)}setInteractivityOn(){this.isInteractive||(this.isInteractive=!0,this.subscribeElementUpdateFn(this))}setInteractivityOff(){this.isInteractive&&(this.isInteractive=!1,this.unsubscribeElementUpdateFn(this),this.lastProgress!=null&&this._computeProgress(Dt([0,1],this.lastProgress)))}_resize(){this.metrics.bcr=this.$el.getBoundingClientRect(),this._computeMetrics(),this._computeIntersection(),this.isFirstResize&&(this.isFirstResize=!1,this.isInFold&&this.setInview())}_computeMetrics(){let{top:e,left:t,height:i,width:n}=this.metrics.bcr,r=this.scrollOrientation==="vertical"?window.innerHeight:window.innerWidth,o=this.scrollOrientation==="vertical"?i:n;this.metrics.offsetStart=this.currentScroll+(this.scrollOrientation==="vertical"?e:t)-this.translateValue,this.metrics.offsetEnd=this.metrics.offsetStart+o,this.isInFold=this.metrics.offsetStart<r&&!this.attributes.scrollIgnoreFold}_computeIntersection(){let e=this.scrollOrientation==="vertical"?window.innerHeight:window.innerWidth,t=this.scrollOrientation==="vertical"?this.metrics.bcr.height:this.metrics.bcr.width,i=this.attributes.scrollOffset.split(","),n=i[0]!=null?i[0].trim():"0",r=i[1]!=null?i[1].trim():"0",o=this.attributes.scrollPosition.split(","),l=o[0]!=null?o[0].trim():"start",a=o[1]!=null?o[1].trim():"end",h=n.includes("%")?e*parseInt(n.replace("%","").trim())*.01:parseInt(n),c=r.includes("%")?e*parseInt(r.replace("%","").trim())*.01:parseInt(r);switch(this.isInFold&&(l="fold"),l){case"start":default:this.intersection.start=this.metrics.offsetStart-e+h;break;case"middle":this.intersection.start=this.metrics.offsetStart-e+h+.5*t;break;case"end":this.intersection.start=this.metrics.offsetStart-e+h+t;break;case"fold":this.intersection.start=0}switch(a){case"start":this.intersection.end=this.metrics.offsetStart-c;break;case"middle":this.intersection.end=this.metrics.offsetStart-c+.5*t;break;default:this.intersection.end=this.metrics.offsetStart-c+t}if(this.intersection.end<=this.intersection.start)switch(a){case"start":default:this.intersection.end=this.intersection.start+1;break;case"middle":this.intersection.end=this.intersection.start+.5*t;break;case"end":this.intersection.end=this.intersection.start+t}}_computeProgress(e){let t=e!=null?e:(i=Pt(this.intersection.start,this.intersection.end,0,1,this.currentScroll))<0?0:i>1?1:i;var i;if(this.progress=t,t!=this.lastProgress){if(this.lastProgress=t,this.attributes.scrollCssProgress&&this._setCssProgress(t),this.attributes.scrollEventProgress&&this._setCustomEventProgress(t),this.attributes.scrollModuleProgress)for(let n of this.progressModularModules)this.modularInstance&&this.modularInstance.call("onScrollProgress",t,n.moduleName,n.moduleId);t>0&&t<1&&this.setInview(),t===0&&this.setOutOfView(),t===1&&this.setOutOfView()}}_setCssProgress(e=0){this.$el.style.setProperty("--progress",e.toString())}_setCustomEventProgress(e=0){let t=this.attributes.scrollEventProgress;if(!t)return;let i=new CustomEvent(t,{detail:{target:this.$el,progress:e}});window.dispatchEvent(i)}_getProgressModularModules(){if(!this.modularInstance)return;let e=Object.keys(this.$el.dataset).filter(i=>i.includes("module")),t=Object.entries(this.modularInstance.modules);if(e.length)for(let i of e){let n=this.$el.dataset[i];if(!n)return;for(let r of t){let[o,l]=r;n in l&&this.progressModularModules.push({moduleName:o,moduleId:n})}}}_getScrollCallFrom(){let e=Dt([this.intersection.start,this.intersection.end],this.currentScroll);return this.intersection.start===e?"start":"end"}_dispatchCall(e,t){var i,n;let r=(i=this.attributes.scrollCall)==null?void 0:i.split(","),o=(n=this.attributes)==null?void 0:n.scrollCallSelf;if(r&&r.length>1){var l;let[a,h,c]=r,u;u=o?this.$el.dataset[`module${h.trim()}`]:c,this.modularInstance&&this.modularInstance.call(a.trim(),{target:this.$el,way:e,from:t},h.trim(),(l=u)==null?void 0:l.trim())}else if(r){let[a]=r,h=new CustomEvent(a,{detail:{target:this.$el,way:e,from:t}});window.dispatchEvent(h)}}},Oe=["scrollOffset","scrollPosition","scrollModuleProgress","scrollCssProgress","scrollEventProgress","scrollSpeed"],rt=class{constructor({$el:e,modularInstance:t,triggerRootMargin:i,rafRootMargin:n,scrollOrientation:r}){this.$scrollContainer=void 0,this.modularInstance=void 0,this.triggerRootMargin=void 0,this.rafRootMargin=void 0,this.scrollElements=void 0,this.triggeredScrollElements=void 0,this.RAFScrollElements=void 0,this.scrollElementsToUpdate=void 0,this.IOTriggerInstance=void 0,this.IORafInstance=void 0,this.scrollOrientation=void 0,e?(this.$scrollContainer=e,this.modularInstance=t,this.scrollOrientation=r,this.triggerRootMargin=i!=null?i:"-1px -1px -1px -1px",this.rafRootMargin=n!=null?n:"100% 100% 100% 100%",this.scrollElements=[],this.triggeredScrollElements=[],this.RAFScrollElements=[],this.scrollElementsToUpdate=[],this._init()):console.error("Please provide a DOM Element as scrollContainer")}_init(){let e=this.$scrollContainer.querySelectorAll("[data-scroll]"),t=Array.from(e);this._subscribeScrollElements(t),this.IOTriggerInstance=new B({scrollElements:[...this.triggeredScrollElements],rootMargin:this.triggerRootMargin,IORaf:!1}),this.IORafInstance=new B({scrollElements:[...this.RAFScrollElements],rootMargin:this.rafRootMargin,IORaf:!0})}destroy(){this.IOTriggerInstance.destroy(),this.IORafInstance.destroy(),this._unsubscribeAllScrollElements()}onResize({currentScroll:e}){for(let t of this.RAFScrollElements)t.onResize({currentScroll:e})}onRender({currentScroll:e,smooth:t}){for(let i of this.scrollElementsToUpdate)i.onRender({currentScroll:e,smooth:t})}removeScrollElements(e){let t=e.querySelectorAll("[data-scroll]");if(t.length){for(let i=0;i<this.triggeredScrollElements.length;i++){let n=this.triggeredScrollElements[i];Array.from(t).indexOf(n.$el)>-1&&(this.IOTriggerInstance.unobserve(n.$el),this.triggeredScrollElements.splice(i,1))}for(let i=0;i<this.RAFScrollElements.length;i++){let n=this.RAFScrollElements[i];Array.from(t).indexOf(n.$el)>-1&&(this.IORafInstance.unobserve(n.$el),this.RAFScrollElements.splice(i,1))}t.forEach(i=>{let n=this.scrollElementsToUpdate.find(o=>o.$el===i),r=this.scrollElements.find(o=>o.$el===i);n&&this._unsubscribeElementUpdate(n),r&&(this.scrollElements=this.scrollElements.filter(o=>o.id!=r.id))})}}addScrollElements(e){let t=e.querySelectorAll("[data-scroll]"),i=[];this.scrollElements.forEach(o=>{i.push(o.id)});let n=Math.max(...i)+1,r=Array.from(t);this._subscribeScrollElements(r,n,!0)}_subscribeScrollElements(e,t=0,i=!1){for(let n=0;n<e.length;n++){let r=e[n],o=this._checkRafNeeded(r),l=new nt({$el:r,id:t+n,scrollOrientation:this.scrollOrientation,modularInstance:this.modularInstance,subscribeElementUpdateFn:this._subscribeElementUpdate.bind(this),unsubscribeElementUpdateFn:this._unsubscribeElementUpdate.bind(this),needRaf:o});this.scrollElements.push(l),o?(this.RAFScrollElements.push(l),i&&(this.IORafInstance.scrollElements.push(l),this.IORafInstance.observe(l.$el))):(this.triggeredScrollElements.push(l),i&&(this.IOTriggerInstance.scrollElements.push(l),this.IOTriggerInstance.observe(l.$el)))}}_unsubscribeAllScrollElements(){this.scrollElements=[],this.RAFScrollElements=[],this.triggeredScrollElements=[],this.scrollElementsToUpdate=[]}_subscribeElementUpdate(e){this.scrollElementsToUpdate.push(e)}_unsubscribeElementUpdate(e){this.scrollElementsToUpdate=this.scrollElementsToUpdate.filter(t=>t.id!=e.id)}_checkRafNeeded(e){let t=[...Oe],i=n=>{t=t.filter(r=>r!=n)};if(e.dataset.scrollOffset){if(e.dataset.scrollOffset.split(",").map(n=>n.replace("%","").trim()).join(",")!="0,0")return!0;i("scrollOffset")}else i("scrollOffset");if(e.dataset.scrollPosition){if(e.dataset.scrollPosition.trim()!="top,bottom")return!0;i("scrollPosition")}else i("scrollPosition");if(e.dataset.scrollSpeed&&!isNaN(parseFloat(e.dataset.scrollSpeed)))return!0;i("scrollSpeed");for(let n of t)if(n in e.dataset)return!0;return!1}},ot=class{constructor({resizeElements:e,resizeCallback:t=()=>{}}){this.$resizeElements=void 0,this.isFirstObserve=void 0,this.observer=void 0,this.resizeCallback=void 0,this.$resizeElements=e,this.resizeCallback=t,this.isFirstObserve=!0,this._init()}_init(){this.observer=new ResizeObserver(e=>{var t;!this.isFirstObserve&&((t=this.resizeCallback)==null||t.call(this)),this.isFirstObserve=!1});for(let e of this.$resizeElements)this.observer.observe(e)}destroy(){this.observer.disconnect()}},xt={wrapper:window,content:document.documentElement,eventsTarget:window,lerp:.1,duration:.75,orientation:"vertical",gestureOrientation:"vertical",smoothWheel:!0,smoothTouch:!1,syncTouch:!1,syncTouchLerp:.1,touchInertiaMultiplier:35,wheelMultiplier:1,touchMultiplier:2,normalizeWheel:!1,autoResize:!0,easing:s=>Math.min(1,1.001-Math.pow(2,-10*s))},q=class{constructor({lenisOptions:e={},modularInstance:t,triggerRootMargin:i,rafRootMargin:n,autoResize:r=!0,autoStart:o=!0,scrollCallback:l=()=>{},initCustomTicker:a,destroyCustomTicker:h}={}){this.rafPlaying=void 0,this.lenisInstance=void 0,this.coreInstance=void 0,this.lenisOptions=void 0,this.modularInstance=void 0,this.triggerRootMargin=void 0,this.rafRootMargin=void 0,this.rafInstance=void 0,this.autoResize=void 0,this.autoStart=void 0,this.ROInstance=void 0,this.initCustomTicker=void 0,this.destroyCustomTicker=void 0,this._onRenderBind=void 0,this._onResizeBind=void 0,this._onScrollToBind=void 0,this.lenisOptions=st({},xt,e),Object.assign(this,{lenisOptions:e,modularInstance:t,triggerRootMargin:i,rafRootMargin:n,autoResize:r,autoStart:o,scrollCallback:l,initCustomTicker:a,destroyCustomTicker:h}),this._onRenderBind=this._onRender.bind(this),this._onScrollToBind=this._onScrollTo.bind(this),this._onResizeBind=this._onResize.bind(this),this.rafPlaying=!1,this._init()}_init(){var e;this.lenisInstance=new V({wrapper:this.lenisOptions.wrapper,content:this.lenisOptions.content,eventsTarget:this.lenisOptions.eventsTarget,lerp:this.lenisOptions.lerp,duration:this.lenisOptions.duration,orientation:this.lenisOptions.orientation,gestureOrientation:this.lenisOptions.gestureOrientation,smoothWheel:this.lenisOptions.smoothWheel,smoothTouch:this.lenisOptions.smoothTouch,syncTouch:this.lenisOptions.syncTouch,syncTouchLerp:this.lenisOptions.syncTouchLerp,touchInertiaMultiplier:this.lenisOptions.touchInertiaMultiplier,wheelMultiplier:this.lenisOptions.wheelMultiplier,touchMultiplier:this.lenisOptions.touchMultiplier,normalizeWheel:this.lenisOptions.normalizeWheel,easing:this.lenisOptions.easing}),(e=this.lenisInstance)==null||e.on("scroll",this.scrollCallback),document.documentElement.setAttribute("data-scroll-orientation",this.lenisInstance.options.orientation),requestAnimationFrame(()=>{this.coreInstance=new rt({$el:this.lenisInstance.rootElement,modularInstance:this.modularInstance,triggerRootMargin:this.triggerRootMargin,rafRootMargin:this.rafRootMargin,scrollOrientation:this.lenisInstance.options.orientation}),this._bindEvents(),this.initCustomTicker&&!this.destroyCustomTicker?console.warn("initCustomTicker callback is declared, but destroyCustomTicker is not. Please pay attention. It could cause trouble."):!this.initCustomTicker&&this.destroyCustomTicker&&console.warn("destroyCustomTicker callback is declared, but initCustomTicker is not. Please pay attention. It could cause trouble."),this.autoStart&&this.start()})}destroy(){var e;this.stop(),this._unbindEvents(),this.lenisInstance.destroy(),(e=this.coreInstance)==null||e.destroy(),requestAnimationFrame(()=>{var t;(t=this.coreInstance)==null||t.destroy()})}_bindEvents(){this._bindScrollToEvents(),this.autoResize&&("ResizeObserver"in window?this.ROInstance=new ot({resizeElements:[document.body],resizeCallback:this._onResizeBind}):window.addEventListener("resize",this._onResizeBind))}_unbindEvents(){this._unbindScrollToEvents(),this.autoResize&&("ResizeObserver"in window?this.ROInstance&&this.ROInstance.destroy():window.removeEventListener("resize",this._onResizeBind))}_bindScrollToEvents(e){let t=e||this.lenisInstance.rootElement,i=t==null?void 0:t.querySelectorAll("[data-scroll-to]");i!=null&&i.length&&i.forEach(n=>{n.addEventListener("click",this._onScrollToBind,!1)})}_unbindScrollToEvents(e){let t=e||this.lenisInstance.rootElement,i=t==null?void 0:t.querySelectorAll("[data-scroll-to]");i!=null&&i.length&&i.forEach(n=>{n.removeEventListener("click",this._onScrollToBind,!1)})}_onResize(){requestAnimationFrame(()=>{var e;(e=this.coreInstance)==null||e.onResize({currentScroll:this.lenisInstance.scroll})})}_onRender(){var e,t;(e=this.lenisInstance)==null||e.raf(Date.now()),(t=this.coreInstance)==null||t.onRender({currentScroll:this.lenisInstance.scroll,smooth:this.lenisInstance.isSmooth})}_onScrollTo(e){var t;e.preventDefault();let i=(t=e.currentTarget)!=null?t:null;if(!i)return;let n=i.getAttribute("data-scroll-to-href")||i.getAttribute("href"),r=i.getAttribute("data-scroll-to-offset")||0,o=i.getAttribute("data-scroll-to-duration")||this.lenisOptions.duration||xt.duration;n&&this.scrollTo(n,{offset:typeof r=="string"?parseInt(r):r,duration:typeof o=="string"?parseInt(o):o})}start(){var e;this.rafPlaying||((e=this.lenisInstance)==null||e.start(),this.rafPlaying=!0,this.initCustomTicker?this.initCustomTicker(this._onRenderBind):this._raf())}stop(){var e;this.rafPlaying&&((e=this.lenisInstance)==null||e.stop(),this.rafPlaying=!1,this.destroyCustomTicker?this.destroyCustomTicker(this._onRenderBind):this.rafInstance&&cancelAnimationFrame(this.rafInstance))}removeScrollElements(e){var t;e?(this._unbindScrollToEvents(e),(t=this.coreInstance)==null||t.removeScrollElements(e)):console.error("Please provide a DOM Element as $oldContainer")}addScrollElements(e){var t;e?((t=this.coreInstance)==null||t.addScrollElements(e),requestAnimationFrame(()=>{this._bindScrollToEvents(e)})):console.error("Please provide a DOM Element as $newContainer")}resize(){this._onResizeBind()}scrollTo(e,t){var i;(i=this.lenisInstance)==null||i.scrollTo(e,{offset:t==null?void 0:t.offset,lerp:t==null?void 0:t.lerp,duration:t==null?void 0:t.duration,immediate:t==null?void 0:t.immediate,lock:t==null?void 0:t.lock,force:t==null?void 0:t.force,easing:t==null?void 0:t.easing,onComplete:t==null?void 0:t.onComplete})}_raf(){this._onRenderBind(),this.rafInstance=requestAnimationFrame(()=>this._raf())}};var G=class extends A{constructor(s){super(s)}init(){this.scroll=new q({modularInstance:this})}lazyLoad(s){zt(s.target,null,()=>{})}scrollTo(s){var n;let i=s,{target:e}=i,t=mt(i,["target"]);t=Object.assign({duration:1},t),(n=this.scroll)==null||n.scrollTo(e,t)}destroy(){this.scroll.destroy()}};var Wt=ee($t(),1);var X;E(void 0,null,function*(){if(M.IS_DEV){let s=yield Promise.resolve().then(()=>(jt(),Nt));X=s==null?void 0:s.gridHelper}});function Ht(){(0,Wt.default)(),X==null||X()}var Vt=(s,e,t=!1)=>{let i=null;return(...n)=>{clearTimeout(i);let r=()=>{i=null,t||s(...n)};t&&!i&&s(...n),i=setTimeout(r,e)}};var k=document.documentElement,di=document.body;var Bt=new Et({modules:lt}),at=()=>{let s=document.documentElement.style,e=document.body.clientWidth*.01;if(s.setProperty("--vw",`${e}px`),M.SUPPORTS_VH)return;let t=window.innerHeight,i=document.documentElement.clientHeight*.01;s.setProperty("--svh",`${i}px`);let n=t*.01;if(s.setProperty("--dvh",`${n}px`),document.body){let o=document.createElement("div");o.style.width="1px",o.style.height="100vh",o.style.position="fixed",o.style.left="0",o.style.top="0",o.style.bottom="0",o.style.visibility="hidden",document.body.appendChild(o);var r=o.clientHeight;o.remove();let l=r*.01;s.setProperty("--lvh",`${l}px`)}};window.addEventListener("load",()=>{let s=document.getElementById("main-css");s?s.isLoaded?qt():s.addEventListener("load",qt):console.warn('The "main-css" stylesheet not found')});function qt(){Ht(),at(),Bt.init(Bt),k.classList.add(S.LOADED),k.classList.add(S.READY),k.classList.remove(S.LOADING);let s=new CustomEvent(Ct.RESIZE_END);window.addEventListener("resize",()=>{at(),Vt(()=>{window.dispatchEvent(s)},200,!1)}),window.addEventListener("orientationchange",()=>{at()}),Ot&&Tt($.EAGER,M.IS_DEV).then(e=>{k.classList.add(S.FONTS_LOADED),M.IS_DEV&&(console.group("Eager fonts loaded!",e.length,"/",document.fonts.size),console.group("State of eager fonts:"),e.forEach(t=>console.log(t.family,t.style,t.weight,t.status)),console.groupEnd(),console.group("State of all fonts:"),document.fonts.forEach(t=>console.log(t.family,t.style,t.weight,t.status)),console.groupEnd())})}})();
|
|
/*! Bundled license information:
|
|
|
|
svg4everybody/dist/svg4everybody.js:
|
|
(*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody *)
|
|
*/
|
|
//# sourceMappingURL=app.js.map
|