roseworx
Version:
Front end css and js framework
1 lines • 59.6 kB
JavaScript
(()=>{var t={734:(t,e,n)=>{"use strict";function i(t){return function(t){if(Array.isArray(t))return r(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){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(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 r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,{default:()=>fe});var o={uniqueIdList:[],uniqueId:function(){var t="_"+Math.random().toString(36).substr(2,12);return o.uniqueIdList.includes(t)?o.uniqueId():(o.uniqueIdList.push(t),t)},setCookie:function(t,e,n){var i=new Date;i.setDate(i.getDate()+n);var r=escape(e)+(null==n?"":"; expires="+i.toUTCString());document.cookie=t+"="+r},getCookie:function(t){var e,n,i,r=document.cookie.split(";");for(e=0;e<r.length;e++)if(n=r[e].substr(0,r[e].indexOf("=")),i=r[e].substr(r[e].indexOf("=")+1),(n=n.replace(/^\s+|\s+$/g,""))==t)return unescape(i)},safeCloneArrayOfObjects:function(t){var e=i(t);return e.map((function(t,n){e[n]=o.safeCloneObject(e[n])})),e},safeCloneObject:function(t){return Object.assign({},t)},safeCloneArray:function(t){return i(t)},shuffleArray:function(t){for(var e=t.length-1;e>0;e--){var n=Math.floor(Math.random()*(e+1)),i=[t[n],t[e]];t[e]=i[0],t[n]=i[1]}},randomValueFromArray:function(t){return t[Math.floor(Math.random()*(t.length-1-0+1)+0)]},isHexValue:function(t){return/^#(?:[0-9a-f]{3}){1,2}$/i.test(t)},convertHexToRGB:function(t){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},isKeyboardClick:function(t){return 13==t.keyCode||32==t.keyCode},convertToButton:function(t,e){t.setAttribute("role","button"),t.setAttribute("tabindex",0),e&&t.addEventListener("keydown",(function(t){o.isKeyboardClick(t)&&(t.preventDefault(),e(t))}))}};const a=o;function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var u=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.debounceEvent=this.debounceEvent.bind(this),this.events=[],this.debounceThreshold=250}var e,n;return e=t,(n=[{key:"removeEvent",value:function(){window.removeEventListener("resize",this.debounceEvent)}},{key:"addEvent",value:function(){window.addEventListener("resize",this.debounceEvent)}},{key:"remove",value:function(t){this.events=this.events.filter((function(e){return e.id!==t})),0===this.events.length&&this.removeEvent()}},{key:"add",value:function(t,e){0===this.events.length&&this.addEvent(),this.events.push({ev:t,id:e})}},{key:"debounceEvent",value:function(t){var e=this;this.debounce&&clearTimeout(this.debounce),this.debounce=setTimeout((function(){e.events.map((function(e){return e.ev(t)}))}),this.debounceThreshold)}}])&&s(e.prototype,n),t}();window.rwx||(window.rwx={}),window.rwx.resizeTracking||(window.rwx.resizeTracking=new u);const c=function(t,e){return window.rwx.resizeTracking.add(t,e)};function l(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.scrollEvent=this.scrollEvent.bind(this),this.throttle=this.throttle.bind(this),this.events=[],this.running=!1}var e,n;return e=t,(n=[{key:"removeEvent",value:function(){document.removeEventListener("scroll",this.throttle),document.removeEventListener("touchmove",this.throttle),document.removeEventListener("scrollTrackThrottle",this.scrollEvent)}},{key:"addEvent",value:function(){document.addEventListener("scrollTrackThrottle",this.scrollEvent),document.addEventListener("scroll",this.throttle),document.addEventListener("touchmove",this.throttle),this.throttle()}},{key:"remove",value:function(t){this.events=this.events.filter((function(e){return e.id!==t})),0===this.events.length&&this.removeEvent()}},{key:"add",value:function(t,e){0===this.events.length&&this.addEvent(),this.events.push({ev:t,id:e})}},{key:"throttle",value:function(){var t=this;this.running||(this.running=!0,window.requestAnimationFrame((function(){document.dispatchEvent(new CustomEvent("scrollTrackThrottle")),t.running=!1})))}},{key:"scrollEvent",value:function(t){this.events.map((function(e){return e.ev(t)}))}}])&&l(e.prototype,n),t}();window.rwx||(window.rwx={}),window.rwx.scrollTracking||(window.rwx.scrollTracking=new h);const f=function(t,e){return window.rwx.scrollTracking.add(t,e)};function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const p=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};d(this,t),this.mousedEvent=this.mousedEvent.bind(this),this.handleOrientation=this.handleOrientation.bind(this),this.node=e,this.moused=n,this.add()}var e,n;return e=t,(n=[{key:"add",value:function(){this.mouse={x:0,y:0},this.lastmouse={x:0,y:0},this.parallaxmouse={x:0,y:0},this.velocity={x:0,y:0},this.node.addEventListener("mousemove",this.mousedEvent),window.addEventListener("deviceorientation",this.handleOrientation)}},{key:"remove",value:function(){this.node.removeEventListener("mousemove",this.mousedEvent),window.removeEventListener("deviceorientation",this.handleOrientation)}},{key:"handleOrientation",value:function(t){null===t.alpha||t.alpha;var e=null===t.beta?0:t.beta,n=null===t.gamma?0:t.gamma;n>90&&(n=90),n<-90&&(n=-90),this.parallaxmouse.x=window.innerWidth*n/180*4,this.parallaxmouse.y=window.innerHeight*e/525*4,this.moused(t)}},{key:"mousedEvent",value:function(t){this.dimensions=this.node===window?{top:0,left:0}:this.node.getBoundingClientRect();var e=t.clientX;e-=this.dimensions.left;var n=t.clientY;n-=this.dimensions.top,this.mouse={x:e,y:n},this.velocity={x:(this.mouse.x-this.lastmouse.x)/2,y:(this.mouse.y-this.lastmouse.y)/2},this.parallaxmouse.x=e-window.innerWidth/2,this.parallaxmouse.y=n-window.innerHeight/2,this.moused(t),this.lastmouse=this.mouse}}])&&m(e.prototype,n),t}();function v(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&&y(t,e)}function y(t,e){return y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},y(t,e)}function b(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,i=k(t);if(e){var r=k(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return g(this,n)}}function g(t,e){return!e||"object"!==E(e)&&"function"!=typeof e?w(t):e}function w(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function k(t){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},k(t)}function E(t){return E="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},E(t)}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function O(t,e,n){return e&&x(t.prototype,e),n&&x(t,n),t}var C=function(){function t(e){var n=this,i=e.selector,r=e.canHaveManualControl,o=void 0!==r&&r,a=e.autoClass,s=void 0===a||a,u=e.resource;A(this,t),i&&(this.internalMap={}),this.resourceName=u,this.autoClass=s,this.execute?(this.execute=this.execute.bind(this),this.selector=i,this.className=this.getClassName(),this.canHaveManualControl=o,window.addEventListener("load",(function(){i?n.scanDOM():n.execute()}))):this.error("No execute method (this.execute) defined on instance.")}return O(t,[{key:"scanDOM",value:function(){var t,e=this;(t=document.querySelectorAll(this.selector),function(t){if(Array.isArray(t))return S(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){if("string"==typeof t)return S(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(t,e):void 0}}(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.")}()).map((function(t){window.requestAnimationFrame((function(){e.hook(t.id||a.uniqueId(),t)}))}))}},{key:"getClassName",value:function(){return this.selector?this.selector.replace("[","").replace("]",""):null}},{key:"checkAttributeOrDefault",value:function(t,e,n){return t.hasAttribute(e)?t.getAttribute(e):n}},{key:"checkAttributeForBool",value:function(t,e){return I(t,e)}},{key:"checkMap",value:function(t){for(var e in this.internalMap)if(this.internalMap[e].el===t)return!0}},{key:"renew",value:function(t){var e=this;this.unhook(t),window.requestAnimationFrame((function(){e.hook(t)}))}},{key:"unhook",value:function(t){if(t){var e=this.getIME(t,!0);e&&(e.stopAnimation=!0,e.removeListeners&&e.removeListeners(),e.removeElements&&e.removeElements(),e.removeStyles&&e.removeStyles(),e.removeAttributes&&e.removeAttributes(),e.cleanUp&&e.cleanUp(),this.autoClass&&e.el&&e.el.classList.remove(this.className),this.deleteIME(t))}}},{key:"hook",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){var n=e||document.getElementById(t);if(!e&&this.autoClass&&n&&n.classList.add(this.className),!n)return void this.error("Hook - Element #".concat(t," not found on page."));if(this.checkMap(n))return;var i=this.canHaveManualControl?this.execute(n,this.checkAttributeForBool(n,"data-rwx-manual-control")):this.execute(n);i&&this.addIME(n.id,i)}}},{key:"validateParameter",value:function(t,e,n){return E(t)===e||(this.error("<".concat(n,"> expected parameter of type ").concat(e," but got ").concat(E(t),".")),!1)}},{key:"commence",value:function(t){var e=this.getIME(t);e&&!e.hasScrolled&&e.scrolledIntoView()}},{key:"pause",value:function(t){var e=this.getIME(t);e&&(e.pauseAnimations&&e.pauseAnimations(),e.stopAnimation=!0)}},{key:"play",value:function(t){var e=this.getIME(t);e&&(!e.hasScrolled&&e.scrolledIntoView?e.scrolledIntoView():(e.playAnimations&&e.playAnimations(),e.startAnimation()))}},{key:"getIMES",value:function(){return this.internalMap}},{key:"addIME",value:function(t,e){var n=t;n?this.internalMap[n]&&this.error("Duplicate ID #".concat(t," detected. Things may not work as expected, please use unique ID's per Component.")):n=a.uniqueId(),this.internalMap[n]=e}},{key:"deleteIME",value:function(t){delete this.internalMap[t]}},{key:"getIME",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.internalMap&&this.internalMap[t]?this.internalMap[t]:(Object.keys(this.internalMap).length>0&&!e&&this.error("No element detected with id - ".concat(t," \n[rwx] Possible ID's on this page are - ").concat(Object.keys(this.internalMap).join(", "))),!1)}},{key:"addEvent",value:function(t,e,n,i){if(e&&i&&this.validateParameter(i,"function","addEvent")){var r=this.getIME(t);r&&!r.customEventsEnabled||r&&r.addEvent(e,i,n)}}},{key:"error",value:function(t){M(t,"{Core} (".concat(this.resourceName,")"))}}]),t}(),T=function(){function t(e){var n=this,i=e.element,r=e.enableCustomEvents,o=(e.enableAnimationLoop,e.enableScrollIntoView);e.enableMouseTracking,e.enableScrollTracking,e.enableResizeDebounce,A(this,t),this.resourceName=this.constructor.name,this.el=i,this.uniqueID=a.uniqueId(),this.addedElements=[],this.addedStyles=[],this.addedAttributes=[],r&&(this.customEventsEnabled=!0,this.availableEvents=[]),o&&(f((function(){return n.scrollIntoViewEvent()}),this.uniqueID),this.scrollIntoViewEvent=this.scrollIntoViewEvent.bind(this),this.setScrollTrigger(200),this.scrollErrorReported=!1,window.requestAnimationFrame(this.scrollIntoViewEvent))}return O(t,[{key:"removeElements",value:function(){this.addedElements.map((function(t){return t.parent.contains(t.child)&&t.parent.removeChild(t.child)})),this.addedElements=[]}},{key:"removeElement",value:function(t,e){t.contains(e)&&t.removeChild(e),this.addedElements=this.addedElements.filter((function(n){return n.parent!==t&&n.child!==e}))}},{key:"addElement",value:function(t,e){t.appendChild(e),this.addedElements.push({parent:t,child:e})}},{key:"addAttribute",value:function(t,e,n){t.setAttribute(e,n),this.addedAttributes.push({parent:t,attribute:e})}},{key:"removeAttributes",value:function(t){this.addedAttributes.map((function(t){return t.parent.removeAttribute(t.attribute)}))}},{key:"addStyle",value:function(t,e,n){t.style[e]=n,this.addedStyles.push({parent:t,style:e})}},{key:"removeStyles",value:function(){this.addedStyles.map((function(t){return t.parent.style[t.style]=""}))}},{key:"removeListeners",value:function(){window.removeEventListener("resize",this.debounceEvent),this.mouseTrack&&this.mouseTrack.remove(),this.stopScroll&&this.stopScroll(),this.stopResize&&this.stopResize()}},{key:"declareEvent",value:function(t){this[t]=[],this.availableEvents.push(t)}},{key:"addEvent",value:function(t,e,n){this.availableEvents.includes(n)?"function"==typeof e?this[n].push({id:t,event:e}):this.error("addEvent - event parameter must be a function."):this.error("No custom event detected with name - ".concat(n))}},{key:"executeEvent",value:function(t,e){if(0!=this[t].length){var n=this[t].filter((function(t){return t.id==e}));0!=n.length&&n.map((function(t){return t.event()}))}}},{key:"setScrollTrigger",value:function(t){this.scrollTriggerOffset=window.innerHeight-t}},{key:"stopScroll",value:function(){this.hasScrolled=!0,window.rwx.scrollTracking&&window.rwx.scrollTracking.remove(this.uniqueID)}},{key:"scrollIntoViewEvent",value:function(){this.hasScrolled||(this.scrolledIntoView?this.el?this.el.getBoundingClientRect().top<this.scrollTriggerOffset&&this.scrolledIntoView():this.scrollErrorReported||(this.error("No element (this.el) defined on instance."),this.scrollErrorReported=!0):this.scrollErrorReported||(this.error("No scrolledIntoView method (this.scrolledIntoView) defined on instance."),this.scrollErrorReported=!0))}},{key:"elFullSizeAbsolute",value:function(t){var e=window.getComputedStyle(this.el.parentNode).position;"absolute"!==e&&"fixed"!==e&&this.addStyle(this.el.parentNode,"position","relative"),this.addStyle(this.el,"position","absolute"),this.addStyle(this.el,"top","0px"),this.addStyle(this.el,"left","0px"),this.addStyle(this.el,"right","0px"),this.addStyle(this.el,"bottom","0px"),this.addStyle(this.el,"width","100%"),this.addStyle(this.el,"height","100%"),this.addStyle(this.el,"overflow","hidden"),t&&this.addStyle(this.el,"backgroundColor",t)}},{key:"error",value:function(t){M(t,"{Component} (".concat(this.resourceName,")"))}}]),t}(),L=function(t){v(n,t);var e=b(n);function n(t){var i;A(this,n),i=e.call(this,t);var r=t.enableResizeDebounce,o=t.enableScrollTracking,a=t.enableMouseTracking;if(r&&(c((function(){return i.resizeEvent()}),i.uniqueID),i.resizeEvent=i.resizeEvent.bind(w(i))),o&&(f((function(){return i.scrollEvent()}),i.uniqueID),i.scrollEvent=i.scrollEvent.bind(w(i)),window.requestAnimationFrame(i.scrollEvent)),a){var s=i.moused?function(t){i.moused(t)}:function(){};i.mouseTrack=new p(i.el.hasAttribute("rwx-mouse-track-use-window")?window:i.el,s)}return i}return O(n,[{key:"stopResize",value:function(){this.hasResized=!0,window.rwx.resizeTracking&&window.rwx.resizeTracking.remove(this.uniqueID)}},{key:"scrollEvent",value:function(){this.hasScrolled||(this.scroll?this.scroll():this.scrollError2Reported||(this.error("No scroll method (this.scroll) defined on instance."),this.scrollError2Reported=!0))}},{key:"resizeEvent",value:function(){this.hasResized||(this.resize?this.resize():this.debounceErrorReported||(this.error("No resize method (this.resize) defined on instance."),this.debounceErrorReported=!0))}}]),n}(function(t){v(n,t);var e=b(n);function n(t){var i;return A(this,n),i=e.call(this,t),t.enableAnimationLoop&&(i.animations=[],i.stopAnimation=!0,i.animateLoop=i.animateLoop.bind(w(i))),i}return O(n,[{key:"startAnimation",value:function(){this.stopAnimation&&(this.stopAnimation=!1,this.animateLoop())}},{key:"animateLoop",value:function(){this.animate?this.stopAnimation||(requestAnimationFrame(this.animateLoop),this.c&&this.canvas&&!this.dontClearRect&&this.c.clearRect(0,0,this.canvas.width,this.canvas.height),this.animate()):this.error("No animate method (this.animate) defined on instance.")}},{key:"pauseAnimations",value:function(){this.animations.map((function(t){return t.pause()}))}},{key:"playAnimations",value:function(){this.animations.map((function(t){return t.play()}))}},{key:"addAnimation",value:function(t){this.animations.push(t)}},{key:"resetAnimations",value:function(){this.animations=[]}}]),n}(T)),M=function(t,e){console.warn("[rwx] ".concat(e," - ").concat(t))},I=function(t,e){return!!t.hasAttribute(e)&&"false"!==t.getAttribute(e)};function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function R(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const q=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dismissableCards()}var e,n;return e=t,(n=[{key:"undismissableCards",value:function(){var t=this;this.dsm&&this.dsm.map((function(e,n){return e.removeChild(t.dcmbs[n]),e.classList.remove("dismissable","dismiss"),!1}))}},{key:"dismissableCards",value:function(){var t,e=this;this.dsm=(t=document.querySelectorAll("p[data-rwx-dismissable]"),function(t){if(Array.isArray(t))return j(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){if("string"==typeof t)return j(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(t,e):void 0}}(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.")}()).filter((function(t){return I(t,"data-rwx-dismissable")})),this.dcmbs=[],this.dsm.map((function(t){if(t.querySelector(".dismissable-button"))return!1;var n=document.createElement("button"),i=document.createElement("i");return n.classList.add("no-decoration"),n.classList.add("dismissable-button"),i.classList.add("card-close"),t.classList.add("dismissable"),n.appendChild(i),t.appendChild(n),n.addEventListener("click",(function(){t.classList.add("dismiss")})),e.dcmbs.push(n),!1}))}}])&&R(e.prototype,n),t}());function N(t){return N="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},N(t)}function _(t){return function(t){if(Array.isArray(t))return P(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){if("string"==typeof t)return P(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}(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 P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function B(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 i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function H(t,e,n){return e&&F(t.prototype,e),n&&F(t,n),t}function V(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&&D(t,e)}function D(t,e){return D=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},D(t,e)}function z(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,i=$(t);if(e){var r=$(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return U(this,n)}}function U(t,e){return!e||"object"!==N(e)&&"function"!=typeof e?W(t):e}function W(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},$(t)}var Q=function(t){V(n,t);var e=z(n);function n(){return B(this,n),e.call(this,{selector:"[rwx-form]",canHaveManualControl:!1,autoClass:!1,resource:"rwxForms"})}return H(n,[{key:"execute",value:function(t){return new Y(t)}},{key:"customSubmitFn",value:function(t,e){if(this.validateParameter(e,"function","customSubmitFn")){var n=this.getIME(t);n&&(n.customSubmit=e)}}}]),n}(C),Y=function(t){V(n,t);var e=z(n);function n(t){var i;return B(this,n),(i=e.call(this,{element:t})).submitButton=i.el.querySelector("button[type='submit']"),i.validEls={},i.events=[],i.getInputs().map((function(t){i.determineValid(t),i.touched(t);var e=function(e){"checkbox"==t.type?i.addValidClass(i.validCheckbox(t,e.target.checked),t):i.addValidClass(i.validInput(t,e.target.value),t)};t.addEventListener("blur",e);var n="checkbox"==t.type||"SELECT"==t.tagName||"radio"==t.type?"change":"keyup",r=function(e){i.determineValid(t),i.submitButton&&(i.submitButton.disabled=!i.isFormValid())};t.addEventListener(n,r),i.events.push([{type:"blur",ev:e},{type:n,ev:r}])})),i.submitButton&&(i.submitButton.disabled=!i.isFormValid()),i.submitFn=function(t){if(i.isFormValid()){if(i.customSubmit){t.preventDefault();var e={};i.getInputs().map((function(t){var n=t.getAttribute("name");n&&(e[n]="checkbox"==t.type?t.checked:t.value)})),i.customSubmit(e)}}else t.preventDefault()},i.submitFn=i.submitFn.bind(W(i)),i.el.addEventListener("submit",i.submitFn),i}return H(n,[{key:"cleanUp",value:function(){var t=this;this.el.removeEventListener("submit",this.submitFn),this.getInputs().map((function(e,n){return t.events[n].map((function(t){return e.removeEventListener(t.type,t.ev)})),t.submitButton.disabled=!1,!1}))}},{key:"getInputs",value:function(){return[].concat(_(this.el.querySelectorAll("input")),_(this.el.querySelectorAll("textarea")),_(this.el.querySelectorAll("select")))}},{key:"determineValid",value:function(t){var e;e="checkbox"==t.type?this.validCheckbox(t,t.checked):"radio"==t.type?this.validRadio(t,t.checked):this.validInput(t,t.value),this.validEls[this.getUniqueAttribute(t)]=e}},{key:"isFormValid",value:function(){return Object.entries(this.validEls).every((function(t){return!0===t[1]}))}},{key:"getUniqueAttribute",value:function(t){return"radio"==t.type&&t.parentNode.parentNode.classList.contains("rwx-form-radio-group")?t.parentNode.parentNode.id:t.id||t.name}},{key:"touched",value:function(t){t.addEventListener("focus",(function(){t.parentNode.classList.add("touched")}))}},{key:"addValidClass",value:function(t,e){this.isTouched(e)&&(t?e.parentNode.classList.add("valid"):e.parentNode.classList.remove("valid"),t?e.parentNode.classList.remove("invalid"):e.parentNode.classList.add("invalid"))}},{key:"isTouched",value:function(t){return t.parentNode.classList.contains("touched")}},{key:"isRequired",value:function(t){return t.parentNode.classList.contains("required")}},{key:"validRadio",value:function(t,e){var n=this.isRequired(t),i=t.parentNode.parentNode.classList.contains("required");return!n&&!i||1==e}},{key:"validInput",value:function(t,e){var n=this.isRequired(t);return"email"===t.type?!n||this.validEmail(e):!n||e.length>0}},{key:"validEmail",value:function(t){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)}},{key:"validCheckbox",value:function(t,e){return!this.isRequired(t)||!0===e}}]),n}(T);const K=new Q;function X(t){return X="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},X(t)}function Z(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function G(t,e){return G=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},G(t,e)}function J(t,e){return!e||"object"!==X(e)&&"function"!=typeof e?tt(t):e}function tt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function et(t){return et=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},et(t)}const nt=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&&G(t,e)}(a,t);var e,n,i,r,o=(i=a,r=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}}(),function(){var t,e=et(i);if(r){var n=et(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return J(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,{element:t,enableResizeDebounce:!0})).update=e.update.bind(tt(e)),e.calculate(),e.addStyle(e.el,"overflow","auto"),e.addStyle(e.el,"position","relative"),e.el.addEventListener("scroll",e.update),e}return e=a,(n=[{key:"cleanUp",value:function(){this.el.removeEventListener("scroll",this.update)}},{key:"resize",value:function(){this.calculate()}},{key:"calculate",value:function(){this.el.scrollWidth>this.el.offsetWidth?this.rightMist||(this.rightMist=document.createElement("div"),this.rightMist.classList.add("rwx-mist-right"),this.addElement(this.el,this.rightMist)):this.rightMist&&(this.removeElement(this.el,this.rightMist),this.rightMist=!1),this.el.scrollHeight>this.el.offsetHeight?this.bottomMist||(this.bottomMist=document.createElement("div"),this.bottomMist.classList.add("rwx-mist-bottom"),this.addElement(this.el,this.bottomMist)):this.bottomMist&&(this.removeElement(this.el,this.bottomMist),this.bottomMist=!1)}},{key:"update",value:function(){this.rightMist&&(this.el.scrollLeft+this.el.offsetWidth<this.el.scrollWidth?this.rightMist.classList.remove("hide"):this.rightMist.classList.add("hide"),this.rightMist.style.right=-this.el.scrollLeft+"px",this.rightMist.style.height=this.el.scrollHeight+"px"),this.bottomMist&&(this.el.scrollTop+this.el.offsetHeight<this.el.scrollHeight?this.bottomMist.classList.remove("hide"):this.bottomMist.classList.add("hide"),this.bottomMist.style.width=this.el.scrollWidth+"px",this.bottomMist.style.bottom=-this.el.scrollTop+"px")}}])&&Z(e.prototype,n),a}(L);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},it(t)}function rt(t){return function(t){if(Array.isArray(t))return ot(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){if("string"==typeof t)return ot(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ot(t,e):void 0}}(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 ot(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function at(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function st(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ut(t,e,n){return e&&st(t.prototype,e),n&&st(t,n),t}function ct(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&<(t,e)}function lt(t,e){return lt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},lt(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,i=mt(t);if(e){var r=mt(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ft(this,n)}}function ft(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 mt(t){return mt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},mt(t)}var pt=function(t){ct(n,t);var e=ht(n);function n(){return at(this,n),e.call(this,{selector:"[rwx-table]",canHaveManualControl:!1,autoClass:!1,resource:"rwxTables"})}return ut(n,[{key:"execute",value:function(t){var e,n,i=t.classList.contains("--dual-headings"),r=t.classList.contains("--vertical"),o=t.classList.contains("--vertical-line"),a=this.checkAttributeForBool(t,"data-rwx-table-no-mist"),s=this.checkAttributeForBool(t,"data-rwx-table-no-stick");return 0!==rt(t.querySelectorAll(".rwx-table-data")).length&&(a||(e=new nt(t)),s||(n=r?new yt(t,30,s,e):i?new vt(t,30,o,s,e):new bt(t,30,s,e)),n||e||!1)}}]),n}(C),vt=function(t){ct(n,t);var e=ht(n);function n(t,i,r,o,a){var s;return at(this,n),(s=e.call(this,{element:t})).mist=a,s.isVerticalLine=r,s.stick=new yt(s.el,i),s.stick2=new bt(s.el,i),s.update=s.update.bind(dt(s)),s.noStick=o,!s.noStick&&s.el.addEventListener("scroll",s.update),s}return ut(n,[{key:"cleanUp",value:function(){this.mist&&(this.mist.removeElements(),this.mist.cleanUp()),this.stick.cleanUp(),this.stick.removeElements(),this.stick2.cleanUp(),this.stick2.removeElements(),!this.noStick&&this.el.removeEventListener("scroll",this.update)}},{key:"createMask",value:function(){var t=document.createElement("span");t.classList.add("scroll"),t.classList.add(this.isVerticalLine?"scroll-mask-vertical":"scroll-mask"),t.style.height=this.stick2.getHeight()+"px",t.style.width=this.stick.getWidth()+"px",t.style.minWidth="0px",this.mask=t,this.addElement(this.el,t),this.maskCreated=!0}},{key:"destroyMask",value:function(){this.removeElement(this.el,this.mask),this.maskCreated=!1}},{key:"update",value:function(){this.stick.update(),this.stick2.update(),this.stick.headerStuck&&this.stick2.headerStuck?this.maskCreated?(this.stick.headerStuck&&(this.mask.style.left=this.el.scrollLeft+"px"),this.stick2.headerStuck&&(this.mask.style.top=this.el.scrollTop+"px")):this.createMask():this.maskCreated&&this.destroyMask()}}]),n}(T),yt=function(t){ct(n,t);var e=ht(n);function n(t,i,r,o){var a;return at(this,n),(a=e.call(this,{element:t})).mist=o,a.tableBoundaries=a.el.getBoundingClientRect(),a.stuckElements=[],a.headerStuck=!1,a.headerEls=rt(a.el.querySelectorAll(".rwx-table-data")),a.leftMin=a.headerEls[0].getBoundingClientRect().left-a.tableBoundaries.left,a.boundary=i+a.leftMin,a.update=a.update.bind(dt(a)),a.noStick=r,!a.noStick&&a.el.addEventListener("scroll",a.update),a}return ut(n,[{key:"cleanUp",value:function(){this.mist&&(this.mist.removeElements(),this.mist.cleanUp()),!this.noStick&&this.el.removeEventListener("scroll",this.update)}},{key:"getWidth",value:function(){var t=[];return this.headerEls.map((function(e){var n=e.querySelector("span:first-child"),i=parseInt(getComputedStyle(n)["padding-left"].replace("px",""))+parseInt(getComputedStyle(n)["padding-right"].replace("px","")),r=n.cloneNode(!0);document.body.appendChild(r),t.push(r.getBoundingClientRect().width+i+4),document.body.removeChild(r)})),Math.max.apply(Math,t)>150?150:Math.max.apply(Math,t)}},{key:"update",value:function(){var t=this;this.el.scrollLeft>this.boundary?(!this.headerStuck&&this.makeHeaderSticky(),this.stuckElements.length>0&&this.stuckElements.map((function(e){e.style.left=t.el.scrollLeft+"px"}))):this.headerStuck&&this.makeHeaderNormal()}},{key:"makeHeaderSticky",value:function(){var t=this;this.stuckElements=[];var e=this.getWidth();this.headerEls.map((function(n){var i=n.querySelector("span:first-child"),r=i.cloneNode(!0);r.style.minWidth="0px",r.style.width=e+"px",r.classList.add("scroll"),r.style.height=i.getBoundingClientRect().height+"px",t.stuckElements.push(r),t.addElement(n,r)})),this.headerStuck=!0}},{key:"makeHeaderNormal",value:function(){var t=this;this.stuckElements.map((function(e,n){return t.removeElement(t.headerEls[n],e)})),this.headerStuck=!1}}]),n}(T),bt=function(t){ct(n,t);var e=ht(n);function n(t,i,r,o){var a;return at(this,n),(a=e.call(this,{element:t})).mist=o,a.tableBoundaries=a.el.getBoundingClientRect(),a.stuckElement=!1,a.headerStuck=!1,a.headerEl=a.el.querySelector(".rwx-table-data:first-child"),a.topMin=a.headerEl.getBoundingClientRect().top-a.tableBoundaries.top,a.boundary=i+a.topMin,a.update=a.update.bind(dt(a)),a.noStick=r,!a.noStick&&a.el.addEventListener("scroll",a.update),a}return ut(n,[{key:"cleanUp",value:function(){this.mist&&(this.mist.removeElements(),this.mist.cleanUp()),!this.noStick&&this.el.removeEventListener("scroll",this.update)}},{key:"getHeight",value:function(){return this.headerEl.getBoundingClientRect().height}},{key:"update",value:function(){this.el.scrollTop>this.boundary?(!this.headerStuck&&this.makeHeaderSticky(),this.stuckElement&&(this.stuckElement.style.top=this.el.scrollTop+"px")):this.headerStuck&&this.makeHeaderNormal()}},{key:"makeHeaderSticky",value:function(){this.stuckElement=this.headerEl.cloneNode(!0),this.stuckElement.classList.add("scroll"),this.stuckElement.style.width=this.headerEl.scrollWidth+"px",this.addElement(this.el,this.stuckElement),this.headerStuck=!0}},{key:"makeHeaderNormal",value:function(){this.removeElement(this.el,this.stuckElement),this.headerStuck=!1}}]),n}(T);const gt=new pt;var wt={hasAncestor:function(t,e){var n=t.parentNode;return!n.matches("body")&&(n.matches(e)?n:wt.hasAncestor(n,e))}};const kt=wt;function Et(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function St(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function At(t,e,n){return e&&St(t.prototype,e),n&&St(t,n),t}var xt={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t},easeInElasticFriction:function(t){return(.04-.04/t)*Math.sin(15*t)+1},easeInElastic:function(t){return(.04-.04/t)*Math.sin(25*t)+1},easeInElasticLoose:function(t){return(.04-.04/t)*Math.sin(35*t)+1},easeOutElasticFriction:function(t){return.04*t/--t*Math.sin(15*t)},easeOutElastic:function(t){return.04*t/--t*Math.sin(25*t)},easeOutElasticLoose:function(t){return.04*t/--t*Math.sin(35*t)},easeInOutElastic:function(t){return(t-=.5)<0?(.02+.01/t)*Math.sin(50*t):(.02-.01/t)*Math.sin(50*t)+1},easeOutBack:function(t){return 1+2.70158*Math.pow(t-1,3)+1.70158*Math.pow(t-1,2)}},Ot=["easeInElasticFriction","easeInElastic","easeInElasticLoose","easeOutElasticFriction","easeOutElastic","easeOutElasticLoose","easeInOutElastic","easeOutBack"],Ct={easingFunction:function(t,e,n){this[n]||(this[n]=performance.now());var i=(performance.now()-this[n])/e,r=xt[t](i);return performance.now()-this[n]>e?1:r.toFixed(6)},getVar:function(t){return"".concat(t,"Ease")},setNow:function(t,e){this[this.getVar(t)]=e},getNow:function(t){return this[this.getVar(t)]},deleteVars:function(t){delete this[this.getVar(t)]}},Tt={getEasingValue:function(t,e,n,i){if(t){var r=Ct.easingFunction(e,n,Ct.getVar(t),i);return(Ot.includes(e)?1===r:r>=1)?(i&&i(),Ct.deleteVars(t),1):r}},fromTo:function(t,e,n,i,r,o){var a=Tt.getEasingValue(n,i,r,o);return Tt.fromToCalc(t,e,a)},fromToCalc:function(t,e,n){return t+(e-t)*n},fromToBezier:function(t,e,n,i,r){var o=3*(e-t),a=3*(n-e)-o;return r*r*r*(i-t-o-a)+a*(r*r)+o*r+t}},Lt=function(){function t(e){var n=e.from,i=e.to,r=e.control,o=e.duration,s=e.easing,u=e.loop,c=void 0!==u&&u,l=e.complete,h=void 0===l?function(){}:l,f=e.prevto;Et(this,t),this.loop=c,this.defaultDuration=1e3,this.defaultEasing="linear",this.complete=h,this.progressCounter=0,this.progressid="progress".concat(a.uniqueId()),this.duration=this.sanitizeDuration(o),this.parse(n,i,s,r,f)}return At(t,[{key:"parse",value:function(t,e,n,i,r){var o=this;this.animations=[],Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]),Array.isArray(n)||(n=[n]),t.map((function(t,s){o.animations.push({from:"prevto"===t?function(){return r[s].toUseTo}:t,to:Array.isArray(e)?"undefined"===e[s]?e[0]:e[s]:e,easing:o.sanitizeEasing(Array.isArray(n)?n[s]||n[0]:n),control:i?Array.isArray(i)?i[s]||i[0]:i:null,id:a.uniqueId(),duration:o.duration,isStarted:!1,isComplete:!1,cb:function(){o.complete()}})}))}},{key:"sanitizeEasing",value:function(t){return xt[t]?t:(M("No '".concat(t,"' easing function, falling back to '").concat(this.defaultEasing,"'."),"(rwxAnimation)"),this.defaultEasing)}},{key:"sanitizeDuration",value:function(t){return Number.isInteger(t)?t:(M("Duration must be an integer, falling back to '".concat(this.defaultDuration,"'."),"(rwxAnimation)"),this.defaultDuration)}},{key:"reset",value:function(){var t=this;this.progressCounter=0,this.isComplete=!1,this.animations.map((function(e,n){if(0===n){var i=Ct.getNow(e.id);i<performance.now()&&(t.timeTracker=i)}e.isComplete=!1,e.isStarted=!1}))}},{key:"pause",value:function(){this.stopNow||(this.easingTrackers=this.animations.map((function(t){return Ct.getNow(t.id)})),this.timeTracker=performance.now(),this.stopNow=!0)}},{key:"play",value:function(){var t=this;this.stopNow&&(this.animations.map((function(e,n){return Ct.setNow(e.id,performance.now()-(t.timeTracker-t.easingTrackers[n]))})),this.stopNow=!1)}},{key:"getProgress",value:function(){return parseFloat(100*this.progressCounter).toFixed(2)}},{key:"getEasingValue",value:function(){return parseFloat(this.easingValue)}},{key:"animate",value:function(t){var e=this;if(!this.stopNow){var n=[];this.animations.map((function(t){t.isStarted||(t.toUseFrom="function"==typeof t.from?t.from():t.from,t.toUseTo="function"==typeof t.to?t.to():t.to,t.control&&(t.tucp1="function"==typeof t.control.cp1?t.control.cp1():t.control.cp1,t.tucp2="function"==typeof t.control.cp2?t.control.cp2():t.control.cp2),t.isStarted=!0),e.easingValue=t.isComplete?1:Tt.getEasingValue(t.id,t.easing,e.duration,(function(){e.loop?window.requestAnimationFrame((function(){return e.reset()})):t.isComplete=!0}));var i=t.isComplete?t.toUseTo:t.control?Tt.fromToBezier(t.toUseFrom,t.tucp1,t.tucp2,t.toUseTo,e.easingValue):Tt.fromToCalc(t.toUseFrom,t.toUseTo,e.easingValue);n.push(i)})),this.isComplete||(this.progressCounter=Tt.getEasingValue(this.progressid,"linear",this.duration),t&&t.apply(void 0,n),this.animations.every((function(t){return t.isComplete}))&&(this.isComplete=!0,this.complete&&window.requestAnimationFrame((function(){return e.complete()}))))}}}]),t}(),Mt=function(){function t(e){var n=e.sequence,i=e.loop,r=void 0!==i&&i,o=e.complete,a=void 0===o?function(){}:o;Et(this,t),this.loop=r,this.seqCounter=0,this.delayCounter=0,this.complete=a,this.parse(n)}return At(t,[{key:"play",value:function(){this.animations.map((function(t){return t.anime.play()})),this.stopNow=!1}},{key:"pause",value:function(){this.animations.map((function(t){return t.anime.pause()})),this.stopNow=!0}},{key:"reset",value:function(){this.seqCounter=0,this.delayCounter=0,this.animations.map((function(t){return t.anime.reset()}))}},{key:"parse",value:function(t){var e=this;this.animations=[],t.map((function(n,i){i>0&&void 0===n.from&&(n.from=e.animations[i-1].anime.animations.map((function(t){return"prevto"})),n.prevto=e.animations[i-1].anime.animations),n.loop=!1;var r=n.complete;n.complete=function(){r&&r(),i<t.length-1?(e.seqCounter+=1,e.delayCounter=0):e.loop?window.requestAnimationFrame((function(){return e.reset()})):window.requestAnimationFrame((function(){return e.complete()}))},e.animations.push({anime:new Lt(n),delay:n.delay/1e3*60||0})}))}},{key:"animate",value:function(t){this.stopNow||(this.delayCounter>=this.animations[this.seqCounter].delay?this.animations[this.seqCounter].anime.animate(t[this.seqCounter]):this.delayCounter+=1)}}]),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},It(t)}function jt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Nt(t,e,n){return e&&qt(t.prototype,e),n&&qt(t,n),t}function _t(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&&Pt(t,e)}function Pt(t,e){return Pt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Pt(t,e)}function Bt(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,i=Vt(t);if(e){var r=Vt(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ft(this,n)}}function Ft(t,e){return!e||"object"!==It(e)&&"function"!=typeof e?Ht(t):e}function Ht(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vt(t){return Vt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Vt(t)}var Dt=function(t){_t(n,t);var e=Bt(n);function n(){return Rt(this,n),e.call(this,{selector:"[rwx-tabs]",canHaveManualControl:!1,resource:"rwxTabs"})}return Nt(n,[{key:"execute",value:function(t){return new zt(t)}},{key:"goToTab",value:function(t,e){if(this.validateParameter(e,"number","goToTab")){var n=this.getIME(t);n&&n.changeTab(e)}}}]),n}(C),zt=function(t){_t(n,t);var e=Bt(n);function n(t){var i,r;if(Rt(this,n),(i=e.call(this,{element:t,enableCustomEvents:!0})).tabs=(r=t.children,function(t){if(Array.isArray(t))return jt(t)}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return jt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jt(t,e):void 0}}(r)||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.")}()).filter((function(t){return t.classList.contains("rwx-tabs-tab")})),0==i.tabs.length)return Ft(i);i.change=i.change.bind(Ht(i)),i.tabHeaders=[];var o=i.tabs.findIndex((function(t){return t.hasAttribute("data-rwx-tabs-initial")}));return i.activeTab=-1===o?1:o+1,i.declareEvent("tabShow"),i.declareEvent("tabHide"),i.autoActiveTabFromLocationHash(),i.createTabs(),i.createAnimations(),i}return Nt(n,[{key:"createAnimations",value:function(){var t=this;this.animation=new Mt({sequence:[{from:[1,1],to:[0,.5],easing:["easeInCubic","linear"],duration:300,complete:function(){return t.tabHidden()}},{to:[1,1],easing:["easeOutCubic","linear"],duration:300,complete:function(){return t.tabShown()}}],complete:function(){t.stopAnimation=!0,t.animating=!1}})}},{key:"autoActiveTabFromLocationHash",value:function(){if(window.location.hash){var t="#".concat(window.location.hash.replace("#",""));if(!function(t){try{document.createDocumentFragment().querySelector(t)}catch(t){return!1}return!0}(t))return;var e=this.el.querySelector(t);if(e){var n=kt.hasAncestor(e,".rwx-tabs-tab"),i=!!n&&kt.hasAncestor(n,".rwx-tabs-tab");if(i&&this.el.contains(i))return void this.compareAndOpen(i);n&&(this.compareAndOpen(n),this.hash=e)}}}},{key:"compareAndOpen",value:function(t){var e=this;this.tabs.map((function(n,i){n==t&&(e.activeTab=i+1)}))}},{key:"cleanUp",value:function(){this.el.removeChild(this.container),this.tabs.map((function(t){return t.classList.remove("initial-hide"),t.style.transform="",t.style.opacity="",t.style.display="",!1}))}},{key:"createTabs",value:function(){var t=this;this.container=document.createElement("div"),this.container.classList.add("rwx-tabs-container"),this.bullet=document.createElement("span"),this.bullet.classList.add("bullet"),this.addElement(this.container,this.bullet);var e=document.createElement("div");e.classList.add("rwx-tabs-button-container"),this.tabs.map((function(n,i){if(n.hasAttribute("data-rwx-tabs-title")){var r=document.createElement("button"),o=document.createTextNode(n.getAttribute("data-rwx-tabs-title"));r.appendChild(o),r.classList.add("no-decoration"),r.setAttribute("role","tab"),r.setAttribute("aria-selected","false"),r.addEventListener("click",(function(){t.changeTab(i+1)})),r.addEventListener("keydown",(function(e){39==e.keyCode?t.tabHeaders[i+1==t.tabs.length?0:i+1].focus():37==e.keyCode&&t.tabHeaders[0==i?t.tabs.length-1:i-1].focus()})),t.tabHeaders.push(r),e.appendChild(r)}i+1==t.activeTab?(t.tabHeaders[i].setAttribute("aria-selected",!0),t.tabHeaders[i].classList.add("active"),window.requestAnimationFrame((function(){t.moveBullet(t.activeTab)}))):n.classList.add("initial-hide")})),this.container.appendChild(e),this.el.insertBefore(this.container,this.tabs[0]),new nt(this.container),this.hash&&window.requestAnimationFrame((function(){window.scrollTo(0,window.scrollY+t.hash.getBoundingClientRect().top-40)}))}},{key:"resetAnimationFlags",value:function(){this.stopAnimation=!1,this.animation.reset()}},{key:"changeTab",value:function(t){t==this.activeTab||this.animating||t<0||t>this.tabs.length||(this.newTabNumber=t,this.resetAnimationFlags(),this.moveBullet(t),this.animating=!0,this.change(),this.tabHeaders.map((function(e,n){return t-1==n?e.classList.add("active"):e.classList.remove("active")})))}},{key:"moveBullet",value:function(t){var e=this.tabHeaders[t-1].getBoundingClientRect(),n=e.left-this.el.getBoundingClientRect().left+this.container.scrollLeft;this.bullet.style.left="".concat(n,"px"),this.bullet.style.width="".concat(e.width,"px")}},{key:"change",value:function(){var t=this;this.anima