{"version":3,"sources":["webpack:///./cartridges/app_accelerator_core/cartridge/client/default/js/modules/module.fixit-trigger.js","webpack:///./node_modules/@borngroup/born-fixit/dist/born-fixit.min.js"],"names":["FixitTrigger","options","_classCallCheck","settings","settingsAttribute","callbackOnElements","elements","setupFixitElements","bind","_createClass","key","value","fixitNode","parsedOptions","JSON","parse","getAttribute","target","enabled","isEnabled","undefined","respondToParent","getElement","containedInParent","removeAttribute","Fixit","objectAssign","dynamicOffset","setupDynamicOffset","elSelector","document","querySelector","offsetSelector","addEventListener","evt","currentInstance","getInstance","isFrozen","isDocked","detail","newDirection","previousDirection","setOffsetElements","setOffsetValue","offset","setTargetPos","breakpointName","matchedBreakpoint","breakpointRanges","min","body","offsetWidth","max"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAE0C;AACqB;AACO;AAAA,IAEjDA,YAAY;EAC7B,SAAAA,aAAYC,OAAO,EAAE;IAAAC,eAAA,OAAAF,YAAA;IACjBC,OAAO,CAACE,QAAQ,GAAGF,OAAO,CAACE,QAAQ,IAAI,CAAC,CAAC;IACzC,IAAI,CAACC,iBAAiB,GAAGH,OAAO,CAACE,QAAQ,CAACC,iBAAiB,IAAI,oBAAoB;IAEnFC,oFAAkB,CAACJ,OAAO,CAACK,QAAQ,EAAE,IAAI,CAACC,kBAAkB,CAACC,IAAI,CAAC,IAAI,EAAEP,OAAO,CAACE,QAAQ,CAAC,CAAC;EAC9F;;EAEA;AACJ;AACA;AACA;EAHI,OAAAM,YAAA,CAAAT,YAAA;IAAAU,GAAA;IAAAC,KAAA,EAIA,SAAAJ,kBAAkBA,CAACJ,QAAQ,EAAES,SAAS,EAAE;MACpC,IAAIC,aAAa,GAAGC,IAAI,CAACC,KAAK,CAACH,SAAS,CAACI,YAAY,CAAC,IAAI,CAACZ,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC;;MAEpF;MACAS,aAAa,CAACI,MAAM,GAAGL,SAAS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,sDAAsD,kDAAkD,EAAE,+CAA+C,oBAAoB,mBAAmB,mBAAmB,kFAAkF,8CAA8C,8CAA8C,8CAA8C,gDAAgD,8BAA8B,sBAAsB,mCAAmC,wBAAwB,iCAAiC,2BAA2B,kDAAkD,WAAW,EAAE,wDAAwD,oDAAoD,EAAE,qEAAqE,wCAAwC,+EAA+E,iFAAiF,+DAA+D,iCAAiC,oDAAoD,EAAE,qDAAqD,+CAA+C,+CAA+C,mEAAmE,EAAE,2DAA2D,2DAA2D,EAAE,mEAAmE,qBAAqB,SAAS,2DAA2D,0EAA0E,KAAK,iCAAiC,oCAAoC,EAAE,iDAAiD,kFAAkF,EAAE,6DAA6D,kDAAkD,sDAAsD,uDAAuD,oDAAoD,8CAA8C,oCAAoC,EAAE,mGAAmG,2EAA2E,kDAAkD,qEAAqE,2DAA2D,oCAAoC,kDAAkD,0DAA0D,2DAA2D,mDAAmD,wCAAwC,EAAE,6GAA6G,yFAAyF,4DAA4D,iDAAiD,EAAE,qFAAqF,+DAA+D,uFAAuF,EAAE,mDAAmD,uEAAuE,iFAAiF,8BAA8B,4DAA4D,6CAA6C,qDAAqD,EAAE,4EAA4E,gBAAgB,6CAA6C,KAAK,kDAAkD,EAAE,mFAAmF,kBAAkB,2CAA2C,qGAAqG,2CAA2C,0CAA0C,yEAAyE,KAAK,0CAA0C,6BAA6B,IAAI,iDAAiD,0BAA0B,GAAG,aAAa,GAAG,yB","file":"module-fixit-trigger.js","sourcesContent":["/**\n * Fixit Trigger\n *\n * This module is a wrapper around born-fixit to allow the use of [data-fixit-trigger]\n * attribute on any element.\n *\n * see ../helpers/modules.js for \"fixit\" module initialization\n */\n\nimport Fixit from '@borngroup/born-fixit';\nimport { callbackOnElements } from '@borngroup/born-utilities';\nimport { breakpointRanges, objectAssign } from '../helpers/utilities';\n\nexport default class FixitTrigger {\n constructor(options) {\n options.settings = options.settings || {};\n this.settingsAttribute = options.settings.settingsAttribute || 'data-fixit-trigger';\n\n callbackOnElements(options.elements, this.setupFixitElements.bind(this, options.settings));\n }\n\n /**\n * Parses the provided `fixitNode` element and tries to find a `this.settingsAttribute` configuration.\n * The configuration is parsed and merged against an optional `settings` object that can be passed to the constructor.\n */\n setupFixitElements(settings, fixitNode) {\n let parsedOptions = JSON.parse(fixitNode.getAttribute(this.settingsAttribute)) || {};\n\n // In this module scenario, target will always be fixitNode.\n parsedOptions.target = fixitNode;\n parsedOptions.enabled = parsedOptions.enabled ? FixitTrigger.isEnabled.bind(this, parsedOptions.enabled) : undefined;\n\n parsedOptions.respondToParent = this.getElement(parsedOptions.respondToParent);\n parsedOptions.containedInParent = this.getElement(parsedOptions.containedInParent);\n\n fixitNode.removeAttribute(this.settingsAttribute);\n\n new Fixit(objectAssign({}, settings, parsedOptions));\n\n if (parsedOptions.dynamicOffset) {\n this.setupDynamicOffset(fixitNode, parsedOptions.dynamicOffset);\n }\n }\n\n getElement(elSelector) {\n return typeof elSelector === 'string' ? document.querySelector(elSelector) : elSelector;\n }\n\n /**\n * Configure a dynamic offset element,\n * which uses FixIt's API to toggle the offset value in the current fixit-trigger node.\n */\n setupDynamicOffset(fixitNode, offsetSelector) {\n this.getElement(offsetSelector).addEventListener('fixit:scrollDirectionUpdate', function(evt) {\n let currentInstance = Fixit.getInstance(fixitNode);\n\n if (!currentInstance.isFrozen && !currentInstance.isDocked) {\n if (evt.detail.newDirection === 'up' && evt.detail.previousDirection) {\n currentInstance.setOffsetElements(offsetSelector);\n\n currentInstance.setOffsetValue();\n } else {\n currentInstance.offset = 0;\n }\n\n currentInstance.setTargetPos(currentInstance.offset === 0);\n }\n });\n }\n\n /**\n * Determines wether or not Fixit should be enabled.\n * This method is called within Fixit on init and resize.\n * Leverages `breakpointRanges` to match agains the `breakpointName` value.\n * @return {Boolean} [description]\n */\n static isEnabled(breakpointName) {\n let matchedBreakpoint = breakpointRanges[breakpointName];\n\n return matchedBreakpoint && (!matchedBreakpoint.min || document.body.offsetWidth >= matchedBreakpoint.min) && (!matchedBreakpoint.max || document.body.offsetWidth <= matchedBreakpoint.max);\n }\n}\n","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});exports[\"default\"]=void 0;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError(\"Cannot call a class as a function\")}}function _defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,FixIt);this.options=options;this.shouldEnable=this.options.enabled||function(){return true};this.target=(typeof this.options.target===\"string\"?document.querySelector(this.options.target):this.options.target)||false;if(this.options.offset&&isNaN(this.options.offset)){this.setOffsetElements();this.setOffsetValue()}else{this.offset=this.options.offset||0}this._scrollDirectionWait=this.options.scrollDirectionWait||100;this._scrollPositionThereshold=this.options.scrollPositionThereshold||75;this._scrollDirectionThrottle=this.options.scrollDirectionThrottle||16;this._boundUpdateStickyStatus=this.updateStickyStatus.bind(this);this._boundEnableSticky=this.enableSticky.bind(this,150);if(this.target){this.enableSticky();window.addEventListener(\"resize\",this._boundEnableSticky)}INSTANCES.set(this.target,this)}_createClass(FixIt,[{key:\"enableSticky\",value:function enableSticky(timeOut){window.clearTimeout(this._resizeTimeout);this._resizeTimeout=window.setTimeout(function(){this.setOffsetValue();if(!this.isEnabled&&this.shouldEnable()){this.isEnabled=true;if(!this.placeholder){this.initialSetup()}this._updateInterval=window.setInterval(this._boundUpdateStickyStatus.bind(this,true),100);window.addEventListener(\"scroll\",this._boundUpdateStickyStatus);this._boundUpdateStickyStatus()}else if(this.isEnabled&&!this.shouldEnable()){this.isEnabled=false;this.setInactive();window.clearInterval(this._updateInterval);window.removeEventListener(\"scroll\",this._boundUpdateStickyStatus)}}.bind(this),timeOut||0)}},{key:\"destroySticky\",value:function destroySticky(){this.isEnabled=false;this.setInactive();this.removePlaceholder();window.clearTimeout(this._resizeTimeout);window.clearInterval(this._updateInterval);window.removeEventListener(\"resize\",this._boundEnableSticky);window.removeEventListener(\"scroll\",this._boundUpdateStickyStatus)}},{key:\"setOffsetValue\",value:function setOffsetValue(){var resultSum=0;if(this.offsetElements instanceof NodeList){[].forEach.call(this.offsetElements,function(currentEl){resultSum+=Math.round(currentEl.getBoundingClientRect().height)})}else{resultSum=this.offset||0}return this.offset=resultSum}},{key:\"setOffsetElements\",value:function setOffsetElements(offset){offset=offset||this.options.offset;return this.offsetElements=typeof offset===\"string\"?document.querySelectorAll(offset):offset}},{key:\"initialSetup\",value:function initialSetup(){this.setPlaceholder();this.parentContainer=this.options.containedInParent?this.options.containedInParent instanceof HTMLElement?this.options.containedInParent:this.target.parentNode:false;if(this.options.respondToParent){this.target.classList.add(\"fixit--respond-to-parent\");this.options.respondToParent=this.options.respondToParent instanceof HTMLElement?this.options.respondToParent:this.parentContainer;window.addEventListener(\"resize\",this.respondTo.bind(this));this.target.addEventListener(\"fixit:triggerResize\",this.respondTo.bind(this))}this.scrollPosition=0;this.publishEvent(\"fixit\",\"init\",this.target,{FixIt:this});if(typeof this.options.onInitCallback===\"function\"){this.options.onInitCallback(this.target,this)}this.target.addEventListener(\"fixit:updateScrollDirection\",function(evt){this.updateScrollDirection(evt.detail.scrollDirection)}.bind(this))}},{key:\"updateStickyStatus\",value:function updateStickyStatus(isAutoUpdate){isAutoUpdate=typeof isAutoUpdate===\"boolean\"?isAutoUpdate:false;if(!isAutoUpdate||isAutoUpdate&&this._previousDocumentHeight!==this.getDocumentHeight()){this.setRectangles();this._scrollListeningStart=this.options.fromViewportBottom?this._placeholderRect.top+this._targetRect.height-Math.max(window.innerHeight,document.documentElement.clientHeight):this._placeholderRect.top;if((!this.parentContainer||this._targetRect.height=this.offset){if(!this.isActive){this.isFrozen=false;this.setActive()}}else if(this.isActive&&!this.isDocked&&!this.shouldDock()){this.isActive=false;this.setFrozen();this.unsetBottom()}}}this.containInParent()}else if(this.isActive){this.setInactive()}}return this.isActive||this.isFrozen}},{key:\"setRectangles\",value:function setRectangles(){this._targetRect=this.target.getBoundingClientRect();this._placeholderRect=this.placeholder.getBoundingClientRect();this._parentContainerRect=this.parentContainer?this.parentContainer.getBoundingClientRect():{}}},{key:\"getDocumentHeight\",value:function getDocumentHeight(){return Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)}},{key:\"containInParent\",value:function containInParent(){if(this.parentContainer&&this.isActive){this.setRectangles();if(this.shouldDock()){this.setDocked()}else if(this.isDocked&&this._targetRect.top>=this.offset){this.setUndocked()}}}},{key:\"shouldDock\",value:function shouldDock(){return this._parentContainerRect.bottom<=document.documentElement.clientHeight&&this._targetRect.bottom>=this._parentContainerRect.bottom&&(this.isBottom||this._targetRect.top<=this.offset)}},{key:\"setDocked\",value:function setDocked(){this.isDocked=true;this.target.classList.add(\"fixit--docked\");this.unsetBottom();this.setTargetPos(true)}},{key:\"setUndocked\",value:function setUndocked(){this.isDocked=false;this.target.classList.remove(\"fixit--docked\");this.setTargetPos()}},{key:\"setTargetPos\",value:function setTargetPos(reset){var newPos=\"\";if(!reset&&this.options.useOffsetOnTarget){newPos=this.offset+\"px\"}this.target.style.top=newPos}},{key:\"respondTo\",value:function respondTo(){if(this.isActive||this.isFrozen){var parentComputedStyle=window.getComputedStyle(this.options.respondToParent),parentWidth=this.options.respondToParent.getBoundingClientRect().width-parseFloat(parentComputedStyle[\"padding-left\"])-parseFloat(parentComputedStyle[\"padding-right\"]);this.target.style.width=parentWidth+\"px\"}}},{key:\"setFrozen\",value:function setFrozen(){this.isFrozen=true;this.target.style.top=Math.abs(this._parentContainerRect.top-this._targetRect.top)+\"px\";this.target.classList.remove(\"fixit--active\");this.target.classList.add(\"fixit--frozen\")}},{key:\"setBottom\",value:function setBottom(){this.isBottom=true;this.setTargetPos(true);this.target.classList.add(\"fixit--bottom\")}},{key:\"unsetBottom\",value:function unsetBottom(){this.isBottom=false;this.target.classList.remove(\"fixit--bottom\")}},{key:\"setIsTall\",value:function setIsTall(){this.isTall=true;this.target.classList.add(\"fixit--is-tall\")}},{key:\"unsetIsTall\",value:function unsetIsTall(){this.isTall=false;this.target.classList.remove(\"fixit--is-tall\")}},{key:\"setActive\",value:function setActive(toBottom){this.isActive=true;this.setPlaceholderProps(!this.options.reversePlaceholderBehavior);this.target.classList.remove(\"fixit--frozen\");this.target.classList.add(\"fixit--active\");if(toBottom){this.setBottom()}else{this.setTargetPos()}if(this.options.respondToParent){this.respondTo()}this.publishEvent(\"fixit\",\"active\",this.target,{FixIt:this});if(typeof this.options.onActiveCallback===\"function\"){this.options.onActiveCallback(this.target,this)}}},{key:\"setInactive\",value:function setInactive(){this.isActive=false;this.unsetBottom();this.unsetIsTall();this.setPlaceholderProps(this.options.reversePlaceholderBehavior&&this.isEnabled);this.target.classList.remove(\"fixit--active\");this.target.classList.remove(\"fixit--docked\");this.target.classList.remove(\"fixit--frozen\");this.target.classList.remove(\"fixit--scrolled\");this.removeDirectionUpdates();this.scrollPosition=0;if(this.options.useOffsetOnTarget){this.setTargetPos(true)}if(this.options.respondToParent){this.target.style.width=\"\"}this.publishEvent(\"fixit\",\"inactive\",this.target,{FixIt:this});if(typeof this.options.onInactiveCallback===\"function\"){this.options.onInactiveCallback(this.target,this)}}},{key:\"removeDirectionUpdates\",value:function removeDirectionUpdates(){if(this.options.enableDirectionUpdates){this.target.classList.remove(\"fixit--scroll-\".concat(PROPERTIES.direction.up));this.target.classList.remove(\"fixit--scroll-\".concat(PROPERTIES.direction.down));this.target.classList.remove(\"fixit--scroll-direction-change\");delete this._prevScrollDirection;window.clearTimeout(this._scrollDirectionTimeout)}}},{key:\"setPlaceholder\",value:function setPlaceholder(){this.placeholder=document.createElement(\"div\");this.placeholder.className=\"fixit-placeholder\";this.target.parentNode.insertBefore(this.placeholder,this.target)}},{key:\"removePlaceholder\",value:function removePlaceholder(){this.placeholder.parentNode.removeChild(this.placeholder)}},{key:\"setPlaceholderProps\",value:function setPlaceholderProps(sync){if(this.placeholder){if(sync){this.placeholder.style.height=this._targetRect.height+\"px\";this.placeholder.style.margin=window.getComputedStyle(this.target).margin}else{this.placeholder.style.height=\"\";this.placeholder.style.margin=\"\"}}}},{key:\"targetIsTall\",value:function targetIsTall(){return this._targetRect.height+this.offset>document.documentElement.clientHeight}},{key:\"getScrollDirection\",value:function getScrollDirection(){if(this.scrollPosition>this._placeholderRect.top){this.currentScrollDirection=PROPERTIES.direction.down}else if(this.scrollPosition=this._scrollDirectionThrottle){this._updateScrollDirectionOnThreshold(newScrollDirection);this._setScrollDirectionCallCount=0}window.clearTimeout(this._scrollDirectionTimeout);this._scrollDirectionTimeout=window.setTimeout(function(){this._updateScrollDirectionOnThreshold(newScrollDirection);this._prevScrollPosition=this._placeholderRect.top}.bind(this),this._scrollDirectionWait)}},{key:\"_updateScrollDirectionOnThreshold\",value:function _updateScrollDirectionOnThreshold(newScrollDirection){this._diffScrollPosition=Math.abs(this._newScrollPosition-(this._prevScrollPosition||0));if(this._diffScrollPosition>this._scrollPositionThereshold){this.updateScrollDirection(newScrollDirection)}}},{key:\"updateScrollDirection\",value:function updateScrollDirection(newScrollDirection){this.publishEvent(\"fixit\",\"scrollDirectionUpdate\",this.target,{previousDirection:this._prevScrollDirection,newDirection:newScrollDirection,FixIt:this});if(this._prevScrollDirection!==newScrollDirection){this.target.classList.add(\"fixit--scroll-\".concat(newScrollDirection));this.target.classList.remove(\"fixit--scroll-\".concat(this._prevScrollDirection));if(this._prevScrollDirection){this.target.classList.add(\"fixit--scroll-direction-change\")}this._prevScrollDirection=newScrollDirection;this._prevScrollPosition=this._placeholderRect.top}}},{key:\"toggletFullyScrolled\",value:function toggletFullyScrolled(setScrolled){if(setScrolled){this.target.classList.add(\"fixit--scrolled\")}else{this.target.classList.remove(\"fixit--scrolled\")}}},{key:\"publishEvent\",value:function publishEvent(moduleName,eventName,target,detail){var event,params={bubbles:true,cancelable:true,detail:detail},eventString=moduleName&&eventName?\"\".concat(moduleName,\":\").concat(eventName):moduleName||eventName;if(typeof window.CustomEvent!==\"function\"){event=document.createEvent(\"CustomEvent\");event.initCustomEvent(eventString,params.bubbles,params.cancelable,null)}else{event=new CustomEvent(eventString,params)}target.dispatchEvent(event)}}],[{key:\"getInstance\",value:function getInstance(el){return INSTANCES.get(el)}}]);return FixIt}();exports[\"default\"]=FixIt;"],"sourceRoot":""}