vevet 2.0.1-dev.24 → 2.0.1-dev.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/build/cdn/index.js +1 -1
  2. package/build/cjs/base/Module.js +13 -4
  3. package/build/cjs/components/animation-frame/AnimationFrame.js +1 -1
  4. package/build/cjs/components/canvas/Ctx2D.js +3 -1
  5. package/build/cjs/components/scroll/scrollable/ScrollView.js +5 -3
  6. package/build/cjs/components/scroll/scrollbar/Bar.js +4 -4
  7. package/build/cjs/components/scroll/scrollbar/ScrollBar.js +3 -1
  8. package/build/cjs/components/scroll/smooth-scroll/SmoothScroll.js +8 -6
  9. package/build/cjs/components/text/SplitText.js +8 -2
  10. package/build/cjs/components/timeline/StaticTimeline.js +3 -3
  11. package/build/cjs/components/timeline/Timeline.js +2 -2
  12. package/build/cjs/utils/math/clamp.js +16 -0
  13. package/build/cjs/utils/math/clampScope.js +16 -0
  14. package/build/cjs/utils/math/inScope.js +10 -0
  15. package/build/cjs/utils/math/index.js +11 -7
  16. package/build/cjs/utils/math/scoped.js +18 -0
  17. package/build/cjs/utils/math/spreadScope.js +18 -0
  18. package/build/es/base/Module.js +2 -4
  19. package/build/es/components/animation-frame/AnimationFrame.js +2 -2
  20. package/build/es/components/canvas/Ctx2D.js +3 -1
  21. package/build/es/components/scroll/scrollable/ScrollView.js +5 -3
  22. package/build/es/components/scroll/scrollbar/Bar.js +4 -4
  23. package/build/es/components/scroll/scrollbar/ScrollBar.js +3 -1
  24. package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +8 -6
  25. package/build/es/components/text/SplitText.js +8 -2
  26. package/build/es/components/timeline/StaticTimeline.js +3 -3
  27. package/build/es/components/timeline/Timeline.js +2 -2
  28. package/build/es/utils/math/clamp.js +12 -0
  29. package/build/es/utils/math/clampScope.js +8 -0
  30. package/build/es/utils/math/inScope.js +6 -0
  31. package/build/es/utils/math/index.js +6 -4
  32. package/build/es/utils/math/scoped.js +14 -0
  33. package/build/es/utils/math/spreadScope.js +15 -0
  34. package/build/types/base/Module.d.ts.map +1 -1
  35. package/build/types/components/canvas/Ctx2D.d.ts +4 -0
  36. package/build/types/components/canvas/Ctx2D.d.ts.map +1 -1
  37. package/build/types/components/scroll/scrollable/ScrollView.d.ts +4 -0
  38. package/build/types/components/scroll/scrollable/ScrollView.d.ts.map +1 -1
  39. package/build/types/components/scroll/scrollbar/ScrollBar.d.ts +4 -0
  40. package/build/types/components/scroll/scrollbar/ScrollBar.d.ts.map +1 -1
  41. package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts +4 -0
  42. package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts.map +1 -1
  43. package/build/types/components/text/SplitText.d.ts +4 -0
  44. package/build/types/components/text/SplitText.d.ts.map +1 -1
  45. package/build/types/utils/math/clamp.d.ts +5 -0
  46. package/build/types/utils/math/clamp.d.ts.map +1 -0
  47. package/build/types/utils/math/clampScope.d.ts +5 -0
  48. package/build/types/utils/math/clampScope.d.ts.map +1 -0
  49. package/build/types/utils/math/inScope.d.ts +5 -0
  50. package/build/types/utils/math/inScope.d.ts.map +1 -0
  51. package/build/types/utils/math/index.d.ts +6 -4
  52. package/build/types/utils/math/index.d.ts.map +1 -1
  53. package/build/types/utils/math/scoped.d.ts +12 -0
  54. package/build/types/utils/math/scoped.d.ts.map +1 -0
  55. package/build/types/utils/math/spreadScope.d.ts +5 -0
  56. package/build/types/utils/math/spreadScope.d.ts.map +1 -0
  57. package/package.json +1 -1
  58. package/src/ts/base/Module.ts +5 -4
  59. package/src/ts/components/animation-frame/AnimationFrame.ts +2 -2
  60. package/src/ts/components/canvas/Ctx2D.ts +7 -0
  61. package/src/ts/components/scroll/scrollable/ScrollView.ts +9 -2
  62. package/src/ts/components/scroll/scrollbar/Bar.ts +4 -4
  63. package/src/ts/components/scroll/scrollbar/ScrollBar.ts +7 -0
  64. package/src/ts/components/scroll/smooth-scroll/SmoothScroll.ts +12 -5
  65. package/src/ts/components/text/SplitText.ts +12 -1
  66. package/src/ts/components/timeline/StaticTimeline.ts +4 -4
  67. package/src/ts/components/timeline/Timeline.ts +2 -2
  68. package/src/ts/utils/math/{boundVal.ts → clamp.ts} +3 -3
  69. package/src/ts/utils/math/clampScope.ts +16 -0
  70. package/src/ts/utils/math/inScope.ts +9 -0
  71. package/src/ts/utils/math/index.ts +10 -6
  72. package/src/ts/utils/math/scoped.ts +17 -0
  73. package/src/ts/utils/math/{spreadScopeProgress.ts → spreadScope.ts} +2 -2
  74. package/src/ts/utils/math/scopeProgress.ts +0 -23
@@ -9,4 +9,4 @@ GitHub Repository: https://github.com/antonbobrov/vevet
9
9
 
10
10
  Powered by Anton Bobrov | https://github.com/antonbobrov
11
11
  */
12
- (()=>{var t={554:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Function]",a="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[s]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),d=e&&!e.nodeType&&e,y=d&&t&&!t.nodeType&&t,v=y&&y.exports===d,b=v&&f.process,_=function(){try{var t=y&&y.require&&y.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(e){}}(),g=_&&_.isTypedArray;function m(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var w,O,P,k=Array.prototype,j=Function.prototype,S=Object.prototype,E=p["__core-js_shared__"],x=j.toString,T=S.hasOwnProperty,R=(w=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",L=S.toString,C=x.call(Object),D=RegExp("^"+x.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?p.Buffer:void 0,W=p.Symbol,B=p.Uint8Array,I=M?M.allocUnsafe:void 0,F=(O=Object.getPrototypeOf,P=Object,function(t){return O(P(t))}),A=Object.create,H=S.propertyIsEnumerable,z=k.splice,N=W?W.toStringTag:void 0,V=function(){try{var t=dt(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),X=M?M.isBuffer:void 0,Q=Math.max,U=Date.now,Y=dt(p,"Map"),$=dt(Object,"create"),q=function(){function t(){}return function(e){if(!St(e))return{};if(A)return A(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function K(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function J(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function G(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Z(t){var e=this.__data__=new J(t);this.size=e.size}function tt(t,e){var n=wt(t),r=!n&&mt(t),o=!n&&!r&&Pt(t),i=!n&&!r&&!o&&xt(t),s=n||r||o||i,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var u in t)!e&&!T.call(t,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||yt(u,c))||a.push(u);return a}function et(t,e,n){(void 0!==n&&!gt(t[e],n)||void 0===n&&!(e in t))&&ot(t,e,n)}function nt(t,e,n){var r=t[e];T.call(t,e)&&gt(r,n)&&(void 0!==n||e in t)||ot(t,e,n)}function rt(t,e){for(var n=t.length;n--;)if(gt(t[n][0],e))return n;return-1}function ot(t,e,n){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}K.prototype.clear=function(){this.__data__=$?$(null):{},this.size=0},K.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},K.prototype.get=function(t){var e=this.__data__;if($){var n=e[t];return n===r?void 0:n}return T.call(e,t)?e[t]:void 0},K.prototype.has=function(t){var e=this.__data__;return $?void 0!==e[t]:T.call(e,t)},K.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=$&&void 0===e?r:e,this},J.prototype.clear=function(){this.__data__=[],this.size=0},J.prototype.delete=function(t){var e=this.__data__,n=rt(e,t);return!(n<0)&&(n==e.length-1?e.pop():z.call(e,n,1),--this.size,!0)},J.prototype.get=function(t){var e=this.__data__,n=rt(e,t);return n<0?void 0:e[n][1]},J.prototype.has=function(t){return rt(this.__data__,t)>-1},J.prototype.set=function(t,e){var n=this.__data__,r=rt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(Y||J),string:new K}},G.prototype.delete=function(t){var e=pt(this,t).delete(t);return this.size-=e?1:0,e},G.prototype.get=function(t){return pt(this,t).get(t)},G.prototype.has=function(t){return pt(this,t).has(t)},G.prototype.set=function(t,e){var n=pt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new J,this.size=0},Z.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Z.prototype.get=function(t){return this.__data__.get(t)},Z.prototype.has=function(t){return this.__data__.has(t)},Z.prototype.set=function(t,e){var n=this.__data__;if(n instanceof J){var r=n.__data__;if(!Y||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(t,e),this.size=n.size,this};var it,st=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),s=i.length;s--;){var a=i[it?s:++r];if(!1===e(o[a],a,o))break}return t};function at(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":N&&N in Object(t)?function(t){var e=T.call(t,N),n=t[N];try{t[N]=void 0;var r=!0}catch(i){}var o=L.call(t);r&&(e?t[N]=n:delete t[N]);return o}(t):function(t){return L.call(t)}(t)}function ct(t){return Et(t)&&at(t)==i}function ut(t){return!(!St(t)||function(t){return!!R&&R in t}(t))&&(kt(t)?D:c).test(function(t){if(null!=t){try{return x.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t))}function lt(t){if(!St(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=vt(t),n=[];for(var r in t)("constructor"!=r||!e&&T.call(t,r))&&n.push(r);return n}function ft(t,e,n,r,o){t!==e&&st(e,(function(i,s){if(o||(o=new Z),St(i))!function(t,e,n,r,o,i,s){var c=bt(t,n),u=bt(e,n),l=s.get(u);if(l)return void et(t,n,l);var f=i?i(c,u,n+"",t,e,s):void 0,h=void 0===f;if(h){var p=wt(u),d=!p&&Pt(u),y=!p&&!d&&xt(u);f=u,p||d||y?wt(c)?f=c:Et(m=c)&&Ot(m)?f=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(c):d?(h=!1,f=function(t,e){if(e)return t.slice();var n=t.length,r=I?I(n):new t.constructor(n);return t.copy(r),r}(u,!0)):y?(h=!1,v=u,b=!0?(_=v.buffer,g=new _.constructor(_.byteLength),new B(g).set(new B(_)),g):v.buffer,f=new v.constructor(b,v.byteOffset,v.length)):f=[]:function(t){if(!Et(t)||at(t)!=a)return!1;var e=F(t);if(null===e)return!0;var n=T.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==C}(u)||mt(u)?(f=c,mt(c)?f=function(t){return function(t,e,n,r){var o=!n;n||(n={});var i=-1,s=e.length;for(;++i<s;){var a=e[i],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),o?ot(n,a,c):nt(n,a,c)}return n}(t,Tt(t))}(c):St(c)&&!kt(c)||(f=function(t){return"function"!=typeof t.constructor||vt(t)?{}:q(F(t))}(u))):h=!1}var v,b,_,g;var m;h&&(s.set(u,f),o(f,u,r,i,s),s.delete(u));et(t,n,f)}(t,e,s,n,ft,r,o);else{var c=r?r(bt(t,s),i,s+"",t,e,o):void 0;void 0===c&&(c=i),et(t,s,c)}}),Tt)}function ht(t,e){return _t(function(t,e,n){return e=Q(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Q(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),m(t,this,a)}}(t,e,Ct),t+"")}function pt(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function dt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return ut(n)?n:void 0}function yt(t,e){var n=typeof t;return!!(e=null==e?o:e)&&("number"==n||"symbol"!=n&&u.test(t))&&t>-1&&t%1==0&&t<e}function vt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||S)}function bt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var _t=function(t){var e=0,n=0;return function(){var r=U(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(V?function(t,e){return V(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Ct);function gt(t,e){return t===e||t!=t&&e!=e}var mt=ct(function(){return arguments}())?ct:function(t){return Et(t)&&T.call(t,"callee")&&!H.call(t,"callee")},wt=Array.isArray;function Ot(t){return null!=t&&jt(t.length)&&!kt(t)}var Pt=X||function(){return!1};function kt(t){if(!St(t))return!1;var e=at(t);return e==s||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function jt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function St(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Et(t){return null!=t&&"object"==typeof t}var xt=g?function(t){return function(e){return t(e)}}(g):function(t){return Et(t)&&jt(t.length)&&!!l[at(t)]};function Tt(t){return Ot(t)?tt(t,!0):lt(t)}var Rt,Lt=(Rt=function(t,e,n,r){ft(t,e,n,r)},ht((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Rt.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!St(n))return!1;var r=typeof e;return!!("number"==r?Ot(n)&&yt(e,n.length):"string"==r&&e in n)&&gt(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=e[n];s&&Rt(t,s,n,o)}return t})));function Ct(t){return t}t.exports=Lt},796:(t,e,n)=>{t.exports=n(643)},264:t=>{"use strict";var e=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:e,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:e&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};t.exports=n},518:t=>{var e,n,r,o,i,s,a,c,u,l,f,h,p,d,y,v=!1;function b(){if(!v){v=!0;var t=navigator.userAgent,b=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),_=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(h=/\b(iPhone|iP[ao]d)/.exec(t),p=/\b(iP[ao]d)/.exec(t),l=/Android/i.exec(t),d=/FBAN\/\w+;/i.exec(t),y=/Mobile/i.exec(t),f=!!/Win64/.exec(t),b){(e=b[1]?parseFloat(b[1]):b[5]?parseFloat(b[5]):NaN)&&document&&document.documentMode&&(e=document.documentMode);var g=/(?:Trident\/(\d+.\d+))/.exec(t);s=g?parseFloat(g[1])+4:e,n=b[2]?parseFloat(b[2]):NaN,r=b[3]?parseFloat(b[3]):NaN,(o=b[4]?parseFloat(b[4]):NaN)?(b=/(?:Chrome\/(\d+\.\d+))/.exec(t),i=b&&b[1]?parseFloat(b[1]):NaN):i=NaN}else e=n=r=i=o=NaN;if(_){if(_[1]){var m=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);a=!m||parseFloat(m[1].replace("_","."))}else a=!1;c=!!_[2],u=!!_[3]}else a=c=u=!1}}var _={ie:function(){return b()||e},ieCompatibilityMode:function(){return b()||s>e},ie64:function(){return _.ie()&&f},firefox:function(){return b()||n},opera:function(){return b()||r},webkit:function(){return b()||o},safari:function(){return _.webkit()},chrome:function(){return b()||i},windows:function(){return b()||c},osx:function(){return b()||a},linux:function(){return b()||u},iphone:function(){return b()||h},mobile:function(){return b()||h||p||l||y},nativeApp:function(){return b()||d},android:function(){return b()||l},ipad:function(){return b()||p}};t.exports=_},534:(t,e,n)=>{"use strict";var r,o=n(264);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=function(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i="function"==typeof s[n]}return!i&&r&&"wheel"===t&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},643:(t,e,n)=>{"use strict";var r=n(518),o=n(534);function i(t){var e=0,n=0,r=0,o=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=10*e,o=10*n,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||o)&&t.deltaMode&&(1==t.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!e&&(e=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},t.exports=i}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";var t={};n.r(t),n.d(t,{mergeWithoutArrays:()=>u,randID:()=>s,timeoutCallback:()=>l});var e={};n.r(e),n.d(e,{boundVal:()=>K,lerp:()=>J,scopeProgress:()=>G,spreadScopeProgress:()=>Z,wrap:()=>tt});var r={};n.r(r),n.d(r,{intersectionObserverSupported:()=>Tt,onScroll:()=>xt});var o={};n.r(o);var i={};function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id",e="".concat(+new Date,"_").concat(Math.round(1e3*Math.random()));return"".concat(t,"_").concat(e)}n.r(i),n.d(i,{AnimationFrame:()=>pt,Application:()=>Ce,Callbacks:()=>T,Component:()=>q,Ctx2D:()=>yo,Ctx2DPrerender:()=>To,CustomCursor:()=>ps,Dragger:()=>Mr,DraggerDirection:()=>eo,DraggerMove:()=>Vr,GeneralTypes:()=>o,Module:()=>F,MutableProp:()=>D,Page:()=>tn,PageLoad:()=>Se,Plugin:()=>ze,Preloader:()=>cr,ProgressPreloader:()=>wr,ScrollBar:()=>Qo,ScrollEventsBase:()=>oi,ScrollView:()=>gi,SmoothScroll:()=>St,SmoothScrollDragPlugin:()=>zi,SmoothScrollKeyboardPlugin:()=>xi,SplitText:()=>ts,StaticTimeline:()=>Bn,Timeline:()=>qn,Viewport:()=>_e,WheelHandler:()=>yn,utils:()=>ds});var a=n(554),c=n.n(a);function u(t,e){return c()(t,e,(function(t,e){if(Array.isArray(t))return e}))}function l(t,e){0===e?t():setTimeout((function(){t()}),e)}function f(t,e){return h(t,e)}function h(t,e){return t===e||null!==t&&h(t.parentNode,e)}function p(t){return t instanceof HTMLElement||t instanceof Element}function d(t){return t instanceof Window}function y(t,e){if(d(t))return t;if(p(t))return t;if(void 0!==e){const n=y(e);if(n)return n.querySelector(t)}return document.querySelector(t)}function v(t,e){if(t instanceof NodeList)return t;if(p(t))return[t];if(Array.isArray(t))return t;if(void 0!==e){const n=y(e);if(n)return n.querySelectorAll(t)}return document.querySelectorAll(t)}function b(t,e,n){const r=e.split(" ");for(let o=0;o<r.length;o++)void 0===n?t.classList.toggle(r[o]):n?t.classList.add(r[o]):t.classList.remove(r[o])}function _(t,e={}){const n=document.createElement(t);if(e.class&&function(t,e){if(t instanceof Element)b(t,e,!0);else for(let n=0;n<t.length;n++)b(t[n],e,!0)}(n,e.class),e.id&&n.setAttribute("id",e.id),e.attr)for(let r=0,o=e.attr.length;r<o;r++){const t=e.attr[r];n.setAttribute(t[0],t[1])}if(e.parent&&e.parent.appendChild(n),e.html&&(n.innerHTML=e.html),e.children)for(let r=0,o=e.children.length;r<o;r++)n.appendChild(e.children[r]);return n}const g=[];function m(t,e,n,r){if(void 0!==r){const o={passive:!1,once:!1};r.once&&(o.once=!0),r.passive&&(o.passive=!0),t.addEventListener(e,n,o)}else t.addEventListener(e,n);const o=`${Math.random()}-${+new Date}`;return g.push({id:o,el:t,target:e,callback:n}),{id:o,remove:w.bind(this,o)}}function w(t){const e=[];for(let n=0,r=g.length;n<r;n++){const r=g[n];r.id===t?r.el.removeEventListener(r.target,r.callback):e.push(r)}}var O=n(796),P=n.n(O);function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var T=function(){function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];S(this,t),x(this,"_app",void 0),x(this,"_callbacks",void 0),this._app=window.vevetApp,this._callbacks=[],e&&this._init()}var e,n,r;return e=t,(n=[{key:"callbacks",get:function(){return this._callbacks}},{key:"_init",value:function(){this._constructor(),this._setEvents()}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=s("callback"),o={id:r,on:!0,data:j({target:t,do:e},n)};return this._callbacks.push(o),this._onAdd(r),{id:r,remove:this.remove.bind(this,r)}}},{key:"_onAdd",value:function(t){}},{key:"remove",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!1,o=this._callbacks.filter((function(o){return o.id!==t||!(!o.data.protected||n)||(e._onRemove(t),r=!0,!1)}));return this._callbacks=o,r}},{key:"_onRemove",value:function(t){}},{key:"removeAll",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._callbacks.length>0;)this.remove(this._callbacks[0].id,t)}},{key:"turn",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.get(t);return!!n&&(n.on=e,this._onTurn(t),!0)}},{key:"_onTurn",value:function(t){}},{key:"get",value:function(t){var e=this._callbacks.filter((function(e){return e.id===t}));return e.length>0&&e[0]}},{key:"_trigger",value:function(t,e){if(t.on){var n=t.data,r=n.timeout,o=n.once,i=t.data.do;r?l(e?this._triggerFunc.bind(this,i,e):this._triggerFunc.bind(this,i,!1),r):e?this._triggerFunc(i,e):this._triggerFunc(i,!1),o&&this.remove(t.id)}}},{key:"_triggerFunc",value:function(t,e){e?t(e):t()}},{key:"tbt",value:function(t,e){var n=this;this._callbacks.forEach((function(r){r.data.target===t&&n._trigger(r,e)}))}},{key:"destroy",value:function(){this.removeAll(!0)}}])&&E(e.prototype,n),r&&E(e,r),t}();function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var D=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"Responsive Prop";R(this,t),C(this,"_initProp",void 0),C(this,"_onResponsive",void 0),C(this,"_onChange",void 0),C(this,"_name",void 0),C(this,"_app",void 0),C(this,"_refProp",void 0),C(this,"_prop",void 0),C(this,"_responsiveRules",[]),C(this,"_viewportCallback",void 0),this._initProp=e,this._onResponsive=n,this._onChange=r,this._name=o,this._app=window.vevetApp,this._refProp=u({},e),this._prop=u({},e)}var e,n,r;return e=t,(n=[{key:"prop",get:function(){return this._prop}},{key:"addResponsiveProp",value:function(t){this._responsiveRules.push(t),void 0===this._viewportCallback&&(this._viewportCallback=this._app.viewport.add("w",this._responseProp.bind(this,!0),{name:this._name})),this._responseProp()}},{key:"_responseProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._responsiveRules,n=this._app,r=n.viewport,o=r.width,i=!1,s=u({},this._refProp);e.forEach((function(t){var e=t.settings,a=t.breakpoint;if("number"==typeof a)o<=t.breakpoint&&(i=u(s,e));else if("string"==typeof a){var c=a.toLowerCase();("d"===c&&r.isDesktop||"t"===c&&r.isTablet||"p"===c&&r.isPhone)&&(i=u(s,e)),("phone"===c&&n.isPhone||"tablet"===c&&n.isTablet||"mobile"===c&&n.isMobile)&&(i=u(s,e))}})),this._prop=u(this._prop,i||this._refProp),t&&this._onResponsive()}},{key:"changeProp",value:function(t){this._prop=u(this._prop,t),this._refProp=u(this._refProp,t),this._onChange(t)}},{key:"destroy",value:function(){this._viewportCallback&&this._viewportCallback.remove()}}])&&L(e.prototype,n),r&&L(e,r),t}();function M(){throw new Error('Vevet.Application does not exist yet. \nCall "new Vevet.Application()" before using all the stuff')}function W(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function I(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var F=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];W(this,t),I(this,"_mutableProp",void 0),I(this,"_callbacks",void 0),I(this,"_listeners",void 0),I(this,"_app",void 0),I(this,"_inited",!1),I(this,"_destroyed",void 0),I(this,"_viewportCallbacks",[]),window.vevetApp?this._app=window.vevetApp:M(),this._destroyed=!1,this._listeners=[],this._callbacks=new T;var r=u(this._getDefaultProp(),e||{});this._mutableProp=new D(r,this._onPropResponsive.bind(this),this._onPropChange.bind(this),this.name),n&&this.init()}var e,n,r;return e=t,(n=[{key:"_getDefaultProp",value:function(){return{parent:!1}}},{key:"prop",get:function(){return this._mutableProp.prop}},{key:"callbacks",get:function(){return this._callbacks}},{key:"prefix",get:function(){return""}},{key:"name",get:function(){return this.constructor.name}},{key:"inited",get:function(){return this._inited}},{key:"destroyed",get:function(){return this._destroyed}},{key:"addResponsiveProp",value:function(t){if(this._inited)throw new Error("Responsive properties cannot be added because the class instance is already initialized");this._mutableProp.addResponsiveProp(t)}},{key:"changeProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._mutableProp.changeProp(t),this._callbacks.tbt("changeProp",!1)}},{key:"_onPropResponsive",value:function(){this._onPropMutate()}},{key:"_onPropChange",value:function(t){this._onPropMutate()}},{key:"_onPropMutate",value:function(){}},{key:"init",value:function(){var t=this;this._inited||(this._inited=!0,this._constructor(),this._setEvents(),this.prop.parent&&this.prop.parent.addCallback("destroy",(function(){t.destroy()})))}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"addViewportCallback",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{name:this.constructor.name},r=this._app.viewport.add(t,e,n);return this._viewportCallbacks.push(r),r}},{key:"addCallback",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.callbacks.add(t,e,n);return r}},{key:"addEventListeners",value:function(t,e,n,r){var o=m(t,e,n,r);return this._listeners.push(o),o}},{key:"destroy",value:function(){this.destroyed||this._destroy()}},{key:"_destroy",value:function(){this._callbacks.tbt("destroy",!1),this._callbacks.destroy(),this._mutableProp.destroy(),this._viewportCallbacks.forEach((function(t){t.remove()})),this._listeners.forEach((function(t){t.remove()})),this._destroyed=!0}}])&&B(e.prototype,n),r&&B(e,r),t}();function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function H(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function N(t,e,n){return(N="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Y(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function V(t,e){return(V=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function X(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Y(t);if(e){var o=Y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Q(this,n)}}function Q(t,e){return!e||"object"!==A(e)&&"function"!=typeof e?U(t):e}function U(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Y(t){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&V(t,e)}(i,t);var e,n,r,o=X(i);function i(){var t;H(this,i);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return $(U(t=o.call.apply(o,[this].concat(n))),"_plugins",void 0),t}return e=i,(n=[{key:"addPlugin",value:function(t){void 0===this._plugins&&(this._plugins=[]),this._plugins.push(t),t.inited||t.initPlugin(this)}},{key:"_destroyPlugins",value:function(){this._plugins&&this._plugins.forEach((function(t){t.destroy()}))}},{key:"_destroy",value:function(){N(Y(i.prototype),"_destroy",this).call(this),this._destroyPlugins()}}])&&z(e.prototype,n),r&&z(e,r),i}(F);function K(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1];return t<e[0]?e[0]:t>e[1]?e[1]:t}function J(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001,o=t*(1-n)+e*n,i=Math.abs(e-o);return i<=r?e:o}function G(t,e){return(t-e[0])/(e[1]-e[0])}function Z(t,e){for(var n=[],r=1/(t-e*(t-1)),o=0;o<t;o+=1){var i=r*(1-e)*o,s=i+r;n.push([i,s])}return n}function tt(t,e,n){var r=e-t;return function(t,e){return t||0===t?e(t):e}(n,(function(e){return(r+(e-t)%r)%r+t}))}function et(t){return(et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function rt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(n),!0).forEach((function(e){ht(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function st(t,e,n){return(st="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ft(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function at(t,e){return(at=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ct(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ft(t);if(e){var o=ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ut(this,n)}}function ut(t,e){return!e||"object"!==et(e)&&"function"!=typeof e?lt(t):e}function lt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ft(t){return(ft=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ht(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var pt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&at(t,e)}(i,t);var e,n,r,o=ct(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ot(this,i),ht(lt(e=o.call(this,t,!1)),"_isPlaying",void 0),ht(lt(e),"_frame",void 0),ht(lt(e),"_frameIndex",void 0),ht(lt(e),"_timeStamp",void 0),ht(lt(e),"_prevFrameTime",void 0),e._isPlaying=!1,e._frame=null,e._frameIndex=-1,e._timeStamp=null,e._prevFrameTime=null,n&&e.init(),e}return e=i,(n=[{key:"isPlaying",get:function(){return this._isPlaying}},{key:"_getDefaultProp",value:function(){return rt(rt({},st(ft(i.prototype),"_getDefaultProp",this).call(this)),{},{fps:140,run:!1})}},{key:"_constructor",value:function(){st(ft(i.prototype),"_constructor",this).call(this),this._create()}},{key:"_create",value:function(){this.prop.run&&this.play()}},{key:"_onPropMutate",value:function(){this._frameIndex=-1,this._timeStamp=null,this._prevFrameTime=null,this.prop.run?this._play():this._pause()}},{key:"play",value:function(){this.destroyed||this.prop.run||this.changeProp({run:!0})}},{key:"_play",value:function(){this.isPlaying||(this._isPlaying=!0,this._frame=window.requestAnimationFrame(this._animate.bind(this)))}},{key:"pause",value:function(){this.prop.run&&this.changeProp({run:!1})}},{key:"_pause",value:function(){this.isPlaying&&(this._frame&&(window.cancelAnimationFrame(this._frame),this._frame=null),this._isPlaying=!1)}},{key:"_animate",value:function(t){if(this._isPlaying){this._frame=window.requestAnimationFrame(this._animate.bind(this));var e=+new Date;null==this._timeStamp&&(this._timeStamp=t),null==this._prevFrameTime&&(this._prevFrameTime=e);var n=Math.floor((t-this._timeStamp)/(1e3/this.prop.fps));if(!(n<=this._frameIndex)){this._frameIndex=n;var r=e-this._prevFrameTime,o=K(0===r?1e3/60:Math.floor(1e3/r),[1,1/0]);this.callbacks.tbt("frame",{fps:this.prop.fps,realFPS:o,prevFrameDuration:e-this._prevFrameTime}),this._prevFrameTime=+new Date}}}},{key:"_destroy",value:function(){this.pause(),st(ft(i.prototype),"_destroy",this).call(this)}}])&&it(e.prototype,n),r&&it(e,r),i}(q);function dt(t){return(dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yt(Object(n),!0).forEach((function(e){jt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function bt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function gt(t,e,n){return(gt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=kt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function mt(t,e){return(mt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=kt(t);if(e){var o=kt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ot(this,n)}}function Ot(t,e){return!e||"object"!==dt(e)&&"function"!=typeof e?Pt(t):e}function Pt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function kt(t){return(kt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var St=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mt(t,e)}(i,t);var e,n,r,o=wt(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];bt(this,i),jt(Pt(e=o.call(this,t,!1)),"_outer",void 0),jt(Pt(e),"_container",void 0),jt(Pt(e),"_containerExists",void 0),jt(Pt(e),"_elements",void 0),jt(Pt(e),"_elementsLength",void 0),jt(Pt(e),"_targetLeft",void 0),jt(Pt(e),"_targetTop",void 0),jt(Pt(e),"_scrollLeft",void 0),jt(Pt(e),"_scrollTop",void 0),jt(Pt(e),"_scrollWidth",void 0),jt(Pt(e),"_scrollHeight",void 0),jt(Pt(e),"_clientWidth",void 0),jt(Pt(e),"_clientHeight",void 0),jt(Pt(e),"_instant",void 0),jt(Pt(e),"_animationFrame",void 0),jt(Pt(e),"_outerAnimationFrameEvent",void 0),jt(Pt(e),"_currentFPS",void 0);var r=e.prop.selectors;if(e._targetLeft=0,e._targetTop=0,e._scrollLeft=0,e._scrollTop=0,e._scrollWidth=0,e._scrollHeight=0,e._clientWidth=0,e._clientHeight=0,e._instant=!1,e._animationFrame=void 0,e._outerAnimationFrameEvent=void 0,e._currentFPS=60,e._outer=y(r.outer),!(e._outer instanceof HTMLElement))throw new Error("".concat(r.outer," is not a HTMLElement"));e._outer.classList.add(e.prefix);var s=y(".".concat(e.prefix,"__container"),e.outer);return p(s)?(e._container=s,e._containerExists=!0):(e._container=_("div",{class:"".concat(e.prefix,"__container"),parent:e.outer,children:Array.from(e.outer.children)}),e._containerExists=!1),r.elements?e._elements=Array.from(v(r.elements,e._outer)):e._elements=[e._container],e._elementsLength=e._elements.length,e.prop.useWillChange&&e._elements.forEach((function(t){t.style.willChange="transform"})),n&&e.init(),e}return e=i,(n=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"smooth-scroll")}},{key:"outer",get:function(){return this._outer}},{key:"container",get:function(){return this._container}},{key:"elements",get:function(){return this._elements}},{key:"targetLeft",get:function(){return this._targetLeft},set:function(t){this.targetLeftBound=t,this._enable()}},{key:"targetLeftBound",get:function(){return this._targetLeft},set:function(t){var e=this.prop.overscroll&&this.prop.isHorizontal?-this.prop.overscroll.max:0,n=this.maxScrollableWidth+(this.prop.overscroll&&this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetLeft=K(t,[e,n])}},{key:"targetTop",get:function(){return this._targetTop},set:function(t){this.targetTopBound=t,this._enable()}},{key:"targetTopBound",get:function(){return this._targetTop},set:function(t){var e=this.prop.overscroll&&!this.prop.isHorizontal?-this.prop.overscroll.max:0,n=this.maxScrollableHeight+(this.prop.overscroll&&!this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetTop=K(t,[e,n])}},{key:"scrollLeft",get:function(){return this._scrollLeft},set:function(t){this.targetLeftBound=t,this._scrollLeft=this._targetLeft,this._enable()}},{key:"scrollTop",get:function(){return this._scrollTop},set:function(t){this.targetTopBound=t,this._scrollTop=this._targetTop,this._enable()}},{key:"scrollWidth",get:function(){return this._scrollWidth}},{key:"scrollHeight",get:function(){return this._scrollHeight}},{key:"clientWidth",get:function(){return this._clientWidth}},{key:"clientHeight",get:function(){return this._clientHeight}},{key:"maxScrollableWidth",get:function(){return this.scrollWidth-this.clientWidth}},{key:"maxScrollableHeight",get:function(){return this.scrollHeight-this.clientHeight}},{key:"_getDefaultProp",value:function(){return vt(vt({},gt(kt(i.prototype),"_getDefaultProp",this).call(this)),{},{selectors:{outer:"#".concat(this.prefix),elements:!1},enabled:!0,animationFrame:!1,recalculateSizes:!0,useWheel:!0,autoStop:!0,isHorizontal:!1,stopPropagation:!0,useWillChange:!0,render:{lerp:.1,lerpToFixed:2,approximation:.1,normalizeLerp:!1},overscroll:{friction:.5,max:250}})}},{key:"_constructor",value:function(){gt(kt(i.prototype),"_constructor",this).call(this),this._toggle()}},{key:"_setEvents",value:function(){var t=this;this.resize(),this.addViewportCallback("",(function(){t.resize(!0)})),this.addEventListeners(this.outer,"wheel",(function(e){t._handleWheel(e)})),this.addEventListeners(this.outer,"scroll",(function(){t.outer.scrollTop=0,t.outer.scrollLeft=0}))}},{key:"_onPropMutate",value:function(){gt(kt(i.prototype),"_onPropMutate",this).call(this),this.resize(),this._toggle()}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.container,n=this.outer;this._clientWidth=n.clientWidth,this._clientHeight=n.clientHeight,this._scrollWidth=K(e.clientWidth,[this.clientWidth,1/0]),this._scrollHeight=K(e.clientHeight,[this.clientHeight,1/0]),t&&(this._instant=!0),t&&(this.targetLeft=parseInt(this.targetLeft.toFixed(0),10),this.targetTop=parseInt(this.targetTop.toFixed(0),10));var r=this.maxScrollableHeight>0||this.maxScrollableWidth>0;n.classList.toggle("has-scroll",r),n.classList.toggle("no-scroll",!r),this._updateElementsProp(),this.callbacks.tbt("resize",!1)}},{key:"_recalculateSizes",value:function(){var t=this.container,e=t.clientHeight,n=t.clientWidth;e===this.scrollHeight&&n===this.scrollWidth||this.resize()}},{key:"_updateElementsProp",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t];e.smoothScrollLeft=this.scrollLeft,e.smoothScrollTop=this.scrollTop;var n=e.getAttribute("".concat(this.prefix,"-ease"));if(n)try{e.smoothScrollLerpEase=parseFloat(n)}catch(r){}}}},{key:"_handleWheel",value:function(t){var e=this.prop;if(e.enabled&&e.useWheel){(e.stopPropagation||!e.stopPropagation&&(this.scrollLeft>0&&this.scrollLeft<this.maxScrollableWidth||this.scrollTop>0&&this.scrollTop<this.maxScrollableHeight))&&(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault());var n=P()(t);this.targetLeftBound+=e.isHorizontal?n.pixelY:n.pixelX,this.targetTopBound+=e.isHorizontal?n.pixelX:n.pixelY,this._enable(),this.callbacks.tbt("wheel",t)}}},{key:"_toggle",value:function(){this.prop.enabled?this._enable():this._disable()}},{key:"_enable",value:function(){var t=this;this.prop.enabled&&(this.prop.animationFrame&&!this._outerAnimationFrameEvent?this._outerAnimationFrameEvent=this.prop.animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})):(this._animationFrame||(this._animationFrame=new pt,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()}))),this._animationFrame.play()))}},{key:"_disable",value:function(){this._outerAnimationFrameEvent&&this.prop.animationFrame&&this._outerAnimationFrameEvent.remove(),this._animationFrame&&this._animationFrame.pause()}},{key:"render",value:function(){var t=this.prop;t.recalculateSizes&&this._recalculateSizes(),this._calcScroll(),this._calcElements(),this._renderElements(),this._instant&&(this._instant=!1),this.callbacks.tbt("scroll",!1);var e=Math.abs(this.targetTop-this.scrollTop);0===Math.abs(this.targetLeft-this.scrollLeft)&&0===e&&t.autoStop&&(this._disable(),this.callbacks.tbt("approximate",!1))}},{key:"_calcScroll",value:function(){var t=this.prop.overscroll;t&&(this.targetLeft<0?this.targetLeftBound=this._lerp(this.targetLeftBound,0,t.friction):this.targetLeft>this.maxScrollableWidth&&(this.targetLeftBound=this._lerp(this.targetLeftBound,this.maxScrollableWidth,t.friction)),this.targetTop<0?this.targetTopBound=this._lerp(this.targetTopBound,0,t.friction):this.targetTop>this.maxScrollableHeight&&(this.targetTopBound=this._lerp(this.targetTopBound,this.maxScrollableHeight,t.friction))),this._scrollLeft=this._lerp(this.scrollLeft,this.targetLeft),this._scrollTop=this._lerp(this.scrollTop,this.targetTop)}},{key:"_calcElements",value:function(){for(var t=this._getLerpEase(),e=0;e<this._elementsLength;e+=1){var n=this._elements[e],r=this._getLerpEase(n);r===t?(n.smoothScrollLeft=this._scrollLeft,n.smoothScrollTop=this._scrollTop):(n.smoothScrollLeft=this._lerp(n.smoothScrollLeft,this._targetLeft,r),n.smoothScrollTop=this._lerp(n.smoothScrollTop,this._targetTop,r))}}},{key:"_lerp",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._getLerpEase(),r=this.prop.render,o=r.lerpToFixed,i=r.approximation,s=this._instant?1:n,a=J(t,e,s,i);if("number"==typeof o){var c=Math.round(Math.abs(o));return parseFloat(a.toFixed(c))}return a}},{key:"_getLerpEase",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.prop.render,n=e.lerp,r=e.normalizeLerp,o=r?60/this._currentFPS:1;return t&&t.smoothScrollLerpEase||n*o}},{key:"_renderElements",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t],n=-e.smoothScrollLeft,r=-e.smoothScrollTop;e.style.transform="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0, ".concat(n,", ").concat(r,", 0,1)")}}},{key:"scrollTo",value:function(){var t=arguments;if(1===t.length&&"object"===dt(t[0])){var e=t[0],n=e.top,r=e.left,o=e.behavior;void 0!==r&&("smooth"===o?this.targetLeftBound=r:this.scrollLeft=r),void 0!==n&&("smooth"===o?this.targetTopBound=n:this.scrollTop=n),"smooth"===o&&this._enable()}"number"!=typeof t[0]&&"number"!=typeof t[1]||("number"==typeof t[0]&&(this.scrollLeft=t[0]),"number"==typeof t[1]&&(this.scrollTop=t[1]))}},{key:"_destroy",value:function(){if(gt(kt(i.prototype),"_destroy",this).call(this),this._disable(),this._animationFrame&&this._animationFrame.destroy(),!this._containerExists){for(;this._container.firstChild;)this._outer.appendChild(this._container.firstChild);this._container.remove()}this._outer.classList.remove(this.prefix),this._elements.forEach((function(t){t.style.transform="",t.style.willChange=""}))}}])&&_t(e.prototype,n),r&&_t(e,r),i}(q),Et=[];function xt(t){var e=t.container,n=t.callback,r=t.isPassive,o=void 0!==r&&r,i=Et.find((function(t){return t.container===e&&t.isPassive===o})),a=s("scroll-event");if(i)i.callbacks.push({id:a,callback:n});else{i={id:s("scroll-event-instance"),container:e,callbacks:[{id:a,callback:n}],isPassive:o,listeners:[]},Et.push(i);var c=i.listeners;if(e instanceof St)c.push(e.addCallback("scroll",(function(){for(var t=e.scrollTop,n=e.scrollLeft,r=0;r<i.callbacks.length;r+=1)i.callbacks[r].callback({scrollTop:t,scrollLeft:n})})));else{var u=e instanceof Window,l=y(e);c.push(m(l,"scroll",(function(){for(var t=u?l.pageYOffset:l.scrollTop,e=u?l.pageXOffset:l.scrollLeft,n=0;n<i.callbacks.length;n+=1)i.callbacks[n].callback({scrollTop:t,scrollLeft:e})}),{passive:o}))}}return{remove:function(){var t=i.callbacks.filter((function(t){return t.id!==a}));i.callbacks=t,0===t.length&&(i.listeners.forEach((function(t){t.remove()})),Et=Et.filter((function(t){return t.id!==i.id})))}}}function Tt(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype}var Rt=/iPhone/i,Lt=/iPod/i,Ct=/iPad/i,Dt=/\biOS-universal(?:.+)Mac\b/i,Mt=/\bAndroid(?:.+)Mobile\b/i,Wt=/Android/i,Bt=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,It=/Silk/i,Ft=/Windows Phone/i,At=/\bWindows(?:.+)ARM\b/i,Ht=/BlackBerry/i,zt=/BB10/i,Nt=/Opera Mini/i,Vt=/\b(CriOS|Chrome)(?:.+)Mobile/i,Xt=/Mobile(?:.+)Firefox\b/i,Qt=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function Ut(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var n=e.userAgent,r=n.split("[FBAN");void 0!==r[1]&&(n=r[0]),void 0!==(r=n.split("Twitter"))[1]&&(n=r[0]);var o=function(t){return function(e){return e.test(t)}}(n),i={apple:{phone:o(Rt)&&!o(Ft),ipod:o(Lt),tablet:!o(Rt)&&(o(Ct)||Qt(e))&&!o(Ft),universal:o(Dt),device:(o(Rt)||o(Lt)||o(Ct)||o(Dt)||Qt(e))&&!o(Ft)},amazon:{phone:o(Bt),tablet:!o(Bt)&&o(It),device:o(Bt)||o(It)},android:{phone:!o(Ft)&&o(Bt)||!o(Ft)&&o(Mt),tablet:!o(Ft)&&!o(Bt)&&!o(Mt)&&(o(It)||o(Wt)),device:!o(Ft)&&(o(Bt)||o(It)||o(Mt)||o(Wt))||o(/\bokhttp\b/i)},windows:{phone:o(Ft),tablet:o(At),device:o(Ft)||o(At)},other:{blackberry:o(Ht),blackberry10:o(zt),opera:o(Nt),firefox:o(Xt),chrome:o(Vt),device:o(Ht)||o(zt)||o(Nt)||o(Xt)||o(Vt)},any:!1,phone:!1,tablet:!1};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}var Yt,$t,qt=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},Kt=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},Jt=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},Gt=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},Zt=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},te=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},ee=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,ne=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],re=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function oe(t){return t?se(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new te:"undefined"!=typeof navigator?se(navigator.userAgent):"undefined"!=typeof process&&process.version?new Jt(process.version.slice(1)):null}function ie(t){return""!==t&&ne.reduce((function(e,n){var r=n[0],o=n[1];if(e)return e;var i=o.exec(t);return!!i&&[r,i]}),!1)}function se(t){var e=ie(t);if(!e)return null;var n=e[0],r=e[1];if("searchbot"===n)return new Zt;var o=r[1]&&r[1].split(/[._]/).slice(0,3);o?o.length<3&&(o=qt(o,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-o.length))):o=[];var i=o.join("."),s=function(t){for(var e=0,n=re.length;e<n;e++){var r=re[e],o=r[0];if(r[1].exec(t))return o}return null}(t),a=ee.exec(t);return a&&a[1]?new Gt(n,i,s,a[1]):new Kt(n,i,s)}class ae extends Error{constructor(t){super(t||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}}class ce{static fn(t){return(...e)=>new ce(((n,r,o)=>{e.push(o),t(...e).then(n,r)}))}constructor(t){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise(((e,n)=>{this._reject=n;const r=t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)};Object.defineProperties(r,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}}),t((t=>{this._isCanceled&&r.shouldReject||(this._isPending=!1,e(t))}),(t=>{this._isPending=!1,n(t)}),r)}))}then(t,e){return this._promise.then(t,e)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(this._isPending&&!this._isCanceled){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(const t of this._cancelHandlers)t()}catch(e){return void this._reject(e)}this._rejectOnCancel&&this._reject(new ae(t))}}get isCanceled(){return this._isCanceled}}function ue(t){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function le(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function fe(t,e,n){return(fe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ve(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function he(t,e){return(he=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ve(t);if(e){var o=ve(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return de(this,n)}}function de(t,e){return!e||"object"!==ue(e)&&"function"!=typeof e?ye(t):e}function ye(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ve(t){return(ve=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function be(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.setPrototypeOf(ce.prototype,Promise.prototype),function(t){t.Desktop="desktop",t.Tablet="tablet",t.Phone="phone"}(Yt||(Yt={})),function(t){t.Landscape="landscape",t.Portrait="portrait"}($t||($t={}));var _e=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&he(t,e)}(i,t);var e,n,r,o=pe(i);function i(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),be(ye(t=o.call(this,!1)),"_width",void 0),be(ye(t),"_height",void 0),be(ye(t),"_prevSize",void 0),be(ye(t),"_isDesktop",void 0),be(ye(t),"_isTablet",void 0),be(ye(t),"_isPhone",void 0),t._width=0,t._height=0,t._prevSize={w:0,h:0},t._isDesktop=!1,t._isTablet=!1,t._isPhone=!1,t._init(),t}return e=i,(n=[{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"vw",get:function(){return this.width/100}},{key:"vh",get:function(){return this.height/100}},{key:"prevSize",get:function(){return this._prevSize}},{key:"isLandscape",get:function(){return this.width>this.height}},{key:"isPortrait",get:function(){return this.width<this.height}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isPhone",get:function(){return this._isPhone}},{key:"dpr",get:function(){return void 0!==window.devicePixelRatio?window.devicePixelRatio:1}},{key:"lowerDesktopDPR",get:function(){return this._app.isDesktop?1:this.dpr}},{key:"_constructor",value:function(){fe(ve(i.prototype),"_constructor",this).call(this),this._setValues()}},{key:"_setEvents",value:function(){var t=this;window.addEventListener("resize",(function(){l((function(){t._onResize()}),t._app.prop.viewportResizeTimeout)}))}},{key:"_setValues",value:function(){var t=this._app,e=t.html,n=t.prop;this._width=e.clientWidth,this._height=e.clientHeight,this._prevSize={w:this._width,h:this._height};var r=this.width;this._isDesktop=r>=n.tablet,this._isTablet=r<=n.tablet&&r>n.phone,this._isPhone=r<=n.phone,this._updateClasses(),this._updateCSSVars()}},{key:"_updateClasses",value:function(){var t=[Yt.Desktop,Yt.Tablet,Yt.Phone];this.isDesktop?this._updateBreakpointClasses(Yt.Desktop,t):this.isTablet?this._updateBreakpointClasses(Yt.Tablet,t):this._updateBreakpointClasses(Yt.Phone,t);var e=[$t.Landscape,$t.Portrait];this.isLandscape?this._updateBreakpointClasses($t.Landscape,e):this.isPortrait?this._updateBreakpointClasses($t.Portrait,e):this._updateBreakpointClasses("",e)}},{key:"_updateBreakpointClasses",value:function(t,e){var n=this._app.html,r=this._app.prefix;e.forEach((function(e){e===t?n.classList.add("".concat(r,"viewport-").concat(e)):n.classList.remove("".concat(r,"viewport-").concat(e))}))}},{key:"_updateCSSVars",value:function(){var t=this._app.html;t.style.setProperty("--vw","".concat(this.vw,"px")),t.style.setProperty("--vh","".concat(this.vh,"px"))}},{key:"_onResize",value:function(){var t=this._prevSize.w,e=this._prevSize.h;this._setValues();var n=this.width,r=this.height,o={widthChanged:n!==t,heightChanged:r!==e,orientationChanged:n>r!=t>e};n!==t&&r===e&&this.tbt("w_",o),r!==e&&n===t&&this.tbt("h_",o),n!==t&&r!==e&&(this.tbt("wh",o),this.tbt("hw",o)),n!==t&&this.tbt("w",o),r!==e&&this.tbt("h",o),this.tbt("",o)}}])&&le(e.prototype,n),r&&le(e,r),i}(T);function ge(t){return(ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function we(t,e){return(we=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Oe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=je(t);if(e){var o=je(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Pe(this,n)}}function Pe(t,e){return!e||"object"!==ge(e)&&"function"!=typeof e?ke(t):e}function ke(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function je(t){return(je=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Se=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&we(t,e)}(i,t);var e,n,r,o=Oe(i);function i(){var t,e,n,r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,!1),e=ke(t),r=void 0,(n="_loaded")in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,t._loaded=!1,t._init(),t}return e=i,(n=[{key:"loaded",get:function(){return this._loaded}},{key:"_setEvents",value:function(){var t=this;"complete"===document.readyState?this._handleLoaded():window.addEventListener("load",(function(){t._handleLoaded()}))}},{key:"_handleLoaded",value:function(){var t=this._app,e=t.prefix;this._loaded=!0,t.html.classList.remove("".concat(e,"loading")),t.body.classList.remove("".concat(e,"loading")),t.html.classList.add("".concat(e,"loaded")),this.tbt("",!1)}},{key:"onLoaded",value:function(t){if(!this.loaded)return this.add("",t.bind(this));t()}}])&&me(e.prototype,n),r&&me(e,r),i}(T);function Ee(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ee(Object(n),!0).forEach((function(e){Le(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Te(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Re(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Le(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ce=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Te(this,t),Le(this,"_prop",void 0),Le(this,"_prefix",void 0),Le(this,"_isPhone",void 0),Le(this,"_isTablet",void 0),Le(this,"_isMobile",void 0),Le(this,"_isDesktop",void 0),Le(this,"_osName",void 0),Le(this,"_browserName",void 0),Le(this,"_pages",[]),Le(this,"_page",!1),Le(this,"_pageLoad",void 0),Le(this,"_viewport",void 0),window.vevetApp)throw new Error("Vevet Application already exists!");this._prop=xe(xe({},this.defaultProp),e),this._prefix=this.prop.prefix,this._sayHi(),window.vevetApp=this;var n=Ut();this._isPhone=n.phone,this.html.classList.toggle("".concat(this.prefix,"phone"),this._isPhone),this._isTablet=n.tablet,this.html.classList.toggle("".concat(this.prefix,"tablet"),this._isTablet),this._isMobile=n.phone||n.tablet,this.html.classList.toggle("".concat(this.prefix,"mobile"),this._isMobile),this._isDesktop=!this._isMobile,this.html.classList.toggle("".concat(this.prefix,"desktop"),this._isDesktop);var r=oe();if(null!=r&&r.os){var o=r.os.split(" ")[0].toLowerCase();this.html.classList.add("".concat(this.prefix,"os-").concat(o)),this._osName=o}else this._osName="";if(null!=r&&r.name){var i=r.name.toLowerCase();this.html.classList.add("".concat(this.prefix,"browser-").concat(i)),this._browserName=i}else this._browserName="";this._pageLoad=new Se,this._viewport=new _e}var e,n,r;return e=t,(n=[{key:"prop",get:function(){return this._prop}},{key:"defaultProp",get:function(){return{tablet:1199,phone:899,prefix:"v-",easing:[.25,.1,.25,1],viewportResizeTimeout:0}}},{key:"prefix",get:function(){return this._prefix}},{key:"isPhone",get:function(){return this._isPhone}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isMobile",get:function(){return this._isMobile}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"osName",get:function(){return this._osName}},{key:"browserName",get:function(){return this._browserName}},{key:"doc",get:function(){return document}},{key:"html",get:function(){return document.documentElement}},{key:"body",get:function(){return document.body}},{key:"pages",get:function(){return this._pages}},{key:"page",get:function(){return this._page},set:function(t){this._page=t}},{key:"onPageCreated",value:function(){var t=this;return new ce((function(e){t._page?t._page.onCreate().then((function(){e(t.page)})):setTimeout((function(){t.onPageCreated().then((function(){e(t.page)}))}),30)}))}},{key:"onPageShown",value:function(){var t=this;return new ce((function(e){t.onPageCreated().then((function(){t._page&&t._page.onShow().then((function(){e(t.page)}))}))}))}},{key:"pageLoad",get:function(){return this._pageLoad}},{key:"onPageLoaded",value:function(){var t=this;return new ce((function(e){t._pageLoad.onLoaded((function(){e()}))}))}},{key:"viewport",get:function(){return this._viewport}},{key:"_sayHi",value:function(){var t=["padding: 1rem 1.5rem;","background: #5F2580;","font: 1rem/1 Arial;","color: #ffffff;"].join("");console.log("%c%s",t,"Vevet")}}])&&Re(e.prototype,n),r&&Re(e,r),t}();function De(t){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function We(t,e,n){return(We="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=He(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Be(t,e){return(Be=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ie(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=He(t);if(e){var o=He(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fe(this,n)}}function Fe(t,e){return!e||"object"!==De(e)&&"function"!=typeof e?Ae(t):e}function Ae(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function He(t){return(He=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ze=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Be(t,e)}(i,t);var e,n,r,o=Ie(i);function i(t){var e,n,r,s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t,!1),n=Ae(e),s=void 0,(r="_component")in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,e}return e=i,(n=[{key:"component",get:function(){return this._component}},{key:"init",value:function(){if(!this._component)throw new Error("Component is not set. Be sure that initlugin is called before.");We(He(i.prototype),"init",this).call(this)}},{key:"initPlugin",value:function(t){this._inited||(this._component=t,this.init())}}])&&Me(e.prototype,n),r&&Me(e,r),i}(F);function Ne(t){return(Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ve(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ve(Object(n),!0).forEach((function(e){Ze(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Qe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ue(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ye(t,e,n){return(Ye="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ge(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function $e(t,e){return($e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ge(t);if(e){var o=Ge(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ke(this,n)}}function Ke(t,e){return!e||"object"!==Ne(e)&&"function"!=typeof e?Je(t):e}function Je(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ge(t){return(Ge=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ze(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var tn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$e(t,e)}(i,t);var e,n,r,o=qe(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Qe(this,i),Ze(Je(e=o.call(this,t,!1)),"_blocked",void 0),Ze(Je(e),"_created",void 0),Ze(Je(e),"_shown",void 0),Ze(Je(e),"_hidden",void 0),Ze(Je(e),"_viaAJAX",void 0),e._blocked=!1,e._created=!1,e._shown=!1,e._hidden=!1,e._destroyed=!1,e._viaAJAX=!1,n&&e.init(),e}return e=i,(n=[{key:"blocked",get:function(){return this._blocked}},{key:"created",get:function(){return this._created}},{key:"shown",get:function(){return this._shown}},{key:"hidden",get:function(){return this._hidden}},{key:"viaAJAX",get:function(){return this._viaAJAX}},{key:"pageClassName",get:function(){return"".concat(this._app.prefix,"page-").concat(this.prop.name)}},{key:"_getDefaultProp",value:function(){return Xe(Xe({},Ye(Ge(i.prototype),"_getDefaultProp",this).call(this)),{},{name:"home"})}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(n,r){t.canCreate().then((function(){t.created||t.blocked?r():(t._blocked=!0,t._shown=!1,t._hidden=!1,t._destroyed=!1,t._viaAJAX=e,t._app.page=t,t._app.html.classList.add(t.pageClassName),t._create().then((function(){t.callbacks.tbt("create",!1),t._blocked=!1,t._created=!0,n()})).catch((function(){r()})))})).catch((function(){r()}))}))}},{key:"_create",value:function(){return new Promise((function(t){t()}))}},{key:"canCreate",value:function(){var t=this;return new Promise((function(e,n){t.created?n():e()}))}},{key:"show",value:function(){var t=this;return new Promise((function(e,n){t.canShow().then((function(){t.shown||t.blocked?n():(t._blocked=!0,t._created=!0,t._hidden=!1,t._destroyed=!1,t._show().then((function(){t.callbacks.tbt("show",!1),t._blocked=!1,t._shown=!0,e()})).catch((function(){n()})))})).catch((function(){n()}))}))}},{key:"_show",value:function(){return new Promise((function(t){t()}))}},{key:"canShow",value:function(){var t=this;return new Promise((function(e,n){!t.created||t.shown?n():e()}))}},{key:"hide",value:function(){var t=this;return new Promise((function(e,n){t.canHide().then((function(){t.hidden||t.blocked?n():(t._blocked=!0,t._created=!0,t._shown=!1,t._destroyed=!1,t._hide().then((function(){t.callbacks.tbt("hide",!1),t._blocked=!1,t._hidden=!0,e()})).catch((function(){n()})))})).catch((function(){n()}))}))}},{key:"_hide",value:function(){return new Promise((function(t){t()}))}},{key:"canHide",value:function(){var t=this;return new Promise((function(e,n){t.created&&t.shown&&!t.hidden?e():n()}))}},{key:"destroy",value:function(){var t=this;return new Promise((function(e,n){t.canDestroy().then((function(){t.destroyed||t.blocked?n():(t._blocked=!0,t._created=!1,t._shown=!1,t._hidden=!0,t._app.page=!1,t._app.html.classList.remove(t.pageClassName),t._destroy().then((function(){t._blocked=!1,t._destroyed=!0,e()})).catch((function(){n()})))})).catch((function(){n()}))}))}},{key:"_destroy",value:function(){var t=this;return new Promise((function(e){Ye(Ge(i.prototype),"_destroy",t).call(t),e()}))}},{key:"canDestroy",value:function(){var t=this;return new Promise((function(e,n){t.created&&t.hidden&&!t.destroyed?e():n()}))}},{key:"onCreate",value:function(){var t=this;return new ce((function(e){t.created?e():t.addCallback("create",(function(){e()}),{once:!0})}))}},{key:"onShow",value:function(){var t=this;return new ce((function(e){t.shown?e():t.addCallback("show",(function(){e()}),{once:!0})}))}},{key:"onHide",value:function(){var t=this;return new ce((function(e){t.hidden?e():t.addCallback("hide",(function(){e()}),{once:!0})}))}}])&&Ue(e.prototype,n),r&&Ue(e,r),i}(q);function en(t){return(en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function rn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nn(Object(n),!0).forEach((function(e){pn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function on(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function an(t,e){return(an=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function cn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=hn(t);if(e){var o=hn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return un(this,n)}}function un(t,e){return!e||"object"!==en(e)&&"function"!=typeof e?ln(t):e}function ln(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fn(t,e,n){return(fn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=hn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function hn(t){return(hn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function pn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var dn,yn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&an(t,e)}(i,t);var e,n,r,o=cn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return on(this,i),pn(ln(e=o.call(this,t,!1)),"_wheelListener",void 0),pn(ln(e),"_lockWheel",void 0),pn(ln(e),"_lockWheelTimeout",void 0),e._wheelListener=void 0,e._lockWheel=!1,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return rn(rn({},fn(hn(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,enabled:!0,stopPropagation:!1,threshold:20})}},{key:"container",get:function(){return this.prop.container?this.prop.container:window}},{key:"_setEvents",value:function(){fn(hn(i.prototype),"_setEvents",this).call(this),this.container instanceof Window?this._toggleWheelEvent():(this._listeners.push(m(this.container,"mouseenter",this._handleMouseEnter.bind(this))),this._listeners.push(m(this.container,"mouseleave",this._handleMouseLeave.bind(this))))}},{key:"_onPropMutate",value:function(){fn(hn(i.prototype),"_onPropMutate",this).call(this),this._toggleWheelEvent()}},{key:"_handleMouseEnter",value:function(){this.prop.enabled&&this._createWheelEvent()}},{key:"_handleMouseLeave",value:function(){this._destroyWheelEvent()}},{key:"_toggleWheelEvent",value:function(){this.prop.enabled?this._createWheelEvent():this._destroyWheelEvent()}},{key:"_createWheelEvent",value:function(){this._wheelListener||(this._lockWheel=!1,this._lockWheelTimeout&&clearTimeout(this._lockWheelTimeout),this._wheelListener=m(this.container,"wheel",this._handleWheel.bind(this)))}},{key:"_destroyWheelEvent",value:function(){this._wheelListener&&(this._wheelListener.remove(),this._wheelListener=void 0)}},{key:"_handleWheel",value:function(t){var e=this;if(this._wheelListener){if(this.prop.stopPropagation&&(t.preventDefault(),t.stopPropagation()),this._lockWheel)return this._lockWheelTimeout&&clearTimeout(this._lockWheelTimeout),void(this._lockWheelTimeout=setTimeout((function(){e._lockWheel=!1}),300));var n=P()(t),r=this.prop.threshold,o=!1;n.pixelY>r?(this._callbacks.tbt("down",!1),o=!0):n.pixelY<-1*r&&(this._callbacks.tbt("up",!1),o=!0),n.pixelX>r?(this._callbacks.tbt("right",!1),o=!0):n.pixelX<-1*r&&(this._callbacks.tbt("left",!1),o=!0),o&&(this._lockWheel=!0)}}},{key:"_destroy",value:function(){fn(hn(i.prototype),"_destroy",this).call(this),this._destroyWheelEvent()}}])&&sn(e.prototype,n),r&&sn(e,r),i}(F);function vn(t,e){const[n,r,o,i]=e;if(n===r&&o===i)return t;const s=[];for(let a=0;a<11;++a)s[a]=bn(.1*a,n,o);return 0===t?0:1===t?1:bn(function(t,e,n){const r=t[0],o=t[2];let i=0,s=1;for(;10!==s&&n[s]<=e;++s)i+=.1;--s;const a=(e-n[s])/(n[s+1]-n[s]),c=i+.1*a,u=wn(c,r,o);if(u>=.001)return function(t,e,n,r){for(let o=0;o<4;++o){const o=wn(e,n,r);if(0===o)return e;e-=(bn(e,n,r)-t)/o}return e}(e,c,r,o);if(0===u)return c;return function(t,e,n,r,o){let i,s,a=0;do{s=e+(n-e)/2,i=bn(s,r,o)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<10);return s}(e,i,i+.1,r,o)}(e,t,s),r,i)}function bn(t,e,n){return((_n(e,n)*t+gn(e,n))*t+mn(e))*t}function _n(t,e){return 1-3*e+3*t}function gn(t,e){return 3*e-6*t}function mn(t){return 3*t}function wn(t,e,n){return 3*_n(e,n)*t*t+2*gn(e,n)*t+mn(e)}function On(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375}function Pn(t,e){switch(e){case dn.easeInSine:return n=t,1-Math.cos(n*Math.PI/2);case dn.easeOutSine:return function(t){return Math.sin(t*Math.PI/2)}(t);case dn.easeInOutSine:return function(t){return-(Math.cos(Math.PI*t)-1)/2}(t);case dn.easeInQuad:return function(t){return Math.pow(t,2)}(t);case dn.easeOutQuad:return function(t){return 1-Math.pow(1-t,2)}(t);case dn.easeInOutQuad:return function(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}(t);case dn.easeInCubic:return function(t){return Math.pow(t,3)}(t);case dn.easeOutCubic:return function(t){return 1-Math.pow(1-t,3)}(t);case dn.easeInOutCubic:return function(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}(t);case dn.easeInQuart:return function(t){return Math.pow(t,4)}(t);case dn.easeOutQuart:return function(t){return 1-Math.pow(1-t,4)}(t);case dn.easeInOutQuart:return function(t){return t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2}(t);case dn.easeInQuint:return function(t){return Math.pow(t,5)}(t);case dn.easeOutQuint:return function(t){return 1-Math.pow(1-t,5)}(t);case dn.easeInOutQuint:return function(t){return t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2}(t);case dn.easeInExpo:return function(t){return 0===t?0:Math.pow(2,10*t-10)}(t);case dn.easeOutExpo:return function(t){return 1===t?1:1-Math.pow(2,-10*t)}(t);case dn.easeInOutExpo:return function(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}(t);case dn.easeInCirc:return function(t){return 1-Math.sqrt(1-Math.pow(t,2))}(t);case dn.easeOutCirc:return function(t){return Math.sqrt(1-Math.pow(t-1,2))}(t);case dn.easeInOutCirc:return function(t){return t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2}(t);case dn.easeInBack:return function(t){return 2.70158*t*t*t-1.70158*t*t}(t);case dn.easeOutBack:return function(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}(t);case dn.easeInOutBack:return function(t){const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2}(t);case dn.easeInElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*e)}(t);case dn.easeOutElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1}(t);case dn.easeInOutElastic:return function(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}(t);case dn.easeInBounce:return function(t){return 1-On(1-t)}(t);case dn.easeOutBounce:return On(t);case dn.easeInOutBounce:return function(t){return t<.5?(1-On(1-2*t))/2:(1+On(2*t-1))/2}(t);default:return t}var n}function kn(t){return(kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Sn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jn(Object(n),!0).forEach((function(e){Wn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function En(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Tn(t,e){return(Tn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Rn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Mn(t);if(e){var o=Mn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ln(this,n)}}function Ln(t,e){return!e||"object"!==kn(e)&&"function"!=typeof e?Cn(t):e}function Cn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dn(t,e,n){return(Dn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Mn(t){return(Mn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Wn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(t){t.easeInSine="easeInSine",t.easeOutSine="easeOutSine",t.easeInOutSine="easeInOutSine",t.easeInQuad="easeInQuad",t.easeOutQuad="easeOutQuad",t.easeInOutQuad="easeInOutQuad",t.easeInCubic="easeInCubic",t.easeOutCubic="easeOutCubic",t.easeInOutCubic="easeInOutCubic",t.easeInQuart="easeInQuart",t.easeOutQuart="easeOutQuart",t.easeInOutQuart="easeInOutQuart",t.easeInQuint="easeInQuint",t.easeOutQuint="easeOutQuint",t.easeInOutQuint="easeInOutQuint",t.easeInExpo="easeInExpo",t.easeOutExpo="easeOutExpo",t.easeInOutExpo="easeInOutExpo",t.easeInCirc="easeInCirc",t.easeOutCirc="easeOutCirc",t.easeInOutCirc="easeInOutCirc",t.easeInBack="easeInBack",t.easeOutBack="easeOutBack",t.easeInOutBack="easeInOutBack",t.easeInElastic="easeInElastic",t.easeOutElastic="easeOutElastic",t.easeInOutElastic="easeInOutElastic",t.easeInBounce="easeInBounce",t.easeOutBounce="easeOutBounce",t.easeInOutBounce="easeInOutBounce"}(dn||(dn={}));var Bn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Tn(t,e)}(i,t);var e,n,r,o=Rn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return En(this,i),Wn(Cn(e=o.call(this,t,!1)),"_progress",void 0),Wn(Cn(e),"_easing",void 0),Wn(Cn(e),"_nestedTimelines",void 0),e._progress=0,e._easing=0,e._nestedTimelines=[],n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Sn(Sn({},Dn(Mn(i.prototype),"_getDefaultProp",this).call(this)),{},{easing:this._app.prop.easing,scope:[0,1],useNestedEasingProgress:!1})}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"easing",get:function(){return this._easing}},{key:"addNestedTimeline",value:function(t){this._nestedTimelines.push(t)}},{key:"_handleProgress",value:function(){this._easing=function(t,e=!1){return e?Array.isArray(e)?vn(t,e):"function"==typeof e?e(t):Pn(t,e):t}(this._progress,this.prop.easing),this._callbacks.tbt("progress",{progress:this._progress,easing:this._easing}),this._renderNestedTimelines()}},{key:"_renderNestedTimelines",value:function(){var t=this._nestedTimelines.length;if(0!==t)for(var e=this.prop.useNestedEasingProgress?this.easing:this.progress,n=0,r=t;n<r;n+=1){var o=this._nestedTimelines[n],i=K(G(e,o.prop.nestedScope),[0,1]);o.progress=i}}},{key:"_destroy",value:function(){Dn(Mn(i.prototype),"_destroy",this).call(this),this._nestedTimelines.forEach((function(t){t.destroy()}))}}])&&xn(e.prototype,n),r&&xn(e,r),i}(q);function In(t){return(In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function An(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fn(Object(n),!0).forEach((function(e){$n(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Hn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Nn(t,e){return(Nn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Yn(t);if(e){var o=Yn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Xn(this,n)}}function Xn(t,e){return!e||"object"!==In(e)&&"function"!=typeof e?Qn(t):e}function Qn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Un(t,e,n){return(Un="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Yn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Yn(t){return(Yn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var qn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Nn(t,e)}(i,t);var e,n,r,o=Vn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Hn(this,i),$n(Qn(e=o.call(this,t,!1)),"_isPlaying",void 0),$n(Qn(e),"_isReversed",void 0),$n(Qn(e),"_isPaused",void 0),$n(Qn(e),"_animationFrame",void 0),$n(Qn(e),"_animationFrameLastTime",void 0),e._isPlaying=!1,e._isReversed=!1,e._isPaused=!1,e._animationFrame=void 0,e._animationFrameLastTime=0,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return An(An({},Un(Yn(i.prototype),"_getDefaultProp",this).call(this)),{},{duration:1e3,reset:!1,destroyOnEnd:!1})}},{key:"isPlaying",get:function(){return void 0!==this._animationFrame}},{key:"isReversed",get:function(){return this._isReversed}},{key:"isPaused",get:function(){return this._isPaused}},{key:"play",value:function(){this._destroyed||(this.prop.reset&&1===this.progress&&(this._progress=0),this._isReversed=!1,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"reverse",value:function(){this._destroyed||(this.prop.reset&&0===this.progress&&(this._progress=1),this._isReversed=!0,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"pause",value:function(){this._destroyed||(this._isPaused=!0,this._animationFrame&&window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}},{key:"_animate",value:function(){if(!this._isPaused){var t=this.isReversed,e=+new Date,n=Math.abs(this._animationFrameLastTime-e);this._animationFrameLastTime=e;var r=n/this.prop.duration/(t?-1:1),o=K(this.progress+r,[0,1]);if(this.progress=o,1===o&&!t||0===o&&t)return this._isReversed=!1,this._isPaused=!1,void(this._animationFrame=void 0);this._animationFrame=window.requestAnimationFrame(this._animate.bind(this))}}},{key:"_handleProgress",value:function(){Un(Yn(i.prototype),"_handleProgress",this).call(this);var t=this._progress;0===t?this.callbacks.tbt("start",!1):1===t&&(this.callbacks.tbt("end",!1),this.prop.destroyOnEnd&&this.destroy())}},{key:"_destroy",value:function(){this.pause(),Un(Yn(i.prototype),"_destroy",this).call(this)}}])&&zn(e.prototype,n),r&&zn(e,r),i}(Bn);function Kn(t){return(Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Gn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jn(Object(n),!0).forEach((function(e){ar(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Zn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function er(t,e){return(er=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function nr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=sr(t);if(e){var o=sr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return rr(this,n)}}function rr(t,e){return!e||"object"!==Kn(e)&&"function"!=typeof e?or(t):e}function or(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ir(t,e,n){return(ir="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=sr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function sr(t){return(sr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ar(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var cr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&er(t,e)}(i,t);var e,n,r,o=nr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Zn(this,i),ar(or(e=o.call(this,t,!1)),"_container",void 0),ar(or(e),"_startTime",void 0),ar(or(e),"_endTime",void 0),ar(or(e),"_toBeHidden",void 0),ar(or(e),"_isHidden",void 0),ar(or(e),"_pageLoadEvent",void 0),e.prop.container){var r=y(e.prop.container);r instanceof HTMLElement&&(e._container=r)}return e._container&&e._container.classList.add(e.prefix),e._startTime=+new Date,e._endTime=1/0,e._toBeHidden=!1,e._isHidden=!1,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Gn(Gn({},ir(sr(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),hide:250})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"preloader")}},{key:"container",get:function(){return this._container}},{key:"startTime",get:function(){return this._startTime}},{key:"endTime",get:function(){return this._endTime}},{key:"totalTime",get:function(){return this._endTime-this._startTime}},{key:"isHidden",get:function(){return this._isHidden}},{key:"_setEvents",value:function(){var t=this;ir(sr(i.prototype),"_setEvents",this).call(this),this._onLoaded().then((function(){t._endTime=+new Date,t._handleLoaded()}))}},{key:"_onLoaded",value:function(){var t=this;return new ce((function(e){t._app.pageLoad.loaded?e():t._pageLoadEvent=t._app.pageLoad.add("",(function(){e()}))}))}},{key:"_handleLoaded",value:function(){this.callbacks.tbt("loaded",!1),"boolean"!=typeof this.prop.hide&&this.hideContainer()}},{key:"hideContainer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"boolean"!=typeof this.prop.hide?this.prop.hide:250;return this.callbacks.tbt("hide",!1),this._toBeHidden=!0,new ce((function(n){var r=t._container;if(!r)return t._handleHidden(),void n();r.style.transition="opacity ".concat(e,"ms, visibility ").concat(e,"ms"),r.style.opacity="0",r.style.visibility="hidden",l((function(){r.style.display="none",t._handleHidden(),n()}),e)}))}},{key:"_handleHidden",value:function(){this._isHidden=!0,this.callbacks.tbt("hidden",!1)}},{key:"onHide",value:function(t){if(!this._toBeHidden)return this.callbacks.add("hide",(function(){t()}));t()}},{key:"onHidden",value:function(t){if(!this._isHidden)return this.callbacks.add("hidden",(function(){t()}));t()}},{key:"_destroy",value:function(){var t;ir(sr(i.prototype),"_destroy",this).call(this),null===(t=this._pageLoadEvent)||void 0===t||t.remove()}}])&&tr(e.prototype,n),r&&tr(e,r),i}(q);function ur(t){return(ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function fr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lr(Object(n),!0).forEach((function(e){mr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function hr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function dr(t,e){return(dr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function yr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=gr(t);if(e){var o=gr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return vr(this,n)}}function vr(t,e){return!e||"object"!==ur(e)&&"function"!=typeof e?br(t):e}function br(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _r(t,e,n){return(_r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=gr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function gr(t){return(gr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var wr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dr(t,e)}(i,t);var e,n,r,o=yr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return hr(this,i),mr(br(e=o.call(this,t,!1)),"_imgs",void 0),mr(br(e),"_videos",void 0),mr(br(e),"_customResources",void 0),mr(br(e),"_resourcesTotal",void 0),mr(br(e),"_resourcesLoaded",void 0),mr(br(e),"_progress",void 0),mr(br(e),"_animationFrame",void 0),mr(br(e),"_endTimeline",void 0),e._imgs=[],e._videos=[],e._customResources=[],e._resourcesTotal=1+e.prop.resources,e._resourcesLoaded=0,e._progress=0,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return fr(fr({},_r(gr(i.prototype),"_getDefaultProp",this).call(this)),{},{resources:0,loaders:{img:!0,video:!0,custom:".js-preload",ignoreClassName:"js-preload-ignore"},calc:{lerp:.1,forceEnd:500}})}},{key:"imgs",get:function(){return this._imgs}},{key:"videos",get:function(){return this._videos}},{key:"customResources",get:function(){return this._customResources}},{key:"resourcesTotal",get:function(){return this._resourcesTotal}},{key:"resourcesLoaded",get:function(){return this._resourcesLoaded}},{key:"loadProgress",get:function(){return this.resourcesLoaded/this.resourcesTotal}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"_constructor",value:function(){_r(gr(i.prototype),"_constructor",this).call(this),this._getResources()}},{key:"_setEvents",value:function(){var t=this;_r(gr(i.prototype),"_setEvents",this).call(this);var e=this.prop.calc.lerp;"number"==typeof e&&(this._animationFrame=new pt,this._animationFrame.addCallback("frame",(function(){t.progress=J(t.progress,t.loadProgress,e)})),this._animationFrame.play()),this._preloadResources(),this._app.onPageLoaded().then((function(){t._handleLoadedResource()}))}},{key:"_onLoaded",value:function(){var t=this;return new ce((function(e){var n=!1;t.callbacks.add("progress",(function(t){t.progress>=1&&!n&&(e(),n=!0)}),{protected:!0})}))}},{key:"_getResources",value:function(){var t=this,e=this.prop.loaders;e.img&&v("img").forEach((function(n){n.classList.contains(e.ignoreClassName)||(t._imgs.push(n),t._resourcesTotal+=1)})),e.video&&v("video").forEach((function(n){n.classList.contains(e.ignoreClassName)||(t._videos.push(n),t._resourcesTotal+=1)})),e.custom&&(this._customResources=Array.from(v(e.custom)).filter((function(t){return!t.classList.contains(e.ignoreClassName)})),this._resourcesTotal+=this._customResources.length)}},{key:"_preloadResources",value:function(){var t=this;0===this._resourcesTotal&&(this._resourcesTotal=1,this._handleLoadedResource()),this._imgs.forEach((function(e){if(e.complete)t._handleLoadedResource();else{var n=new Image;e.addEventListener("load",(function(){t._handleLoadedResource()})),e.addEventListener("error",(function(){t._handleLoadedResource()})),n.src=e.currentSrc||e.src}})),this._videos.forEach((function(e){if(e.readyState>0)t._handleLoadedResource();else{if("none"===e.preload)return void t._handleLoadedResource();e.addEventListener("error",(function(){t._handleLoadedResource()})),e.addEventListener("loadedmetadata",(function(){t._handleLoadedResource()}))}})),this._customResources.forEach((function(e){t._seekCustomResourceLoaded(e).then((function(){t._handleLoadedResource()}))}))}},{key:"_seekCustomResourceLoaded",value:function(t){var e=this;return new Promise((function(n){t.isComplete||t.isLoaded||t.getAttribute("data-is-loaded")||t.getAttribute("is-loaded")?n():setTimeout((function(){e.destroyed||e._seekCustomResourceLoaded(t).then((function(){n()}))}),50)}))}},{key:"addResourcesLoaded",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=0;e<t;e+=1)this._handleLoadedResource()}},{key:"addResourcesTotal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this._resourcesTotal+=t}},{key:"_handleLoadedResource",value:function(){this.loadProgress>=1||(this._resourcesLoaded+=1,this.callbacks.tbt("resourceLoad",!1),this._animationFrame||(this.progress=this.loadProgress))}},{key:"_handleProgress",value:function(){var t=this;if(this.callbacks.tbt("progress",{progress:this._progress}),this.progress>=1)this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0);else if("number"==typeof this.prop.calc.forceEnd&&this.loadProgress>=1&&!this._endTimeline){this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0),this._endTimeline=new qn({duration:this.prop.calc.forceEnd});var e=this.progress;this._endTimeline.addCallback("progress",(function(n){var r=1-e;t.progress=e+r*n.progress})),this._endTimeline.play()}}},{key:"_destroy",value:function(){_r(gr(i.prototype),"_destroy",this).call(this),this._animationFrame&&this._animationFrame.destroy()}}])&&pr(e.prototype,n),r&&pr(e,r),i}(cr);function Or(t){return(Or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function kr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pr(Object(n),!0).forEach((function(e){Dr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function jr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Er(t,e){return(Er=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cr(t);if(e){var o=Cr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Tr(this,n)}}function Tr(t,e){return!e||"object"!==Or(e)&&"function"!=typeof e?Rr(t):e}function Rr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Lr(t,e,n){return(Lr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Cr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Cr(t){return(Cr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Dr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Mr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Er(t,e)}(i,t);var e,n,r,o=xr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(jr(this,i),Dr(Rr(e=o.call(this,t,!1)),"_container",void 0),Dr(Rr(e),"_runtimeEvents",void 0),Dr(Rr(e),"_isDragging",void 0),Dr(Rr(e),"_pointerID",void 0),Dr(Rr(e),"_coords",void 0),Dr(Rr(e),"_prevCoords",void 0),Dr(Rr(e),"_startCoords",void 0),e._container=y(e.prop.container),!p(e._container)&&!d(e._container))throw new Error("No container");return e._runtimeEvents=[],e._isDragging=!1,e._pointerID=null,e._coords={x:0,y:0},e._prevCoords={x:0,y:0},e._startCoords={x:0,y:0},n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return kr(kr({},Lr(Cr(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),usePassive:!1,enabled:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"dragger")}},{key:"container",get:function(){return this._container}},{key:"isDragging",get:function(){return this._isDragging}},{key:"coords",get:function(){return this._coords}},{key:"startCoords",get:function(){return this._startCoords}},{key:"_setEvents",value:function(){var t=this.container,e=this.prop.usePassive;this.addEventListeners(t,"mousedown",this._handleStart.bind(this),{passive:e}),this.addEventListeners(t,"touchstart",this._handleStart.bind(this),{passive:e})}},{key:"_addRuntimeEvents",value:function(){var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mouseup",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchend",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchcancel",this.cancel.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"blur",this.cancel.bind(this),{passive:t}))}},{key:"_removeRuntimeEvents",value:function(){this._runtimeEvents.forEach((function(t){t.remove()})),this._runtimeEvents=[]}},{key:"_normalizeEvent",value:function(t){if(t.type.includes("touch")){var e=t,n=e.targetTouches[0]||e.changedTouches[0];return{x:n.clientX,y:n.clientY,id:n.identifier}}var r=t;return{x:r.clientX,y:r.clientY,id:null}}},{key:"_handleStart",value:function(t){if(!this.prop.enabled)return!1;if(this.isDragging)return!1;var e=this._normalizeEvent(t);if("mousedown"===t.type){if(1!==t.which)return!1;t.stopPropagation()}return this._isDragging=!0,this._pointerID=e.id,this._coords={x:e.x,y:e.y},this._prevCoords={x:e.x,y:e.y},this._startCoords={x:e.x,y:e.y},this._addRuntimeEvents(),this.callbacks.tbt("start",{evt:t}),!0}},{key:"_handleEnd",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this.cancel(),0))}},{key:"cancel",value:function(){this._removeRuntimeEvents(),this._isDragging=!1,this.callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){Lr(Cr(i.prototype),"_destroy",this).call(this),this._removeRuntimeEvents()}}])&&Sr(e.prototype,n),r&&Sr(e,r),i}(q);function Wr(t){return(Wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Br(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ir(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Fr(t,e,n){return(Fr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Nr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ar(t,e){return(Ar=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Hr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Nr(t);if(e){var o=Nr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zr(this,n)}}function zr(t,e){return!e||"object"!==Wr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Nr(t){return(Nr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Vr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ar(t,e)}(i,t);var e,n,r,o=Hr(i);function i(){return Br(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"stepCoords",get:function(){return{x:this._coords.x-this._prevCoords.x,y:this._coords.y-this._prevCoords.y}}},{key:"_addRuntimeEvents",value:function(){Fr(Nr(i.prototype),"_addRuntimeEvents",this).call(this);var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mousemove",this._handleMove.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchmove",this._handleMove.bind(this),{passive:t}))}},{key:"_handleMove",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this._prevCoords={x:this._coords.x,y:this._coords.y},this._coords={x:e.x,y:e.y},this.callbacks.tbt("move",{evt:t,start:this.startCoords,coords:this.coords,step:this.stepCoords}),0))}},{key:"_destroy",value:function(){Fr(Nr(i.prototype),"_destroy",this).call(this)}}])&&Ir(e.prototype,n),r&&Ir(e,r),i}(Mr);function Xr(t){return(Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ur(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qr(Object(n),!0).forEach((function(e){Yr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Yr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Kr(t,e,n){return(Kr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=to(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Jr(t,e){return(Jr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Gr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=to(t);if(e){var o=to(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Zr(this,n)}}function Zr(t,e){return!e||"object"!==Xr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function to(t){return(to=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var eo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jr(t,e)}(i,t);var e,n,r,o=Gr(i);function i(){return $r(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Ur(Ur({},Kr(to(i.prototype),"_getDefaultProp",this).call(this)),{},{min:75})}},{key:"_handleEnd",value:function(t){var e=Kr(to(i.prototype),"_handleEnd",this).call(this,t);if(!e)return e;var n=this._normalizeEvent(t),r=this.startCoords,o=Math.abs(this.prop.min);return r.y>n.y&&Math.abs(n.y-r.y)>=o&&this.callbacks.tbt("up",!1),r.y<n.y&&Math.abs(n.y-r.y)>=o&&this.callbacks.tbt("down",!1),r.x>n.x&&Math.abs(n.x-r.x)>=o&&this.callbacks.tbt("left",!1),r.x<n.x&&Math.abs(n.x-r.x)>=o&&this.callbacks.tbt("right",!1),!0}}])&&qr(e.prototype,n),r&&qr(e,r),i}(Mr);function no(t){return(no="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ro(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function oo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ro(Object(n),!0).forEach((function(e){po(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ro(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function io(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function so(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ao(t,e,n){return(ao="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ho(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function co(t,e){return(co=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function uo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ho(t);if(e){var o=ho(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return lo(this,n)}}function lo(t,e){return!e||"object"!==no(e)&&"function"!=typeof e?fo(t):e}function fo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ho(t){return(ho=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function po(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&co(t,e)}(i,t);var e,n,r,o=uo(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];io(this,i),po(fo(e=o.call(this,t,!1)),"_canvas",void 0),po(fo(e),"_ctx",void 0),po(fo(e),"_width",void 0),po(fo(e),"_height",void 0),po(fo(e),"_dpr",void 0),e._width=0,e._height=0,e._dpr=1;var r=e.prop,s=r.append,a=r.container,c=s&&a?a:void 0;return e._canvas=_("canvas",{parent:c}),e._ctx=e._canvas.getContext("2d"),e.resize(),n&&e.init(),e}return e=i,(n=[{key:"container",get:function(){return this.prop.container}},{key:"canvas",get:function(){return this._canvas}},{key:"ctx",get:function(){return this._ctx}},{key:"width",get:function(){return this._width}},{key:"nonDPRWidth",get:function(){return this.width/this.dpr}},{key:"height",get:function(){return this._height}},{key:"nonDPRHeight",get:function(){return this.height/this.dpr}},{key:"dpr",get:function(){return this._dpr}},{key:"_getDefaultProp",value:function(){return oo(oo({},ao(ho(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,append:!0,updateOnResize:!1,width:!1,height:!1,dpr:!1})}},{key:"_setEvents",value:function(){var t=this;if(ao(ho(i.prototype),"_setEvents",this).call(this),!1!==this.prop.updateOnResize){var e="boolean"==typeof this.prop.updateOnResize?"":this.prop.updateOnResize;this.addViewportCallback(e,(function(){t.resize()})),this.resize()}}},{key:"_onPropMutate",value:function(){ao(ho(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){var t=this.prop,e=this.canvas;if(e){var n=this._app.viewport;"number"==typeof t.dpr?this._dpr=t.dpr:this._dpr=n.dpr;var r=this._dpr,o=0,i=0;"number"==typeof t.width&&"number"==typeof t.height?(o=t.width,i=t.height):this.container?(o=this.container.clientWidth,i=this.container.clientHeight):(o=n.width,i=n.height),o*=r,i*=r,this._width=o,this._height=i,e.width=o,e.height=i,this.callbacks.tbt("resize",!1)}}},{key:"_destroy",value:function(){ao(ho(i.prototype),"_destroy",this).call(this),this.canvas&&this.canvas.remove()}}])&&so(e.prototype,n),r&&so(e,r),i}(q);function vo(t){const e=function(t){if("container"in t)return{width:t.container.clientWidth,height:t.container.clientHeight};return{width:t.width,height:t.height}}(t),n=function(t){const{source:e}=t;if(t.sourceWidth&&t.sourceHeight)return{width:t.sourceWidth,height:t.sourceHeight};if(e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if(e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};return{width:e.width,height:e.height}}(t);let r;return"cover"===t.rule?r=function(t,e,n){let r=e.width*bo(t),o=n.height*r/n.width;o/bo(t)<e.height&&(o=e.height*bo(t),r=n.width*o/n.height);const i=(e.width-r)/2,s=(e.height-o)/2;return{width:r,height:o,x:i,y:s}}(t,e,n):"contain"===t.rule?r=function(t,e,n){let r=0,o=0;const i=n.width/n.height;e.width>e.height?(o=e.height,r=o*i,r>e.width&&(r=e.width,o=r/i)):e.height>=e.width&&(r=e.width,o=r/i,o>e.height&&(o=e.height,r=o*i));r*=bo(t),o*=bo(t);const s=(e.width-r)/2,a=(e.height-o)/2;return{width:r,height:o,x:s,y:a}}(t,e,n):"top-left"===t.rule?r=function(t,e){const n=e.width*bo(t),r=e.height*bo(t);return{width:n,height:r,x:0,y:0}}(t,n):"top-right"===t.rule?r=function(t,e,n){const r=n.width*bo(t),o=n.height*bo(t),i=e.width-n.width;return{width:r,height:o,x:i,y:0}}(t,e,n):"bottom-left"===t.rule?r=function(t,e,n){const r=n.width*bo(t),o=n.height*bo(t),i=e.height-n.height;return{width:r,height:o,x:0,y:i}}(t,e,n):"bottom-right"===t.rule?r=function(t,e,n){const r=n.width*bo(t),o=n.height*bo(t),i=e.width-n.width,s=e.height-n.height;return{width:r,height:o,x:i,y:s}}(t,e,n):"center"===t.rule&&(r=function(t,e,n){const r=n.width*bo(t),o=n.height*bo(t),i=(e.width-n.width)/2,s=(e.height-n.height)/2;return{width:r,height:o,x:i,y:s}}(t,e,n)),Object.assign(r,{sourceWidth:n.width,sourceHeight:n.height})}function bo(t){return void 0!==t.scale?t.scale:1}function _o(t){return(_o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function go(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function mo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?go(Object(n),!0).forEach((function(e){wo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):go(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function wo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Po(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ko(t,e,n){return(ko="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function jo(t,e){return(jo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function So(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=xo(t);if(e){var o=xo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Eo(this,n)}}function Eo(t,e){return!e||"object"!==_o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function xo(t){return(xo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var To=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jo(t,e)}(i,t);var e,n,r,o=So(i);function i(){return Oo(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_getDefaultProp",value:function(){return mo(mo({},ko(xo(i.prototype),"_getDefaultProp",this).call(this)),{},{media:!1,posRule:"cover"})}},{key:"resize",value:function(){ko(xo(i.prototype),"resize",this).call(this),this._prerender()}},{key:"_prerender",value:function(){if(0!==this.width&&0!==this.height){var t=this.prop.media;if(t){var e,n,r;t instanceof yo?(e=t.canvas,n=t.width,r=t.height):e=t;var o=vo({source:e,sourceWidth:n,sourceHeight:r,rule:this.prop.posRule,scale:1,width:this.width,height:this.height});this._ctx.clearRect(0,0,this.width,this.height),this._ctx.drawImage(e,o.x,o.y,o.width,o.height),this.callbacks.tbt("prerender",!1)}}}}])&&Po(e.prototype,n),r&&Po(e,r),i}(yo);function Ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Lo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Co=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Lo(this,"_prop",void 0),Lo(this,"_outer",void 0),Lo(this,"_thumb",void 0),Lo(this,"_outerHeight",void 0),Lo(this,"_outerWidth",void 0),Lo(this,"_thumbHeight",void 0),Lo(this,"_thumbWidth",void 0),Lo(this,"_scrollVal",void 0),Lo(this,"_coordsAtDragStart",void 0),Lo(this,"_listeners",void 0),Lo(this,"_scrollEvent",void 0),Lo(this,"_actionTimeout",void 0),Lo(this,"_dragger",void 0),this._prop=e;var n=e.prefix,r=e.dir,o=e.domParent,i=e.container,s=e.autoHide;this._outerHeight=0,this._outerWidth=0,this._thumbHeight=0,this._thumbWidth=0,this._scrollVal=0,this._coordsAtDragStart={left:0,top:0},this._scrollEvent=void 0,this._actionTimeout=void 0,this._dragger=void 0;var a="".concat(n," ").concat(n,"_").concat(r);i instanceof Window&&(a+=" in-window"),this._outer=_("div",{parent:o,class:a}),this._thumb=_("div",{parent:this._outer,class:"".concat(n,"__thumb ").concat(n,"__thumb_").concat(r)}),s&&this.outer.classList.add("auto-hide"),this._listeners=[],this._setEvents()}var e,n,r;return e=t,(n=[{key:"outer",get:function(){return this._outer}},{key:"thumb",get:function(){return this._thumb}},{key:"prefix",get:function(){return this._prop.prefix}},{key:"isX",get:function(){return"x"===this.prop.dir}},{key:"isY",get:function(){return!this.isX}},{key:"scrollElement",get:function(){return this.prop.container instanceof Window?document.documentElement:this.prop.container}},{key:"scrollLine",get:function(){var t=this.scrollElement;return this.isX?t.scrollWidth-t.clientWidth:t.scrollHeight-t.clientHeight}},{key:"scrollWidth",get:function(){return this.scrollElement.scrollWidth}},{key:"scrollHeight",get:function(){return this.scrollElement.scrollHeight}},{key:"prop",get:function(){return this._prop}},{key:"scrollValues",get:function(){var t=this.prop.container,e=0,n=0;return t instanceof Window?(e=t.pageYOffset,n=t.pageXOffset):t instanceof St?(e=t.targetTop,n=t.targetLeft):(e=t.scrollTop,n=t.scrollLeft),{left:n,top:e}}},{key:"_setEvents",value:function(){var t=this;this._listeners.push(m(this.outer,"mouseenter",this._handleHover.bind(this,!0))),this._listeners.push(m(this.outer,"mouseleave",this._handleHover.bind(this,!1))),this._scrollEvent=xt({container:this.prop.container,callback:function(e){t._handleScroll(e)}}),this.prop.isDraggable&&(this._dragger=new Vr({container:this.thumb}),this._dragger.addCallback("start",(function(){t.thumb.classList.add("in-action"),t._disableScrollBehaviour(!0),t._coordsAtDragStart=t.scrollValues})),this._dragger.addCallback("move",(function(e){t._handleThumbDrag(e)})),this._dragger.addCallback("end",(function(){t.thumb.classList.remove("in-action"),t._disableScrollBehaviour(!1)})))}},{key:"_disableScrollBehaviour",value:function(t){var e=t?"auto":"unset";(this.prop.container instanceof Window||this.prop.container instanceof HTMLElement)&&(document.documentElement.style.scrollBehavior=e)}},{key:"_handleHover",value:function(t){this.outer.classList.toggle("is-hovered",t)}},{key:"_handleScroll",value:function(t){var e=this;this.prop.optimizeCalculations||this.resize();var n=!1;this.isX?(n=t.scrollLeft!==this._scrollVal,this._scrollVal=t.scrollLeft):(n=t.scrollTop!==this._scrollVal,this._scrollVal=t.scrollTop),n&&(this.prop.autoHide&&n&&(this.outer.classList.add("in-action"),this._actionTimeout&&(clearTimeout(this._actionTimeout),this._actionTimeout=void 0),this._actionTimeout=setTimeout((function(){e.outer.classList.remove("in-action")}),500)),this.prop.optimizeCalculations&&this._renderThumb())}},{key:"_handleThumbDrag",value:function(t){t.evt.preventDefault();var e=this.prop.container,n=(t.coords.x-t.start.x)/(this._outerWidth-this._thumbWidth)*this.scrollLine,r=(t.coords.y-t.start.y)/(this._outerHeight-this._thumbHeight)*this.scrollLine,o=this._coordsAtDragStart,i=o.left,s=o.top;this.isX?i+=n:s+=r,e.scrollTo({top:s,left:i,behavior:e instanceof St?this.prop.draggableScrollBehavior:"auto"})}},{key:"_renderThumb",value:function(){var t=K(this._scrollVal/this.scrollLine,[0,1]),e=this.isX?(this._outerWidth-this._thumbWidth)*t:0,n=this.isY?(this._outerHeight-this._thumbHeight)*t:0;this._thumb.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}},{key:"resize",value:function(){var t=this.outer,e=this.thumb,n=this.scrollLine,r=this.prop.minSize;if(this._outerHeight=t.clientHeight,this._outerWidth=t.clientWidth,this.prop.autoSize)if(this.isX){var o=K(this._outerWidth/(this.scrollWidth/(this.scrollWidth-n)),[r,1/0]);e.style.width="".concat(o,"px")}else{var i=K(this._outerHeight/(this.scrollHeight/(this.scrollHeight-n)),[r,1/0]);e.style.height="".concat(i,"px")}this._thumbHeight=e.clientHeight,this._thumbWidth=e.clientWidth,t.classList.toggle("is-empty",0===n),this._renderThumb()}},{key:"destroy",value:function(){this._listeners.forEach((function(t){t.remove()})),this._scrollEvent&&this._scrollEvent.remove(),this._actionTimeout&&clearTimeout(this._actionTimeout),this._dragger&&this._dragger.destroy(),this._outer.remove()}}])&&Ro(e.prototype,n),r&&Ro(e,r),t}();function Do(t){return(Do="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mo(Object(n),!0).forEach((function(e){Xo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Bo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Io(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Fo(t,e){return(Fo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ao(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Vo(t);if(e){var o=Vo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ho(this,n)}}function Ho(t,e){return!e||"object"!==Do(e)&&"function"!=typeof e?zo(t):e}function zo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function No(t,e,n){return(No="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Vo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Vo(t){return(Vo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Xo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fo(t,e)}(i,t);var e,n,r,o=Ao(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Bo(this,i),Xo(zo(e=o.call(this,t,!1)),"_container",void 0),Xo(zo(e),"_scrollWrapper",void 0),Xo(zo(e),"_xBar",void 0),Xo(zo(e),"_yBar",void 0);var r=e.prop,s=r.autoHide,a=r.autoSize,c=r.minSize,u=r.optimizeCalculations,l=r.isDraggable,f=r.draggableScrollBehavior;if("string"==typeof e.prop.container){var h=y(e.prop.container);if(!h)throw new Error("No scroll container");e._container=h}else e._container=e.prop.container;if(e.container instanceof Element){var p=e.container.parentElement;p&&(e._scrollWrapper=_("div"),e._scrollWrapper.style.position="relative",e._scrollWrapper.style.display="inline-block",p.insertBefore(e._scrollWrapper,e.container),e._scrollWrapper.appendChild(e.container),e._scrollWrapper.classList.add("".concat(e.prefix,"-wrapper")))}var d={container:e.container,domParent:e.domParent,autoHide:s,autoSize:a,minSize:c,optimizeCalculations:u,prefix:e.prefix,isDraggable:l,draggableScrollBehavior:f};return e._xBar=new Co(Wo({dir:"x"},d)),e._yBar=new Co(Wo({dir:"y"},d)),e.scrollableElement.classList.add("".concat(e.prefix,"-parent")),n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Wo(Wo({},No(Vo(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,domParent:!1,draggable:!0,autoSize:!0,autoHide:!0,minSize:50,optimizeCalculations:!1,isDraggable:!0,draggableScrollBehavior:"smooth"})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"scrollbar")}},{key:"container",get:function(){return this._container}},{key:"scrollableElement",get:function(){var t=this.container;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"domParent",get:function(){var t=this.prop.domParent,e=this.container;return t||(this._scrollWrapper?this._scrollWrapper:e instanceof Window?this._app.body:e instanceof Element?e:e.outer)}},{key:"_setEvents",value:function(){var t=this;No(Vo(i.prototype),"_setEvents",this).call(this);var e=this.container;e instanceof St?e.addCallback("resize",(function(){t.resize()}),{name:this.name}):this.addViewportCallback("",(function(){t.resize()})),this.resize()}},{key:"_onPropMutate",value:function(){No(Vo(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._xBar.resize(),this._yBar.resize()}},{key:"_destroy",value:function(){if(No(Vo(i.prototype),"_destroy",this).call(this),this._xBar.destroy(),this._yBar.destroy(),this._scrollWrapper&&this.container instanceof Element){var t=this._scrollWrapper.parentElement;t&&t.insertBefore(this.container,this._scrollWrapper),this._scrollWrapper.remove()}this.scrollableElement.classList.remove("".concat(this.prefix,"-parent"))}}])&&Io(e.prototype,n),r&&Io(e,r),i}(q);function Uo(t){return(Uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yo(Object(n),!0).forEach((function(e){ri(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function qo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ko(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Jo(t,e){return(Jo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Go(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ni(t);if(e){var o=ni(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Zo(this,n)}}function Zo(t,e){return!e||"object"!==Uo(e)&&"function"!=typeof e?ti(t):e}function ti(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ei(t,e,n){return(ei="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ni(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ni(t){return(ni=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ri(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var oi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jo(t,e)}(i,t);var e,n,r,o=Go(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return qo(this,i),ri(ti(e=o.call(this,t,!1)),"_scrollContainer",void 0),"string"==typeof e.prop.container?e._scrollContainer=y(e.prop.container):e._scrollContainer=e.prop.container,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return $o($o({},ei(ni(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window})}},{key:"scrollContainer",get:function(){return this._scrollContainer}},{key:"scrollableElement",get:function(){return this._scrollContainer instanceof Window?this._app.html:this._scrollContainer}},{key:"domParent",get:function(){var t=this.scrollContainer;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"intersectionRoot",get:function(){var t=this.scrollContainer;return t instanceof Window?null:t instanceof Element?t:t.outer}},{key:"scrollContainerBounding",get:function(){if(this.intersectionRoot){var t=this.intersectionRoot.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}return{top:0,left:0,width:this._app.viewport.width,height:this._app.viewport.height}}}])&&Ko(e.prototype,n),r&&Ko(e,r),i}(q);function ii(t){return(ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function si(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ai(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?si(Object(n),!0).forEach((function(e){_i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):si(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ci(t){return function(t){if(Array.isArray(t))return ui(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ui(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ui(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ui(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function li(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function hi(t,e){return(hi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function pi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=bi(t);if(e){var o=bi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return di(this,n)}}function di(t,e){return!e||"object"!==ii(e)&&"function"!=typeof e?yi(t):e}function yi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vi(t,e,n){return(vi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=bi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function bi(t){return(bi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&hi(t,e)}(i,t);var e,n,r,o=pi(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return li(this,i),_i(yi(e=o.call(this,t,!1)),"_scrollEvent",void 0),_i(yi(e),"_intersectionObserverIn",void 0),_i(yi(e),"_intersectionObserverOut",void 0),_i(yi(e),"_firstStart",void 0),_i(yi(e),"_elements",void 0),e._scrollEvent=void 0,e._intersectionObserverIn=void 0,e._intersectionObserverOut=void 0,e._firstStart=!0,e._elements=ci(e.prop.elements),n&&e.init(),e}return e=i,(n=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"scroll-view")}},{key:"_getDefaultProp",value:function(){return ai(ai({},vi(bi(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,container:window,elements:[],threshold:.9,states:"in",classToToggle:"viewed",useDelay:!1,useIntersectionObserver:!0})}},{key:"elements",get:function(){return this._elements}},{key:"init",value:function(){vi(bi(i.prototype),"init",this).call(this)}},{key:"_setEvents",value:function(){var t=this;vi(bi(i.prototype),"_setEvents",this).call(this),this.resize(),this.addViewportCallback("",(function(){t.resize()}))}},{key:"_onPropMutate",value:function(){vi(bi(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._removeViewEvents(),this.prop.enabled&&(this._setViewEvents(),this.seekBounding())}},{key:"_setViewEvents",value:function(){var t=this;if(Tt()&&this.prop.useIntersectionObserver){var e=this.scrollContainerBounding,n=this._firstStart?0:e.width*(1-this.prop.threshold)*-1,r=this._firstStart?0:e.height*(1-this.prop.threshold)*-1;this._intersectionObserverIn=new IntersectionObserver(this._handleIntersectionObserverIn.bind(this),{root:this.intersectionRoot,threshold:0,rootMargin:"0px ".concat(n,"px ").concat(r,"px 0px")}),this.elements.forEach((function(e){var n;null===(n=t._intersectionObserverIn)||void 0===n||n.observe(e)})),"inout"===this.prop.states&&(this._intersectionObserverOut=new IntersectionObserver(this._handleIntersectionObserverOut.bind(this),{root:this.intersectionRoot,threshold:0,rootMargin:"0px 0px 0px 0px"}),this.elements.forEach((function(e){var n;null===(n=t._intersectionObserverOut)||void 0===n||n.observe(e)})))}else this._scrollEvent=xt({container:this.prop.container,callback:this._handleScroll.bind(this)})}},{key:"_removeViewEvents",value:function(){var t,e;this._scrollEvent&&(this._scrollEvent.remove(),this._scrollEvent=void 0),null===(t=this._intersectionObserverIn)||void 0===t||t.disconnect(),this._intersectionObserverIn=void 0,null===(e=this._intersectionObserverOut)||void 0===e||e.disconnect(),this._intersectionObserverOut=void 0}},{key:"_handleIntersectionObserverIn",value:function(t){for(var e=!!this._firstStart&&this.scrollContainerBounding,n=0;n<t.length;n+=1){var r=t[n],o=0;this._firstStart&&e&&r.isIntersecting&&(o=this._elementInViewportData(r.target,e).delay),r.isIntersecting&&this._handleInOut(r.target,r.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1,this.resize())}},{key:"_handleIntersectionObserverOut",value:function(t){for(var e=0;e<t.length;e+=1){var n=t[e];n.isIntersecting||this._handleInOut(n.target,n.isIntersecting,0)}}},{key:"_handleScroll",value:function(){this.seekBounding()}},{key:"seekBounding",value:function(){if(!Tt()||!this.prop.useIntersectionObserver){for(var t=this.scrollContainerBounding,e=0;e<this.elements.length;e+=1){var n=this.elements[e],r=this._elementInViewportData(n,t),o=r.isIntersecting?r.delay:0;"boolean"==typeof r.isIntersecting&&this._handleInOut(n,r.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1)}}},{key:"_elementInViewportData",value:function(t,e){var n,r=this.prop,o=r.threshold,i=r.states,s=r.useDelay,a=this._firstStart?1:o,c=t.getBoundingClientRect();c.top<e.top+e.height*a&&c.left<e.left+e.width*a?n="in"===i||!(c.right<e.left*a||c.bottom<e.top*a):(c.top>e.top+e.height||c.left>e.left+e.width)&&(n=!1);var u=0;return s&&this._firstStart&&(u=K("x"===s.dir?(c.left-e.left)/e.width:(c.top-e.top)/e.height,[0,1])*s.max),{isIntersecting:n,delay:u}}},{key:"_handleInOut",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=this.prop.states;t.scrollViewIn&&e||!t.scrollViewIn&&!e||(t.scrollViewIn=e,this.prop.classToToggle&&l((function(){t.classList.toggle(n.prop.classToToggle,e)}),r),!e||"in"!==o&&"inout"!==o?e||"inout"!==o||l((function(){n.callbacks.tbt("out",t)}),r):l((function(){n.callbacks.tbt("in",t)}),r))}},{key:"_processUnusedElements",value:function(){var t=this;"in"===this.prop.states&&(this._elements.filter((function(t){return t.scrollViewIn})).forEach((function(e){var n,r;null===(n=t._intersectionObserverIn)||void 0===n||n.unobserve(e),null===(r=t._intersectionObserverOut)||void 0===r||r.unobserve(e)})),this._elements=this._elements.filter((function(t){return!t.scrollViewIn})))}},{key:"addElement",value:function(t){var e,n,r=this;return t.scrollViewIn=void 0,this._elements.push(t),null===(e=this._intersectionObserverIn)||void 0===e||e.observe(t),null===(n=this._intersectionObserverOut)||void 0===n||n.observe(t),this.prop.enabled&&this.seekBounding(),{remove:function(){r.removeElement(t)}}}},{key:"removeElement",value:function(t){var e,n;t.scrollViewIn=void 0,this._elements=this._elements.filter((function(e){return e!==t})),null===(e=this._intersectionObserverIn)||void 0===e||e.unobserve(t),null===(n=this._intersectionObserverOut)||void 0===n||n.unobserve(t)}},{key:"removeElements",value:function(){var t=this;this._elements.forEach((function(e){t.removeElement(e)})),this._elements=[]}},{key:"_destroy",value:function(){vi(bi(i.prototype),"_destroy",this).call(this),this._removeViewEvents()}}])&&fi(e.prototype,n),r&&fi(e,r),i}(oi);function mi(t){return(mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Pi(t,e,n){return(Pi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ei(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ki(t,e){return(ki=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ji(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ei(t);if(e){var o=Ei(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Si(this,n)}}function Si(t,e){return!e||"object"!==mi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ei(t){return(Ei=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ki(t,e)}(i,t);var e,n,r,o=ji(i);function i(){return wi(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_setEvents",value:function(){var t=this;Pi(Ei(i.prototype),"_setEvents",this).call(this),this.addEventListeners(window,"keydown",(function(e){t._handleKeydown(e)}))}},{key:"_handleKeydown",value:function(t){var e=this._component;if(e.prop.enabled)if(9!==t.keyCode){var n=document.activeElement;if(!n||!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)){var r=this._app.viewport,o=e.outer.getBoundingClientRect();if(o.left<r.width&&o.right>0&&o.top<r.height&&o.bottom>0){var i=40;switch(t.keyCode){case 38:e.targetTop-=i;break;case 40:e.targetTop+=i;break;case 39:e.targetLeft+=i;break;case 37:e.targetLeft-=i;break;case 34:e.targetTop+=400;break;case 33:e.targetTop-=400;break;case 36:e.targetTop=0,e.targetLeft=0;break;case 35:e.targetTop=e.scrollHeight,e.targetLeft=e.scrollWidth;break;case 32:e.targetTop+=200}}}}else this._handleTab()}},{key:"_handleTab",value:function(){var t=this;l((function(){var e=t._component,n=document.activeElement;if(n instanceof HTMLElement&&f(n,e.outer)){var r=e.outer.getBoundingClientRect(),o=n.getBoundingClientRect(),i=e.scrollTop+(o.top-r.top)-(e.clientHeight/2-o.height/2),s=e.scrollLeft+(o.left-r.left)-(e.clientWidth/2-o.width/2);e.targetTop=i,e.targetLeft=s}}),120)}}])&&Oi(e.prototype,n),r&&Oi(e,r),i}(ze);function Ti(t){return(Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ri(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Li(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ri(Object(n),!0).forEach((function(e){Ai(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ri(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ci(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Di(t,e){return(Di=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Mi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Fi(t);if(e){var o=Fi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Wi(this,n)}}function Wi(t,e){return!e||"object"!==Ti(e)&&"function"!=typeof e?Bi(t):e}function Bi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ii(t,e,n){return(Ii="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Fi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Fi(t){return(Fi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ai(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Hi="is-dragging",zi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Di(t,e)}(i,t);var e,n,r,o=Mi(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Ai(Bi(e=o.call(this,t)),"_dragger",void 0),Ai(Bi(e),"_componentEvents",void 0),Ai(Bi(e),"_currentLerp",void 0),e._dragger=void 0,e._componentEvents=[],e._currentLerp=!1,e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Li(Li({},Ii(Fi(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,speed:1,lerp:!1,reverseDir:!1,stopPropagation:!1})}},{key:"isDragging",get:function(){return!!this._dragger&&this._dragger.isDragging}},{key:"_constructor",value:function(){Ii(Fi(i.prototype),"_constructor",this).call(this),this._toggleDragger()}},{key:"_onPropMutate",value:function(){Ii(Fi(i.prototype),"_onPropMutate",this).call(this),this._toggleDragger()}},{key:"_toggleDragger",value:function(){this.prop.enabled?this._addDragger():this._removeDragger()}},{key:"_addDragger",value:function(){var t=this;if(!this._dragger){var e=this.component;this._dragger=new Vr({container:e.outer}),this._dragger.addCallback("start",this._handleDragStart.bind(this)),this._dragger.addCallback("move",(function(e){t._handleDragMove(e)})),this._dragger.addCallback("end",this._handleDragEnd.bind(this)),this._componentEvents.push(e.addCallback("wheel",(function(){var e;null===(e=t._dragger)||void 0===e||e.cancel()})))}}},{key:"_removeDragger",value:function(){this._dragger&&(this._dragger.destroy(),this._dragger=void 0,this._componentEvents.forEach((function(t){t.remove()})),this._componentEvents=[])}},{key:"_handleDragStart",value:function(){var t=this.component;if(t.prop.enabled&&!(t.maxScrollableWidth<=0&&t.maxScrollableHeight<=0)){var e=this.prop.lerp;"boolean"!=typeof e&&(this._currentLerp=t.prop.render.lerp,t.changeProp({render:{lerp:e}})),this._callbacks.tbt("start",!1)}}},{key:"_handleDragMove",value:function(t){var e=this.component;if(e.prop.enabled&&!(e.maxScrollableWidth<=0&&e.maxScrollableHeight<=0)){var n=t.evt,r=this.prop.stopPropagation;if(r){if(!n.cancelable)return;var o=Math.abs(t.coords.x-t.start.x),i=Math.abs(t.coords.y-t.start.y);(o>r.threshold&&"x"===r.dir||i>r.threshold&&"y"===r.dir)&&n.cancelable&&(n.preventDefault(),n.stopPropagation())}var s=this.prop,a=s.speed,c=s.reverseDir,u=t.step.x*a,l=t.step.y*a;e.targetLeft-=c?l:u,e.targetTop-=c?u:l,e.outer.classList.add(Hi),e.container.classList.add(Hi),this._callbacks.tbt("move",!1)}}},{key:"_handleDragEnd",value:function(){var t=this.component;t.outer.classList.remove(Hi),t.container.classList.remove(Hi),"boolean"!=typeof this._currentLerp&&(t.changeProp({render:{lerp:this._currentLerp}}),this._currentLerp=!1),this._callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){Ii(Fi(i.prototype),"_destroy",this).call(this),this._removeDragger()}}])&&Ci(e.prototype,n),r&&Ci(e,r),i}(ze);function Ni(t){return(Ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vi(Object(n),!0).forEach((function(e){Zi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Qi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ui(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Yi(t,e){return(Yi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function $i(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Gi(t);if(e){var o=Gi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return qi(this,n)}}function qi(t,e){return!e||"object"!==Ni(e)&&"function"!=typeof e?Ki(t):e}function Ki(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ji(t,e,n){return(Ji="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Gi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Gi(t){return(Gi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ts=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yi(t,e)}(i,t);var e,n,r,o=$i(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Qi(this,i),Zi(Ki(e=o.call(this,t,!1)),"_initText",void 0),Zi(Ki(e),"_initHTML",void 0),Zi(Ki(e),"_isPrimarySplit",void 0),Zi(Ki(e),"_container",void 0),Zi(Ki(e),"_letters",void 0),Zi(Ki(e),"_words",void 0),Zi(Ki(e),"_lines",void 0),e.prop.container){var r=y(e.prop.container);r instanceof HTMLElement&&(e._container=r)}return e._container&&e._container.classList.add(e.prefix),e._initHTML=e._container.innerHTML,e._initText=(e._container.innerText||e._container.innerHTML||"no rendered text").trim(),e._initText=e._initText.replace(/\s+\n/gm,"\n"),e._isPrimarySplit=!1,e._letters=[],e._words=[],e._lines=[],n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Xi(Xi({},Ji(Gi(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),appendLetters:!0,appendLines:!1,viewportTarget:""})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"split-text")}},{key:"container",get:function(){return this._container}},{key:"letters",get:function(){return this._letters}},{key:"words",get:function(){return this._words}},{key:"lines",get:function(){return this._lines}},{key:"_setEvents",value:function(){var t=this;Ji(Gi(i.prototype),"_setEvents",this).call(this),this.splitText(),this.prop.appendLines&&this.addViewportCallback(this.prop.viewportTarget,(function(){t.splitText()}))}},{key:"splitText",value:function(){this._isPrimarySplit||(this.container.innerHTML="",this._splitIntoWords(),this._splitIntoLetters(),this._appendWords(),this._isPrimarySplit=!0),this.prop.appendLines&&this._splitIntoLines(),this.callbacks.tbt("split",!1)}},{key:"_splitIntoWords",value:function(){var t=this,e=this._initText.split(""),n=0;e.forEach((function(e){var r=t._words[n]||{content:"",hasNewLine:!1,el:_("span",{class:"".concat(t.prefix,"__word")}),letters:[]};r.el.style.display="inline-block",t._words[n]=r;var o=e.charCodeAt(0),i=32===o||160===o,s=[45,8208,8211,8212,8722].includes(o),a=10===o;i&&(r.whitespace=document.createTextNode(" ")),a&&(r.br=_("br")),r.hasNewLine=a,i||a?n+=1:(r.content+=e,t.prop.appendLetters||(r.el.innerHTML=r.content),s&&(n+=1))})),this._words=this._words.filter((function(e,n){return 0!==e.content.length||(n>0&&(t._words[n-1].whitespace=e.whitespace,t._words[n-1].br=e.br),!1)}))}},{key:"_appendWords",value:function(){var t=this;this._words.forEach((function(e){t.container.appendChild(e.el),e.whitespace&&t.container.appendChild(e.whitespace),e.br&&t.container.appendChild(e.br)}))}},{key:"_removeWords",value:function(){this._words.forEach((function(t){t.el.remove(),t.whitespace&&t.whitespace.remove(),t.br&&t.br.remove()}))}},{key:"_splitIntoLetters",value:function(){var t=this;this.prop.appendLetters&&(this._words.forEach((function(e){var n=e.content.split(""),r=[];n.forEach((function(n){var o={el:_("span",{class:"".concat(t.prefix,"__letter"),html:n}),content:n,word:e};o.el.style.display="inline-block",t._letters.push(o),r.push(o)})),e.letters=r})),this._letters.forEach((function(t){t.word.el.appendChild(t.el)})))}},{key:"_splitIntoLines",value:function(){var t=this;this._removeLines();var e=!1,n=1/0,r=!1;this.words.forEach((function(o){var i=!1,s=o.el.offsetTop;i=!(!r||!r.br)||s!==n,r=o,n=s,i&&((e={el:_("span",{class:"".concat(t.prefix,"__line")}),content:"",words:[]}).el.style.display="block",t._lines.push(e)),e&&e.words.push(o)})),this._lines.forEach((function(t){t.content=t.words.map((function(t){return t.content})).join(" ")})),this._lines.forEach((function(e){e.words.forEach((function(t){e.el.appendChild(t.el),t.br&&t.br.remove(),t.whitespace&&e.el.appendChild(t.whitespace)})),t.container.appendChild(e.el)}))}},{key:"_removeLines",value:function(){this._lines.forEach((function(t){t.el.remove()})),this._lines=[],this._appendWords()}},{key:"_destroy",value:function(){Ji(Gi(i.prototype),"_destroy",this).call(this),this._lines=[],this._words=[],this._letters=[],this._container.innerHTML=this._initHTML}}])&&Ui(e.prototype,n),r&&Ui(e,r),i}(q);function es(t){return(es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ns(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function rs(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ns(Object(n),!0).forEach((function(e){hs(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ns(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function os(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function is(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ss(t,e){return(ss=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function as(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fs(t);if(e){var o=fs(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return cs(this,n)}}function cs(t,e){return!e||"object"!==es(e)&&"function"!=typeof e?us(t):e}function us(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ls(t,e,n){return(ls="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=fs(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function fs(t){return(fs=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hs(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ps=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ss(t,e)}(i,t);var e,n,r,o=as(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];os(this,i),hs(us(e=o.call(this,t,!1)),"_container",void 0),hs(us(e),"_containerIsWindow",void 0),hs(us(e),"_outerCursor",void 0),hs(us(e),"_innerCursor",void 0),hs(us(e),"_animationFrame",void 0),hs(us(e),"_currentFPS",void 0),hs(us(e),"_canPlay",void 0),hs(us(e),"_x",void 0),hs(us(e),"_xTarget",void 0),hs(us(e),"_y",void 0),hs(us(e),"_yTarget",void 0);var r=y(e.prop.container);if(!r)throw new Error("No cursor container for ".concat(e.prop.container));return e._container=r,e._containerIsWindow=r instanceof Window,e._x=0,e._xTarget=0,e._y=0,e._yTarget=0,e._currentFPS=60,e._canPlay=e.prop.run,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return rs(rs({},ls(fs(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,run:!0,hideNativeCursor:!1,render:{lerp:.2,lerpToFixed:2,normalizeLerp:!1},autoStop:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"custom-cursor")}},{key:"container",get:function(){return this._container}},{key:"eventsContainer",get:function(){return this._container}},{key:"domContainer",get:function(){return this.container instanceof Window?this._app.html:this.container}},{key:"outerCursor",get:function(){return this._outerCursor}},{key:"innerCursor",get:function(){return this._innerCursor}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"_constructor",value:function(){ls(fs(i.prototype),"_constructor",this).call(this),this._createCursor()}},{key:"_setEvents",value:function(){var t=this;ls(fs(i.prototype),"_setEvents",this).call(this);var e=this.domContainer;this._animationFrame=new pt,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})),this._canPlay&&this.enable(),this.addEventListeners(e,"mouseenter",this._handleMouseEnter.bind(this)),this.addEventListeners(e,"mouseleave",this._handleMouseLeave.bind(this)),this.addEventListeners(e,"mousemove",this._handleMouseMove.bind(this)),this.addEventListeners(e,"mousedown",this._handleMouseDown.bind(this)),this.addEventListeners(e,"mouseup",this._handleMouseUp.bind(this)),this.addEventListeners(window,"blur",this._handleWindowBlur.bind(this))}},{key:"_createCursor",value:function(){var t=this.prefix,e=this.container,n=this.domContainer;this.prop.hideNativeCursor&&(n.style.cursor="none",n.classList.add("hide-defaut-cursor")),n.classList.add("".concat(t,"-container")),this._outerCursor=_("div",{class:"".concat(t," ").concat(e instanceof Window?"in-window":"in-element"," disabled"),parent:n}),this._innerCursor=_("div",{class:"".concat(t,"__inner disabled"),parent:this._outerCursor}),this.callbacks.tbt("create",{outerCursor:this.outerCursor,innerCursor:this.innerCursor})}},{key:"_destroyCursor",value:function(){var t=this.prefix,e=this.domContainer;e.style.cursor="",e.classList.remove("hide-defaut-cursor"),e.classList.remove("".concat(t,"-container")),this._outerCursor.remove(),this._innerCursor.remove()}},{key:"_handleMouseEnter",value:function(t){this._xTarget=t.clientX,this._x=this._xTarget,this._yTarget=t.clientY,this._y=this._yTarget,this.outerCursor.classList.add("in-action")}},{key:"_handleMouseLeave",value:function(){this.outerCursor.classList.remove("in-action")}},{key:"_handleMouseMove",value:function(t){this._xTarget=t.clientX,this._yTarget=t.clientY,this.outerCursor.classList.add("in-action"),this._canPlay&&this._animationFrame.play()}},{key:"_handleMouseDown",value:function(t){1===t.which&&(this.outerCursor.classList.add("click"),this.innerCursor.classList.add("click"))}},{key:"_handleMouseUp",value:function(){this.outerCursor.classList.remove("click"),this.innerCursor.classList.remove("click")}},{key:"_handleWindowBlur",value:function(){this._handleMouseUp()}},{key:"render",value:function(){var t=this.prop,e=this.domContainer,n=t.render,r=n.normalizeLerp,o=n.lerp,i=n.lerpToFixed,s=r?60/this._currentFPS:1;if(this._x=J(this._x,this._xTarget,o*s,.02),this._y=J(this._y,this._yTarget,o*s,.02),"number"==typeof i){var a=Math.round(Math.abs(i));this._x=parseFloat(this._x.toFixed(a)),this._y=parseFloat(this._y.toFixed(a))}var c=this._x,u=this._y;if(!this._containerIsWindow){var l=e.getBoundingClientRect();c-=l.left,u-=l.top}this.outerCursor.style.transform="translate(".concat(c,"px, ").concat(u,"px)"),t.autoStop&&this._x===this._xTarget&&this._y===this._yTarget&&this._animationFrame.pause(),this._callbacks.tbt("render",{x:c,y:u})}},{key:"enable",value:function(){this._canPlay=!0,this._animationFrame.isPlaying||(this.outerCursor.classList.remove("disabled"),this.innerCursor.classList.remove("disabled"),this._animationFrame.play())}},{key:"disable",value:function(){this._canPlay=!1,this._animationFrame.isPlaying&&(this.outerCursor.classList.add("disabled"),this.innerCursor.classList.add("disabled"),this._animationFrame.pause())}},{key:"_destroy",value:function(){ls(fs(i.prototype),"_destroy",this).call(this),this._destroyCursor(),this._animationFrame.destroy()}}])&&is(e.prototype,n),r&&is(e,r),i}(q),ds={common:t,listeners:r,math:e};window.Vevet=i})()})();
12
+ (()=>{var t={554:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Function]",a="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[s]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),d=e&&!e.nodeType&&e,y=d&&t&&!t.nodeType&&t,v=y&&y.exports===d,b=v&&f.process,_=function(){try{var t=y&&y.require&&y.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(e){}}(),g=_&&_.isTypedArray;function m(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var w,O,P,k=Array.prototype,j=Function.prototype,S=Object.prototype,E=p["__core-js_shared__"],x=j.toString,T=S.hasOwnProperty,R=(w=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",L=S.toString,C=x.call(Object),D=RegExp("^"+x.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?p.Buffer:void 0,W=p.Symbol,B=p.Uint8Array,I=M?M.allocUnsafe:void 0,F=(O=Object.getPrototypeOf,P=Object,function(t){return O(P(t))}),A=Object.create,H=S.propertyIsEnumerable,z=k.splice,N=W?W.toStringTag:void 0,V=function(){try{var t=dt(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),X=M?M.isBuffer:void 0,Q=Math.max,U=Date.now,Y=dt(p,"Map"),$=dt(Object,"create"),q=function(){function t(){}return function(e){if(!St(e))return{};if(A)return A(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function K(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function J(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function G(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Z(t){var e=this.__data__=new J(t);this.size=e.size}function tt(t,e){var n=wt(t),r=!n&&mt(t),o=!n&&!r&&Pt(t),i=!n&&!r&&!o&&xt(t),s=n||r||o||i,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var u in t)!e&&!T.call(t,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||yt(u,c))||a.push(u);return a}function et(t,e,n){(void 0!==n&&!gt(t[e],n)||void 0===n&&!(e in t))&&ot(t,e,n)}function nt(t,e,n){var r=t[e];T.call(t,e)&&gt(r,n)&&(void 0!==n||e in t)||ot(t,e,n)}function rt(t,e){for(var n=t.length;n--;)if(gt(t[n][0],e))return n;return-1}function ot(t,e,n){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}K.prototype.clear=function(){this.__data__=$?$(null):{},this.size=0},K.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},K.prototype.get=function(t){var e=this.__data__;if($){var n=e[t];return n===r?void 0:n}return T.call(e,t)?e[t]:void 0},K.prototype.has=function(t){var e=this.__data__;return $?void 0!==e[t]:T.call(e,t)},K.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=$&&void 0===e?r:e,this},J.prototype.clear=function(){this.__data__=[],this.size=0},J.prototype.delete=function(t){var e=this.__data__,n=rt(e,t);return!(n<0)&&(n==e.length-1?e.pop():z.call(e,n,1),--this.size,!0)},J.prototype.get=function(t){var e=this.__data__,n=rt(e,t);return n<0?void 0:e[n][1]},J.prototype.has=function(t){return rt(this.__data__,t)>-1},J.prototype.set=function(t,e){var n=this.__data__,r=rt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(Y||J),string:new K}},G.prototype.delete=function(t){var e=pt(this,t).delete(t);return this.size-=e?1:0,e},G.prototype.get=function(t){return pt(this,t).get(t)},G.prototype.has=function(t){return pt(this,t).has(t)},G.prototype.set=function(t,e){var n=pt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new J,this.size=0},Z.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Z.prototype.get=function(t){return this.__data__.get(t)},Z.prototype.has=function(t){return this.__data__.has(t)},Z.prototype.set=function(t,e){var n=this.__data__;if(n instanceof J){var r=n.__data__;if(!Y||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(t,e),this.size=n.size,this};var it,st=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),s=i.length;s--;){var a=i[it?s:++r];if(!1===e(o[a],a,o))break}return t};function at(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":N&&N in Object(t)?function(t){var e=T.call(t,N),n=t[N];try{t[N]=void 0;var r=!0}catch(i){}var o=L.call(t);r&&(e?t[N]=n:delete t[N]);return o}(t):function(t){return L.call(t)}(t)}function ct(t){return Et(t)&&at(t)==i}function ut(t){return!(!St(t)||function(t){return!!R&&R in t}(t))&&(kt(t)?D:c).test(function(t){if(null!=t){try{return x.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t))}function lt(t){if(!St(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=vt(t),n=[];for(var r in t)("constructor"!=r||!e&&T.call(t,r))&&n.push(r);return n}function ft(t,e,n,r,o){t!==e&&st(e,(function(i,s){if(o||(o=new Z),St(i))!function(t,e,n,r,o,i,s){var c=bt(t,n),u=bt(e,n),l=s.get(u);if(l)return void et(t,n,l);var f=i?i(c,u,n+"",t,e,s):void 0,h=void 0===f;if(h){var p=wt(u),d=!p&&Pt(u),y=!p&&!d&&xt(u);f=u,p||d||y?wt(c)?f=c:Et(m=c)&&Ot(m)?f=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(c):d?(h=!1,f=function(t,e){if(e)return t.slice();var n=t.length,r=I?I(n):new t.constructor(n);return t.copy(r),r}(u,!0)):y?(h=!1,v=u,b=!0?(_=v.buffer,g=new _.constructor(_.byteLength),new B(g).set(new B(_)),g):v.buffer,f=new v.constructor(b,v.byteOffset,v.length)):f=[]:function(t){if(!Et(t)||at(t)!=a)return!1;var e=F(t);if(null===e)return!0;var n=T.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==C}(u)||mt(u)?(f=c,mt(c)?f=function(t){return function(t,e,n,r){var o=!n;n||(n={});var i=-1,s=e.length;for(;++i<s;){var a=e[i],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),o?ot(n,a,c):nt(n,a,c)}return n}(t,Tt(t))}(c):St(c)&&!kt(c)||(f=function(t){return"function"!=typeof t.constructor||vt(t)?{}:q(F(t))}(u))):h=!1}var v,b,_,g;var m;h&&(s.set(u,f),o(f,u,r,i,s),s.delete(u));et(t,n,f)}(t,e,s,n,ft,r,o);else{var c=r?r(bt(t,s),i,s+"",t,e,o):void 0;void 0===c&&(c=i),et(t,s,c)}}),Tt)}function ht(t,e){return _t(function(t,e,n){return e=Q(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Q(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),m(t,this,a)}}(t,e,Ct),t+"")}function pt(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function dt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return ut(n)?n:void 0}function yt(t,e){var n=typeof t;return!!(e=null==e?o:e)&&("number"==n||"symbol"!=n&&u.test(t))&&t>-1&&t%1==0&&t<e}function vt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||S)}function bt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var _t=function(t){var e=0,n=0;return function(){var r=U(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(V?function(t,e){return V(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Ct);function gt(t,e){return t===e||t!=t&&e!=e}var mt=ct(function(){return arguments}())?ct:function(t){return Et(t)&&T.call(t,"callee")&&!H.call(t,"callee")},wt=Array.isArray;function Ot(t){return null!=t&&jt(t.length)&&!kt(t)}var Pt=X||function(){return!1};function kt(t){if(!St(t))return!1;var e=at(t);return e==s||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function jt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function St(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Et(t){return null!=t&&"object"==typeof t}var xt=g?function(t){return function(e){return t(e)}}(g):function(t){return Et(t)&&jt(t.length)&&!!l[at(t)]};function Tt(t){return Ot(t)?tt(t,!0):lt(t)}var Rt,Lt=(Rt=function(t,e,n,r){ft(t,e,n,r)},ht((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Rt.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!St(n))return!1;var r=typeof e;return!!("number"==r?Ot(n)&&yt(e,n.length):"string"==r&&e in n)&&gt(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=e[n];s&&Rt(t,s,n,o)}return t})));function Ct(t){return t}t.exports=Lt},796:(t,e,n)=>{t.exports=n(643)},264:t=>{"use strict";var e=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:e,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:e&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};t.exports=n},518:t=>{var e,n,r,o,i,s,a,c,u,l,f,h,p,d,y,v=!1;function b(){if(!v){v=!0;var t=navigator.userAgent,b=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),_=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(h=/\b(iPhone|iP[ao]d)/.exec(t),p=/\b(iP[ao]d)/.exec(t),l=/Android/i.exec(t),d=/FBAN\/\w+;/i.exec(t),y=/Mobile/i.exec(t),f=!!/Win64/.exec(t),b){(e=b[1]?parseFloat(b[1]):b[5]?parseFloat(b[5]):NaN)&&document&&document.documentMode&&(e=document.documentMode);var g=/(?:Trident\/(\d+.\d+))/.exec(t);s=g?parseFloat(g[1])+4:e,n=b[2]?parseFloat(b[2]):NaN,r=b[3]?parseFloat(b[3]):NaN,(o=b[4]?parseFloat(b[4]):NaN)?(b=/(?:Chrome\/(\d+\.\d+))/.exec(t),i=b&&b[1]?parseFloat(b[1]):NaN):i=NaN}else e=n=r=i=o=NaN;if(_){if(_[1]){var m=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);a=!m||parseFloat(m[1].replace("_","."))}else a=!1;c=!!_[2],u=!!_[3]}else a=c=u=!1}}var _={ie:function(){return b()||e},ieCompatibilityMode:function(){return b()||s>e},ie64:function(){return _.ie()&&f},firefox:function(){return b()||n},opera:function(){return b()||r},webkit:function(){return b()||o},safari:function(){return _.webkit()},chrome:function(){return b()||i},windows:function(){return b()||c},osx:function(){return b()||a},linux:function(){return b()||u},iphone:function(){return b()||h},mobile:function(){return b()||h||p||l||y},nativeApp:function(){return b()||d},android:function(){return b()||l},ipad:function(){return b()||p}};t.exports=_},534:(t,e,n)=>{"use strict";var r,o=n(264);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=function(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i="function"==typeof s[n]}return!i&&r&&"wheel"===t&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},643:(t,e,n)=>{"use strict";var r=n(518),o=n(534);function i(t){var e=0,n=0,r=0,o=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=10*e,o=10*n,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||o)&&t.deltaMode&&(1==t.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!e&&(e=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},t.exports=i}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";var t={};n.r(t),n.d(t,{mergeWithoutArrays:()=>u,randID:()=>s,timeoutCallback:()=>l});var e={};n.r(e),n.d(e,{clamp:()=>G,clampScope:()=>rt,inScope:()=>nt,lerp:()=>Z,scoped:()=>tt,spreadScope:()=>et,wrap:()=>ot});var r={};n.r(r),n.d(r,{intersectionObserverSupported:()=>Dt,onScroll:()=>Ct});var o={};n.r(o);var i={};function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id",e="".concat(+new Date,"_").concat(Math.round(1e3*Math.random()));return"".concat(t,"_").concat(e)}n.r(i),n.d(i,{AnimationFrame:()=>bt,Application:()=>Be,Callbacks:()=>T,Component:()=>J,Ctx2D:()=>go,Ctx2DPrerender:()=>Do,CustomCursor:()=>bs,Dragger:()=>Fr,DraggerDirection:()=>io,DraggerMove:()=>Yr,GeneralTypes:()=>o,Module:()=>H,MutableProp:()=>D,Page:()=>on,PageLoad:()=>Re,Plugin:()=>Qe,Preloader:()=>hr,ProgressPreloader:()=>jr,ScrollBar:()=>qo,ScrollEventsBase:()=>ci,ScrollView:()=>Pi,SmoothScroll:()=>Rt,SmoothScrollDragPlugin:()=>Qi,SmoothScrollKeyboardPlugin:()=>Ci,SplitText:()=>os,StaticTimeline:()=>Hn,Timeline:()=>Zn,Viewport:()=>Oe,WheelHandler:()=>gn,utils:()=>_s});var a=n(554),c=n.n(a);function u(t,e){return c()(t,e,(function(t,e){if(Array.isArray(t))return e}))}function l(t,e){0===e?t():setTimeout((function(){t()}),e)}function f(t,e){return h(t,e)}function h(t,e){return t===e||null!==t&&h(t.parentNode,e)}function p(t){return t instanceof HTMLElement||t instanceof Element}function d(t){return t instanceof Window}function y(t,e){if(d(t))return t;if(p(t))return t;if(void 0!==e){const n=y(e);if(n)return n.querySelector(t)}return document.querySelector(t)}function v(t,e){if(t instanceof NodeList)return t;if(p(t))return[t];if(Array.isArray(t))return t;if(void 0!==e){const n=y(e);if(n)return n.querySelectorAll(t)}return document.querySelectorAll(t)}function b(t,e,n){const r=e.split(" ");for(let o=0;o<r.length;o++)void 0===n?t.classList.toggle(r[o]):n?t.classList.add(r[o]):t.classList.remove(r[o])}function _(t,e={}){const n=document.createElement(t);if(e.class&&function(t,e){if(t instanceof Element)b(t,e,!0);else for(let n=0;n<t.length;n++)b(t[n],e,!0)}(n,e.class),e.id&&n.setAttribute("id",e.id),e.attr)for(let r=0,o=e.attr.length;r<o;r++){const t=e.attr[r];n.setAttribute(t[0],t[1])}if(e.parent&&e.parent.appendChild(n),e.html&&(n.innerHTML=e.html),e.children)for(let r=0,o=e.children.length;r<o;r++)n.appendChild(e.children[r]);return n}const g=[];function m(t,e,n,r){if(void 0!==r){const o={passive:!1,once:!1};r.once&&(o.once=!0),r.passive&&(o.passive=!0),t.addEventListener(e,n,o)}else t.addEventListener(e,n);const o=`${Math.random()}-${+new Date}`;return g.push({id:o,el:t,target:e,callback:n}),{id:o,remove:w.bind(this,o)}}function w(t){const e=[];for(let n=0,r=g.length;n<r;n++){const r=g[n];r.id===t?r.el.removeEventListener(r.target,r.callback):e.push(r)}}var O=n(796),P=n.n(O);function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var T=function(){function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];S(this,t),x(this,"_app",void 0),x(this,"_callbacks",void 0),this._app=window.vevetApp,this._callbacks=[],e&&this._init()}var e,n,r;return e=t,(n=[{key:"callbacks",get:function(){return this._callbacks}},{key:"_init",value:function(){this._constructor(),this._setEvents()}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=s("callback"),o={id:r,on:!0,data:j({target:t,do:e},n)};return this._callbacks.push(o),this._onAdd(r),{id:r,remove:this.remove.bind(this,r)}}},{key:"_onAdd",value:function(t){}},{key:"remove",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!1,o=this._callbacks.filter((function(o){return o.id!==t||!(!o.data.protected||n)||(e._onRemove(t),r=!0,!1)}));return this._callbacks=o,r}},{key:"_onRemove",value:function(t){}},{key:"removeAll",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._callbacks.length>0;)this.remove(this._callbacks[0].id,t)}},{key:"turn",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.get(t);return!!n&&(n.on=e,this._onTurn(t),!0)}},{key:"_onTurn",value:function(t){}},{key:"get",value:function(t){var e=this._callbacks.filter((function(e){return e.id===t}));return e.length>0&&e[0]}},{key:"_trigger",value:function(t,e){if(t.on){var n=t.data,r=n.timeout,o=n.once,i=t.data.do;r?l(e?this._triggerFunc.bind(this,i,e):this._triggerFunc.bind(this,i,!1),r):e?this._triggerFunc(i,e):this._triggerFunc(i,!1),o&&this.remove(t.id)}}},{key:"_triggerFunc",value:function(t,e){e?t(e):t()}},{key:"tbt",value:function(t,e){var n=this;this._callbacks.forEach((function(r){r.data.target===t&&n._trigger(r,e)}))}},{key:"destroy",value:function(){this.removeAll(!0)}}])&&E(e.prototype,n),r&&E(e,r),t}();function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var D=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"Responsive Prop";R(this,t),C(this,"_initProp",void 0),C(this,"_onResponsive",void 0),C(this,"_onChange",void 0),C(this,"_name",void 0),C(this,"_app",void 0),C(this,"_refProp",void 0),C(this,"_prop",void 0),C(this,"_responsiveRules",[]),C(this,"_viewportCallback",void 0),this._initProp=e,this._onResponsive=n,this._onChange=r,this._name=o,this._app=window.vevetApp,this._refProp=u({},e),this._prop=u({},e)}var e,n,r;return e=t,(n=[{key:"prop",get:function(){return this._prop}},{key:"addResponsiveProp",value:function(t){this._responsiveRules.push(t),void 0===this._viewportCallback&&(this._viewportCallback=this._app.viewport.add("w",this._responseProp.bind(this,!0),{name:this._name})),this._responseProp()}},{key:"_responseProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._responsiveRules,n=this._app,r=n.viewport,o=r.width,i=!1,s=u({},this._refProp);e.forEach((function(t){var e=t.settings,a=t.breakpoint;if("number"==typeof a)o<=t.breakpoint&&(i=u(s,e));else if("string"==typeof a){var c=a.toLowerCase();("d"===c&&r.isDesktop||"t"===c&&r.isTablet||"p"===c&&r.isPhone)&&(i=u(s,e)),("phone"===c&&n.isPhone||"tablet"===c&&n.isTablet||"mobile"===c&&n.isMobile)&&(i=u(s,e))}})),this._prop=u(this._prop,i||this._refProp),t&&this._onResponsive()}},{key:"changeProp",value:function(t){this._prop=u(this._prop,t),this._refProp=u(this._refProp,t),this._onChange(t)}},{key:"destroy",value:function(){this._viewportCallback&&this._viewportCallback.remove()}}])&&L(e.prototype,n),r&&L(e,r),t}();function M(){throw new Error('Vevet.Application does not exist yet. \nCall "new Vevet.Application()" before using all the stuff')}function W(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?W(Object(n),!0).forEach((function(e){A(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function A(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var H=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];I(this,t),A(this,"_mutableProp",void 0),A(this,"_callbacks",void 0),A(this,"_listeners",void 0),A(this,"_app",void 0),A(this,"_inited",!1),A(this,"_destroyed",void 0),A(this,"_viewportCallbacks",[]),window.vevetApp?this._app=window.vevetApp:M(),this._destroyed=!1,this._listeners=[],this._callbacks=new T;var r=u(this._getDefaultProp(),e||{});this._mutableProp=new D(r,this._onPropResponsive.bind(this),this._onPropChange.bind(this),this.name),n&&this.init()}var e,n,r;return e=t,(n=[{key:"_getDefaultProp",value:function(){return{parent:!1}}},{key:"prop",get:function(){return this._mutableProp.prop}},{key:"callbacks",get:function(){return this._callbacks}},{key:"prefix",get:function(){return""}},{key:"name",get:function(){return this.constructor.name}},{key:"inited",get:function(){return this._inited}},{key:"destroyed",get:function(){return this._destroyed}},{key:"addResponsiveProp",value:function(t){if(this._inited)throw new Error("Responsive properties cannot be added because the class instance is already initialized");this._mutableProp.addResponsiveProp(t)}},{key:"changeProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._mutableProp.changeProp(t),this._callbacks.tbt("changeProp",!1)}},{key:"_onPropResponsive",value:function(){this._onPropMutate()}},{key:"_onPropChange",value:function(t){this._onPropMutate()}},{key:"_onPropMutate",value:function(){}},{key:"init",value:function(){var t=this;this._inited||(this._inited=!0,this._constructor(),this._setEvents(),this.prop.parent&&this.prop.parent.addCallback("destroy",(function(){t.destroy()})))}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"addViewportCallback",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this._app.viewport.add(t,e,B(B({},n),{},{name:this.constructor.name}));return this._viewportCallbacks.push(r),r}},{key:"addCallback",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.callbacks.add(t,e,n);return r}},{key:"addEventListeners",value:function(t,e,n,r){var o=m(t,e,n,r);return this._listeners.push(o),o}},{key:"destroy",value:function(){this.destroyed||this._destroy()}},{key:"_destroy",value:function(){this._callbacks.tbt("destroy",!1),this._callbacks.destroy(),this._mutableProp.destroy(),this._viewportCallbacks.forEach((function(t){t.remove()})),this._listeners.forEach((function(t){t.remove()})),this._destroyed=!0}}])&&F(e.prototype,n),r&&F(e,r),t}();function z(t){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function X(t,e,n){return(X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=q(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Q(t,e){return(Q=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function U(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=q(t);if(e){var o=q(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Y(this,n)}}function Y(t,e){return!e||"object"!==z(e)&&"function"!=typeof e?$(t):e}function $(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function q(t){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function K(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var J=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Q(t,e)}(i,t);var e,n,r,o=U(i);function i(){var t;N(this,i);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return K($(t=o.call.apply(o,[this].concat(n))),"_plugins",void 0),t}return e=i,(n=[{key:"addPlugin",value:function(t){void 0===this._plugins&&(this._plugins=[]),this._plugins.push(t),t.inited||t.initPlugin(this)}},{key:"_destroyPlugins",value:function(){this._plugins&&this._plugins.forEach((function(t){t.destroy()}))}},{key:"_destroy",value:function(){X(q(i.prototype),"_destroy",this).call(this),this._destroyPlugins()}}])&&V(e.prototype,n),r&&V(e,r),i}(H);function G(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1];return t<e[0]?e[0]:t>e[1]?e[1]:t}function Z(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001,o=t*(1-n)+e*n,i=Math.abs(e-o);return i<=r?e:o}function tt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1],n=(t-e[0])/(e[1]-e[0]);return n}function et(t,e){for(var n=[],r=1/(t-e*(t-1)),o=0;o<t;o+=1){var i=r*(1-e)*o,s=i+r;n.push([i,s])}return n}function nt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1];return t>=e[0]&&t<=e[1]}function rt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,1];return G(tt(t,e),n)}function ot(t,e,n){var r=e-t;return function(t,e){return t||0===t?e(t):e}(n,(function(e){return(r+(e-t)%r)%r+t}))}function it(t){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function st(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function at(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?st(Object(n),!0).forEach((function(e){vt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):st(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ct(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ut(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function lt(t,e,n){return(lt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=yt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ft(t,e){return(ft=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ht(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=yt(t);if(e){var o=yt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pt(this,n)}}function pt(t,e){return!e||"object"!==it(e)&&"function"!=typeof e?dt(t):e}function dt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yt(t){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function vt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var bt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ft(t,e)}(i,t);var e,n,r,o=ht(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ct(this,i),vt(dt(e=o.call(this,t,!1)),"_isPlaying",void 0),vt(dt(e),"_frame",void 0),vt(dt(e),"_frameIndex",void 0),vt(dt(e),"_timeStamp",void 0),vt(dt(e),"_prevFrameTime",void 0),e._isPlaying=!1,e._frame=null,e._frameIndex=-1,e._timeStamp=null,e._prevFrameTime=null,n&&e.init(),e}return e=i,(n=[{key:"isPlaying",get:function(){return this._isPlaying}},{key:"_getDefaultProp",value:function(){return at(at({},lt(yt(i.prototype),"_getDefaultProp",this).call(this)),{},{fps:140,run:!1})}},{key:"_constructor",value:function(){lt(yt(i.prototype),"_constructor",this).call(this),this._create()}},{key:"_create",value:function(){this.prop.run&&this.play()}},{key:"_onPropMutate",value:function(){this._frameIndex=-1,this._timeStamp=null,this._prevFrameTime=null,this.prop.run?this._play():this._pause()}},{key:"play",value:function(){this.destroyed||this.prop.run||this.changeProp({run:!0})}},{key:"_play",value:function(){this.isPlaying||(this._isPlaying=!0,this._frame=window.requestAnimationFrame(this._animate.bind(this)))}},{key:"pause",value:function(){this.prop.run&&this.changeProp({run:!1})}},{key:"_pause",value:function(){this.isPlaying&&(this._frame&&(window.cancelAnimationFrame(this._frame),this._frame=null),this._isPlaying=!1)}},{key:"_animate",value:function(t){if(this._isPlaying){this._frame=window.requestAnimationFrame(this._animate.bind(this));var e=+new Date;null==this._timeStamp&&(this._timeStamp=t),null==this._prevFrameTime&&(this._prevFrameTime=e);var n=Math.floor((t-this._timeStamp)/(1e3/this.prop.fps));if(!(n<=this._frameIndex)){this._frameIndex=n;var r=e-this._prevFrameTime,o=G(0===r?1e3/60:Math.floor(1e3/r),[1,1/0]);this.callbacks.tbt("frame",{fps:this.prop.fps,realFPS:o,prevFrameDuration:e-this._prevFrameTime}),this._prevFrameTime=+new Date}}}},{key:"_destroy",value:function(){this.pause(),lt(yt(i.prototype),"_destroy",this).call(this)}}])&&ut(e.prototype,n),r&&ut(e,r),i}(J);function _t(t){return(_t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function mt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?gt(Object(n),!0).forEach((function(e){Tt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function wt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Pt(t,e,n){return(Pt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function kt(t,e){return(kt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function jt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=xt(t);if(e){var o=xt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return St(this,n)}}function St(t,e){return!e||"object"!==_t(e)&&"function"!=typeof e?Et(t):e}function Et(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xt(t){return(xt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Rt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&kt(t,e)}(i,t);var e,n,r,o=jt(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];wt(this,i),Tt(Et(e=o.call(this,t,!1)),"_outer",void 0),Tt(Et(e),"_container",void 0),Tt(Et(e),"_containerExists",void 0),Tt(Et(e),"_elements",void 0),Tt(Et(e),"_elementsLength",void 0),Tt(Et(e),"_targetLeft",void 0),Tt(Et(e),"_targetTop",void 0),Tt(Et(e),"_scrollLeft",void 0),Tt(Et(e),"_scrollTop",void 0),Tt(Et(e),"_scrollWidth",void 0),Tt(Et(e),"_scrollHeight",void 0),Tt(Et(e),"_clientWidth",void 0),Tt(Et(e),"_clientHeight",void 0),Tt(Et(e),"_instant",void 0),Tt(Et(e),"_animationFrame",void 0),Tt(Et(e),"_outerAnimationFrameEvent",void 0),Tt(Et(e),"_currentFPS",void 0);var r=e.prop.selectors;if(e._targetLeft=0,e._targetTop=0,e._scrollLeft=0,e._scrollTop=0,e._scrollWidth=0,e._scrollHeight=0,e._clientWidth=0,e._clientHeight=0,e._instant=!1,e._animationFrame=void 0,e._outerAnimationFrameEvent=void 0,e._currentFPS=60,e._outer=y(r.outer),!(e._outer instanceof HTMLElement))throw new Error("".concat(r.outer," is not a HTMLElement"));e._outer.classList.add(e.prefix);var s=y(".".concat(e.prefix,"__container"),e.outer);return p(s)?(e._container=s,e._containerExists=!0):(e._container=_("div",{class:"".concat(e.prefix,"__container"),parent:e.outer,children:Array.from(e.outer.children)}),e._containerExists=!1),r.elements?e._elements=Array.from(v(r.elements,e._outer)):e._elements=[e._container],e._elementsLength=e._elements.length,e.prop.useWillChange&&e._elements.forEach((function(t){t.style.willChange="transform"})),n&&e.init(),e}return e=i,(n=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"smooth-scroll")}},{key:"outer",get:function(){return this._outer}},{key:"container",get:function(){return this._container}},{key:"elements",get:function(){return this._elements}},{key:"targetLeft",get:function(){return this._targetLeft},set:function(t){this.targetLeftBound=t,this._enable()}},{key:"targetLeftBound",get:function(){return this._targetLeft},set:function(t){var e=this.prop.overscroll&&this.prop.isHorizontal?-this.prop.overscroll.max:0,n=this.maxScrollableWidth+(this.prop.overscroll&&this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetLeft=G(t,[e,n])}},{key:"targetTop",get:function(){return this._targetTop},set:function(t){this.targetTopBound=t,this._enable()}},{key:"targetTopBound",get:function(){return this._targetTop},set:function(t){var e=this.prop.overscroll&&!this.prop.isHorizontal?-this.prop.overscroll.max:0,n=this.maxScrollableHeight+(this.prop.overscroll&&!this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetTop=G(t,[e,n])}},{key:"scrollLeft",get:function(){return this._scrollLeft},set:function(t){this.targetLeftBound=t,this._scrollLeft=this._targetLeft,this._enable()}},{key:"scrollTop",get:function(){return this._scrollTop},set:function(t){this.targetTopBound=t,this._scrollTop=this._targetTop,this._enable()}},{key:"scrollWidth",get:function(){return this._scrollWidth}},{key:"scrollHeight",get:function(){return this._scrollHeight}},{key:"clientWidth",get:function(){return this._clientWidth}},{key:"clientHeight",get:function(){return this._clientHeight}},{key:"maxScrollableWidth",get:function(){return this.scrollWidth-this.clientWidth}},{key:"maxScrollableHeight",get:function(){return this.scrollHeight-this.clientHeight}},{key:"_getDefaultProp",value:function(){return mt(mt({},Pt(xt(i.prototype),"_getDefaultProp",this).call(this)),{},{selectors:{outer:"#".concat(this.prefix),elements:!1},enabled:!0,animationFrame:!1,recalculateSizes:!0,resizeTimeout:0,useWheel:!0,autoStop:!0,isHorizontal:!1,stopPropagation:!0,useWillChange:!0,render:{lerp:.1,lerpToFixed:2,approximation:.1,normalizeLerp:!1},overscroll:{friction:.5,max:250}})}},{key:"_constructor",value:function(){Pt(xt(i.prototype),"_constructor",this).call(this),this._toggle()}},{key:"_setEvents",value:function(){var t=this;this.resize(),this.addViewportCallback("",(function(){t.resize(!0)}),{timeout:this.prop.resizeTimeout}),this.addEventListeners(this.outer,"wheel",(function(e){t._handleWheel(e)})),this.addEventListeners(this.outer,"scroll",(function(){t.outer.scrollTop=0,t.outer.scrollLeft=0}))}},{key:"_onPropMutate",value:function(){Pt(xt(i.prototype),"_onPropMutate",this).call(this),this.resize(),this._toggle()}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.container,n=this.outer;this._clientWidth=n.clientWidth,this._clientHeight=n.clientHeight,this._scrollWidth=G(e.clientWidth,[this.clientWidth,1/0]),this._scrollHeight=G(e.clientHeight,[this.clientHeight,1/0]),t&&(this._instant=!0),t&&(this.targetLeft=parseInt(this.targetLeft.toFixed(0),10),this.targetTop=parseInt(this.targetTop.toFixed(0),10));var r=this.maxScrollableHeight>0||this.maxScrollableWidth>0;n.classList.toggle("has-scroll",r),n.classList.toggle("no-scroll",!r),this._updateElementsProp(),this.callbacks.tbt("resize",!1)}},{key:"_recalculateSizes",value:function(){var t=this.container,e=t.clientHeight,n=t.clientWidth;e===this.scrollHeight&&n===this.scrollWidth||this.resize()}},{key:"_updateElementsProp",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t];e.smoothScrollLeft=this.scrollLeft,e.smoothScrollTop=this.scrollTop;var n=e.getAttribute("".concat(this.prefix,"-ease"));if(n)try{e.smoothScrollLerpEase=parseFloat(n)}catch(r){}}}},{key:"_handleWheel",value:function(t){var e=this.prop;if(e.enabled&&e.useWheel){(e.stopPropagation||!e.stopPropagation&&(this.scrollLeft>0&&this.scrollLeft<this.maxScrollableWidth||this.scrollTop>0&&this.scrollTop<this.maxScrollableHeight))&&(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault());var n=P()(t);this.targetLeftBound+=e.isHorizontal?n.pixelY:n.pixelX,this.targetTopBound+=e.isHorizontal?n.pixelX:n.pixelY,this._enable(),this.callbacks.tbt("wheel",t)}}},{key:"_toggle",value:function(){this.prop.enabled?this._enable():this._disable()}},{key:"_enable",value:function(){var t=this;this.prop.enabled&&(this.prop.animationFrame&&!this._outerAnimationFrameEvent?this._outerAnimationFrameEvent=this.prop.animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})):(this._animationFrame||(this._animationFrame=new bt,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()}))),this._animationFrame.play()))}},{key:"_disable",value:function(){this._outerAnimationFrameEvent&&this.prop.animationFrame&&this._outerAnimationFrameEvent.remove(),this._animationFrame&&this._animationFrame.pause()}},{key:"render",value:function(){var t=this.prop;t.recalculateSizes&&this._recalculateSizes(),this._calcScroll(),this._calcElements(),this._renderElements(),this._instant&&(this._instant=!1),this.callbacks.tbt("scroll",!1);var e=Math.abs(this.targetTop-this.scrollTop);0===Math.abs(this.targetLeft-this.scrollLeft)&&0===e&&t.autoStop&&(this._disable(),this.callbacks.tbt("approximate",!1))}},{key:"_calcScroll",value:function(){var t=this.prop.overscroll;t&&(this.targetLeft<0?this.targetLeftBound=this._lerp(this.targetLeftBound,0,t.friction):this.targetLeft>this.maxScrollableWidth&&(this.targetLeftBound=this._lerp(this.targetLeftBound,this.maxScrollableWidth,t.friction)),this.targetTop<0?this.targetTopBound=this._lerp(this.targetTopBound,0,t.friction):this.targetTop>this.maxScrollableHeight&&(this.targetTopBound=this._lerp(this.targetTopBound,this.maxScrollableHeight,t.friction))),this._scrollLeft=this._lerp(this.scrollLeft,this.targetLeft),this._scrollTop=this._lerp(this.scrollTop,this.targetTop)}},{key:"_calcElements",value:function(){for(var t=this._getLerpEase(),e=0;e<this._elementsLength;e+=1){var n=this._elements[e],r=this._getLerpEase(n);r===t?(n.smoothScrollLeft=this._scrollLeft,n.smoothScrollTop=this._scrollTop):(n.smoothScrollLeft=this._lerp(n.smoothScrollLeft,this._targetLeft,r),n.smoothScrollTop=this._lerp(n.smoothScrollTop,this._targetTop,r))}}},{key:"_lerp",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._getLerpEase(),r=this.prop.render,o=r.lerpToFixed,i=r.approximation,s=this._instant?1:n,a=Z(t,e,s,i);if("number"==typeof o){var c=Math.round(Math.abs(o));return parseFloat(a.toFixed(c))}return a}},{key:"_getLerpEase",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.prop.render,n=e.lerp,r=e.normalizeLerp,o=r?60/this._currentFPS:1;return t&&t.smoothScrollLerpEase||n*o}},{key:"_renderElements",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t],n=-e.smoothScrollLeft,r=-e.smoothScrollTop;e.style.transform="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0, ".concat(n,", ").concat(r,", 0,1)")}}},{key:"scrollTo",value:function(){var t=arguments;if(1===t.length&&"object"===_t(t[0])){var e=t[0],n=e.top,r=e.left,o=e.behavior;void 0!==r&&("smooth"===o?this.targetLeftBound=r:this.scrollLeft=r),void 0!==n&&("smooth"===o?this.targetTopBound=n:this.scrollTop=n),"smooth"===o&&this._enable()}"number"!=typeof t[0]&&"number"!=typeof t[1]||("number"==typeof t[0]&&(this.scrollLeft=t[0]),"number"==typeof t[1]&&(this.scrollTop=t[1]))}},{key:"_destroy",value:function(){if(Pt(xt(i.prototype),"_destroy",this).call(this),this._disable(),this._animationFrame&&this._animationFrame.destroy(),!this._containerExists){for(;this._container.firstChild;)this._outer.appendChild(this._container.firstChild);this._container.remove()}this._outer.classList.remove(this.prefix),this._elements.forEach((function(t){t.style.transform="",t.style.willChange=""}))}}])&&Ot(e.prototype,n),r&&Ot(e,r),i}(J),Lt=[];function Ct(t){var e=t.container,n=t.callback,r=t.isPassive,o=void 0!==r&&r,i=Lt.find((function(t){return t.container===e&&t.isPassive===o})),a=s("scroll-event");if(i)i.callbacks.push({id:a,callback:n});else{i={id:s("scroll-event-instance"),container:e,callbacks:[{id:a,callback:n}],isPassive:o,listeners:[]},Lt.push(i);var c=i.listeners;if(e instanceof Rt)c.push(e.addCallback("scroll",(function(){for(var t=e.scrollTop,n=e.scrollLeft,r=0;r<i.callbacks.length;r+=1)i.callbacks[r].callback({scrollTop:t,scrollLeft:n})})));else{var u=e instanceof Window,l=y(e);c.push(m(l,"scroll",(function(){for(var t=u?l.pageYOffset:l.scrollTop,e=u?l.pageXOffset:l.scrollLeft,n=0;n<i.callbacks.length;n+=1)i.callbacks[n].callback({scrollTop:t,scrollLeft:e})}),{passive:o}))}}return{remove:function(){var t=i.callbacks.filter((function(t){return t.id!==a}));i.callbacks=t,0===t.length&&(i.listeners.forEach((function(t){t.remove()})),Lt=Lt.filter((function(t){return t.id!==i.id})))}}}function Dt(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype}var Mt=/iPhone/i,Wt=/iPod/i,Bt=/iPad/i,It=/\biOS-universal(?:.+)Mac\b/i,Ft=/\bAndroid(?:.+)Mobile\b/i,At=/Android/i,Ht=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,zt=/Silk/i,Nt=/Windows Phone/i,Vt=/\bWindows(?:.+)ARM\b/i,Xt=/BlackBerry/i,Qt=/BB10/i,Ut=/Opera Mini/i,Yt=/\b(CriOS|Chrome)(?:.+)Mobile/i,$t=/Mobile(?:.+)Firefox\b/i,qt=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function Kt(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var n=e.userAgent,r=n.split("[FBAN");void 0!==r[1]&&(n=r[0]),void 0!==(r=n.split("Twitter"))[1]&&(n=r[0]);var o=function(t){return function(e){return e.test(t)}}(n),i={apple:{phone:o(Mt)&&!o(Nt),ipod:o(Wt),tablet:!o(Mt)&&(o(Bt)||qt(e))&&!o(Nt),universal:o(It),device:(o(Mt)||o(Wt)||o(Bt)||o(It)||qt(e))&&!o(Nt)},amazon:{phone:o(Ht),tablet:!o(Ht)&&o(zt),device:o(Ht)||o(zt)},android:{phone:!o(Nt)&&o(Ht)||!o(Nt)&&o(Ft),tablet:!o(Nt)&&!o(Ht)&&!o(Ft)&&(o(zt)||o(At)),device:!o(Nt)&&(o(Ht)||o(zt)||o(Ft)||o(At))||o(/\bokhttp\b/i)},windows:{phone:o(Nt),tablet:o(Vt),device:o(Nt)||o(Vt)},other:{blackberry:o(Xt),blackberry10:o(Qt),opera:o(Ut),firefox:o($t),chrome:o(Yt),device:o(Xt)||o(Qt)||o(Ut)||o($t)||o(Yt)},any:!1,phone:!1,tablet:!1};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}var Jt,Gt,Zt=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},te=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},ee=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},ne=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},re=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},oe=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},ie=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,se=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],ae=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function ce(t){return t?le(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new oe:"undefined"!=typeof navigator?le(navigator.userAgent):"undefined"!=typeof process&&process.version?new ee(process.version.slice(1)):null}function ue(t){return""!==t&&se.reduce((function(e,n){var r=n[0],o=n[1];if(e)return e;var i=o.exec(t);return!!i&&[r,i]}),!1)}function le(t){var e=ue(t);if(!e)return null;var n=e[0],r=e[1];if("searchbot"===n)return new re;var o=r[1]&&r[1].split(/[._]/).slice(0,3);o?o.length<3&&(o=Zt(o,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-o.length))):o=[];var i=o.join("."),s=function(t){for(var e=0,n=ae.length;e<n;e++){var r=ae[e],o=r[0];if(r[1].exec(t))return o}return null}(t),a=ie.exec(t);return a&&a[1]?new ne(n,i,s,a[1]):new te(n,i,s)}class fe extends Error{constructor(t){super(t||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}}class he{static fn(t){return(...e)=>new he(((n,r,o)=>{e.push(o),t(...e).then(n,r)}))}constructor(t){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise(((e,n)=>{this._reject=n;const r=t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)};Object.defineProperties(r,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}}),t((t=>{this._isCanceled&&r.shouldReject||(this._isPending=!1,e(t))}),(t=>{this._isPending=!1,n(t)}),r)}))}then(t,e){return this._promise.then(t,e)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(this._isPending&&!this._isCanceled){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(const t of this._cancelHandlers)t()}catch(e){return void this._reject(e)}this._rejectOnCancel&&this._reject(new fe(t))}}get isCanceled(){return this._isCanceled}}function pe(t){return(pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function de(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ye(t,e,n){return(ye="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=me(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ve(t,e){return(ve=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function be(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=me(t);if(e){var o=me(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _e(this,n)}}function _e(t,e){return!e||"object"!==pe(e)&&"function"!=typeof e?ge(t):e}function ge(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function me(t){return(me=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function we(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.setPrototypeOf(he.prototype,Promise.prototype),function(t){t.Desktop="desktop",t.Tablet="tablet",t.Phone="phone"}(Jt||(Jt={})),function(t){t.Landscape="landscape",t.Portrait="portrait"}(Gt||(Gt={}));var Oe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ve(t,e)}(i,t);var e,n,r,o=be(i);function i(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),we(ge(t=o.call(this,!1)),"_width",void 0),we(ge(t),"_height",void 0),we(ge(t),"_prevSize",void 0),we(ge(t),"_isDesktop",void 0),we(ge(t),"_isTablet",void 0),we(ge(t),"_isPhone",void 0),t._width=0,t._height=0,t._prevSize={w:0,h:0},t._isDesktop=!1,t._isTablet=!1,t._isPhone=!1,t._init(),t}return e=i,(n=[{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"vw",get:function(){return this.width/100}},{key:"vh",get:function(){return this.height/100}},{key:"prevSize",get:function(){return this._prevSize}},{key:"isLandscape",get:function(){return this.width>this.height}},{key:"isPortrait",get:function(){return this.width<this.height}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isPhone",get:function(){return this._isPhone}},{key:"dpr",get:function(){return void 0!==window.devicePixelRatio?window.devicePixelRatio:1}},{key:"lowerDesktopDPR",get:function(){return this._app.isDesktop?1:this.dpr}},{key:"_constructor",value:function(){ye(me(i.prototype),"_constructor",this).call(this),this._setValues()}},{key:"_setEvents",value:function(){var t=this;window.addEventListener("resize",(function(){l((function(){t._onResize()}),t._app.prop.viewportResizeTimeout)}))}},{key:"_setValues",value:function(){var t=this._app,e=t.html,n=t.prop;this._width=e.clientWidth,this._height=e.clientHeight,this._prevSize={w:this._width,h:this._height};var r=this.width;this._isDesktop=r>=n.tablet,this._isTablet=r<=n.tablet&&r>n.phone,this._isPhone=r<=n.phone,this._updateClasses(),this._updateCSSVars()}},{key:"_updateClasses",value:function(){var t=[Jt.Desktop,Jt.Tablet,Jt.Phone];this.isDesktop?this._updateBreakpointClasses(Jt.Desktop,t):this.isTablet?this._updateBreakpointClasses(Jt.Tablet,t):this._updateBreakpointClasses(Jt.Phone,t);var e=[Gt.Landscape,Gt.Portrait];this.isLandscape?this._updateBreakpointClasses(Gt.Landscape,e):this.isPortrait?this._updateBreakpointClasses(Gt.Portrait,e):this._updateBreakpointClasses("",e)}},{key:"_updateBreakpointClasses",value:function(t,e){var n=this._app.html,r=this._app.prefix;e.forEach((function(e){e===t?n.classList.add("".concat(r,"viewport-").concat(e)):n.classList.remove("".concat(r,"viewport-").concat(e))}))}},{key:"_updateCSSVars",value:function(){var t=this._app.html;t.style.setProperty("--vw","".concat(this.vw,"px")),t.style.setProperty("--vh","".concat(this.vh,"px"))}},{key:"_onResize",value:function(){var t=this._prevSize.w,e=this._prevSize.h;this._setValues();var n=this.width,r=this.height,o={widthChanged:n!==t,heightChanged:r!==e,orientationChanged:n>r!=t>e};n!==t&&r===e&&this.tbt("w_",o),r!==e&&n===t&&this.tbt("h_",o),n!==t&&r!==e&&(this.tbt("wh",o),this.tbt("hw",o)),n!==t&&this.tbt("w",o),r!==e&&this.tbt("h",o),this.tbt("",o)}}])&&de(e.prototype,n),r&&de(e,r),i}(T);function Pe(t){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ke(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function je(t,e){return(je=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Se(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Te(t);if(e){var o=Te(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ee(this,n)}}function Ee(t,e){return!e||"object"!==Pe(e)&&"function"!=typeof e?xe(t):e}function xe(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Te(t){return(Te=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Re=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&je(t,e)}(i,t);var e,n,r,o=Se(i);function i(){var t,e,n,r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,!1),e=xe(t),r=void 0,(n="_loaded")in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,t._loaded=!1,t._init(),t}return e=i,(n=[{key:"loaded",get:function(){return this._loaded}},{key:"_setEvents",value:function(){var t=this;"complete"===document.readyState?this._handleLoaded():window.addEventListener("load",(function(){t._handleLoaded()}))}},{key:"_handleLoaded",value:function(){var t=this._app,e=t.prefix;this._loaded=!0,t.html.classList.remove("".concat(e,"loading")),t.body.classList.remove("".concat(e,"loading")),t.html.classList.add("".concat(e,"loaded")),this.tbt("",!1)}},{key:"onLoaded",value:function(t){if(!this.loaded)return this.add("",t.bind(this));t()}}])&&ke(e.prototype,n),r&&ke(e,r),i}(T);function Le(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ce(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Le(Object(n),!0).forEach((function(e){We(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function De(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function We(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Be=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(De(this,t),We(this,"_prop",void 0),We(this,"_prefix",void 0),We(this,"_isPhone",void 0),We(this,"_isTablet",void 0),We(this,"_isMobile",void 0),We(this,"_isDesktop",void 0),We(this,"_osName",void 0),We(this,"_browserName",void 0),We(this,"_pages",[]),We(this,"_page",!1),We(this,"_pageLoad",void 0),We(this,"_viewport",void 0),window.vevetApp)throw new Error("Vevet Application already exists!");this._prop=Ce(Ce({},this.defaultProp),e),this._prefix=this.prop.prefix,this._sayHi(),window.vevetApp=this;var n=Kt();this._isPhone=n.phone,this.html.classList.toggle("".concat(this.prefix,"phone"),this._isPhone),this._isTablet=n.tablet,this.html.classList.toggle("".concat(this.prefix,"tablet"),this._isTablet),this._isMobile=n.phone||n.tablet,this.html.classList.toggle("".concat(this.prefix,"mobile"),this._isMobile),this._isDesktop=!this._isMobile,this.html.classList.toggle("".concat(this.prefix,"desktop"),this._isDesktop);var r=ce();if(null!=r&&r.os){var o=r.os.split(" ")[0].toLowerCase();this.html.classList.add("".concat(this.prefix,"os-").concat(o)),this._osName=o}else this._osName="";if(null!=r&&r.name){var i=r.name.toLowerCase();this.html.classList.add("".concat(this.prefix,"browser-").concat(i)),this._browserName=i}else this._browserName="";this._pageLoad=new Re,this._viewport=new Oe}var e,n,r;return e=t,(n=[{key:"prop",get:function(){return this._prop}},{key:"defaultProp",get:function(){return{tablet:1199,phone:899,prefix:"v-",easing:[.25,.1,.25,1],viewportResizeTimeout:0}}},{key:"prefix",get:function(){return this._prefix}},{key:"isPhone",get:function(){return this._isPhone}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isMobile",get:function(){return this._isMobile}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"osName",get:function(){return this._osName}},{key:"browserName",get:function(){return this._browserName}},{key:"doc",get:function(){return document}},{key:"html",get:function(){return document.documentElement}},{key:"body",get:function(){return document.body}},{key:"pages",get:function(){return this._pages}},{key:"page",get:function(){return this._page},set:function(t){this._page=t}},{key:"onPageCreated",value:function(){var t=this;return new he((function(e){t._page?t._page.onCreate().then((function(){e(t.page)})):setTimeout((function(){t.onPageCreated().then((function(){e(t.page)}))}),30)}))}},{key:"onPageShown",value:function(){var t=this;return new he((function(e){t.onPageCreated().then((function(){t._page&&t._page.onShow().then((function(){e(t.page)}))}))}))}},{key:"pageLoad",get:function(){return this._pageLoad}},{key:"onPageLoaded",value:function(){var t=this;return new he((function(e){t._pageLoad.onLoaded((function(){e()}))}))}},{key:"viewport",get:function(){return this._viewport}},{key:"_sayHi",value:function(){var t=["padding: 1rem 1.5rem;","background: #5F2580;","font: 1rem/1 Arial;","color: #ffffff;"].join("");console.log("%c%s",t,"Vevet")}}])&&Me(e.prototype,n),r&&Me(e,r),t}();function Ie(t){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ae(t,e,n){return(Ae="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xe(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function He(t,e){return(He=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ze(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Xe(t);if(e){var o=Xe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ne(this,n)}}function Ne(t,e){return!e||"object"!==Ie(e)&&"function"!=typeof e?Ve(t):e}function Ve(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xe(t){return(Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Qe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&He(t,e)}(i,t);var e,n,r,o=ze(i);function i(t){var e,n,r,s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t,!1),n=Ve(e),s=void 0,(r="_component")in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,e}return e=i,(n=[{key:"component",get:function(){return this._component}},{key:"init",value:function(){if(!this._component)throw new Error("Component is not set. Be sure that initlugin is called before.");Ae(Xe(i.prototype),"init",this).call(this)}},{key:"initPlugin",value:function(t){this._inited||(this._component=t,this.init())}}])&&Fe(e.prototype,n),r&&Fe(e,r),i}(H);function Ue(t){return(Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ye(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $e(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ye(Object(n),!0).forEach((function(e){rn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function qe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ke(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Je(t,e,n){return(Je="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=nn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ge(t,e){return(Ge=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ze(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=nn(t);if(e){var o=nn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return tn(this,n)}}function tn(t,e){return!e||"object"!==Ue(e)&&"function"!=typeof e?en(t):e}function en(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nn(t){return(nn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var on=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ge(t,e)}(i,t);var e,n,r,o=Ze(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return qe(this,i),rn(en(e=o.call(this,t,!1)),"_blocked",void 0),rn(en(e),"_created",void 0),rn(en(e),"_shown",void 0),rn(en(e),"_hidden",void 0),rn(en(e),"_viaAJAX",void 0),e._blocked=!1,e._created=!1,e._shown=!1,e._hidden=!1,e._destroyed=!1,e._viaAJAX=!1,n&&e.init(),e}return e=i,(n=[{key:"blocked",get:function(){return this._blocked}},{key:"created",get:function(){return this._created}},{key:"shown",get:function(){return this._shown}},{key:"hidden",get:function(){return this._hidden}},{key:"viaAJAX",get:function(){return this._viaAJAX}},{key:"pageClassName",get:function(){return"".concat(this._app.prefix,"page-").concat(this.prop.name)}},{key:"_getDefaultProp",value:function(){return $e($e({},Je(nn(i.prototype),"_getDefaultProp",this).call(this)),{},{name:"home"})}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(n,r){t.canCreate().then((function(){t.created||t.blocked?r():(t._blocked=!0,t._shown=!1,t._hidden=!1,t._destroyed=!1,t._viaAJAX=e,t._app.page=t,t._app.html.classList.add(t.pageClassName),t._create().then((function(){t.callbacks.tbt("create",!1),t._blocked=!1,t._created=!0,n()})).catch((function(){r()})))})).catch((function(){r()}))}))}},{key:"_create",value:function(){return new Promise((function(t){t()}))}},{key:"canCreate",value:function(){var t=this;return new Promise((function(e,n){t.created?n():e()}))}},{key:"show",value:function(){var t=this;return new Promise((function(e,n){t.canShow().then((function(){t.shown||t.blocked?n():(t._blocked=!0,t._created=!0,t._hidden=!1,t._destroyed=!1,t._show().then((function(){t.callbacks.tbt("show",!1),t._blocked=!1,t._shown=!0,e()})).catch((function(){n()})))})).catch((function(){n()}))}))}},{key:"_show",value:function(){return new Promise((function(t){t()}))}},{key:"canShow",value:function(){var t=this;return new Promise((function(e,n){!t.created||t.shown?n():e()}))}},{key:"hide",value:function(){var t=this;return new Promise((function(e,n){t.canHide().then((function(){t.hidden||t.blocked?n():(t._blocked=!0,t._created=!0,t._shown=!1,t._destroyed=!1,t._hide().then((function(){t.callbacks.tbt("hide",!1),t._blocked=!1,t._hidden=!0,e()})).catch((function(){n()})))})).catch((function(){n()}))}))}},{key:"_hide",value:function(){return new Promise((function(t){t()}))}},{key:"canHide",value:function(){var t=this;return new Promise((function(e,n){t.created&&t.shown&&!t.hidden?e():n()}))}},{key:"destroy",value:function(){var t=this;return new Promise((function(e,n){t.canDestroy().then((function(){t.destroyed||t.blocked?n():(t._blocked=!0,t._created=!1,t._shown=!1,t._hidden=!0,t._app.page=!1,t._app.html.classList.remove(t.pageClassName),t._destroy().then((function(){t._blocked=!1,t._destroyed=!0,e()})).catch((function(){n()})))})).catch((function(){n()}))}))}},{key:"_destroy",value:function(){var t=this;return new Promise((function(e){Je(nn(i.prototype),"_destroy",t).call(t),e()}))}},{key:"canDestroy",value:function(){var t=this;return new Promise((function(e,n){t.created&&t.hidden&&!t.destroyed?e():n()}))}},{key:"onCreate",value:function(){var t=this;return new he((function(e){t.created?e():t.addCallback("create",(function(){e()}),{once:!0})}))}},{key:"onShow",value:function(){var t=this;return new he((function(e){t.shown?e():t.addCallback("show",(function(){e()}),{once:!0})}))}},{key:"onHide",value:function(){var t=this;return new he((function(e){t.hidden?e():t.addCallback("hide",(function(){e()}),{once:!0})}))}}])&&Ke(e.prototype,n),r&&Ke(e,r),i}(J);function sn(t){return(sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function an(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function cn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?an(Object(n),!0).forEach((function(e){bn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):an(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function un(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ln(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function fn(t,e){return(fn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=vn(t);if(e){var o=vn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return pn(this,n)}}function pn(t,e){return!e||"object"!==sn(e)&&"function"!=typeof e?dn(t):e}function dn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yn(t,e,n){return(yn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=vn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function vn(t){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function bn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var _n,gn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fn(t,e)}(i,t);var e,n,r,o=hn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return un(this,i),bn(dn(e=o.call(this,t,!1)),"_wheelListener",void 0),bn(dn(e),"_lockWheel",void 0),bn(dn(e),"_lockWheelTimeout",void 0),e._wheelListener=void 0,e._lockWheel=!1,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return cn(cn({},yn(vn(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,enabled:!0,stopPropagation:!1,threshold:20})}},{key:"container",get:function(){return this.prop.container?this.prop.container:window}},{key:"_setEvents",value:function(){yn(vn(i.prototype),"_setEvents",this).call(this),this.container instanceof Window?this._toggleWheelEvent():(this._listeners.push(m(this.container,"mouseenter",this._handleMouseEnter.bind(this))),this._listeners.push(m(this.container,"mouseleave",this._handleMouseLeave.bind(this))))}},{key:"_onPropMutate",value:function(){yn(vn(i.prototype),"_onPropMutate",this).call(this),this._toggleWheelEvent()}},{key:"_handleMouseEnter",value:function(){this.prop.enabled&&this._createWheelEvent()}},{key:"_handleMouseLeave",value:function(){this._destroyWheelEvent()}},{key:"_toggleWheelEvent",value:function(){this.prop.enabled?this._createWheelEvent():this._destroyWheelEvent()}},{key:"_createWheelEvent",value:function(){this._wheelListener||(this._lockWheel=!1,this._lockWheelTimeout&&clearTimeout(this._lockWheelTimeout),this._wheelListener=m(this.container,"wheel",this._handleWheel.bind(this)))}},{key:"_destroyWheelEvent",value:function(){this._wheelListener&&(this._wheelListener.remove(),this._wheelListener=void 0)}},{key:"_handleWheel",value:function(t){var e=this;if(this._wheelListener){if(this.prop.stopPropagation&&(t.preventDefault(),t.stopPropagation()),this._lockWheel)return this._lockWheelTimeout&&clearTimeout(this._lockWheelTimeout),void(this._lockWheelTimeout=setTimeout((function(){e._lockWheel=!1}),300));var n=P()(t),r=this.prop.threshold,o=!1;n.pixelY>r?(this._callbacks.tbt("down",!1),o=!0):n.pixelY<-1*r&&(this._callbacks.tbt("up",!1),o=!0),n.pixelX>r?(this._callbacks.tbt("right",!1),o=!0):n.pixelX<-1*r&&(this._callbacks.tbt("left",!1),o=!0),o&&(this._lockWheel=!0)}}},{key:"_destroy",value:function(){yn(vn(i.prototype),"_destroy",this).call(this),this._destroyWheelEvent()}}])&&ln(e.prototype,n),r&&ln(e,r),i}(H);function mn(t,e){const[n,r,o,i]=e;if(n===r&&o===i)return t;const s=[];for(let a=0;a<11;++a)s[a]=wn(.1*a,n,o);return 0===t?0:1===t?1:wn(function(t,e,n){const r=t[0],o=t[2];let i=0,s=1;for(;10!==s&&n[s]<=e;++s)i+=.1;--s;const a=(e-n[s])/(n[s+1]-n[s]),c=i+.1*a,u=jn(c,r,o);if(u>=.001)return function(t,e,n,r){for(let o=0;o<4;++o){const o=jn(e,n,r);if(0===o)return e;e-=(wn(e,n,r)-t)/o}return e}(e,c,r,o);if(0===u)return c;return function(t,e,n,r,o){let i,s,a=0;do{s=e+(n-e)/2,i=wn(s,r,o)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<10);return s}(e,i,i+.1,r,o)}(e,t,s),r,i)}function wn(t,e,n){return((On(e,n)*t+Pn(e,n))*t+kn(e))*t}function On(t,e){return 1-3*e+3*t}function Pn(t,e){return 3*e-6*t}function kn(t){return 3*t}function jn(t,e,n){return 3*On(e,n)*t*t+2*Pn(e,n)*t+kn(e)}function Sn(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375}function En(t,e){switch(e){case _n.easeInSine:return n=t,1-Math.cos(n*Math.PI/2);case _n.easeOutSine:return function(t){return Math.sin(t*Math.PI/2)}(t);case _n.easeInOutSine:return function(t){return-(Math.cos(Math.PI*t)-1)/2}(t);case _n.easeInQuad:return function(t){return Math.pow(t,2)}(t);case _n.easeOutQuad:return function(t){return 1-Math.pow(1-t,2)}(t);case _n.easeInOutQuad:return function(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}(t);case _n.easeInCubic:return function(t){return Math.pow(t,3)}(t);case _n.easeOutCubic:return function(t){return 1-Math.pow(1-t,3)}(t);case _n.easeInOutCubic:return function(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}(t);case _n.easeInQuart:return function(t){return Math.pow(t,4)}(t);case _n.easeOutQuart:return function(t){return 1-Math.pow(1-t,4)}(t);case _n.easeInOutQuart:return function(t){return t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2}(t);case _n.easeInQuint:return function(t){return Math.pow(t,5)}(t);case _n.easeOutQuint:return function(t){return 1-Math.pow(1-t,5)}(t);case _n.easeInOutQuint:return function(t){return t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2}(t);case _n.easeInExpo:return function(t){return 0===t?0:Math.pow(2,10*t-10)}(t);case _n.easeOutExpo:return function(t){return 1===t?1:1-Math.pow(2,-10*t)}(t);case _n.easeInOutExpo:return function(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}(t);case _n.easeInCirc:return function(t){return 1-Math.sqrt(1-Math.pow(t,2))}(t);case _n.easeOutCirc:return function(t){return Math.sqrt(1-Math.pow(t-1,2))}(t);case _n.easeInOutCirc:return function(t){return t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2}(t);case _n.easeInBack:return function(t){return 2.70158*t*t*t-1.70158*t*t}(t);case _n.easeOutBack:return function(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}(t);case _n.easeInOutBack:return function(t){const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2}(t);case _n.easeInElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*e)}(t);case _n.easeOutElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1}(t);case _n.easeInOutElastic:return function(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}(t);case _n.easeInBounce:return function(t){return 1-Sn(1-t)}(t);case _n.easeOutBounce:return Sn(t);case _n.easeInOutBounce:return function(t){return t<.5?(1-Sn(1-2*t))/2:(1+Sn(2*t-1))/2}(t);default:return t}var n}function xn(t){return(xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Rn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Tn(Object(n),!0).forEach((function(e){An(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ln(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Dn(t,e){return(Dn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Mn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Fn(t);if(e){var o=Fn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Wn(this,n)}}function Wn(t,e){return!e||"object"!==xn(e)&&"function"!=typeof e?Bn(t):e}function Bn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function In(t,e,n){return(In="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Fn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Fn(t){return(Fn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function An(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(t){t.easeInSine="easeInSine",t.easeOutSine="easeOutSine",t.easeInOutSine="easeInOutSine",t.easeInQuad="easeInQuad",t.easeOutQuad="easeOutQuad",t.easeInOutQuad="easeInOutQuad",t.easeInCubic="easeInCubic",t.easeOutCubic="easeOutCubic",t.easeInOutCubic="easeInOutCubic",t.easeInQuart="easeInQuart",t.easeOutQuart="easeOutQuart",t.easeInOutQuart="easeInOutQuart",t.easeInQuint="easeInQuint",t.easeOutQuint="easeOutQuint",t.easeInOutQuint="easeInOutQuint",t.easeInExpo="easeInExpo",t.easeOutExpo="easeOutExpo",t.easeInOutExpo="easeInOutExpo",t.easeInCirc="easeInCirc",t.easeOutCirc="easeOutCirc",t.easeInOutCirc="easeInOutCirc",t.easeInBack="easeInBack",t.easeOutBack="easeOutBack",t.easeInOutBack="easeInOutBack",t.easeInElastic="easeInElastic",t.easeOutElastic="easeOutElastic",t.easeInOutElastic="easeInOutElastic",t.easeInBounce="easeInBounce",t.easeOutBounce="easeOutBounce",t.easeInOutBounce="easeInOutBounce"}(_n||(_n={}));var Hn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Dn(t,e)}(i,t);var e,n,r,o=Mn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ln(this,i),An(Bn(e=o.call(this,t,!1)),"_progress",void 0),An(Bn(e),"_easing",void 0),An(Bn(e),"_nestedTimelines",void 0),e._progress=0,e._easing=0,e._nestedTimelines=[],n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Rn(Rn({},In(Fn(i.prototype),"_getDefaultProp",this).call(this)),{},{easing:this._app.prop.easing,scope:[0,1],useNestedEasingProgress:!1})}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"easing",get:function(){return this._easing}},{key:"addNestedTimeline",value:function(t){this._nestedTimelines.push(t)}},{key:"_handleProgress",value:function(){this._easing=function(t,e=!1){return e?Array.isArray(e)?mn(t,e):"function"==typeof e?e(t):En(t,e):t}(this._progress,this.prop.easing),this._callbacks.tbt("progress",{progress:this._progress,easing:this._easing}),this._renderNestedTimelines()}},{key:"_renderNestedTimelines",value:function(){var t=this._nestedTimelines.length;if(0!==t)for(var e=this.prop.useNestedEasingProgress?this.easing:this.progress,n=0,r=t;n<r;n+=1){var o=this._nestedTimelines[n],i=G(tt(e,o.prop.nestedScope),[0,1]);o.progress=i}}},{key:"_destroy",value:function(){In(Fn(i.prototype),"_destroy",this).call(this),this._nestedTimelines.forEach((function(t){t.destroy()}))}}])&&Cn(e.prototype,n),r&&Cn(e,r),i}(J);function zn(t){return(zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Vn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nn(Object(n),!0).forEach((function(e){Gn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Xn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Un(t,e){return(Un=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Yn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Jn(t);if(e){var o=Jn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return $n(this,n)}}function $n(t,e){return!e||"object"!==zn(e)&&"function"!=typeof e?qn(t):e}function qn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Kn(t,e,n){return(Kn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Jn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Jn(t){return(Jn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Gn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Zn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Un(t,e)}(i,t);var e,n,r,o=Yn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Xn(this,i),Gn(qn(e=o.call(this,t,!1)),"_isPlaying",void 0),Gn(qn(e),"_isReversed",void 0),Gn(qn(e),"_isPaused",void 0),Gn(qn(e),"_animationFrame",void 0),Gn(qn(e),"_animationFrameLastTime",void 0),e._isPlaying=!1,e._isReversed=!1,e._isPaused=!1,e._animationFrame=void 0,e._animationFrameLastTime=0,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Vn(Vn({},Kn(Jn(i.prototype),"_getDefaultProp",this).call(this)),{},{duration:1e3,reset:!1,destroyOnEnd:!1})}},{key:"isPlaying",get:function(){return void 0!==this._animationFrame}},{key:"isReversed",get:function(){return this._isReversed}},{key:"isPaused",get:function(){return this._isPaused}},{key:"play",value:function(){this._destroyed||(this.prop.reset&&1===this.progress&&(this._progress=0),this._isReversed=!1,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"reverse",value:function(){this._destroyed||(this.prop.reset&&0===this.progress&&(this._progress=1),this._isReversed=!0,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"pause",value:function(){this._destroyed||(this._isPaused=!0,this._animationFrame&&window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}},{key:"_animate",value:function(){if(!this._isPaused){var t=this.isReversed,e=+new Date,n=Math.abs(this._animationFrameLastTime-e);this._animationFrameLastTime=e;var r=n/this.prop.duration/(t?-1:1),o=G(this.progress+r,[0,1]);if(this.progress=o,1===o&&!t||0===o&&t)return this._isReversed=!1,this._isPaused=!1,void(this._animationFrame=void 0);this._animationFrame=window.requestAnimationFrame(this._animate.bind(this))}}},{key:"_handleProgress",value:function(){Kn(Jn(i.prototype),"_handleProgress",this).call(this);var t=this._progress;0===t?this.callbacks.tbt("start",!1):1===t&&(this.callbacks.tbt("end",!1),this.prop.destroyOnEnd&&this.destroy())}},{key:"_destroy",value:function(){this.pause(),Kn(Jn(i.prototype),"_destroy",this).call(this)}}])&&Qn(e.prototype,n),r&&Qn(e,r),i}(Hn);function tr(t){return(tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function er(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function nr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?er(Object(n),!0).forEach((function(e){fr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):er(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function rr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function or(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ir(t,e){return(ir=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function sr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=lr(t);if(e){var o=lr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ar(this,n)}}function ar(t,e){return!e||"object"!==tr(e)&&"function"!=typeof e?cr(t):e}function cr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ur(t,e,n){return(ur="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=lr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function lr(t){return(lr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function fr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var hr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ir(t,e)}(i,t);var e,n,r,o=sr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(rr(this,i),fr(cr(e=o.call(this,t,!1)),"_container",void 0),fr(cr(e),"_startTime",void 0),fr(cr(e),"_endTime",void 0),fr(cr(e),"_toBeHidden",void 0),fr(cr(e),"_isHidden",void 0),fr(cr(e),"_pageLoadEvent",void 0),e.prop.container){var r=y(e.prop.container);r instanceof HTMLElement&&(e._container=r)}return e._container&&e._container.classList.add(e.prefix),e._startTime=+new Date,e._endTime=1/0,e._toBeHidden=!1,e._isHidden=!1,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return nr(nr({},ur(lr(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),hide:250})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"preloader")}},{key:"container",get:function(){return this._container}},{key:"startTime",get:function(){return this._startTime}},{key:"endTime",get:function(){return this._endTime}},{key:"totalTime",get:function(){return this._endTime-this._startTime}},{key:"isHidden",get:function(){return this._isHidden}},{key:"_setEvents",value:function(){var t=this;ur(lr(i.prototype),"_setEvents",this).call(this),this._onLoaded().then((function(){t._endTime=+new Date,t._handleLoaded()}))}},{key:"_onLoaded",value:function(){var t=this;return new he((function(e){t._app.pageLoad.loaded?e():t._pageLoadEvent=t._app.pageLoad.add("",(function(){e()}))}))}},{key:"_handleLoaded",value:function(){this.callbacks.tbt("loaded",!1),"boolean"!=typeof this.prop.hide&&this.hideContainer()}},{key:"hideContainer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"boolean"!=typeof this.prop.hide?this.prop.hide:250;return this.callbacks.tbt("hide",!1),this._toBeHidden=!0,new he((function(n){var r=t._container;if(!r)return t._handleHidden(),void n();r.style.transition="opacity ".concat(e,"ms, visibility ").concat(e,"ms"),r.style.opacity="0",r.style.visibility="hidden",l((function(){r.style.display="none",t._handleHidden(),n()}),e)}))}},{key:"_handleHidden",value:function(){this._isHidden=!0,this.callbacks.tbt("hidden",!1)}},{key:"onHide",value:function(t){if(!this._toBeHidden)return this.callbacks.add("hide",(function(){t()}));t()}},{key:"onHidden",value:function(t){if(!this._isHidden)return this.callbacks.add("hidden",(function(){t()}));t()}},{key:"_destroy",value:function(){var t;ur(lr(i.prototype),"_destroy",this).call(this),null===(t=this._pageLoadEvent)||void 0===t||t.remove()}}])&&or(e.prototype,n),r&&or(e,r),i}(J);function pr(t){return(pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dr(Object(n),!0).forEach((function(e){kr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function vr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function br(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _r(t,e){return(_r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Pr(t);if(e){var o=Pr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return mr(this,n)}}function mr(t,e){return!e||"object"!==pr(e)&&"function"!=typeof e?wr(t):e}function wr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Or(t,e,n){return(Or="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Pr(t){return(Pr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function kr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var jr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_r(t,e)}(i,t);var e,n,r,o=gr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return vr(this,i),kr(wr(e=o.call(this,t,!1)),"_imgs",void 0),kr(wr(e),"_videos",void 0),kr(wr(e),"_customResources",void 0),kr(wr(e),"_resourcesTotal",void 0),kr(wr(e),"_resourcesLoaded",void 0),kr(wr(e),"_progress",void 0),kr(wr(e),"_animationFrame",void 0),kr(wr(e),"_endTimeline",void 0),e._imgs=[],e._videos=[],e._customResources=[],e._resourcesTotal=1+e.prop.resources,e._resourcesLoaded=0,e._progress=0,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return yr(yr({},Or(Pr(i.prototype),"_getDefaultProp",this).call(this)),{},{resources:0,loaders:{img:!0,video:!0,custom:".js-preload",ignoreClassName:"js-preload-ignore"},calc:{lerp:.1,forceEnd:500}})}},{key:"imgs",get:function(){return this._imgs}},{key:"videos",get:function(){return this._videos}},{key:"customResources",get:function(){return this._customResources}},{key:"resourcesTotal",get:function(){return this._resourcesTotal}},{key:"resourcesLoaded",get:function(){return this._resourcesLoaded}},{key:"loadProgress",get:function(){return this.resourcesLoaded/this.resourcesTotal}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"_constructor",value:function(){Or(Pr(i.prototype),"_constructor",this).call(this),this._getResources()}},{key:"_setEvents",value:function(){var t=this;Or(Pr(i.prototype),"_setEvents",this).call(this);var e=this.prop.calc.lerp;"number"==typeof e&&(this._animationFrame=new bt,this._animationFrame.addCallback("frame",(function(){t.progress=Z(t.progress,t.loadProgress,e)})),this._animationFrame.play()),this._preloadResources(),this._app.onPageLoaded().then((function(){t._handleLoadedResource()}))}},{key:"_onLoaded",value:function(){var t=this;return new he((function(e){var n=!1;t.callbacks.add("progress",(function(t){t.progress>=1&&!n&&(e(),n=!0)}),{protected:!0})}))}},{key:"_getResources",value:function(){var t=this,e=this.prop.loaders;e.img&&v("img").forEach((function(n){n.classList.contains(e.ignoreClassName)||(t._imgs.push(n),t._resourcesTotal+=1)})),e.video&&v("video").forEach((function(n){n.classList.contains(e.ignoreClassName)||(t._videos.push(n),t._resourcesTotal+=1)})),e.custom&&(this._customResources=Array.from(v(e.custom)).filter((function(t){return!t.classList.contains(e.ignoreClassName)})),this._resourcesTotal+=this._customResources.length)}},{key:"_preloadResources",value:function(){var t=this;0===this._resourcesTotal&&(this._resourcesTotal=1,this._handleLoadedResource()),this._imgs.forEach((function(e){if(e.complete)t._handleLoadedResource();else{var n=new Image;e.addEventListener("load",(function(){t._handleLoadedResource()})),e.addEventListener("error",(function(){t._handleLoadedResource()})),n.src=e.currentSrc||e.src}})),this._videos.forEach((function(e){if(e.readyState>0)t._handleLoadedResource();else{if("none"===e.preload)return void t._handleLoadedResource();e.addEventListener("error",(function(){t._handleLoadedResource()})),e.addEventListener("loadedmetadata",(function(){t._handleLoadedResource()}))}})),this._customResources.forEach((function(e){t._seekCustomResourceLoaded(e).then((function(){t._handleLoadedResource()}))}))}},{key:"_seekCustomResourceLoaded",value:function(t){var e=this;return new Promise((function(n){t.isComplete||t.isLoaded||t.getAttribute("data-is-loaded")||t.getAttribute("is-loaded")?n():setTimeout((function(){e.destroyed||e._seekCustomResourceLoaded(t).then((function(){n()}))}),50)}))}},{key:"addResourcesLoaded",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=0;e<t;e+=1)this._handleLoadedResource()}},{key:"addResourcesTotal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this._resourcesTotal+=t}},{key:"_handleLoadedResource",value:function(){this.loadProgress>=1||(this._resourcesLoaded+=1,this.callbacks.tbt("resourceLoad",!1),this._animationFrame||(this.progress=this.loadProgress))}},{key:"_handleProgress",value:function(){var t=this;if(this.callbacks.tbt("progress",{progress:this._progress}),this.progress>=1)this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0);else if("number"==typeof this.prop.calc.forceEnd&&this.loadProgress>=1&&!this._endTimeline){this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0),this._endTimeline=new Zn({duration:this.prop.calc.forceEnd});var e=this.progress;this._endTimeline.addCallback("progress",(function(n){var r=1-e;t.progress=e+r*n.progress})),this._endTimeline.play()}}},{key:"_destroy",value:function(){Or(Pr(i.prototype),"_destroy",this).call(this),this._animationFrame&&this._animationFrame.destroy()}}])&&br(e.prototype,n),r&&br(e,r),i}(hr);function Sr(t){return(Sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Er(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Er(Object(n),!0).forEach((function(e){Ir(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Er(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Tr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Lr(t,e){return(Lr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Cr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Br(t);if(e){var o=Br(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Dr(this,n)}}function Dr(t,e){return!e||"object"!==Sr(e)&&"function"!=typeof e?Mr(t):e}function Mr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wr(t,e,n){return(Wr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Br(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Br(t){return(Br=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ir(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Fr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Lr(t,e)}(i,t);var e,n,r,o=Cr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Tr(this,i),Ir(Mr(e=o.call(this,t,!1)),"_container",void 0),Ir(Mr(e),"_runtimeEvents",void 0),Ir(Mr(e),"_isDragging",void 0),Ir(Mr(e),"_pointerID",void 0),Ir(Mr(e),"_coords",void 0),Ir(Mr(e),"_prevCoords",void 0),Ir(Mr(e),"_startCoords",void 0),e._container=y(e.prop.container),!p(e._container)&&!d(e._container))throw new Error("No container");return e._runtimeEvents=[],e._isDragging=!1,e._pointerID=null,e._coords={x:0,y:0},e._prevCoords={x:0,y:0},e._startCoords={x:0,y:0},n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return xr(xr({},Wr(Br(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),usePassive:!1,enabled:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"dragger")}},{key:"container",get:function(){return this._container}},{key:"isDragging",get:function(){return this._isDragging}},{key:"coords",get:function(){return this._coords}},{key:"startCoords",get:function(){return this._startCoords}},{key:"_setEvents",value:function(){var t=this.container,e=this.prop.usePassive;this.addEventListeners(t,"mousedown",this._handleStart.bind(this),{passive:e}),this.addEventListeners(t,"touchstart",this._handleStart.bind(this),{passive:e})}},{key:"_addRuntimeEvents",value:function(){var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mouseup",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchend",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchcancel",this.cancel.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"blur",this.cancel.bind(this),{passive:t}))}},{key:"_removeRuntimeEvents",value:function(){this._runtimeEvents.forEach((function(t){t.remove()})),this._runtimeEvents=[]}},{key:"_normalizeEvent",value:function(t){if(t.type.includes("touch")){var e=t,n=e.targetTouches[0]||e.changedTouches[0];return{x:n.clientX,y:n.clientY,id:n.identifier}}var r=t;return{x:r.clientX,y:r.clientY,id:null}}},{key:"_handleStart",value:function(t){if(!this.prop.enabled)return!1;if(this.isDragging)return!1;var e=this._normalizeEvent(t);if("mousedown"===t.type){if(1!==t.which)return!1;t.stopPropagation()}return this._isDragging=!0,this._pointerID=e.id,this._coords={x:e.x,y:e.y},this._prevCoords={x:e.x,y:e.y},this._startCoords={x:e.x,y:e.y},this._addRuntimeEvents(),this.callbacks.tbt("start",{evt:t}),!0}},{key:"_handleEnd",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this.cancel(),0))}},{key:"cancel",value:function(){this._removeRuntimeEvents(),this._isDragging=!1,this.callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){Wr(Br(i.prototype),"_destroy",this).call(this),this._removeRuntimeEvents()}}])&&Rr(e.prototype,n),r&&Rr(e,r),i}(J);function Ar(t){return(Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Nr(t,e,n){return(Nr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ur(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Vr(t,e){return(Vr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ur(t);if(e){var o=Ur(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Qr(this,n)}}function Qr(t,e){return!e||"object"!==Ar(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ur(t){return(Ur=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Yr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Vr(t,e)}(i,t);var e,n,r,o=Xr(i);function i(){return Hr(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"stepCoords",get:function(){return{x:this._coords.x-this._prevCoords.x,y:this._coords.y-this._prevCoords.y}}},{key:"_addRuntimeEvents",value:function(){Nr(Ur(i.prototype),"_addRuntimeEvents",this).call(this);var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mousemove",this._handleMove.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchmove",this._handleMove.bind(this),{passive:t}))}},{key:"_handleMove",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this._prevCoords={x:this._coords.x,y:this._coords.y},this._coords={x:e.x,y:e.y},this.callbacks.tbt("move",{evt:t,start:this.startCoords,coords:this.coords,step:this.stepCoords}),0))}},{key:"_destroy",value:function(){Nr(Ur(i.prototype),"_destroy",this).call(this)}}])&&zr(e.prototype,n),r&&zr(e,r),i}(Fr);function $r(t){return($r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qr(Object(n),!0).forEach((function(e){Jr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Jr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function to(t,e,n){return(to="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=oo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function eo(t,e){return(eo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function no(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=oo(t);if(e){var o=oo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ro(this,n)}}function ro(t,e){return!e||"object"!==$r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function oo(t){return(oo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var io=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&eo(t,e)}(i,t);var e,n,r,o=no(i);function i(){return Gr(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Kr(Kr({},to(oo(i.prototype),"_getDefaultProp",this).call(this)),{},{min:75})}},{key:"_handleEnd",value:function(t){var e=to(oo(i.prototype),"_handleEnd",this).call(this,t);if(!e)return e;var n=this._normalizeEvent(t),r=this.startCoords,o=Math.abs(this.prop.min);return r.y>n.y&&Math.abs(n.y-r.y)>=o&&this.callbacks.tbt("up",!1),r.y<n.y&&Math.abs(n.y-r.y)>=o&&this.callbacks.tbt("down",!1),r.x>n.x&&Math.abs(n.x-r.x)>=o&&this.callbacks.tbt("left",!1),r.x<n.x&&Math.abs(n.x-r.x)>=o&&this.callbacks.tbt("right",!1),!0}}])&&Zr(e.prototype,n),r&&Zr(e,r),i}(Fr);function so(t){return(so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ao(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function co(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ao(Object(n),!0).forEach((function(e){_o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ao(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function uo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function fo(t,e,n){return(fo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=bo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ho(t,e){return(ho=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function po(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=bo(t);if(e){var o=bo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yo(this,n)}}function yo(t,e){return!e||"object"!==so(e)&&"function"!=typeof e?vo(t):e}function vo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bo(t){return(bo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var go=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ho(t,e)}(i,t);var e,n,r,o=po(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];uo(this,i),_o(vo(e=o.call(this,t,!1)),"_canvas",void 0),_o(vo(e),"_ctx",void 0),_o(vo(e),"_width",void 0),_o(vo(e),"_height",void 0),_o(vo(e),"_dpr",void 0),e._width=0,e._height=0,e._dpr=1;var r=e.prop,s=r.append,a=r.container,c=s&&a?a:void 0;return e._canvas=_("canvas",{parent:c}),e._ctx=e._canvas.getContext("2d"),e.resize(),n&&e.init(),e}return e=i,(n=[{key:"container",get:function(){return this.prop.container}},{key:"canvas",get:function(){return this._canvas}},{key:"ctx",get:function(){return this._ctx}},{key:"width",get:function(){return this._width}},{key:"nonDPRWidth",get:function(){return this.width/this.dpr}},{key:"height",get:function(){return this._height}},{key:"nonDPRHeight",get:function(){return this.height/this.dpr}},{key:"dpr",get:function(){return this._dpr}},{key:"_getDefaultProp",value:function(){return co(co({},fo(bo(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,append:!0,updateOnResize:!1,resizeTimeout:0,width:!1,height:!1,dpr:!1})}},{key:"_setEvents",value:function(){var t=this;if(fo(bo(i.prototype),"_setEvents",this).call(this),!1!==this.prop.updateOnResize){var e="boolean"==typeof this.prop.updateOnResize?"":this.prop.updateOnResize;this.addViewportCallback(e,(function(){t.resize()}),{timeout:this.prop.resizeTimeout}),this.resize()}}},{key:"_onPropMutate",value:function(){fo(bo(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){var t=this.prop,e=this.canvas;if(e){var n=this._app.viewport;"number"==typeof t.dpr?this._dpr=t.dpr:this._dpr=n.dpr;var r=this._dpr,o=0,i=0;"number"==typeof t.width&&"number"==typeof t.height?(o=t.width,i=t.height):this.container?(o=this.container.clientWidth,i=this.container.clientHeight):(o=n.width,i=n.height),o*=r,i*=r,this._width=o,this._height=i,e.width=o,e.height=i,this.callbacks.tbt("resize",!1)}}},{key:"_destroy",value:function(){fo(bo(i.prototype),"_destroy",this).call(this),this.canvas&&this.canvas.remove()}}])&&lo(e.prototype,n),r&&lo(e,r),i}(J);function mo(t){const e=function(t){if("container"in t)return{width:t.container.clientWidth,height:t.container.clientHeight};return{width:t.width,height:t.height}}(t),n=function(t){const{source:e}=t;if(t.sourceWidth&&t.sourceHeight)return{width:t.sourceWidth,height:t.sourceHeight};if(e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if(e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};return{width:e.width,height:e.height}}(t);let r;return"cover"===t.rule?r=function(t,e,n){let r=e.width*wo(t),o=n.height*r/n.width;o/wo(t)<e.height&&(o=e.height*wo(t),r=n.width*o/n.height);const i=(e.width-r)/2,s=(e.height-o)/2;return{width:r,height:o,x:i,y:s}}(t,e,n):"contain"===t.rule?r=function(t,e,n){let r=0,o=0;const i=n.width/n.height;e.width>e.height?(o=e.height,r=o*i,r>e.width&&(r=e.width,o=r/i)):e.height>=e.width&&(r=e.width,o=r/i,o>e.height&&(o=e.height,r=o*i));r*=wo(t),o*=wo(t);const s=(e.width-r)/2,a=(e.height-o)/2;return{width:r,height:o,x:s,y:a}}(t,e,n):"top-left"===t.rule?r=function(t,e){const n=e.width*wo(t),r=e.height*wo(t);return{width:n,height:r,x:0,y:0}}(t,n):"top-right"===t.rule?r=function(t,e,n){const r=n.width*wo(t),o=n.height*wo(t),i=e.width-n.width;return{width:r,height:o,x:i,y:0}}(t,e,n):"bottom-left"===t.rule?r=function(t,e,n){const r=n.width*wo(t),o=n.height*wo(t),i=e.height-n.height;return{width:r,height:o,x:0,y:i}}(t,e,n):"bottom-right"===t.rule?r=function(t,e,n){const r=n.width*wo(t),o=n.height*wo(t),i=e.width-n.width,s=e.height-n.height;return{width:r,height:o,x:i,y:s}}(t,e,n):"center"===t.rule&&(r=function(t,e,n){const r=n.width*wo(t),o=n.height*wo(t),i=(e.width-n.width)/2,s=(e.height-n.height)/2;return{width:r,height:o,x:i,y:s}}(t,e,n)),Object.assign(r,{sourceWidth:n.width,sourceHeight:n.height})}function wo(t){return void 0!==t.scale?t.scale:1}function Oo(t){return(Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Po(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ko(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Po(Object(n),!0).forEach((function(e){jo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Po(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function jo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function So(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Eo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xo(t,e,n){return(xo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Co(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function To(t,e){return(To=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ro(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Co(t);if(e){var o=Co(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Lo(this,n)}}function Lo(t,e){return!e||"object"!==Oo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Co(t){return(Co=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Do=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&To(t,e)}(i,t);var e,n,r,o=Ro(i);function i(){return So(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_getDefaultProp",value:function(){return ko(ko({},xo(Co(i.prototype),"_getDefaultProp",this).call(this)),{},{media:!1,posRule:"cover"})}},{key:"resize",value:function(){xo(Co(i.prototype),"resize",this).call(this),this._prerender()}},{key:"_prerender",value:function(){if(0!==this.width&&0!==this.height){var t=this.prop.media;if(t){var e,n,r;t instanceof go?(e=t.canvas,n=t.width,r=t.height):e=t;var o=mo({source:e,sourceWidth:n,sourceHeight:r,rule:this.prop.posRule,scale:1,width:this.width,height:this.height});this._ctx.clearRect(0,0,this.width,this.height),this._ctx.drawImage(e,o.x,o.y,o.width,o.height),this.callbacks.tbt("prerender",!1)}}}}])&&Eo(e.prototype,n),r&&Eo(e,r),i}(go);function Mo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Wo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Bo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Wo(this,"_prop",void 0),Wo(this,"_outer",void 0),Wo(this,"_thumb",void 0),Wo(this,"_outerHeight",void 0),Wo(this,"_outerWidth",void 0),Wo(this,"_thumbHeight",void 0),Wo(this,"_thumbWidth",void 0),Wo(this,"_scrollVal",void 0),Wo(this,"_coordsAtDragStart",void 0),Wo(this,"_listeners",void 0),Wo(this,"_scrollEvent",void 0),Wo(this,"_actionTimeout",void 0),Wo(this,"_dragger",void 0),this._prop=e;var n=e.prefix,r=e.dir,o=e.domParent,i=e.container,s=e.autoHide;this._outerHeight=0,this._outerWidth=0,this._thumbHeight=0,this._thumbWidth=0,this._scrollVal=0,this._coordsAtDragStart={left:0,top:0},this._scrollEvent=void 0,this._actionTimeout=void 0,this._dragger=void 0;var a="".concat(n," ").concat(n,"_").concat(r);i instanceof Window&&(a+=" in-window"),this._outer=_("div",{parent:o,class:a}),this._thumb=_("div",{parent:this._outer,class:"".concat(n,"__thumb ").concat(n,"__thumb_").concat(r)}),s&&this.outer.classList.add("auto-hide"),this._listeners=[],this._setEvents()}var e,n,r;return e=t,(n=[{key:"outer",get:function(){return this._outer}},{key:"thumb",get:function(){return this._thumb}},{key:"prefix",get:function(){return this._prop.prefix}},{key:"isX",get:function(){return"x"===this.prop.dir}},{key:"isY",get:function(){return!this.isX}},{key:"scrollElement",get:function(){return this.prop.container instanceof Window?document.documentElement:this.prop.container}},{key:"scrollLine",get:function(){var t=this.scrollElement;return this.isX?t.scrollWidth-t.clientWidth:t.scrollHeight-t.clientHeight}},{key:"scrollWidth",get:function(){return this.scrollElement.scrollWidth}},{key:"scrollHeight",get:function(){return this.scrollElement.scrollHeight}},{key:"prop",get:function(){return this._prop}},{key:"scrollValues",get:function(){var t=this.prop.container,e=0,n=0;return t instanceof Window?(e=t.pageYOffset,n=t.pageXOffset):t instanceof Rt?(e=t.targetTop,n=t.targetLeft):(e=t.scrollTop,n=t.scrollLeft),{left:n,top:e}}},{key:"_setEvents",value:function(){var t=this;this._listeners.push(m(this.outer,"mouseenter",this._handleHover.bind(this,!0))),this._listeners.push(m(this.outer,"mouseleave",this._handleHover.bind(this,!1))),this._scrollEvent=Ct({container:this.prop.container,callback:function(e){t._handleScroll(e)}}),this.prop.isDraggable&&(this._dragger=new Yr({container:this.thumb}),this._dragger.addCallback("start",(function(){t.thumb.classList.add("in-action"),t._disableScrollBehaviour(!0),t._coordsAtDragStart=t.scrollValues})),this._dragger.addCallback("move",(function(e){t._handleThumbDrag(e)})),this._dragger.addCallback("end",(function(){t.thumb.classList.remove("in-action"),t._disableScrollBehaviour(!1)})))}},{key:"_disableScrollBehaviour",value:function(t){var e=t?"auto":"unset";(this.prop.container instanceof Window||this.prop.container instanceof HTMLElement)&&(document.documentElement.style.scrollBehavior=e)}},{key:"_handleHover",value:function(t){this.outer.classList.toggle("is-hovered",t)}},{key:"_handleScroll",value:function(t){var e=this;this.prop.optimizeCalculations||this.resize();var n=!1;this.isX?(n=t.scrollLeft!==this._scrollVal,this._scrollVal=t.scrollLeft):(n=t.scrollTop!==this._scrollVal,this._scrollVal=t.scrollTop),n&&(this.prop.autoHide&&n&&(this.outer.classList.add("in-action"),this._actionTimeout&&(clearTimeout(this._actionTimeout),this._actionTimeout=void 0),this._actionTimeout=setTimeout((function(){e.outer.classList.remove("in-action")}),500)),this.prop.optimizeCalculations&&this._renderThumb())}},{key:"_handleThumbDrag",value:function(t){t.evt.preventDefault();var e=this.prop.container,n=(t.coords.x-t.start.x)/(this._outerWidth-this._thumbWidth)*this.scrollLine,r=(t.coords.y-t.start.y)/(this._outerHeight-this._thumbHeight)*this.scrollLine,o=this._coordsAtDragStart,i=o.left,s=o.top;this.isX?i+=n:s+=r,e.scrollTo({top:s,left:i,behavior:e instanceof Rt?this.prop.draggableScrollBehavior:"auto"})}},{key:"_renderThumb",value:function(){var t=G(this._scrollVal/this.scrollLine,[0,1]),e=this.isX?(this._outerWidth-this._thumbWidth)*t:0,n=this.isY?(this._outerHeight-this._thumbHeight)*t:0;this._thumb.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}},{key:"resize",value:function(){var t=this.outer,e=this.thumb,n=this.scrollLine,r=this.prop.minSize;if(this._outerHeight=t.clientHeight,this._outerWidth=t.clientWidth,this.prop.autoSize)if(this.isX){var o=G(this._outerWidth/(this.scrollWidth/(this.scrollWidth-n)),[r,1/0]);e.style.width="".concat(o,"px")}else{var i=G(this._outerHeight/(this.scrollHeight/(this.scrollHeight-n)),[r,1/0]);e.style.height="".concat(i,"px")}this._thumbHeight=e.clientHeight,this._thumbWidth=e.clientWidth,t.classList.toggle("is-empty",0===n),this._renderThumb()}},{key:"destroy",value:function(){this._listeners.forEach((function(t){t.remove()})),this._scrollEvent&&this._scrollEvent.remove(),this._actionTimeout&&clearTimeout(this._actionTimeout),this._dragger&&this._dragger.destroy(),this._outer.remove()}}])&&Mo(e.prototype,n),r&&Mo(e,r),t}();function Io(t){return(Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ao(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fo(Object(n),!0).forEach((function(e){$o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ho(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function No(t,e){return(No=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Yo(t);if(e){var o=Yo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Xo(this,n)}}function Xo(t,e){return!e||"object"!==Io(e)&&"function"!=typeof e?Qo(t):e}function Qo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Uo(t,e,n){return(Uo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Yo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Yo(t){return(Yo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var qo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&No(t,e)}(i,t);var e,n,r,o=Vo(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Ho(this,i),$o(Qo(e=o.call(this,t,!1)),"_container",void 0),$o(Qo(e),"_scrollWrapper",void 0),$o(Qo(e),"_xBar",void 0),$o(Qo(e),"_yBar",void 0);var r=e.prop,s=r.autoHide,a=r.autoSize,c=r.minSize,u=r.optimizeCalculations,l=r.isDraggable,f=r.draggableScrollBehavior;if("string"==typeof e.prop.container){var h=y(e.prop.container);if(!h)throw new Error("No scroll container");e._container=h}else e._container=e.prop.container;if(e.container instanceof Element){var p=e.container.parentElement;p&&(e._scrollWrapper=_("div"),e._scrollWrapper.style.position="relative",e._scrollWrapper.style.display="inline-block",p.insertBefore(e._scrollWrapper,e.container),e._scrollWrapper.appendChild(e.container),e._scrollWrapper.classList.add("".concat(e.prefix,"-wrapper")))}var d={container:e.container,domParent:e.domParent,autoHide:s,autoSize:a,minSize:c,optimizeCalculations:u,prefix:e.prefix,isDraggable:l,draggableScrollBehavior:f};return e._xBar=new Bo(Ao({dir:"x"},d)),e._yBar=new Bo(Ao({dir:"y"},d)),e.scrollableElement.classList.add("".concat(e.prefix,"-parent")),n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Ao(Ao({},Uo(Yo(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,domParent:!1,draggable:!0,autoSize:!0,autoHide:!0,minSize:50,optimizeCalculations:!1,resizeTimeout:0,isDraggable:!0,draggableScrollBehavior:"smooth"})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"scrollbar")}},{key:"container",get:function(){return this._container}},{key:"scrollableElement",get:function(){var t=this.container;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"domParent",get:function(){var t=this.prop.domParent,e=this.container;return t||(this._scrollWrapper?this._scrollWrapper:e instanceof Window?this._app.body:e instanceof Element?e:e.outer)}},{key:"_setEvents",value:function(){var t=this;Uo(Yo(i.prototype),"_setEvents",this).call(this);var e=this.container;e instanceof Rt?e.addCallback("resize",(function(){t.resize()}),{name:this.name}):this.addViewportCallback("",(function(){t.resize()}),{timeout:this.prop.resizeTimeout}),this.resize()}},{key:"_onPropMutate",value:function(){Uo(Yo(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._xBar.resize(),this._yBar.resize()}},{key:"_destroy",value:function(){if(Uo(Yo(i.prototype),"_destroy",this).call(this),this._xBar.destroy(),this._yBar.destroy(),this._scrollWrapper&&this.container instanceof Element){var t=this._scrollWrapper.parentElement;t&&t.insertBefore(this.container,this._scrollWrapper),this._scrollWrapper.remove()}this.scrollableElement.classList.remove("".concat(this.prefix,"-parent"))}}])&&zo(e.prototype,n),r&&zo(e,r),i}(J);function Ko(t){return(Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Go(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jo(Object(n),!0).forEach((function(e){ai(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Zo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ti(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ei(t,e){return(ei=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ni(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=si(t);if(e){var o=si(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ri(this,n)}}function ri(t,e){return!e||"object"!==Ko(e)&&"function"!=typeof e?oi(t):e}function oi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ii(t,e,n){return(ii="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=si(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function si(t){return(si=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ai(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ci=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ei(t,e)}(i,t);var e,n,r,o=ni(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Zo(this,i),ai(oi(e=o.call(this,t,!1)),"_scrollContainer",void 0),"string"==typeof e.prop.container?e._scrollContainer=y(e.prop.container):e._scrollContainer=e.prop.container,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Go(Go({},ii(si(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window})}},{key:"scrollContainer",get:function(){return this._scrollContainer}},{key:"scrollableElement",get:function(){return this._scrollContainer instanceof Window?this._app.html:this._scrollContainer}},{key:"domParent",get:function(){var t=this.scrollContainer;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"intersectionRoot",get:function(){var t=this.scrollContainer;return t instanceof Window?null:t instanceof Element?t:t.outer}},{key:"scrollContainerBounding",get:function(){if(this.intersectionRoot){var t=this.intersectionRoot.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}return{top:0,left:0,width:this._app.viewport.width,height:this._app.viewport.height}}}])&&ti(e.prototype,n),r&&ti(e,r),i}(J);function ui(t){return(ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function li(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function fi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?li(Object(n),!0).forEach((function(e){Oi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):li(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function hi(t){return function(t){if(Array.isArray(t))return pi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return pi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pi(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function di(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function vi(t,e){return(vi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function bi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=wi(t);if(e){var o=wi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _i(this,n)}}function _i(t,e){return!e||"object"!==ui(e)&&"function"!=typeof e?gi(t):e}function gi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mi(t,e,n){return(mi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=wi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function wi(t){return(wi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Oi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Pi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&vi(t,e)}(i,t);var e,n,r,o=bi(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return di(this,i),Oi(gi(e=o.call(this,t,!1)),"_scrollEvent",void 0),Oi(gi(e),"_intersectionObserverIn",void 0),Oi(gi(e),"_intersectionObserverOut",void 0),Oi(gi(e),"_firstStart",void 0),Oi(gi(e),"_elements",void 0),e._scrollEvent=void 0,e._intersectionObserverIn=void 0,e._intersectionObserverOut=void 0,e._firstStart=!0,e._elements=hi(e.prop.elements),n&&e.init(),e}return e=i,(n=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"scroll-view")}},{key:"_getDefaultProp",value:function(){return fi(fi({},mi(wi(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,container:window,elements:[],threshold:.9,states:"in",classToToggle:"viewed",useDelay:!1,useIntersectionObserver:!0,resizeTimeout:0})}},{key:"elements",get:function(){return this._elements}},{key:"init",value:function(){mi(wi(i.prototype),"init",this).call(this)}},{key:"_setEvents",value:function(){var t=this;mi(wi(i.prototype),"_setEvents",this).call(this),this.resize(),this.addViewportCallback("",(function(){t.resize()}),{timeout:this.prop.resizeTimeout})}},{key:"_onPropMutate",value:function(){mi(wi(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._removeViewEvents(),this.prop.enabled&&(this._setViewEvents(),this.seekBounding())}},{key:"_setViewEvents",value:function(){var t=this;if(Dt()&&this.prop.useIntersectionObserver){var e=this.scrollContainerBounding,n=this._firstStart?0:e.width*(1-this.prop.threshold)*-1,r=this._firstStart?0:e.height*(1-this.prop.threshold)*-1;this._intersectionObserverIn=new IntersectionObserver(this._handleIntersectionObserverIn.bind(this),{root:this.intersectionRoot,threshold:0,rootMargin:"0px ".concat(n,"px ").concat(r,"px 0px")}),this.elements.forEach((function(e){var n;null===(n=t._intersectionObserverIn)||void 0===n||n.observe(e)})),"inout"===this.prop.states&&(this._intersectionObserverOut=new IntersectionObserver(this._handleIntersectionObserverOut.bind(this),{root:this.intersectionRoot,threshold:0,rootMargin:"0px 0px 0px 0px"}),this.elements.forEach((function(e){var n;null===(n=t._intersectionObserverOut)||void 0===n||n.observe(e)})))}else this._scrollEvent=Ct({container:this.prop.container,callback:this._handleScroll.bind(this)})}},{key:"_removeViewEvents",value:function(){var t,e;this._scrollEvent&&(this._scrollEvent.remove(),this._scrollEvent=void 0),null===(t=this._intersectionObserverIn)||void 0===t||t.disconnect(),this._intersectionObserverIn=void 0,null===(e=this._intersectionObserverOut)||void 0===e||e.disconnect(),this._intersectionObserverOut=void 0}},{key:"_handleIntersectionObserverIn",value:function(t){for(var e=!!this._firstStart&&this.scrollContainerBounding,n=0;n<t.length;n+=1){var r=t[n],o=0;this._firstStart&&e&&r.isIntersecting&&(o=this._elementInViewportData(r.target,e).delay),r.isIntersecting&&this._handleInOut(r.target,r.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1,this.resize())}},{key:"_handleIntersectionObserverOut",value:function(t){for(var e=0;e<t.length;e+=1){var n=t[e];n.isIntersecting||this._handleInOut(n.target,n.isIntersecting,0)}}},{key:"_handleScroll",value:function(){this.seekBounding()}},{key:"seekBounding",value:function(){if(!Dt()||!this.prop.useIntersectionObserver){for(var t=this.scrollContainerBounding,e=0;e<this.elements.length;e+=1){var n=this.elements[e],r=this._elementInViewportData(n,t),o=r.isIntersecting?r.delay:0;"boolean"==typeof r.isIntersecting&&this._handleInOut(n,r.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1)}}},{key:"_elementInViewportData",value:function(t,e){var n,r=this.prop,o=r.threshold,i=r.states,s=r.useDelay,a=this._firstStart?1:o,c=t.getBoundingClientRect();c.top<e.top+e.height*a&&c.left<e.left+e.width*a?n="in"===i||!(c.right<e.left*a||c.bottom<e.top*a):(c.top>e.top+e.height||c.left>e.left+e.width)&&(n=!1);var u=0;return s&&this._firstStart&&(u=G("x"===s.dir?(c.left-e.left)/e.width:(c.top-e.top)/e.height,[0,1])*s.max),{isIntersecting:n,delay:u}}},{key:"_handleInOut",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=this.prop.states;t.scrollViewIn&&e||!t.scrollViewIn&&!e||(t.scrollViewIn=e,this.prop.classToToggle&&l((function(){t.classList.toggle(n.prop.classToToggle,e)}),r),!e||"in"!==o&&"inout"!==o?e||"inout"!==o||l((function(){n.callbacks.tbt("out",t)}),r):l((function(){n.callbacks.tbt("in",t)}),r))}},{key:"_processUnusedElements",value:function(){var t=this;"in"===this.prop.states&&(this._elements.filter((function(t){return t.scrollViewIn})).forEach((function(e){var n,r;null===(n=t._intersectionObserverIn)||void 0===n||n.unobserve(e),null===(r=t._intersectionObserverOut)||void 0===r||r.unobserve(e)})),this._elements=this._elements.filter((function(t){return!t.scrollViewIn})))}},{key:"addElement",value:function(t){var e,n,r=this;return t.scrollViewIn=void 0,this._elements.push(t),null===(e=this._intersectionObserverIn)||void 0===e||e.observe(t),null===(n=this._intersectionObserverOut)||void 0===n||n.observe(t),this.prop.enabled&&this.seekBounding(),{remove:function(){r.removeElement(t)}}}},{key:"removeElement",value:function(t){var e,n;t.scrollViewIn=void 0,this._elements=this._elements.filter((function(e){return e!==t})),null===(e=this._intersectionObserverIn)||void 0===e||e.unobserve(t),null===(n=this._intersectionObserverOut)||void 0===n||n.unobserve(t)}},{key:"removeElements",value:function(){var t=this;this._elements.forEach((function(e){t.removeElement(e)})),this._elements=[]}},{key:"_destroy",value:function(){mi(wi(i.prototype),"_destroy",this).call(this),this._removeViewEvents()}}])&&yi(e.prototype,n),r&&yi(e,r),i}(ci);function ki(t){return(ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ji(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Si(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ei(t,e,n){return(Ei="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Li(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function xi(t,e){return(xi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ti(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Li(t);if(e){var o=Li(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ri(this,n)}}function Ri(t,e){return!e||"object"!==ki(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Li(t){return(Li=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ci=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xi(t,e)}(i,t);var e,n,r,o=Ti(i);function i(){return ji(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_setEvents",value:function(){var t=this;Ei(Li(i.prototype),"_setEvents",this).call(this),this.addEventListeners(window,"keydown",(function(e){t._handleKeydown(e)}))}},{key:"_handleKeydown",value:function(t){var e=this._component;if(e.prop.enabled)if(9!==t.keyCode){var n=document.activeElement;if(!n||!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)){var r=this._app.viewport,o=e.outer.getBoundingClientRect();if(o.left<r.width&&o.right>0&&o.top<r.height&&o.bottom>0){var i=40;switch(t.keyCode){case 38:e.targetTop-=i;break;case 40:e.targetTop+=i;break;case 39:e.targetLeft+=i;break;case 37:e.targetLeft-=i;break;case 34:e.targetTop+=400;break;case 33:e.targetTop-=400;break;case 36:e.targetTop=0,e.targetLeft=0;break;case 35:e.targetTop=e.scrollHeight,e.targetLeft=e.scrollWidth;break;case 32:e.targetTop+=200}}}}else this._handleTab()}},{key:"_handleTab",value:function(){var t=this;l((function(){var e=t._component,n=document.activeElement;if(n instanceof HTMLElement&&f(n,e.outer)){var r=e.outer.getBoundingClientRect(),o=n.getBoundingClientRect(),i=e.scrollTop+(o.top-r.top)-(e.clientHeight/2-o.height/2),s=e.scrollLeft+(o.left-r.left)-(e.clientWidth/2-o.width/2);e.targetTop=i,e.targetLeft=s}}),120)}}])&&Si(e.prototype,n),r&&Si(e,r),i}(Qe);function Di(t){return(Di="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mi(Object(n),!0).forEach((function(e){Vi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Bi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ii(t,e){return(Ii=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Fi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ni(t);if(e){var o=Ni(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ai(this,n)}}function Ai(t,e){return!e||"object"!==Di(e)&&"function"!=typeof e?Hi(t):e}function Hi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zi(t,e,n){return(zi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ni(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ni(t){return(Ni=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Vi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Xi="is-dragging",Qi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ii(t,e)}(i,t);var e,n,r,o=Fi(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Vi(Hi(e=o.call(this,t)),"_dragger",void 0),Vi(Hi(e),"_componentEvents",void 0),Vi(Hi(e),"_currentLerp",void 0),e._dragger=void 0,e._componentEvents=[],e._currentLerp=!1,e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Wi(Wi({},zi(Ni(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,speed:1,lerp:!1,reverseDir:!1,stopPropagation:!1})}},{key:"isDragging",get:function(){return!!this._dragger&&this._dragger.isDragging}},{key:"_constructor",value:function(){zi(Ni(i.prototype),"_constructor",this).call(this),this._toggleDragger()}},{key:"_onPropMutate",value:function(){zi(Ni(i.prototype),"_onPropMutate",this).call(this),this._toggleDragger()}},{key:"_toggleDragger",value:function(){this.prop.enabled?this._addDragger():this._removeDragger()}},{key:"_addDragger",value:function(){var t=this;if(!this._dragger){var e=this.component;this._dragger=new Yr({container:e.outer}),this._dragger.addCallback("start",this._handleDragStart.bind(this)),this._dragger.addCallback("move",(function(e){t._handleDragMove(e)})),this._dragger.addCallback("end",this._handleDragEnd.bind(this)),this._componentEvents.push(e.addCallback("wheel",(function(){var e;null===(e=t._dragger)||void 0===e||e.cancel()})))}}},{key:"_removeDragger",value:function(){this._dragger&&(this._dragger.destroy(),this._dragger=void 0,this._componentEvents.forEach((function(t){t.remove()})),this._componentEvents=[])}},{key:"_handleDragStart",value:function(){var t=this.component;if(t.prop.enabled&&!(t.maxScrollableWidth<=0&&t.maxScrollableHeight<=0)){var e=this.prop.lerp;"boolean"!=typeof e&&(this._currentLerp=t.prop.render.lerp,t.changeProp({render:{lerp:e}})),this._callbacks.tbt("start",!1)}}},{key:"_handleDragMove",value:function(t){var e=this.component;if(e.prop.enabled&&!(e.maxScrollableWidth<=0&&e.maxScrollableHeight<=0)){var n=t.evt,r=this.prop.stopPropagation;if(r){if(!n.cancelable)return;var o=Math.abs(t.coords.x-t.start.x),i=Math.abs(t.coords.y-t.start.y);(o>r.threshold&&"x"===r.dir||i>r.threshold&&"y"===r.dir)&&n.cancelable&&(n.preventDefault(),n.stopPropagation())}var s=this.prop,a=s.speed,c=s.reverseDir,u=t.step.x*a,l=t.step.y*a;e.targetLeft-=c?l:u,e.targetTop-=c?u:l,e.outer.classList.add(Xi),e.container.classList.add(Xi),this._callbacks.tbt("move",!1)}}},{key:"_handleDragEnd",value:function(){var t=this.component;t.outer.classList.remove(Xi),t.container.classList.remove(Xi),"boolean"!=typeof this._currentLerp&&(t.changeProp({render:{lerp:this._currentLerp}}),this._currentLerp=!1),this._callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){zi(Ni(i.prototype),"_destroy",this).call(this),this._removeDragger()}}])&&Bi(e.prototype,n),r&&Bi(e,r),i}(Qe);function Ui(t){return(Ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yi(Object(n),!0).forEach((function(e){rs(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function qi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ki(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ji(t,e){return(Ji=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Gi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ns(t);if(e){var o=ns(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Zi(this,n)}}function Zi(t,e){return!e||"object"!==Ui(e)&&"function"!=typeof e?ts(t):e}function ts(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function es(t,e,n){return(es="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ns(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ns(t){return(ns=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rs(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var os=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ji(t,e)}(i,t);var e,n,r,o=Gi(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(qi(this,i),rs(ts(e=o.call(this,t,!1)),"_initText",void 0),rs(ts(e),"_initHTML",void 0),rs(ts(e),"_isPrimarySplit",void 0),rs(ts(e),"_container",void 0),rs(ts(e),"_letters",void 0),rs(ts(e),"_words",void 0),rs(ts(e),"_lines",void 0),e.prop.container){var r=y(e.prop.container);r instanceof HTMLElement&&(e._container=r)}e._container&&e._container.classList.add(e.prefix),e._initHTML=e._container.innerHTML;var s=e._container.innerText.trim()||e._container.innerHTML.trim();return e._initText=s||"no rendered text",e._initText=e._initText.replace(/\s+\n/gm,"\n"),e._initText=e._initText.replace(/<br>/gm,String.fromCharCode(10)),e._initText=e._initText.replace(/<br\/>/gm,String.fromCharCode(10)),e._initText=e._initText.replace(/<br \/>/gm,String.fromCharCode(10)),e._isPrimarySplit=!1,e._letters=[],e._words=[],e._lines=[],n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return $i($i({},es(ns(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),appendLetters:!0,appendLines:!1,viewportTarget:"",resizeTimeout:0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"split-text")}},{key:"container",get:function(){return this._container}},{key:"letters",get:function(){return this._letters}},{key:"words",get:function(){return this._words}},{key:"lines",get:function(){return this._lines}},{key:"_setEvents",value:function(){var t=this;es(ns(i.prototype),"_setEvents",this).call(this),this.splitText(),this.prop.appendLines&&this.addViewportCallback(this.prop.viewportTarget,(function(){t.splitText()}),{timeout:this.prop.resizeTimeout})}},{key:"splitText",value:function(){this._isPrimarySplit||(this.container.innerHTML="",this._splitIntoWords(),this._splitIntoLetters(),this._appendWords(),this._isPrimarySplit=!0),this.prop.appendLines&&this._splitIntoLines(),this.callbacks.tbt("split",!1)}},{key:"_splitIntoWords",value:function(){var t=this,e=this._initText.split(""),n=0;e.forEach((function(e){var r=t._words[n]||{content:"",hasNewLine:!1,el:_("span",{class:"".concat(t.prefix,"__word")}),letters:[]};r.el.style.display="inline-block",t._words[n]=r;var o=e.charCodeAt(0),i=32===o||160===o,s=[45,8208,8211,8212,8722].includes(o),a=10===o;i&&(r.whitespace=document.createTextNode(" ")),a&&(r.br=_("br")),r.hasNewLine=a,i||a?n+=1:(r.content+=e,t.prop.appendLetters||(r.el.innerHTML=r.content),s&&(n+=1))})),this._words=this._words.filter((function(e,n){return 0!==e.content.length||(n>0&&(t._words[n-1].whitespace=e.whitespace,t._words[n-1].br=e.br),!1)}))}},{key:"_appendWords",value:function(){var t=this;this._words.forEach((function(e){t.container.appendChild(e.el),e.whitespace&&t.container.appendChild(e.whitespace),e.br&&t.container.appendChild(e.br)}))}},{key:"_removeWords",value:function(){this._words.forEach((function(t){t.el.remove(),t.whitespace&&t.whitespace.remove(),t.br&&t.br.remove()}))}},{key:"_splitIntoLetters",value:function(){var t=this;this.prop.appendLetters&&(this._words.forEach((function(e){var n=e.content.split(""),r=[];n.forEach((function(n){var o={el:_("span",{class:"".concat(t.prefix,"__letter"),html:n}),content:n,word:e};o.el.style.display="inline-block",t._letters.push(o),r.push(o)})),e.letters=r})),this._letters.forEach((function(t){t.word.el.appendChild(t.el)})))}},{key:"_splitIntoLines",value:function(){var t=this;this._removeLines();var e=!1,n=1/0,r=!1;this.words.forEach((function(o){var i=!1,s=o.el.offsetTop;i=!(!r||!r.br)||s!==n,r=o,n=s,i&&((e={el:_("span",{class:"".concat(t.prefix,"__line")}),content:"",words:[]}).el.style.display="block",t._lines.push(e)),e&&e.words.push(o)})),this._lines.forEach((function(t){t.content=t.words.map((function(t){return t.content})).join(" ")})),this._lines.forEach((function(e){e.words.forEach((function(t){e.el.appendChild(t.el),t.br&&t.br.remove(),t.whitespace&&e.el.appendChild(t.whitespace)})),t.container.appendChild(e.el)}))}},{key:"_removeLines",value:function(){this._lines.forEach((function(t){t.el.remove()})),this._lines=[],this._appendWords()}},{key:"_destroy",value:function(){es(ns(i.prototype),"_destroy",this).call(this),this._lines=[],this._words=[],this._letters=[],this._container.innerHTML=this._initHTML}}])&&Ki(e.prototype,n),r&&Ki(e,r),i}(J);function is(t){return(is="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ss(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function as(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ss(Object(n),!0).forEach((function(e){vs(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ss(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function cs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function us(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ls(t,e){return(ls=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ys(t);if(e){var o=ys(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return hs(this,n)}}function hs(t,e){return!e||"object"!==is(e)&&"function"!=typeof e?ps(t):e}function ps(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ds(t,e,n){return(ds="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ys(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ys(t){return(ys=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function vs(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var bs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ls(t,e)}(i,t);var e,n,r,o=fs(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];cs(this,i),vs(ps(e=o.call(this,t,!1)),"_container",void 0),vs(ps(e),"_containerIsWindow",void 0),vs(ps(e),"_outerCursor",void 0),vs(ps(e),"_innerCursor",void 0),vs(ps(e),"_animationFrame",void 0),vs(ps(e),"_currentFPS",void 0),vs(ps(e),"_canPlay",void 0),vs(ps(e),"_x",void 0),vs(ps(e),"_xTarget",void 0),vs(ps(e),"_y",void 0),vs(ps(e),"_yTarget",void 0);var r=y(e.prop.container);if(!r)throw new Error("No cursor container for ".concat(e.prop.container));return e._container=r,e._containerIsWindow=r instanceof Window,e._x=0,e._xTarget=0,e._y=0,e._yTarget=0,e._currentFPS=60,e._canPlay=e.prop.run,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return as(as({},ds(ys(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,run:!0,hideNativeCursor:!1,render:{lerp:.2,lerpToFixed:2,normalizeLerp:!1},autoStop:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"custom-cursor")}},{key:"container",get:function(){return this._container}},{key:"eventsContainer",get:function(){return this._container}},{key:"domContainer",get:function(){return this.container instanceof Window?this._app.html:this.container}},{key:"outerCursor",get:function(){return this._outerCursor}},{key:"innerCursor",get:function(){return this._innerCursor}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"_constructor",value:function(){ds(ys(i.prototype),"_constructor",this).call(this),this._createCursor()}},{key:"_setEvents",value:function(){var t=this;ds(ys(i.prototype),"_setEvents",this).call(this);var e=this.domContainer;this._animationFrame=new bt,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})),this._canPlay&&this.enable(),this.addEventListeners(e,"mouseenter",this._handleMouseEnter.bind(this)),this.addEventListeners(e,"mouseleave",this._handleMouseLeave.bind(this)),this.addEventListeners(e,"mousemove",this._handleMouseMove.bind(this)),this.addEventListeners(e,"mousedown",this._handleMouseDown.bind(this)),this.addEventListeners(e,"mouseup",this._handleMouseUp.bind(this)),this.addEventListeners(window,"blur",this._handleWindowBlur.bind(this))}},{key:"_createCursor",value:function(){var t=this.prefix,e=this.container,n=this.domContainer;this.prop.hideNativeCursor&&(n.style.cursor="none",n.classList.add("hide-defaut-cursor")),n.classList.add("".concat(t,"-container")),this._outerCursor=_("div",{class:"".concat(t," ").concat(e instanceof Window?"in-window":"in-element"," disabled"),parent:n}),this._innerCursor=_("div",{class:"".concat(t,"__inner disabled"),parent:this._outerCursor}),this.callbacks.tbt("create",{outerCursor:this.outerCursor,innerCursor:this.innerCursor})}},{key:"_destroyCursor",value:function(){var t=this.prefix,e=this.domContainer;e.style.cursor="",e.classList.remove("hide-defaut-cursor"),e.classList.remove("".concat(t,"-container")),this._outerCursor.remove(),this._innerCursor.remove()}},{key:"_handleMouseEnter",value:function(t){this._xTarget=t.clientX,this._x=this._xTarget,this._yTarget=t.clientY,this._y=this._yTarget,this.outerCursor.classList.add("in-action")}},{key:"_handleMouseLeave",value:function(){this.outerCursor.classList.remove("in-action")}},{key:"_handleMouseMove",value:function(t){this._xTarget=t.clientX,this._yTarget=t.clientY,this.outerCursor.classList.add("in-action"),this._canPlay&&this._animationFrame.play()}},{key:"_handleMouseDown",value:function(t){1===t.which&&(this.outerCursor.classList.add("click"),this.innerCursor.classList.add("click"))}},{key:"_handleMouseUp",value:function(){this.outerCursor.classList.remove("click"),this.innerCursor.classList.remove("click")}},{key:"_handleWindowBlur",value:function(){this._handleMouseUp()}},{key:"render",value:function(){var t=this.prop,e=this.domContainer,n=t.render,r=n.normalizeLerp,o=n.lerp,i=n.lerpToFixed,s=r?60/this._currentFPS:1;if(this._x=Z(this._x,this._xTarget,o*s,.02),this._y=Z(this._y,this._yTarget,o*s,.02),"number"==typeof i){var a=Math.round(Math.abs(i));this._x=parseFloat(this._x.toFixed(a)),this._y=parseFloat(this._y.toFixed(a))}var c=this._x,u=this._y;if(!this._containerIsWindow){var l=e.getBoundingClientRect();c-=l.left,u-=l.top}this.outerCursor.style.transform="translate(".concat(c,"px, ").concat(u,"px)"),t.autoStop&&this._x===this._xTarget&&this._y===this._yTarget&&this._animationFrame.pause(),this._callbacks.tbt("render",{x:c,y:u})}},{key:"enable",value:function(){this._canPlay=!0,this._animationFrame.isPlaying||(this.outerCursor.classList.remove("disabled"),this.innerCursor.classList.remove("disabled"),this._animationFrame.play())}},{key:"disable",value:function(){this._canPlay=!1,this._animationFrame.isPlaying&&(this.outerCursor.classList.add("disabled"),this.innerCursor.classList.add("disabled"),this._animationFrame.pause())}},{key:"_destroy",value:function(){ds(ys(i.prototype),"_destroy",this).call(this),this._destroyCursor(),this._animationFrame.destroy()}}])&&us(e.prototype,n),r&&us(e,r),i}(J),_s={common:t,listeners:r,math:e};window.Vevet=i})()})();